@livetiles/reach-components-react 0.3.79 → 0.3.80

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.
package/index.esm2.js CHANGED
@@ -2,7 +2,7 @@ import { jsx as jsx$1, Fragment, jsxs } from 'react/jsx-runtime';
2
2
  import require$$0$6 from 'events';
3
3
  import * as React$d from 'react';
4
4
  import React__default, { useContext, createContext, useMemo, useRef as useRef$1, useEffect as useEffect$1, useState as useState$2, useCallback, useReducer, Children, isValidElement, cloneElement, Component, lazy as lazy$1, Suspense, forwardRef, createElement as createElement$a, useLayoutEffect, useImperativeHandle, Fragment as Fragment$1 } from 'react';
5
- import { PersonaInitialsColor, MessageBarType, loadTheme, IconButton as IconButton$1, Link as Link$3, MessageBar, ActionButton as ActionButton$1, TextField, PrimaryButton, DefaultButton, Icon, Image as Image$1, Spinner as Spinner$1, Toggle, ChoiceGroup as ChoiceGroup$1, Persona, Checkbox, Label as Label$2, Dropdown as Dropdown$1, ProgressIndicator, Shimmer, ShimmerElementsGroup, ShimmerElementType, DirectionalHint, PersonaSize, TooltipHost as TooltipHost$1, DialogType, Dialog as Dialog$1, DialogFooter, SelectionMode, NormalPeoplePicker, FocusTrapCallout, SpinnerSize, SearchBox as SearchBox$1, ResponsiveMode, ImageFit, Layer as Layer$1, initializeIcons, TagPicker, Breadcrumb, CommandBarButton, DatePicker, DayOfWeek } from 'office-ui-fabric-react';
5
+ import { PersonaInitialsColor, MessageBarType, loadTheme, IconButton as IconButton$1, Link as Link$3, MessageBar, ActionButton as ActionButton$1, TextField, PrimaryButton, DefaultButton, Icon, Image as Image$1, Spinner as Spinner$1, Toggle, ChoiceGroup as ChoiceGroup$1, Persona, Checkbox, Label as Label$2, Dropdown as Dropdown$1, ProgressIndicator, Shimmer, ShimmerElementsGroup, ShimmerElementType, DirectionalHint, PersonaSize, TooltipHost as TooltipHost$1, DialogType, Dialog as Dialog$1, DialogFooter, SelectionMode, NormalPeoplePicker, FocusTrapCallout, SpinnerSize, SearchBox as SearchBox$1, ResponsiveMode, ImageFit, Layer as Layer$1, initializeIcons, Breadcrumb, CommandBarButton, DatePicker, DayOfWeek } from 'office-ui-fabric-react';
6
6
  import * as ReactRouterDom from 'react-router-dom';
7
7
  import { useHistory, useRouteMatch, useLocation as useLocation$1, Link as Link$4, NavLink, MemoryRouter, Switch, Route } from 'react-router-dom';
8
8
  import require$$0$7 from 'react-is';
@@ -48388,7 +48388,7 @@ function __makeTemplateObject$k(cooked, raw) {
48388
48388
  return cooked;
48389
48389
  }
48390
48390
 
48391
- var FocusStyles = createGlobalStyle(templateObject_1$4$3 || (templateObject_1$4$3 = __makeTemplateObject$k(["\n // focus style should be visible only when keyboard navigation is activated\n // office ui fabric adds 'ms-Fabric--isFocusVisible' when the user presses keyboard keys, and removes it when the user clicks a mouse button\n\n .ms-Fabric--isFocusVisible .lt-reach {\n a:not(.ms-Button):focus,\n div[data-is-focusable]:not(.ms-PickerPersona-container):focus {\n box-shadow: none;\n outline: 2px solid ", ";\n outline-offset: 2px;\n }\n\n div[data-is-focusable][role=\"listbox\"]:focus,\n div[data-is-focusable].ms-Dropdown:focus {\n &::after {\n border: 0;\n }\n }\n\n a[data-rounded-outline='true']:focus {\n border-radius: 20px;\n outline-offset: 4px;\n }\n\n button:focus {\n &::after {\n outline: 2px solid ", ";\n outline-offset: 2px;\n inset: 0;\n }\n }\n\n button[data-rounded-outline='50']:focus {\n &::after {\n border-radius: 50%;\n outline-offset: 4px;\n }\n }\n\n button[data-rounded-outline='true']:focus {\n &::after {\n border-radius: 20px;\n outline-offset: 4px;\n }\n }\n\n button[data-toggle-button='true']:focus {\n &::after {\n border: none;\n border-radius: 12px;\n outline-offset: 3px;\n }\n }\n\n a[data-clickable-overlay]:focus {\n outline: 0 !important;\n\n &::before {\n outline: 2px solid ", ";\n outline-offset: 5px;\n }\n }\n\n input[type='checkbox']:focus + label::before {\n outline: 2px solid ", ";\n }\n\n div.ms-Dropdown-item input[type='checkbox']:focus + label::before,\n button.ms-Dropdown-item:focus::after {\n outline-offset: -2px;\n }\n\n div.ms-ChoiceField-wrapper.is-inFocus {\n &::after {\n outline: 2px solid ", ";\n border: 0;\n }\n }\n\n .ms-SearchBox-clearButton button:focus::after {\n outline-offset: -4px;\n }\n\n .ms-PickerPersona-container:focus {\n &::after {\n outline: 2px solid ", ";\n outline-offset: 0;\n }\n }\n }\n\n .ms-Fabric--isFocusVisible .lt-reach-callout {\n button:focus {\n &::after {\n outline-color: ", ";\n outline-width: 2px;\n outline-offset: -2px;\n }\n }\n }\n"], ["\n // focus style should be visible only when keyboard navigation is activated\n // office ui fabric adds 'ms-Fabric--isFocusVisible' when the user presses keyboard keys, and removes it when the user clicks a mouse button\n\n .ms-Fabric--isFocusVisible .lt-reach {\n a:not(.ms-Button):focus,\n div[data-is-focusable]:not(.ms-PickerPersona-container):focus {\n box-shadow: none;\n outline: 2px solid ", ";\n outline-offset: 2px;\n }\n\n div[data-is-focusable][role=\"listbox\"]:focus,\n div[data-is-focusable].ms-Dropdown:focus {\n &::after {\n border: 0;\n }\n }\n\n a[data-rounded-outline='true']:focus {\n border-radius: 20px;\n outline-offset: 4px;\n }\n\n button:focus {\n &::after {\n outline: 2px solid ", ";\n outline-offset: 2px;\n inset: 0;\n }\n }\n\n button[data-rounded-outline='50']:focus {\n &::after {\n border-radius: 50%;\n outline-offset: 4px;\n }\n }\n\n button[data-rounded-outline='true']:focus {\n &::after {\n border-radius: 20px;\n outline-offset: 4px;\n }\n }\n\n button[data-toggle-button='true']:focus {\n &::after {\n border: none;\n border-radius: 12px;\n outline-offset: 3px;\n }\n }\n\n a[data-clickable-overlay]:focus {\n outline: 0 !important;\n\n &::before {\n outline: 2px solid ", ";\n outline-offset: 5px;\n }\n }\n\n input[type='checkbox']:focus + label::before {\n outline: 2px solid ", ";\n }\n\n div.ms-Dropdown-item input[type='checkbox']:focus + label::before,\n button.ms-Dropdown-item:focus::after {\n outline-offset: -2px;\n }\n\n div.ms-ChoiceField-wrapper.is-inFocus {\n &::after {\n outline: 2px solid ", ";\n border: 0;\n }\n }\n\n .ms-SearchBox-clearButton button:focus::after {\n outline-offset: -4px;\n }\n\n .ms-PickerPersona-container:focus {\n &::after {\n outline: 2px solid ", ";\n outline-offset: 0;\n }\n }\n }\n\n .ms-Fabric--isFocusVisible .lt-reach-callout {\n button:focus {\n &::after {\n outline-color: ", ";\n outline-width: 2px;\n outline-offset: -2px;\n }\n }\n }\n"])), function (p) {
48391
+ var FocusStyles = createGlobalStyle(templateObject_1$4$3 || (templateObject_1$4$3 = __makeTemplateObject$k(["\n // focus style should be visible only when keyboard navigation is activated\n // office ui fabric adds 'ms-Fabric--isFocusVisible' when the user presses keyboard keys, and removes it when the user clicks a mouse button\n\n .ms-Fabric--isFocusVisible .lt-reach {\n a:not(.ms-Button):focus,\n div[data-is-focusable]:not(.ms-PickerPersona-container):focus {\n box-shadow: none;\n outline: 2px solid ", ";\n outline-offset: 2px;\n }\n\n div[data-is-focusable][role=\"listbox\"]:focus,\n div[data-is-focusable].ms-Dropdown:focus {\n &::after {\n border: 0;\n }\n }\n\n a[data-rounded-outline='true']:focus {\n border-radius: 20px;\n outline-offset: 4px;\n }\n\n button:focus {\n &::after {\n outline: 2px solid ", ";\n outline-offset: 2px;\n inset: 0;\n }\n }\n\n button[data-rounded-outline='50']:focus {\n &::after {\n border-radius: 50%;\n outline-offset: 4px;\n }\n }\n\n button[data-rounded-outline='true']:focus {\n &::after {\n border-radius: 20px;\n outline-offset: 4px;\n }\n }\n\n button[data-toggle-button='true']:focus {\n &::after {\n border: none;\n border-radius: 12px;\n outline-offset: 3px;\n }\n }\n\n a[data-clickable-overlay]:focus {\n outline: 0 !important;\n\n &::before {\n outline: 2px solid ", ";\n outline-offset: 5px;\n }\n }\n\n input[type='checkbox']:focus + label::before {\n outline: 2px solid ", ";\n }\n\n div.ms-Dropdown-item input[type='checkbox']:focus + label::before,\n button.ms-Dropdown-item:focus::after {\n outline-offset: -2px;\n }\n\n div.ms-ChoiceField-wrapper.is-inFocus {\n &::after {\n outline: 2px solid ", ";\n border: 0;\n }\n }\n\n .ms-SearchBox-clearButton button:focus::after {\n outline-offset: -4px;\n }\n\n .ms-PickerPersona-container:focus {\n &::after {\n outline: 2px solid ", ";\n outline-offset: 0;\n }\n }\n }\n\n .ms-Fabric--isFocusVisible .lt-reach-contextual-menu {\n button:focus {\n &::after {\n outline-color: ", ";\n outline-width: 2px;\n outline-offset: -2px;\n }\n }\n }\n"], ["\n // focus style should be visible only when keyboard navigation is activated\n // office ui fabric adds 'ms-Fabric--isFocusVisible' when the user presses keyboard keys, and removes it when the user clicks a mouse button\n\n .ms-Fabric--isFocusVisible .lt-reach {\n a:not(.ms-Button):focus,\n div[data-is-focusable]:not(.ms-PickerPersona-container):focus {\n box-shadow: none;\n outline: 2px solid ", ";\n outline-offset: 2px;\n }\n\n div[data-is-focusable][role=\"listbox\"]:focus,\n div[data-is-focusable].ms-Dropdown:focus {\n &::after {\n border: 0;\n }\n }\n\n a[data-rounded-outline='true']:focus {\n border-radius: 20px;\n outline-offset: 4px;\n }\n\n button:focus {\n &::after {\n outline: 2px solid ", ";\n outline-offset: 2px;\n inset: 0;\n }\n }\n\n button[data-rounded-outline='50']:focus {\n &::after {\n border-radius: 50%;\n outline-offset: 4px;\n }\n }\n\n button[data-rounded-outline='true']:focus {\n &::after {\n border-radius: 20px;\n outline-offset: 4px;\n }\n }\n\n button[data-toggle-button='true']:focus {\n &::after {\n border: none;\n border-radius: 12px;\n outline-offset: 3px;\n }\n }\n\n a[data-clickable-overlay]:focus {\n outline: 0 !important;\n\n &::before {\n outline: 2px solid ", ";\n outline-offset: 5px;\n }\n }\n\n input[type='checkbox']:focus + label::before {\n outline: 2px solid ", ";\n }\n\n div.ms-Dropdown-item input[type='checkbox']:focus + label::before,\n button.ms-Dropdown-item:focus::after {\n outline-offset: -2px;\n }\n\n div.ms-ChoiceField-wrapper.is-inFocus {\n &::after {\n outline: 2px solid ", ";\n border: 0;\n }\n }\n\n .ms-SearchBox-clearButton button:focus::after {\n outline-offset: -4px;\n }\n\n .ms-PickerPersona-container:focus {\n &::after {\n outline: 2px solid ", ";\n outline-offset: 0;\n }\n }\n }\n\n .ms-Fabric--isFocusVisible .lt-reach-contextual-menu {\n button:focus {\n &::after {\n outline-color: ", ";\n outline-width: 2px;\n outline-offset: -2px;\n }\n }\n }\n"])), function (p) {
48392
48392
  return p.theme.palette.accent;
48393
48393
  }, function (p) {
48394
48394
  return p.theme.palette.accent;
@@ -55128,7 +55128,7 @@ function getFlatKeywordList(keywords) {
55128
55128
  });
55129
55129
  }
55130
55130
 
55131
- function ensureMandatoryKeywords(mandatoryKeywords, allKeywords) {
55131
+ function ensureMandatoryKeywords$1(mandatoryKeywords, allKeywords) {
55132
55132
  var mandatory = mandatoryKeywords || [];
55133
55133
  var all = allKeywords || [];
55134
55134
  var mandatoryKeywordIds = mandatory.map(function (k) {
@@ -55461,12 +55461,12 @@ var ToastNotificationHost = function ToastNotificationHost() {
55461
55461
  }, void 0);
55462
55462
  };
55463
55463
 
55464
- var ToastGlobalStyles = createGlobalStyle(templateObject_3$1i || (templateObject_3$1i = __makeTemplateObject$k(["\n .lt-reach .Toastify .Toastify__toast-container {\n ", "\n\n ", "\n }\n\n .Toastify {\n .Toastify__toast-container {\n // This allows us to have wider toasts that do not wrap too soon.\n // Toastify itself will add responsive design at 480px and span the\n // toast the full width...\n max-width: 540px;\n width: auto;\n z-index: 1000001;\n\n @media (max-width: 480px) {\n padding: 0 10px !important;\n }\n }\n\n .Toastify__toast-body {\n display: flex;\n flex: 1 1 540px;\n height: 100%;\n justify-content: center;\n flex-direction: column;\n // IE fix: this is a default value from Toastify but doesn't work properly unless added here too\n min-height: 48px;\n }\n }\n"], ["\n .lt-reach .Toastify .Toastify__toast-container {\n ", "\n\n ", "\n }\n\n .Toastify {\n .Toastify__toast-container {\n // This allows us to have wider toasts that do not wrap too soon.\n // Toastify itself will add responsive design at 480px and span the\n // toast the full width...\n max-width: 540px;\n width: auto;\n z-index: 1000001;\n\n @media (max-width: 480px) {\n padding: 0 10px !important;\n }\n }\n\n .Toastify__toast-body {\n display: flex;\n flex: 1 1 540px;\n height: 100%;\n justify-content: center;\n flex-direction: column;\n // IE fix: this is a default value from Toastify but doesn't work properly unless added here too\n min-height: 48px;\n }\n }\n"])), function (p) {
55465
- return !p.chromeless && css$2(templateObject_1$2L || (templateObject_1$2L = __makeTemplateObject$k(["\n top: 4em;\n "], ["\n top: 4em;\n "])));
55464
+ var ToastGlobalStyles = createGlobalStyle(templateObject_3$1j || (templateObject_3$1j = __makeTemplateObject$k(["\n .lt-reach .Toastify .Toastify__toast-container {\n ", "\n\n ", "\n }\n\n .Toastify {\n .Toastify__toast-container {\n // This allows us to have wider toasts that do not wrap too soon.\n // Toastify itself will add responsive design at 480px and span the\n // toast the full width...\n max-width: 540px;\n width: auto;\n z-index: 1000001;\n\n @media (max-width: 480px) {\n padding: 0 10px !important;\n }\n }\n\n .Toastify__toast-body {\n display: flex;\n flex: 1 1 540px;\n height: 100%;\n justify-content: center;\n flex-direction: column;\n // IE fix: this is a default value from Toastify but doesn't work properly unless added here too\n min-height: 48px;\n }\n }\n"], ["\n .lt-reach .Toastify .Toastify__toast-container {\n ", "\n\n ", "\n }\n\n .Toastify {\n .Toastify__toast-container {\n // This allows us to have wider toasts that do not wrap too soon.\n // Toastify itself will add responsive design at 480px and span the\n // toast the full width...\n max-width: 540px;\n width: auto;\n z-index: 1000001;\n\n @media (max-width: 480px) {\n padding: 0 10px !important;\n }\n }\n\n .Toastify__toast-body {\n display: flex;\n flex: 1 1 540px;\n height: 100%;\n justify-content: center;\n flex-direction: column;\n // IE fix: this is a default value from Toastify but doesn't work properly unless added here too\n min-height: 48px;\n }\n }\n"])), function (p) {
55465
+ return !p.chromeless && css$2(templateObject_1$2M || (templateObject_1$2M = __makeTemplateObject$k(["\n top: 4em;\n "], ["\n top: 4em;\n "])));
55466
55466
  }, function (p) {
55467
- return p.chromeless && css$2(templateObject_2$1R || (templateObject_2$1R = __makeTemplateObject$k(["\n @media all and (max-width: ", "px) {\n top: 0.5em;\n right: 0.5em;\n }\n "], ["\n @media all and (max-width: ", "px) {\n top: 0.5em;\n right: 0.5em;\n }\n "])), maxScreenSize.small);
55467
+ return p.chromeless && css$2(templateObject_2$1S || (templateObject_2$1S = __makeTemplateObject$k(["\n @media all and (max-width: ", "px) {\n top: 0.5em;\n right: 0.5em;\n }\n "], ["\n @media all and (max-width: ", "px) {\n top: 0.5em;\n right: 0.5em;\n }\n "])), maxScreenSize.small);
55468
55468
  });
55469
- var templateObject_1$2L, templateObject_2$1R, templateObject_3$1i;
55469
+ var templateObject_1$2M, templateObject_2$1S, templateObject_3$1j;
55470
55470
 
55471
55471
  function useKeywordsApi() {
55472
55472
  var api = useApi();
@@ -65635,7 +65635,7 @@ var getSmallAvatar = function (avatar) {
65635
65635
  var ext = (_b = (_a = avatar === null || avatar === void 0 ? void 0 : avatar.split('.')) === null || _a === void 0 ? void 0 : _a.pop()) === null || _b === void 0 ? void 0 : _b.toLowerCase();
65636
65636
  return avatar.replace("." + ext, "/80h." + ext);
65637
65637
  };
65638
- var Img = styled_1$b.default.img(templateObject_1$2K || (templateObject_1$2K = __makeTemplateObject$j(["\n object-fit: cover;\n width: 32px;\n height: 32px;\n margin-right: 8px;\n"], ["\n object-fit: cover;\n width: 32px;\n height: 32px;\n margin-right: 8px;\n"])));
65638
+ var Img = styled_1$b.default.img(templateObject_1$2L || (templateObject_1$2L = __makeTemplateObject$j(["\n object-fit: cover;\n width: 32px;\n height: 32px;\n margin-right: 8px;\n"], ["\n object-fit: cover;\n width: 32px;\n height: 32px;\n margin-right: 8px;\n"])));
65639
65639
  var Avatar$5 = function (_a) {
65640
65640
  var user = _a.user, _b = _a.className, className = _b === void 0 ? '' : _b;
65641
65641
  var defaultAvatarId = react_1$u.useRef(Math.floor(Math.random() * 5) + 1);
@@ -65645,7 +65645,7 @@ var Avatar$5 = function (_a) {
65645
65645
  return react_1$u.default.createElement(Img, { src: url, className: className });
65646
65646
  };
65647
65647
  avatar.default = Avatar$5;
65648
- var templateObject_1$2K;
65648
+ var templateObject_1$2L;
65649
65649
 
65650
65650
  var user = {};
65651
65651
 
@@ -65875,11 +65875,11 @@ var __makeTemplateObject$i = (commonjsGlobal$7 && commonjsGlobal$7.__makeTemplat
65875
65875
  Object.defineProperty(loader$2, "__esModule", { value: true });
65876
65876
  var emotion_1 = require$$0$3;
65877
65877
  var colors_1 = colors;
65878
- var bouncer$1 = emotion_1.keyframes(templateObject_1$2J || (templateObject_1$2J = __makeTemplateObject$i(["\n to {\n transform: scale(1.75) translateY(-20px);\n }\n"], ["\n to {\n transform: scale(1.75) translateY(-20px);\n }\n"])));
65878
+ var bouncer$1 = emotion_1.keyframes(templateObject_1$2K || (templateObject_1$2K = __makeTemplateObject$i(["\n to {\n transform: scale(1.75) translateY(-20px);\n }\n"], ["\n to {\n transform: scale(1.75) translateY(-20px);\n }\n"])));
65879
65879
  var loaderHeight$1 = 37;
65880
- var loader$1 = emotion_1.css(templateObject_2$1Q || (templateObject_2$1Q = __makeTemplateObject$i(["\n display: flex;\n align-items: center;\n height: ", "px;\n padding-top: 15px;\n margin: 0 auto;\n text-align: center;\n justify-content: center;\n animation: pulse 0.8s ease-in-out 0s infinite alternate backwards;\n div {\n display: inline-block;\n height: 10px;\n width: 10px;\n margin: ", "px 10px 10px 10px;\n position: relative;\n box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.3);\n animation: ", " cubic-bezier(0.455, 0.03, 0.515, 0.955) 0.75s infinite alternate;\n &:nth-child(5n + 1) {\n background: ", ";\n animation-delay: 0;\n }\n &:nth-child(5n + 2) {\n background: ", ";\n animation-delay: calc(0s + (0.1s * 1));\n }\n &:nth-child(5n + 3) {\n background: ", ";\n animation-delay: calc(0s + (0.1s * 2));\n }\n &:nth-child(5n + 4) {\n background: ", ";\n animation-delay: calc(0s + (0.1s * 3));\n }\n &:nth-child(5n + 5) {\n background: ", ";\n animation-delay: calc(0s + (0.1s * 4));\n }\n }\n"], ["\n display: flex;\n align-items: center;\n height: ", "px;\n padding-top: 15px;\n margin: 0 auto;\n text-align: center;\n justify-content: center;\n animation: pulse 0.8s ease-in-out 0s infinite alternate backwards;\n div {\n display: inline-block;\n height: 10px;\n width: 10px;\n margin: ", "px 10px 10px 10px;\n position: relative;\n box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.3);\n animation: ", " cubic-bezier(0.455, 0.03, 0.515, 0.955) 0.75s infinite alternate;\n &:nth-child(5n + 1) {\n background: ", ";\n animation-delay: 0;\n }\n &:nth-child(5n + 2) {\n background: ", ";\n animation-delay: calc(0s + (0.1s * 1));\n }\n &:nth-child(5n + 3) {\n background: ", ";\n animation-delay: calc(0s + (0.1s * 2));\n }\n &:nth-child(5n + 4) {\n background: ", ";\n animation-delay: calc(0s + (0.1s * 3));\n }\n &:nth-child(5n + 5) {\n background: ", ";\n animation-delay: calc(0s + (0.1s * 4));\n }\n }\n"])), loaderHeight$1, loaderHeight$1, bouncer$1, colors_1.giphyGreen, colors_1.giphyBlue, colors_1.giphyPurple, colors_1.giphyRed, colors_1.giphyYellow);
65880
+ var loader$1 = emotion_1.css(templateObject_2$1R || (templateObject_2$1R = __makeTemplateObject$i(["\n display: flex;\n align-items: center;\n height: ", "px;\n padding-top: 15px;\n margin: 0 auto;\n text-align: center;\n justify-content: center;\n animation: pulse 0.8s ease-in-out 0s infinite alternate backwards;\n div {\n display: inline-block;\n height: 10px;\n width: 10px;\n margin: ", "px 10px 10px 10px;\n position: relative;\n box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.3);\n animation: ", " cubic-bezier(0.455, 0.03, 0.515, 0.955) 0.75s infinite alternate;\n &:nth-child(5n + 1) {\n background: ", ";\n animation-delay: 0;\n }\n &:nth-child(5n + 2) {\n background: ", ";\n animation-delay: calc(0s + (0.1s * 1));\n }\n &:nth-child(5n + 3) {\n background: ", ";\n animation-delay: calc(0s + (0.1s * 2));\n }\n &:nth-child(5n + 4) {\n background: ", ";\n animation-delay: calc(0s + (0.1s * 3));\n }\n &:nth-child(5n + 5) {\n background: ", ";\n animation-delay: calc(0s + (0.1s * 4));\n }\n }\n"], ["\n display: flex;\n align-items: center;\n height: ", "px;\n padding-top: 15px;\n margin: 0 auto;\n text-align: center;\n justify-content: center;\n animation: pulse 0.8s ease-in-out 0s infinite alternate backwards;\n div {\n display: inline-block;\n height: 10px;\n width: 10px;\n margin: ", "px 10px 10px 10px;\n position: relative;\n box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.3);\n animation: ", " cubic-bezier(0.455, 0.03, 0.515, 0.955) 0.75s infinite alternate;\n &:nth-child(5n + 1) {\n background: ", ";\n animation-delay: 0;\n }\n &:nth-child(5n + 2) {\n background: ", ";\n animation-delay: calc(0s + (0.1s * 1));\n }\n &:nth-child(5n + 3) {\n background: ", ";\n animation-delay: calc(0s + (0.1s * 2));\n }\n &:nth-child(5n + 4) {\n background: ", ";\n animation-delay: calc(0s + (0.1s * 3));\n }\n &:nth-child(5n + 5) {\n background: ", ";\n animation-delay: calc(0s + (0.1s * 4));\n }\n }\n"])), loaderHeight$1, loaderHeight$1, bouncer$1, colors_1.giphyGreen, colors_1.giphyBlue, colors_1.giphyPurple, colors_1.giphyRed, colors_1.giphyYellow);
65881
65881
  loader$2.default = loader$1;
65882
- var templateObject_1$2J, templateObject_2$1Q;
65882
+ var templateObject_1$2K, templateObject_2$1R;
65883
65883
 
65884
65884
  var typography = {};
65885
65885
 
@@ -66009,8 +66009,8 @@ var styled_1$a = __importDefault$k(require$$0$4);
66009
66009
  var react_1$s = __importDefault$k(React__default);
66010
66010
  var avatar_1$3 = __importDefault$k(avatar);
66011
66011
  var user_1$1 = __importDefault$k(user);
66012
- var Container$b = styled_1$a.default.div(templateObject_1$2I || (templateObject_1$2I = __makeTemplateObject$h(["\n display: flex;\n align-items: center;\n font-family: interface, helvetica, arial;\n"], ["\n display: flex;\n align-items: center;\n font-family: interface, helvetica, arial;\n"])));
66013
- var Avatar$4 = styled_1$a.default(avatar_1$3.default)(templateObject_2$1P || (templateObject_2$1P = __makeTemplateObject$h(["\n flex-shrink: 0;\n"], ["\n flex-shrink: 0;\n"])));
66012
+ var Container$b = styled_1$a.default.div(templateObject_1$2J || (templateObject_1$2J = __makeTemplateObject$h(["\n display: flex;\n align-items: center;\n font-family: interface, helvetica, arial;\n"], ["\n display: flex;\n align-items: center;\n font-family: interface, helvetica, arial;\n"])));
66013
+ var Avatar$4 = styled_1$a.default(avatar_1$3.default)(templateObject_2$1Q || (templateObject_2$1Q = __makeTemplateObject$h(["\n flex-shrink: 0;\n"], ["\n flex-shrink: 0;\n"])));
66014
66014
  var Attribution$2 = function (_a) {
66015
66015
  var gif = _a.gif, className = _a.className, onClick = _a.onClick;
66016
66016
  var user = gif.user;
@@ -66034,7 +66034,7 @@ var Attribution$2 = function (_a) {
66034
66034
  };
66035
66035
  Attribution$2.className = 'giphy-attribution';
66036
66036
  attribution$1.default = Attribution$2;
66037
- var templateObject_1$2I, templateObject_2$1P;
66037
+ var templateObject_1$2J, templateObject_2$1Q;
66038
66038
 
66039
66039
  var overlay = {};
66040
66040
 
@@ -66068,9 +66068,9 @@ Object.defineProperty(overlay, "__esModule", { value: true });
66068
66068
  var styled_1$9 = __importDefault$j(require$$0$4);
66069
66069
  var react_1$r = __importStar$c(React__default);
66070
66070
  var _1$1 = __importDefault$j(attribution$1);
66071
- var Background = styled_1$9.default.div(templateObject_1$2H || (templateObject_1$2H = __makeTemplateObject$g(["\n background: linear-gradient(rgba(0, 0, 0, 0), rgba(18, 18, 18, 0.6));\n cursor: default;\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n height: 75px;\n pointer-events: none;\n"], ["\n background: linear-gradient(rgba(0, 0, 0, 0), rgba(18, 18, 18, 0.6));\n cursor: default;\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n height: 75px;\n pointer-events: none;\n"])));
66072
- var Attribution$1 = styled_1$9.default(_1$1.default)(templateObject_2$1O || (templateObject_2$1O = __makeTemplateObject$g(["\n position: absolute;\n bottom: 10px;\n left: 10px;\n right: 10px;\n"], ["\n position: absolute;\n bottom: 10px;\n left: 10px;\n right: 10px;\n"])));
66073
- var Container$a = styled_1$9.default.div(templateObject_3$1h || (templateObject_3$1h = __makeTemplateObject$g(["\n transition: opacity 150ms ease-in;\n"], ["\n transition: opacity 150ms ease-in;\n"])));
66071
+ var Background = styled_1$9.default.div(templateObject_1$2I || (templateObject_1$2I = __makeTemplateObject$g(["\n background: linear-gradient(rgba(0, 0, 0, 0), rgba(18, 18, 18, 0.6));\n cursor: default;\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n height: 75px;\n pointer-events: none;\n"], ["\n background: linear-gradient(rgba(0, 0, 0, 0), rgba(18, 18, 18, 0.6));\n cursor: default;\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n height: 75px;\n pointer-events: none;\n"])));
66072
+ var Attribution$1 = styled_1$9.default(_1$1.default)(templateObject_2$1P || (templateObject_2$1P = __makeTemplateObject$g(["\n position: absolute;\n bottom: 10px;\n left: 10px;\n right: 10px;\n"], ["\n position: absolute;\n bottom: 10px;\n left: 10px;\n right: 10px;\n"])));
66073
+ var Container$a = styled_1$9.default.div(templateObject_3$1i || (templateObject_3$1i = __makeTemplateObject$g(["\n transition: opacity 150ms ease-in;\n"], ["\n transition: opacity 150ms ease-in;\n"])));
66074
66074
  var AttributionOverlay = function (_a) {
66075
66075
  var gif = _a.gif, isHovered = _a.isHovered, onClick = _a.onClick;
66076
66076
  var hasHovered = react_1$r.useRef(isHovered);
@@ -66083,7 +66083,7 @@ var AttributionOverlay = function (_a) {
66083
66083
  react_1$r.default.createElement(Attribution$1, { gif: gif, onClick: onClick }))) : null;
66084
66084
  };
66085
66085
  overlay.default = AttributionOverlay;
66086
- var templateObject_1$2H, templateObject_2$1O, templateObject_3$1h;
66086
+ var templateObject_1$2I, templateObject_2$1P, templateObject_3$1i;
66087
66087
 
66088
66088
  var carousel = {};
66089
66089
 
@@ -69349,9 +69349,9 @@ var throttle_debounce_1$1 = cjs;
69349
69349
  var observer_1$1 = __importDefault$f(observer);
69350
69350
  var gif_1$1 = __importDefault$f(gif);
69351
69351
  var pingback_context_manager_1$1 = __importDefault$f(pingbackContextManager);
69352
- var Container$9 = styled_1$8.default.div(templateObject_1$2G || (templateObject_1$2G = __makeTemplateObject$f(["\n -webkit-overflow-scrolling: touch;\n overflow-x: auto;\n overflow-y: hidden;\n white-space: nowrap;\n position: relative;\n"], ["\n -webkit-overflow-scrolling: touch;\n overflow-x: auto;\n overflow-y: hidden;\n white-space: nowrap;\n position: relative;\n"])));
69353
- var Gif = styled_1$8.default(gif_1$1.default)(templateObject_2$1N || (templateObject_2$1N = __makeTemplateObject$f(["\n position: relative;\n display: inline-block;\n list-style: none;\n margin-left: ", "px;\n /* make sure gifs are fully visible with a scrollbar */\n margin-bottom: 1px;\n\n &:first-of-type {\n margin-left: 0;\n }\n .", " {\n position: absolute;\n top: 0;\n left: 0;\n }\n"], ["\n position: relative;\n display: inline-block;\n list-style: none;\n margin-left: ", "px;\n /* make sure gifs are fully visible with a scrollbar */\n margin-bottom: 1px;\n\n &:first-of-type {\n margin-left: 0;\n }\n .", " {\n position: absolute;\n top: 0;\n left: 0;\n }\n"])), function (props) { return props.ml; }, gif_1$1.default.imgClassName);
69354
- var Observer = styled_1$8.default(observer_1$1.default)(templateObject_3$1g || (templateObject_3$1g = __makeTemplateObject$f(["\n display: inline-block;\n"], ["\n display: inline-block;\n"])));
69352
+ var Container$9 = styled_1$8.default.div(templateObject_1$2H || (templateObject_1$2H = __makeTemplateObject$f(["\n -webkit-overflow-scrolling: touch;\n overflow-x: auto;\n overflow-y: hidden;\n white-space: nowrap;\n position: relative;\n"], ["\n -webkit-overflow-scrolling: touch;\n overflow-x: auto;\n overflow-y: hidden;\n white-space: nowrap;\n position: relative;\n"])));
69353
+ var Gif = styled_1$8.default(gif_1$1.default)(templateObject_2$1O || (templateObject_2$1O = __makeTemplateObject$f(["\n position: relative;\n display: inline-block;\n list-style: none;\n margin-left: ", "px;\n /* make sure gifs are fully visible with a scrollbar */\n margin-bottom: 1px;\n\n &:first-of-type {\n margin-left: 0;\n }\n .", " {\n position: absolute;\n top: 0;\n left: 0;\n }\n"], ["\n position: relative;\n display: inline-block;\n list-style: none;\n margin-left: ", "px;\n /* make sure gifs are fully visible with a scrollbar */\n margin-bottom: 1px;\n\n &:first-of-type {\n margin-left: 0;\n }\n .", " {\n position: absolute;\n top: 0;\n left: 0;\n }\n"])), function (props) { return props.ml; }, gif_1$1.default.imgClassName);
69354
+ var Observer = styled_1$8.default(observer_1$1.default)(templateObject_3$1h || (templateObject_3$1h = __makeTemplateObject$f(["\n display: inline-block;\n"], ["\n display: inline-block;\n"])));
69355
69355
  var Loader$2 = styled_1$8.default.div(templateObject_4$S || (templateObject_4$S = __makeTemplateObject$f(["\n width: 30px;\n display: inline-block;\n opacity: ", ";\n height: ", "px;\n"], ["\n width: 30px;\n display: inline-block;\n opacity: ", ";\n height: ", "px;\n"])), function (props) { return (props.isFirstLoad ? 0 : 1); }, function (props) { return props.height; });
69356
69356
  var defaultProps$1 = Object.freeze({ gutter: 6, user: {}, initialGifs: [] });
69357
69357
  var initialState$2 = Object.freeze({
@@ -69440,7 +69440,7 @@ var Carousel$1 = /** @class */ (function (_super) {
69440
69440
  return Carousel;
69441
69441
  }(react_1$p.PureComponent));
69442
69442
  carousel.default = Carousel$1;
69443
- var templateObject_1$2G, templateObject_2$1N, templateObject_3$1g, templateObject_4$S;
69443
+ var templateObject_1$2H, templateObject_2$1O, templateObject_3$1h, templateObject_4$S;
69444
69444
 
69445
69445
  var grid = {};
69446
69446
 
@@ -69457,7 +69457,7 @@ Object.defineProperty(fetchError, "__esModule", { value: true });
69457
69457
  var styled_1$7 = __importDefault$e(require$$0$4);
69458
69458
  var js_brand_1$5 = dist$2;
69459
69459
  var react_1$o = __importDefault$e(React__default);
69460
- var Message$1 = styled_1$7.default.div(templateObject_1$2F || (templateObject_1$2F = __makeTemplateObject$e(["\n color: ", ";\n display: flex;\n justify-content: center;\n margin: 30px 0;\n font-family: ", ";\n font-size: 16px;\n font-weight: 600;\n a {\n color: ", ";\n cursor: pointer;\n &:hover {\n color: white;\n }\n }\n"], ["\n color: ", ";\n display: flex;\n justify-content: center;\n margin: 30px 0;\n font-family: ", ";\n font-size: 16px;\n font-weight: 600;\n a {\n color: ", ";\n cursor: pointer;\n &:hover {\n color: white;\n }\n }\n"])), js_brand_1$5.giphyLightGrey, js_brand_1$5.fontFamily.body, js_brand_1$5.giphyBlue);
69460
+ var Message$1 = styled_1$7.default.div(templateObject_1$2G || (templateObject_1$2G = __makeTemplateObject$e(["\n color: ", ";\n display: flex;\n justify-content: center;\n margin: 30px 0;\n font-family: ", ";\n font-size: 16px;\n font-weight: 600;\n a {\n color: ", ";\n cursor: pointer;\n &:hover {\n color: white;\n }\n }\n"], ["\n color: ", ";\n display: flex;\n justify-content: center;\n margin: 30px 0;\n font-family: ", ";\n font-size: 16px;\n font-weight: 600;\n a {\n color: ", ";\n cursor: pointer;\n &:hover {\n color: white;\n }\n }\n"])), js_brand_1$5.giphyLightGrey, js_brand_1$5.fontFamily.body, js_brand_1$5.giphyBlue);
69461
69461
  var FetchError = function (_a) {
69462
69462
  var onClick = _a.onClick;
69463
69463
  return (react_1$o.default.createElement(Message$1, null,
@@ -69465,7 +69465,7 @@ var FetchError = function (_a) {
69465
69465
  react_1$o.default.createElement("a", { onClick: onClick }, "Try again?")));
69466
69466
  };
69467
69467
  fetchError.default = FetchError;
69468
- var templateObject_1$2F;
69468
+ var templateObject_1$2G;
69469
69469
 
69470
69470
  var loader = {};
69471
69471
 
@@ -69481,10 +69481,10 @@ var core_1$4 = require$$0$1;
69481
69481
  var styled_1$6 = __importDefault$d(require$$0$4);
69482
69482
  var js_brand_1$4 = dist$2;
69483
69483
  var react_1$n = __importDefault$d(React__default);
69484
- var bouncer = core_1$4.keyframes(templateObject_1$2E || (templateObject_1$2E = __makeTemplateObject$d(["\n to {\n transform: scale(1.75) translateY(-20px);\n }\n"], ["\n to {\n transform: scale(1.75) translateY(-20px);\n }\n"])));
69484
+ var bouncer = core_1$4.keyframes(templateObject_1$2F || (templateObject_1$2F = __makeTemplateObject$d(["\n to {\n transform: scale(1.75) translateY(-20px);\n }\n"], ["\n to {\n transform: scale(1.75) translateY(-20px);\n }\n"])));
69485
69485
  var loaderHeight = 37;
69486
- var Loader$1 = styled_1$6.default.div(templateObject_2$1M || (templateObject_2$1M = __makeTemplateObject$d(["\n display: flex;\n align-items: center;\n height: ", "px;\n padding-top: 15px;\n margin: 0 auto;\n text-align: center;\n justify-content: center;\n animation: pulse 0.8s ease-in-out 0s infinite alternate backwards;\n"], ["\n display: flex;\n align-items: center;\n height: ", "px;\n padding-top: 15px;\n margin: 0 auto;\n text-align: center;\n justify-content: center;\n animation: pulse 0.8s ease-in-out 0s infinite alternate backwards;\n"])), loaderHeight);
69487
- var Dot = styled_1$6.default.div(templateObject_3$1f || (templateObject_3$1f = __makeTemplateObject$d(["\n display: inline-block;\n height: 10px;\n width: 10px;\n margin: ", "px 10px 10px 10px;\n position: relative;\n box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.3);\n animation: ", " cubic-bezier(0.455, 0.03, 0.515, 0.955) 0.75s infinite alternate;\n background: ", ";\n animation-delay: ", ";\n"], ["\n display: inline-block;\n height: 10px;\n width: 10px;\n margin: ", "px 10px 10px 10px;\n position: relative;\n box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.3);\n animation: ", " cubic-bezier(0.455, 0.03, 0.515, 0.955) 0.75s infinite alternate;\n background: ", ";\n animation-delay: ", ";\n"])), loaderHeight, bouncer, function (props) { return props.color; }, function (props) { return props.delay; });
69486
+ var Loader$1 = styled_1$6.default.div(templateObject_2$1N || (templateObject_2$1N = __makeTemplateObject$d(["\n display: flex;\n align-items: center;\n height: ", "px;\n padding-top: 15px;\n margin: 0 auto;\n text-align: center;\n justify-content: center;\n animation: pulse 0.8s ease-in-out 0s infinite alternate backwards;\n"], ["\n display: flex;\n align-items: center;\n height: ", "px;\n padding-top: 15px;\n margin: 0 auto;\n text-align: center;\n justify-content: center;\n animation: pulse 0.8s ease-in-out 0s infinite alternate backwards;\n"])), loaderHeight);
69487
+ var Dot = styled_1$6.default.div(templateObject_3$1g || (templateObject_3$1g = __makeTemplateObject$d(["\n display: inline-block;\n height: 10px;\n width: 10px;\n margin: ", "px 10px 10px 10px;\n position: relative;\n box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.3);\n animation: ", " cubic-bezier(0.455, 0.03, 0.515, 0.955) 0.75s infinite alternate;\n background: ", ";\n animation-delay: ", ";\n"], ["\n display: inline-block;\n height: 10px;\n width: 10px;\n margin: ", "px 10px 10px 10px;\n position: relative;\n box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.3);\n animation: ", " cubic-bezier(0.455, 0.03, 0.515, 0.955) 0.75s infinite alternate;\n background: ", ";\n animation-delay: ", ";\n"])), loaderHeight, bouncer, function (props) { return props.color; }, function (props) { return props.delay; });
69488
69488
  loader.default = (function (_a) {
69489
69489
  var _b = _a.className, className = _b === void 0 ? '' : _b;
69490
69490
  return (react_1$n.default.createElement(Loader$1, { className: className },
@@ -69494,7 +69494,7 @@ loader.default = (function (_a) {
69494
69494
  react_1$n.default.createElement(Dot, { color: js_brand_1$4.giphyRed, delay: ".3s" }),
69495
69495
  react_1$n.default.createElement(Dot, { color: js_brand_1$4.giphyYellow, delay: ".4s" })));
69496
69496
  });
69497
- var templateObject_1$2E, templateObject_2$1M, templateObject_3$1f;
69497
+ var templateObject_1$2F, templateObject_2$1N, templateObject_3$1g;
69498
69498
 
69499
69499
  var masonryGrid = {};
69500
69500
 
@@ -69659,7 +69659,7 @@ var gif_1 = __importDefault$c(gif);
69659
69659
  var loader_1 = __importDefault$c(loader);
69660
69660
  var masonry_grid_1 = __importDefault$c(masonryGrid);
69661
69661
  var pingback_context_manager_1 = __importDefault$c(pingbackContextManager);
69662
- var Loader = styled_1$5.default.div(templateObject_1$2D || (templateObject_1$2D = __makeTemplateObject$c(["\n opacity: ", ";\n"], ["\n opacity: ", ";\n"])), function (props) { return (props.isFirstLoad ? 0 : 1); });
69662
+ var Loader = styled_1$5.default.div(templateObject_1$2E || (templateObject_1$2E = __makeTemplateObject$c(["\n opacity: ", ";\n"], ["\n opacity: ", ";\n"])), function (props) { return (props.isFirstLoad ? 0 : 1); });
69663
69663
  var defaultProps = Object.freeze({ gutter: 6, user: {}, initialGifs: [] });
69664
69664
  var initialState$1 = Object.freeze({
69665
69665
  isFetching: false,
@@ -69765,7 +69765,7 @@ var Grid$1 = /** @class */ (function (_super) {
69765
69765
  return Grid;
69766
69766
  }(react_1$l.PureComponent));
69767
69767
  grid.default = Grid$1;
69768
- var templateObject_1$2D;
69768
+ var templateObject_1$2E;
69769
69769
 
69770
69770
  var searchBar = {};
69771
69771
 
@@ -69928,11 +69928,11 @@ theme.initTheme = initTheme;
69928
69928
  // DRY but kinda ugly
69929
69929
  var getSize = function (theme, includeWidth) {
69930
69930
  if (includeWidth === void 0) { includeWidth = false; }
69931
- return core_1$3.css(templateObject_3$1e || (templateObject_3$1e = __makeTemplateObject$b(["\n height: ", "px;\n ", ";\n @media (", ") {\n height: ", "px;\n ", ";\n }\n"], ["\n height: ", "px;\n ", ";\n @media (", ") {\n height: ", "px;\n ", ";\n }\n"])), theme.searchbarHeight, includeWidth && core_1$3.css(templateObject_1$2C || (templateObject_1$2C = __makeTemplateObject$b(["\n width: ", "px;\n "], ["\n width: ", "px;\n "])), theme.searchbarHeight), theme.condensedMediaQuery, theme.smallSearchbarHeight, includeWidth && core_1$3.css(templateObject_2$1L || (templateObject_2$1L = __makeTemplateObject$b(["\n width: ", "px;\n "], ["\n width: ", "px;\n "])), theme.smallSearchbarHeight));
69931
+ return core_1$3.css(templateObject_3$1f || (templateObject_3$1f = __makeTemplateObject$b(["\n height: ", "px;\n ", ";\n @media (", ") {\n height: ", "px;\n ", ";\n }\n"], ["\n height: ", "px;\n ", ";\n @media (", ") {\n height: ", "px;\n ", ";\n }\n"])), theme.searchbarHeight, includeWidth && core_1$3.css(templateObject_1$2D || (templateObject_1$2D = __makeTemplateObject$b(["\n width: ", "px;\n "], ["\n width: ", "px;\n "])), theme.searchbarHeight), theme.condensedMediaQuery, theme.smallSearchbarHeight, includeWidth && core_1$3.css(templateObject_2$1M || (templateObject_2$1M = __makeTemplateObject$b(["\n width: ", "px;\n "], ["\n width: ", "px;\n "])), theme.smallSearchbarHeight));
69932
69932
  };
69933
69933
  theme.getSize = getSize;
69934
69934
  theme.default = styled_1$4.default;
69935
- var templateObject_1$2C, templateObject_2$1L, templateObject_3$1e;
69935
+ var templateObject_1$2D, templateObject_2$1M, templateObject_3$1f;
69936
69936
 
69937
69937
  (function (exports) {
69938
69938
  var __assign = (commonjsGlobal$7 && commonjsGlobal$7.__assign) || function () {
@@ -70175,9 +70175,9 @@ var theme_1$4 = __importDefault$a(theme);
70175
70175
  var channelMargin = 6;
70176
70176
  var channelSearchHeight = function (theme) { return theme.searchbarHeight - channelMargin * 2; };
70177
70177
  var smallChannelSearchHeight = function (theme) { return theme.smallSearchbarHeight - 3 * 2; };
70178
- var animateAvatar = function (h) { return core_1$2.keyframes(templateObject_1$2B || (templateObject_1$2B = __makeTemplateObject$a(["\nto {\n width: ", "px;\n}\n"], ["\nto {\n width: ", "px;\n}\n"])), h); };
70179
- var Avatar$3 = theme_1$4.default(avatar_1$2.default)(templateObject_2$1K || (templateObject_2$1K = __makeTemplateObject$a(["\n height: ", "px;\n margin: 0;\n width: 0;\n animation: ", " 100ms ease-in-out forwards;\n @media (", ") {\n height: ", "px;\n animation: ", " 100ms ease-in-out forwards;\n }\n"], ["\n height: ", "px;\n margin: 0;\n width: 0;\n animation: ", " 100ms ease-in-out forwards;\n @media (", ") {\n height: ", "px;\n animation: ", " 100ms ease-in-out forwards;\n }\n"])), function (props) { return channelSearchHeight(props.theme); }, function (props) { return animateAvatar(channelSearchHeight(props.theme)); }, function (props) { return props.theme.condensedMediaQuery; }, function (props) { return smallChannelSearchHeight(props.theme); }, function (props) { return animateAvatar(smallChannelSearchHeight(props.theme)); });
70180
- var Username = theme_1$4.default.div(templateObject_3$1d || (templateObject_3$1d = __makeTemplateObject$a(["\n background: ", ";\n display: flex;\n align-items: center;\n padding-left: ", "px;\n"], ["\n background: ", ";\n display: flex;\n align-items: center;\n padding-left: ", "px;\n"])), function (props) { return (props.theme.mode === 'dark' ? js_brand_1$3.giphyCharcoal : js_brand_1$3.giphyWhite); }, channelMargin);
70178
+ var animateAvatar = function (h) { return core_1$2.keyframes(templateObject_1$2C || (templateObject_1$2C = __makeTemplateObject$a(["\nto {\n width: ", "px;\n}\n"], ["\nto {\n width: ", "px;\n}\n"])), h); };
70179
+ var Avatar$3 = theme_1$4.default(avatar_1$2.default)(templateObject_2$1L || (templateObject_2$1L = __makeTemplateObject$a(["\n height: ", "px;\n margin: 0;\n width: 0;\n animation: ", " 100ms ease-in-out forwards;\n @media (", ") {\n height: ", "px;\n animation: ", " 100ms ease-in-out forwards;\n }\n"], ["\n height: ", "px;\n margin: 0;\n width: 0;\n animation: ", " 100ms ease-in-out forwards;\n @media (", ") {\n height: ", "px;\n animation: ", " 100ms ease-in-out forwards;\n }\n"])), function (props) { return channelSearchHeight(props.theme); }, function (props) { return animateAvatar(channelSearchHeight(props.theme)); }, function (props) { return props.theme.condensedMediaQuery; }, function (props) { return smallChannelSearchHeight(props.theme); }, function (props) { return animateAvatar(smallChannelSearchHeight(props.theme)); });
70180
+ var Username = theme_1$4.default.div(templateObject_3$1e || (templateObject_3$1e = __makeTemplateObject$a(["\n background: ", ";\n display: flex;\n align-items: center;\n padding-left: ", "px;\n"], ["\n background: ", ";\n display: flex;\n align-items: center;\n padding-left: ", "px;\n"])), function (props) { return (props.theme.mode === 'dark' ? js_brand_1$3.giphyCharcoal : js_brand_1$3.giphyWhite); }, channelMargin);
70181
70181
  var UsernamePill = theme_1$4.default.div(templateObject_4$R || (templateObject_4$R = __makeTemplateObject$a(["\n background: ", ";\n display: flex;\n padding: 0 4px;\n color: ", ";\n font-family: interface, Helvetica Neue, helvetica, sans-serif;\n font-weight: 600;\n font-size: 12px;\n align-items: center;\n height: ", "px;\n @media (", ") {\n display: none;\n }\n"], ["\n background: ", ";\n display: flex;\n padding: 0 4px;\n color: ", ";\n font-family: interface, Helvetica Neue, helvetica, sans-serif;\n font-weight: 600;\n font-size: 12px;\n align-items: center;\n height: ", "px;\n @media (", ") {\n display: none;\n }\n"])), js_brand_1$3.giphyWhiteSmoke, js_brand_1$3.giphyDarkCharcoal, function (props) { return channelSearchHeight(props.theme); }, function (props) { return props.theme.condensedMediaQuery; });
70182
70182
  var SearchBarChannel = function (_a) {
70183
70183
  var _b = _a.className, className = _b === void 0 ? '' : _b;
@@ -70191,7 +70191,7 @@ var SearchBarChannel = function (_a) {
70191
70191
  activeChannel.user.is_verified && react_1$i.default.createElement(verified_badge_1$1.default, { size: 14 })))) : null;
70192
70192
  };
70193
70193
  searchBarChannel.default = SearchBarChannel;
70194
- var templateObject_1$2B, templateObject_2$1K, templateObject_3$1d, templateObject_4$R;
70194
+ var templateObject_1$2C, templateObject_2$1L, templateObject_3$1e, templateObject_4$R;
70195
70195
 
70196
70196
  var searchButton = {};
70197
70197
 
@@ -70317,14 +70317,14 @@ var time = '2s';
70317
70317
  var purp = '#9933FF';
70318
70318
  var pink = '#FF6666';
70319
70319
  var strongEasing = 'cubic-bezier(0.920, 0.240, 0.185, 0.730)';
70320
- var searchFx = core_1$1.keyframes(templateObject_1$2A || (templateObject_1$2A = __makeTemplateObject$9(["\n 0% {\n transform: rotate(34deg) translate(-10px, 80px);\n };\n \n 100% {\n transform: rotate(34deg) translate(-10px, -20px);\n }\n"], ["\n 0% {\n transform: rotate(34deg) translate(-10px, 80px);\n };\n \n 100% {\n transform: rotate(34deg) translate(-10px, -20px);\n }\n"])));
70321
- var plus$1 = core_1$1.keyframes(templateObject_2$1J || (templateObject_2$1J = __makeTemplateObject$9(["\n 0% { \n transform: translate(0px, 0px);\n opacity: 0;\n }\n 50% {\n opacity: 1;\n }\n 100% {\n transform: translate(10px, -17px);\n opacity: 0;\n }\n"], ["\n 0% { \n transform: translate(0px, 0px);\n opacity: 0;\n }\n 50% {\n opacity: 1;\n }\n 100% {\n transform: translate(10px, -17px);\n opacity: 0;\n }\n"])));
70322
- var gradientFade = core_1$1.keyframes(templateObject_3$1c || (templateObject_3$1c = __makeTemplateObject$9(["\n 0% {\n opacity: 0;\n transform: translateX(-400%);\n }\n 50% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n transform: translateX(0);\n }\n"], ["\n 0% {\n opacity: 0;\n transform: translateX(-400%);\n }\n 50% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n transform: translateX(0);\n }\n"])));
70320
+ var searchFx = core_1$1.keyframes(templateObject_1$2B || (templateObject_1$2B = __makeTemplateObject$9(["\n 0% {\n transform: rotate(34deg) translate(-10px, 80px);\n };\n \n 100% {\n transform: rotate(34deg) translate(-10px, -20px);\n }\n"], ["\n 0% {\n transform: rotate(34deg) translate(-10px, 80px);\n };\n \n 100% {\n transform: rotate(34deg) translate(-10px, -20px);\n }\n"])));
70321
+ var plus$1 = core_1$1.keyframes(templateObject_2$1K || (templateObject_2$1K = __makeTemplateObject$9(["\n 0% { \n transform: translate(0px, 0px);\n opacity: 0;\n }\n 50% {\n opacity: 1;\n }\n 100% {\n transform: translate(10px, -17px);\n opacity: 0;\n }\n"], ["\n 0% { \n transform: translate(0px, 0px);\n opacity: 0;\n }\n 50% {\n opacity: 1;\n }\n 100% {\n transform: translate(10px, -17px);\n opacity: 0;\n }\n"])));
70322
+ var gradientFade = core_1$1.keyframes(templateObject_3$1d || (templateObject_3$1d = __makeTemplateObject$9(["\n 0% {\n opacity: 0;\n transform: translateX(-400%);\n }\n 50% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n transform: translateX(0);\n }\n"], ["\n 0% {\n opacity: 0;\n transform: translateX(-400%);\n }\n 50% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n transform: translateX(0);\n }\n"])));
70323
70323
  var Container$8 = theme_1$3.default.div(templateObject_4$Q || (templateObject_4$Q = __makeTemplateObject$9(["\n display: flex;\n justify-content: center;\n align-items: center;\n position: relative;\n cursor: pointer;\n @media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) {\n display: none;\n }\n ", "\n"], ["\n display: flex;\n justify-content: center;\n align-items: center;\n position: relative;\n cursor: pointer;\n @media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) {\n display: none;\n }\n ", "\n"])), function (props) { return theme_1$3.getSize(props.theme, true); });
70324
70324
  var GradientBox = theme_1$3.default.div(templateObject_5$H || (templateObject_5$H = __makeTemplateObject$9(["\n position: absolute;\n height: 100%;\n width: 100%;\n background: linear-gradient(45deg, ", " 0%, ", " 100%);\n overflow: hidden;\n &:before {\n animation: ", " ", " linear 0s infinite;\n background-image: linear-gradient(45deg, ", " 0%, ", " 50%, ", " 100%);\n background-size: 400%;\n background-position: 0% 100%;\n content: '';\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n width: 400%;\n }\n"], ["\n position: absolute;\n height: 100%;\n width: 100%;\n background: linear-gradient(45deg, ", " 0%, ", " 100%);\n overflow: hidden;\n &:before {\n animation: ", " ", " linear 0s infinite;\n background-image: linear-gradient(45deg, ", " 0%, ", " 50%, ", " 100%);\n background-size: 400%;\n background-position: 0% 100%;\n content: '';\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n width: 400%;\n }\n"])), purp, pink, gradientFade, time, purp, pink, purp);
70325
70325
  var Fx = theme_1$3.default.div(templateObject_6$w || (templateObject_6$w = __makeTemplateObject$9(["\n width: 100%;\n height: 100%;\n position: absolute;\n overflow: hidden;\n &::after {\n content: '+';\n color: white;\n font-family: 'SS Standard';\n font-size: 8px;\n position: absolute;\n top: 65%;\n left: 66%;\n animation: ", " 1s ", " 0s 1 forwards;\n }\n"], ["\n width: 100%;\n height: 100%;\n position: absolute;\n overflow: hidden;\n &::after {\n content: '+';\n color: white;\n font-family: 'SS Standard';\n font-size: 8px;\n position: absolute;\n top: 65%;\n left: 66%;\n animation: ", " 1s ", " 0s 1 forwards;\n }\n"])), plus$1, strongEasing);
70326
- var Scanner = theme_1$3.default.div(templateObject_7$p || (templateObject_7$p = __makeTemplateObject$9(["\n position: absolute;\n width: 200%;\n height: 20px;\n background: rgba(255, 255, 255, 0.5);\n transform: rotate(34deg) translate(-10px, -20px);\n animation: ", " 1s ", " 0s 1;\n filter: blur(1px);\n"], ["\n position: absolute;\n width: 200%;\n height: 20px;\n background: rgba(255, 255, 255, 0.5);\n transform: rotate(34deg) translate(-10px, -20px);\n animation: ", " 1s ", " 0s 1;\n filter: blur(1px);\n"])), searchFx, strongEasing);
70327
- var SearchIcon = theme_1$3.default(search_icon_1.default)(templateObject_8$n || (templateObject_8$n = __makeTemplateObject$9(["\n z-index: 1;\n display: flex;\n width: 60%;\n height: 60%;\n"], ["\n z-index: 1;\n display: flex;\n width: 60%;\n height: 60%;\n"])));
70326
+ var Scanner = theme_1$3.default.div(templateObject_7$o || (templateObject_7$o = __makeTemplateObject$9(["\n position: absolute;\n width: 200%;\n height: 20px;\n background: rgba(255, 255, 255, 0.5);\n transform: rotate(34deg) translate(-10px, -20px);\n animation: ", " 1s ", " 0s 1;\n filter: blur(1px);\n"], ["\n position: absolute;\n width: 200%;\n height: 20px;\n background: rgba(255, 255, 255, 0.5);\n transform: rotate(34deg) translate(-10px, -20px);\n animation: ", " 1s ", " 0s 1;\n filter: blur(1px);\n"])), searchFx, strongEasing);
70327
+ var SearchIcon = theme_1$3.default(search_icon_1.default)(templateObject_8$m || (templateObject_8$m = __makeTemplateObject$9(["\n z-index: 1;\n display: flex;\n width: 60%;\n height: 60%;\n"], ["\n z-index: 1;\n display: flex;\n width: 60%;\n height: 60%;\n"])));
70328
70328
  var SearchButton = function () {
70329
70329
  var isFetching = react_1$d.useContext(context_1$3.SearchContext).isFetching;
70330
70330
  // let the animation run by throttling isFetching
@@ -70336,7 +70336,7 @@ var SearchButton = function () {
70336
70336
  react_1$d.default.createElement(Scanner, null)))));
70337
70337
  };
70338
70338
  searchButton.default = SearchButton;
70339
- var templateObject_1$2A, templateObject_2$1J, templateObject_3$1c, templateObject_4$Q, templateObject_5$H, templateObject_6$w, templateObject_7$p, templateObject_8$n;
70339
+ var templateObject_1$2B, templateObject_2$1K, templateObject_3$1d, templateObject_4$Q, templateObject_5$H, templateObject_6$w, templateObject_7$o, templateObject_8$m;
70340
70340
 
70341
70341
  var __makeTemplateObject$8 = (commonjsGlobal$7 && commonjsGlobal$7.__makeTemplateObject) || function (cooked, raw) {
70342
70342
  if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
@@ -70381,9 +70381,9 @@ function usePrevious$1(value) {
70381
70381
  return ref.current;
70382
70382
  }
70383
70383
  var SEARCH_DEBOUNCE = 500;
70384
- var Container$7 = theme_1$2.default.div(templateObject_1$2z || (templateObject_1$2z = __makeTemplateObject$8(["\n display: flex;\n background: white;\n ", "\n"], ["\n display: flex;\n background: white;\n ", "\n"])), function (props) { return theme_1$2.getSize(props.theme); });
70385
- var Input = theme_1$2.default.input(templateObject_3$1b || (templateObject_3$1b = __makeTemplateObject$8(["\n background: ", ";\n box-sizing: border-box;\n border: 0;\n appearance: none;\n font-weight: normal;\n font-family: interface, Helvetica Neue, helvetica, sans-serif;\n outline: 0;\n font-size: 15px;\n padding: 0 10px;\n border-radius: 0;\n text-overflow: ellipsis;\n color: ", ";\n &::placeholder {\n color: ", ";\n }\n min-width: 150px;\n flex: 1;\n ", "\n"], ["\n background: ", ";\n box-sizing: border-box;\n border: 0;\n appearance: none;\n font-weight: normal;\n font-family: interface, Helvetica Neue, helvetica, sans-serif;\n outline: 0;\n font-size: 15px;\n padding: 0 10px;\n border-radius: 0;\n text-overflow: ellipsis;\n color: ", ";\n &::placeholder {\n color: ", ";\n }\n min-width: 150px;\n flex: 1;\n ", "\n"])), function (props) { return (props.theme.mode === 'dark' ? js_brand_1$2.giphyCharcoal : js_brand_1$2.giphyWhite); }, function (props) { return (props.theme.mode === 'dark' ? js_brand_1$2.giphyWhite : js_brand_1$2.giphyBlack); }, function (props) { return (props.theme.mode === 'dark' ? js_brand_1$2.giphyLightGrey : js_brand_1$2.giphyLightGrey); }, function (props) {
70386
- return props.isUsernameSearch && core_1.css(templateObject_2$1I || (templateObject_2$1I = __makeTemplateObject$8(["\n color: ", ";\n "], ["\n color: ", ";\n "])), js_brand_1$2.giphyIndigo);
70384
+ var Container$7 = theme_1$2.default.div(templateObject_1$2A || (templateObject_1$2A = __makeTemplateObject$8(["\n display: flex;\n background: white;\n ", "\n"], ["\n display: flex;\n background: white;\n ", "\n"])), function (props) { return theme_1$2.getSize(props.theme); });
70385
+ var Input = theme_1$2.default.input(templateObject_3$1c || (templateObject_3$1c = __makeTemplateObject$8(["\n background: ", ";\n box-sizing: border-box;\n border: 0;\n appearance: none;\n font-weight: normal;\n font-family: interface, Helvetica Neue, helvetica, sans-serif;\n outline: 0;\n font-size: 15px;\n padding: 0 10px;\n border-radius: 0;\n text-overflow: ellipsis;\n color: ", ";\n &::placeholder {\n color: ", ";\n }\n min-width: 150px;\n flex: 1;\n ", "\n"], ["\n background: ", ";\n box-sizing: border-box;\n border: 0;\n appearance: none;\n font-weight: normal;\n font-family: interface, Helvetica Neue, helvetica, sans-serif;\n outline: 0;\n font-size: 15px;\n padding: 0 10px;\n border-radius: 0;\n text-overflow: ellipsis;\n color: ", ";\n &::placeholder {\n color: ", ";\n }\n min-width: 150px;\n flex: 1;\n ", "\n"])), function (props) { return (props.theme.mode === 'dark' ? js_brand_1$2.giphyCharcoal : js_brand_1$2.giphyWhite); }, function (props) { return (props.theme.mode === 'dark' ? js_brand_1$2.giphyWhite : js_brand_1$2.giphyBlack); }, function (props) { return (props.theme.mode === 'dark' ? js_brand_1$2.giphyLightGrey : js_brand_1$2.giphyLightGrey); }, function (props) {
70386
+ return props.isUsernameSearch && core_1.css(templateObject_2$1J || (templateObject_2$1J = __makeTemplateObject$8(["\n color: ", ";\n "], ["\n color: ", ";\n "])), js_brand_1$2.giphyIndigo);
70387
70387
  });
70388
70388
  var SearchBar = function (_a) {
70389
70389
  var className = _a.className, _b = _a.placeholder, placeholder = _b === void 0 ? "Search GIPHY" : _b, _c = _a.clear, clear = _c === void 0 ? false : _c, autoFocus = _a.autoFocus;
@@ -70450,7 +70450,7 @@ var SearchBar = function (_a) {
70450
70450
  };
70451
70451
  SearchBar.className = 'giphy-search-bar';
70452
70452
  searchBar.default = SearchBar;
70453
- var templateObject_1$2z, templateObject_2$1I, templateObject_3$1b;
70453
+ var templateObject_1$2A, templateObject_2$1J, templateObject_3$1c;
70454
70454
 
70455
70455
  var suggestionBar = {};
70456
70456
 
@@ -70509,9 +70509,9 @@ var context_1$1 = context;
70509
70509
  var theme_1$1 = __importStar$4(theme);
70510
70510
  var trending_icon_1 = __importDefault$5(trendingIcon);
70511
70511
  var margin = 9;
70512
- var ChannelPillContainer = theme_1$1.default.div(templateObject_1$2y || (templateObject_1$2y = __makeTemplateObject$7(["\n background: ", ";\n display: flex;\n padding-right: 4px;\n align-items: center;\n margin-right: ", "px;\n cursor: pointer;\n"], ["\n background: ", ";\n display: flex;\n padding-right: 4px;\n align-items: center;\n margin-right: ", "px;\n cursor: pointer;\n"])), js_brand_1$1.giphyDarkestGrey, margin);
70513
- var TrendingSearchPillContainer = theme_1$1.default.div(templateObject_2$1H || (templateObject_2$1H = __makeTemplateObject$7(["\n background: ", ";\n display: flex;\n padding: 14px;\n align-items: center;\n margin-right: ", "px;\n white-space: nowrap;\n cursor: pointer;\n font-style: italic;\n border-radius: 20px;\n"], ["\n background: ", ";\n display: flex;\n padding: 14px;\n align-items: center;\n margin-right: ", "px;\n white-space: nowrap;\n cursor: pointer;\n font-style: italic;\n border-radius: 20px;\n"])), js_brand_1$1.giphyDarkestGrey, margin);
70514
- var Avatar$2 = theme_1$1.default(avatar_1$1.default)(templateObject_3$1a || (templateObject_3$1a = __makeTemplateObject$7(["\n ", "\n"], ["\n ", "\n"])), function (props) { return theme_1$1.getSize(props.theme, true); });
70512
+ var ChannelPillContainer = theme_1$1.default.div(templateObject_1$2z || (templateObject_1$2z = __makeTemplateObject$7(["\n background: ", ";\n display: flex;\n padding-right: 4px;\n align-items: center;\n margin-right: ", "px;\n cursor: pointer;\n"], ["\n background: ", ";\n display: flex;\n padding-right: 4px;\n align-items: center;\n margin-right: ", "px;\n cursor: pointer;\n"])), js_brand_1$1.giphyDarkestGrey, margin);
70513
+ var TrendingSearchPillContainer = theme_1$1.default.div(templateObject_2$1I || (templateObject_2$1I = __makeTemplateObject$7(["\n background: ", ";\n display: flex;\n padding: 14px;\n align-items: center;\n margin-right: ", "px;\n white-space: nowrap;\n cursor: pointer;\n font-style: italic;\n border-radius: 20px;\n"], ["\n background: ", ";\n display: flex;\n padding: 14px;\n align-items: center;\n margin-right: ", "px;\n white-space: nowrap;\n cursor: pointer;\n font-style: italic;\n border-radius: 20px;\n"])), js_brand_1$1.giphyDarkestGrey, margin);
70514
+ var Avatar$2 = theme_1$1.default(avatar_1$1.default)(templateObject_3$1b || (templateObject_3$1b = __makeTemplateObject$7(["\n ", "\n"], ["\n ", "\n"])), function (props) { return theme_1$1.getSize(props.theme, true); });
70515
70515
  var TrendingIcon = theme_1$1.default(trending_icon_1.default)(templateObject_4$P || (templateObject_4$P = __makeTemplateObject$7(["\n margin-right: 2px;\n"], ["\n margin-right: 2px;\n"])));
70516
70516
  var ChannelPill = function (_a) {
70517
70517
  var channel = _a.channel;
@@ -70532,7 +70532,7 @@ var TrendingSearchPill = function (_a) {
70532
70532
  trendingSearch));
70533
70533
  };
70534
70534
  pills.TrendingSearchPill = TrendingSearchPill;
70535
- var templateObject_1$2y, templateObject_2$1H, templateObject_3$1a, templateObject_4$P;
70535
+ var templateObject_1$2z, templateObject_2$1I, templateObject_3$1b, templateObject_4$P;
70536
70536
 
70537
70537
  var __makeTemplateObject$6 = (commonjsGlobal$7 && commonjsGlobal$7.__makeTemplateObject) || function (cooked, raw) {
70538
70538
  if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
@@ -70598,7 +70598,7 @@ var react_1$9 = __importStar$3(React__default);
70598
70598
  var context_1 = context;
70599
70599
  var theme_1 = __importStar$3(theme);
70600
70600
  var pills_1 = pills;
70601
- var Container$6 = theme_1.default.div(templateObject_1$2x || (templateObject_1$2x = __makeTemplateObject$6(["\n display: flex;\n color: white;\n flex-direction: row;\n font-family: 'interface';\n font-weight: 600;\n font-size: 14px;\n -webkit-overflow-scrolling: touch;\n overflow-x: auto;\n overflow-y: hidden;\n padding-bottom: 10px;\n ", "\n"], ["\n display: flex;\n color: white;\n flex-direction: row;\n font-family: 'interface';\n font-weight: 600;\n font-size: 14px;\n -webkit-overflow-scrolling: touch;\n overflow-x: auto;\n overflow-y: hidden;\n padding-bottom: 10px;\n ", "\n"])), function (props) { return theme_1.getSize(props.theme); });
70601
+ var Container$6 = theme_1.default.div(templateObject_1$2y || (templateObject_1$2y = __makeTemplateObject$6(["\n display: flex;\n color: white;\n flex-direction: row;\n font-family: 'interface';\n font-weight: 600;\n font-size: 14px;\n -webkit-overflow-scrolling: touch;\n overflow-x: auto;\n overflow-y: hidden;\n padding-bottom: 10px;\n ", "\n"], ["\n display: flex;\n color: white;\n flex-direction: row;\n font-family: 'interface';\n font-weight: 600;\n font-size: 14px;\n -webkit-overflow-scrolling: touch;\n overflow-x: auto;\n overflow-y: hidden;\n padding-bottom: 10px;\n ", "\n"])), function (props) { return theme_1.getSize(props.theme); });
70602
70602
  var SuggestionBar = function () {
70603
70603
  var _a = react_1$9.useContext(context_1.SearchContext), channelSearch = _a.channelSearch, fetchChannelSearch = _a.fetchChannelSearch, trendingSearches = _a.trendingSearches, activeChannel = _a.activeChannel;
70604
70604
  var _b = react_1$9.useState([]), channels = _b[0], setChannels = _b[1];
@@ -70628,7 +70628,7 @@ var SuggestionBar = function () {
70628
70628
  : trendingSearches.map(function (trendingSearch) { return (react_1$9.default.createElement(pills_1.TrendingSearchPill, { key: trendingSearch, trendingSearch: trendingSearch })); })));
70629
70629
  };
70630
70630
  suggestionBar.default = SuggestionBar;
70631
- var templateObject_1$2x;
70631
+ var templateObject_1$2y;
70632
70632
 
70633
70633
  var video$1 = {};
70634
70634
 
@@ -75432,9 +75432,9 @@ var react_1$6 = __importDefault$3(React__default);
75432
75432
  var avatar_1 = __importDefault$3(avatar);
75433
75433
  var user_1 = __importDefault$3(user);
75434
75434
  var clips_branding_1 = __importDefault$3(clipsBranding);
75435
- var Container$5 = styled_1$3.default.div(templateObject_1$2w || (templateObject_1$2w = __makeTemplateObject$5(["\n display: flex;\n align-items: center;\n font-family: interface, helvetica, arial;\n cursor: pointer;\n"], ["\n display: flex;\n align-items: center;\n font-family: interface, helvetica, arial;\n cursor: pointer;\n"])));
75436
- var Avatar$1 = styled_1$3.default(avatar_1.default)(templateObject_2$1G || (templateObject_2$1G = __makeTemplateObject$5(["\n flex-shrink: 0;\n"], ["\n flex-shrink: 0;\n"])));
75437
- var Right = styled_1$3.default.div(templateObject_3$19 || (templateObject_3$19 = __makeTemplateObject$5(["\n display: flex;\n flex-direction: column;\n"], ["\n display: flex;\n flex-direction: column;\n"])));
75435
+ var Container$5 = styled_1$3.default.div(templateObject_1$2x || (templateObject_1$2x = __makeTemplateObject$5(["\n display: flex;\n align-items: center;\n font-family: interface, helvetica, arial;\n cursor: pointer;\n"], ["\n display: flex;\n align-items: center;\n font-family: interface, helvetica, arial;\n cursor: pointer;\n"])));
75436
+ var Avatar$1 = styled_1$3.default(avatar_1.default)(templateObject_2$1H || (templateObject_2$1H = __makeTemplateObject$5(["\n flex-shrink: 0;\n"], ["\n flex-shrink: 0;\n"])));
75437
+ var Right = styled_1$3.default.div(templateObject_3$1a || (templateObject_3$1a = __makeTemplateObject$5(["\n display: flex;\n flex-direction: column;\n"], ["\n display: flex;\n flex-direction: column;\n"])));
75438
75438
  var Attribution = function (_a) {
75439
75439
  var gif = _a.gif, className = _a.className, onClick = _a.onClick;
75440
75440
  var user = gif.user;
@@ -75469,7 +75469,7 @@ var Attribution = function (_a) {
75469
75469
  };
75470
75470
  Attribution.className = 'giphy-attribution';
75471
75471
  attribution.default = Attribution;
75472
- var templateObject_1$2w, templateObject_2$1G, templateObject_3$19;
75472
+ var templateObject_1$2x, templateObject_2$1H, templateObject_3$1a;
75473
75473
 
75474
75474
  var volume = {};
75475
75475
 
@@ -75596,7 +75596,7 @@ var styled_1$2 = __importDefault$2(require$$0$4);
75596
75596
  var js_brand_1 = dist$2;
75597
75597
  var react_1$3 = __importDefault$2(React__default);
75598
75598
  var useRaf_1 = __importDefault$2(useRaf$1);
75599
- var Bar$1 = styled_1$2.default.div(templateObject_1$2v || (templateObject_1$2v = __makeTemplateObject$4(["\n background: ", ";\n height: ", "px;\n position: absolute;\n width: 5px;\n bottom: 0;\n left: 0;\n opacity: 0.95;\n"], ["\n background: ", ";\n height: ", "px;\n position: absolute;\n width: 5px;\n bottom: 0;\n left: 0;\n opacity: 0.95;\n"])), js_brand_1.giphyWhite, function (props) { return props.barHeight; });
75599
+ var Bar$1 = styled_1$2.default.div(templateObject_1$2w || (templateObject_1$2w = __makeTemplateObject$4(["\n background: ", ";\n height: ", "px;\n position: absolute;\n width: 5px;\n bottom: 0;\n left: 0;\n opacity: 0.95;\n"], ["\n background: ", ";\n height: ", "px;\n position: absolute;\n width: 5px;\n bottom: 0;\n left: 0;\n opacity: 0.95;\n"])), js_brand_1.giphyWhite, function (props) { return props.barHeight; });
75600
75600
  var ProgressBar = function (_a) {
75601
75601
  var videoEl = _a.videoEl;
75602
75602
  useRaf_1.default(2147483647, 100);
@@ -75615,7 +75615,7 @@ var ProgressBar = function (_a) {
75615
75615
  return react_1$3.default.createElement(Bar$1, { style: { width: percentage + "%" }, barHeight: barHeight, className: "hide-in-percy" });
75616
75616
  };
75617
75617
  progressBar.default = ProgressBar;
75618
- var templateObject_1$2v;
75618
+ var templateObject_1$2w;
75619
75619
 
75620
75620
  var video = {};
75621
75621
 
@@ -75940,9 +75940,9 @@ var attribution_1 = __importDefault$1(attribution);
75940
75940
  var volume_1$1 = volume;
75941
75941
  var progress_bar_1 = __importDefault$1(progressBar);
75942
75942
  var video_1 = __importDefault$1(video);
75943
- var Container$4 = styled_1$1.default.div(templateObject_1$2u || (templateObject_1$2u = __makeTemplateObject$3(["\n position: relative;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: black;\n font-family: interface, helvetica, arial;\n -webkit-font-smoothing: antialiased;\n"], ["\n position: relative;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: black;\n font-family: interface, helvetica, arial;\n -webkit-font-smoothing: antialiased;\n"])));
75944
- var Volume = styled_1$1.default.div(templateObject_2$1F || (templateObject_2$1F = __makeTemplateObject$3(["\n display: flex;\n justify-content: center;\n align-items: center;\n position: relative;\n cursor: pointer;\n"], ["\n display: flex;\n justify-content: center;\n align-items: center;\n position: relative;\n cursor: pointer;\n"])));
75945
- var Controls = styled_1$1.default.div(templateObject_3$18 || (templateObject_3$18 = __makeTemplateObject$3(["\n position: absolute;\n top: 10px;\n right: 10px;\n left: 10px;\n bottom: 0;\n display: flex;\n justify-content: space-between;\n opacity: ", ";\n transition: opacity ease-out 250ms;\n align-items: flex-start;\n"], ["\n position: absolute;\n top: 10px;\n right: 10px;\n left: 10px;\n bottom: 0;\n display: flex;\n justify-content: space-between;\n opacity: ", ";\n transition: opacity ease-out 250ms;\n align-items: flex-start;\n"])), function (props) { return (props.isHovered ? 1 : 0); });
75943
+ var Container$4 = styled_1$1.default.div(templateObject_1$2v || (templateObject_1$2v = __makeTemplateObject$3(["\n position: relative;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: black;\n font-family: interface, helvetica, arial;\n -webkit-font-smoothing: antialiased;\n"], ["\n position: relative;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: black;\n font-family: interface, helvetica, arial;\n -webkit-font-smoothing: antialiased;\n"])));
75944
+ var Volume = styled_1$1.default.div(templateObject_2$1G || (templateObject_2$1G = __makeTemplateObject$3(["\n display: flex;\n justify-content: center;\n align-items: center;\n position: relative;\n cursor: pointer;\n"], ["\n display: flex;\n justify-content: center;\n align-items: center;\n position: relative;\n cursor: pointer;\n"])));
75945
+ var Controls = styled_1$1.default.div(templateObject_3$19 || (templateObject_3$19 = __makeTemplateObject$3(["\n position: absolute;\n top: 10px;\n right: 10px;\n left: 10px;\n bottom: 0;\n display: flex;\n justify-content: space-between;\n opacity: ", ";\n transition: opacity ease-out 250ms;\n align-items: flex-start;\n"], ["\n position: absolute;\n top: 10px;\n right: 10px;\n left: 10px;\n bottom: 0;\n display: flex;\n justify-content: space-between;\n opacity: ", ";\n transition: opacity ease-out 250ms;\n align-items: flex-start;\n"])), function (props) { return (props.isHovered ? 1 : 0); });
75946
75946
  var Title$4 = styled_1$1.default.div(templateObject_4$O || (templateObject_4$O = __makeTemplateObject$3(["\n font-size: 26px;\n color: white;\n margin-bottom: 5px;\n font-weight: bold;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n user-select: none;\n cursor: pointer;\n"], ["\n font-size: 26px;\n color: white;\n margin-bottom: 5px;\n font-weight: bold;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n user-select: none;\n cursor: pointer;\n"])));
75947
75947
  var TitleContainer$1 = styled_1$1.default.div(templateObject_5$G || (templateObject_5$G = __makeTemplateObject$3(["\n position: relative;\n min-width: 0;\n"], ["\n position: relative;\n min-width: 0;\n"])));
75948
75948
  var Gradient = styled_1$1.default.div(templateObject_6$v || (templateObject_6$v = __makeTemplateObject$3(["\n &:before {\n background: linear-gradient(rgba(18, 18, 18, 0.6), rgba(0, 0, 0, 0));\n content: '';\n height: ", "px;\n left: 0;\n pointer-events: none;\n position: absolute;\n top: 0;\n width: 100%;\n }\n &:after {\n background: linear-gradient(rgba(0, 0, 0, 0), rgba(18, 18, 18, 0.6));\n content: '';\n height: ", "px;\n left: 0;\n pointer-events: none;\n position: absolute;\n bottom: 0;\n width: 100%;\n }\n"], ["\n &:before {\n background: linear-gradient(rgba(18, 18, 18, 0.6), rgba(0, 0, 0, 0));\n content: '';\n height: ", "px;\n left: 0;\n pointer-events: none;\n position: absolute;\n top: 0;\n width: 100%;\n }\n &:after {\n background: linear-gradient(rgba(0, 0, 0, 0), rgba(18, 18, 18, 0.6));\n content: '';\n height: ", "px;\n left: 0;\n pointer-events: none;\n position: absolute;\n bottom: 0;\n width: 100%;\n }\n"])), function (props) { return (props.isLargePlayer ? 125 : 75); }, function (props) { return (props.isLargePlayer ? 125 : 75); });
@@ -76025,7 +76025,7 @@ var VideoWrapper = function (props) {
76025
76025
  return props.controls ? react_1$1.default.createElement(VideoPlayer, __assign$3({}, props)) : react_1$1.default.createElement(video_1.default, __assign$3({}, props));
76026
76026
  };
76027
76027
  video$1.default = VideoWrapper;
76028
- var templateObject_1$2u, templateObject_2$1F, templateObject_3$18, templateObject_4$O, templateObject_5$G, templateObject_6$v;
76028
+ var templateObject_1$2v, templateObject_2$1G, templateObject_3$19, templateObject_4$O, templateObject_5$G, templateObject_6$v;
76029
76029
 
76030
76030
  var playPause = {};
76031
76031
 
@@ -76100,9 +76100,9 @@ var styled_1 = __importDefault(require$$0$4);
76100
76100
  var react_1 = __importStar(React__default);
76101
76101
  var _1 = __importDefault(video$1);
76102
76102
  var volume_1 = volume;
76103
- var VideoContainer = styled_1.default.div(templateObject_1$2t || (templateObject_1$2t = __makeTemplateObject$2(["\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n height: 100%;\n width: 100%;\n"], ["\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n height: 100%;\n width: 100%;\n"])));
76104
- var VideoStyled = styled_1.default(_1.default)(templateObject_2$1E || (templateObject_2$1E = __makeTemplateObject$2(["\n height: 100%;\n display: inline-block;\n object-fit: fill;\n pointer-events: none;\n background: rgb(0, 0, 0, 0);\n"], ["\n height: 100%;\n display: inline-block;\n object-fit: fill;\n pointer-events: none;\n background: rgb(0, 0, 0, 0);\n"])));
76105
- var Button$2 = styled_1.default.div(templateObject_3$17 || (templateObject_3$17 = __makeTemplateObject$2(["\n position: absolute;\n top: 6px;\n right: 6px;\n cursor: pointer;\n opacity: ", ";\n transition: opacity ease-out 800ms;\n"], ["\n position: absolute;\n top: 6px;\n right: 6px;\n cursor: pointer;\n opacity: ", ";\n transition: opacity ease-out 800ms;\n"])), function (props) { return (props.isHovered ? 1 : 0.8); });
76103
+ var VideoContainer = styled_1.default.div(templateObject_1$2u || (templateObject_1$2u = __makeTemplateObject$2(["\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n height: 100%;\n width: 100%;\n"], ["\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n height: 100%;\n width: 100%;\n"])));
76104
+ var VideoStyled = styled_1.default(_1.default)(templateObject_2$1F || (templateObject_2$1F = __makeTemplateObject$2(["\n height: 100%;\n display: inline-block;\n object-fit: fill;\n pointer-events: none;\n background: rgb(0, 0, 0, 0);\n"], ["\n height: 100%;\n display: inline-block;\n object-fit: fill;\n pointer-events: none;\n background: rgb(0, 0, 0, 0);\n"])));
76105
+ var Button$2 = styled_1.default.div(templateObject_3$18 || (templateObject_3$18 = __makeTemplateObject$2(["\n position: absolute;\n top: 6px;\n right: 6px;\n cursor: pointer;\n opacity: ", ";\n transition: opacity ease-out 800ms;\n"], ["\n position: absolute;\n top: 6px;\n right: 6px;\n cursor: pointer;\n opacity: ", ";\n transition: opacity ease-out 800ms;\n"])), function (props) { return (props.isHovered ? 1 : 0.8); });
76106
76106
  var speakerClassName = 'giphy-video-overlay-button';
76107
76107
  var VolumeButton = function (_a) {
76108
76108
  var muted = _a.muted, toggleMute = _a.toggleMute, mutedByBrowser = _a.mutedByBrowser, isHovered = _a.isHovered;
@@ -76136,7 +76136,7 @@ var VideoOverlay = function (_a) {
76136
76136
  };
76137
76137
  VideoOverlay.imgClassName = speakerClassName;
76138
76138
  videoOverlay.default = VideoOverlay;
76139
- var templateObject_1$2t, templateObject_2$1E, templateObject_3$17;
76139
+ var templateObject_1$2u, templateObject_2$1F, templateObject_3$18;
76140
76140
 
76141
76141
  var _args = [
76142
76142
  [
@@ -77420,7 +77420,8 @@ return !String(Symbol());});var NATIVE_SYMBOL$1$1=nativeSymbol$1;var useSymbolAs
77420
77420
  // https://tc39.github.io/ecma262/#sec-isregexp
77421
77421
  var isRegexp$2=function(it){var isRegExp;return isObject$5$1(it)&&((isRegExp=it[MATCH$2$1])!==undefined?!!isRegExp:classof$7$1(it)=='RegExp');};var isRegExp$2$1=isRegexp$2;var notARegexp$2=function(it){if(isRegExp$2$1(it)){throw TypeError("The method doesn't accept regular expressions");}return it;};var wellKnownSymbol$g$1=wellKnownSymbol$i$1;var MATCH$1$1=wellKnownSymbol$g$1('match');var correctIsRegexpLogic$2=function(METHOD_NAME){var regexp=/./;try{'/./'[METHOD_NAME](regexp);}catch(e){try{regexp[MATCH$1$1]=false;return '/./'[METHOD_NAME](regexp);}catch(f){/* empty */}}return false;};var $$7$1=_export$1;var notARegExp$1$1=notARegexp$2;var requireObjectCoercible$6$1=requireObjectCoercible$9$1;var correctIsRegExpLogic$1$1=correctIsRegexpLogic$2;// `String.prototype.includes` method
77422
77422
  // https://tc39.github.io/ecma262/#sec-string.prototype.includes
77423
- $$7$1({target:'String',proto:true,forced:!correctIsRegExpLogic$1$1('includes')},{includes:function includes(searchString/* , position = 0 */){return !!~String(requireObjectCoercible$6$1(this)).indexOf(notARegExp$1$1(searchString),arguments.length>1?arguments[1]:undefined);}});var DESCRIPTORS$2$1=descriptors$1;var definePropertyModule$2$1=objectDefineProperty$1;var anObject$b$1=anObject$e$1;var objectKeys$3=objectKeys$2$1;// `Object.defineProperties` method
77423
+ $$7$1({target:'String',proto:true,forced:!correctIsRegExpLogic$1$1('includes')},{includes:function includes(searchString/* , position = 0 */){return !!~String(requireObjectCoercible$6$1(this)).indexOf(notARegExp$1$1(searchString),arguments.length>1?arguments[1]:undefined);}});function ensureMandatoryKeywords(mandatoryKeywords,allKeywords){var mandatory=mandatoryKeywords||[];var all=allKeywords||[];var mandatoryKeywordIds=mandatory.map(function(k){return k.id;});// in the editor mode it is possible to have duplicate keywords if they are in the mandatory list, here we remove the duplicates
77424
+ var filteredList=all.filter(function(k){return !mandatoryKeywordIds.includes(k.id);});return mandatory.concat(filteredList);}var DESCRIPTORS$2$1=descriptors$1;var definePropertyModule$2$1=objectDefineProperty$1;var anObject$b$1=anObject$e$1;var objectKeys$3=objectKeys$2$1;// `Object.defineProperties` method
77424
77425
  // https://tc39.github.io/ecma262/#sec-object.defineproperties
77425
77426
  var objectDefineProperties$1=DESCRIPTORS$2$1?Object.defineProperties:function defineProperties(O,Properties){anObject$b$1(O);var keys=objectKeys$3(Properties);var length=keys.length;var index=0;var key;while(length>index)definePropertyModule$2$1.f(O,key=keys[index++],Properties[key]);return O;};var getBuiltIn$3$1=getBuiltIn$5$1;var html$2$1=getBuiltIn$3$1('document','documentElement');var anObject$a$1=anObject$e$1;var defineProperties$2=objectDefineProperties$1;var enumBugKeys$4=enumBugKeys$3$1;var hiddenKeys$5=hiddenKeys$4$1;var html$1$1=html$2$1;var documentCreateElement$2=documentCreateElement$1$1;var sharedKey$1$1=sharedKey$3$1;var GT$1='>';var LT$1='<';var PROTOTYPE$1='prototype';var SCRIPT$1='script';var IE_PROTO$1$1=sharedKey$1$1('IE_PROTO');var EmptyConstructor$1=function(){/* empty */};var scriptTag$1=function(content){return LT$1+SCRIPT$1+GT$1+content+LT$1+'/'+SCRIPT$1+GT$1;};// Create object with fake `null` prototype: use ActiveX Object with cleared prototype
77426
77427
  var NullProtoObjectViaActiveX$1=function(activeXDocument){activeXDocument.write(scriptTag$1(''));activeXDocument.close();var temp=activeXDocument.parentWindow.Object;activeXDocument=null;// avoid memory leak
@@ -77681,7 +77682,7 @@ function createDownloadClickHandler(target,getUrl){var _this=this;return functio
77681
77682
  // (mobile app even has to be restarted) and one image just freezes and
77682
77683
  // on the console we have errors like this: Uncaught TypeError: Cannot read property 'mouseUsed' of null
77683
77684
  var gallery;clearTimeout(initializeGalleryHandle.current);initializeGalleryHandle.current=setTimeout(function(){return gallery=initializeGallery();},200);return function(){return gallery===null||gallery===void 0?void 0:gallery.close();};// eslint-disable-next-line react-hooks/exhaustive-deps
77684
- },[hidden,selectedIndex]);return jsxs(Fragment,{children:[jsx$1(GeneralFixes,{},void 0),jsxs("div",__assign$1({ref:host,className:"pswp",tabIndex:-1,role:"dialog","aria-hidden":"true"},{children:[jsx$1("div",{className:"pswp__bg"},void 0),jsxs("div",__assign$1({className:"pswp__scroll-wrap"},{children:[jsxs("div",__assign$1({className:"pswp__container"},{children:[jsx$1("div",{className:"pswp__item"},void 0),jsx$1("div",{className:"pswp__item"},void 0),jsx$1("div",{className:"pswp__item"},void 0)]}),void 0),jsxs("div",__assign$1({className:"pswp__ui pswp__ui--hidden"},{children:[jsxs("div",__assign$1({className:"pswp__top-bar"},{children:[jsx$1("div",{className:"pswp__counter"},void 0),jsx$1("button",{className:"pswp__button pswp__button--close",title:formatMessage({id:'ImageViewer.closeCaption'})},void 0),jsx$1("button",{className:"pswp__button pswp__button--fs",title:formatMessage({id:'ImageViewer.toggleFullscreenCaption'})},void 0),jsx$1("div",__assign$1({className:"pswp__preloader"},{children:jsx$1("div",__assign$1({className:"pswp__preloader__icn"},{children:jsx$1("div",__assign$1({className:"pswp__preloader__cut"},{children:jsx$1("div",{className:"pswp__preloader__donut"},void 0)}),void 0)}),void 0)}),void 0)]}),void 0),jsx$1("div",__assign$1({className:"pswp__share-modal pswp__share-modal--hidden pswp__single-tap"},{children:jsx$1("div",{className:"pswp__share-tooltip"},void 0)}),void 0),jsx$1("button",{className:"pswp__button pswp__button--arrow--left",title:formatMessage({id:'ImageView.previousCaption'})},void 0),jsx$1("button",{className:"pswp__button pswp__button--arrow--right",title:formatMessage({id:'ImageView.nextCaption'})},void 0),jsx$1("div",__assign$1({className:"pswp__caption"},{children:jsx$1("div",{className:"pswp__caption__center"},void 0)}),void 0)]}),void 0)]}),void 0)]}),void 0)]},void 0);function initializeGallery(){var gallery=new PhotoSwipe(host.current,PhotoSwipeUiDefault,images.map(function(i){return {src:i.large,msrc:i.thumbnail,w:i.width,h:i.height,title:i.caption};}),{index:selectedIndex});gallery.listen('close',onClose);gallery.init();return gallery;}};var GeneralFixes=createGlobalStyle(templateObject_1$L$1||(templateObject_1$L$1=__makeTemplateObject$1(["\n.browser-name-ios-webview {\n .pswp__top-bar {\n padding-top: calc(env(safe-area-inset-top));\n height: calc(initial + env(safe-area-inset-top));\n\n .pswp__counter {\n padding-top: env(safe-area-inset-top);\n }\n }\n}\n\n.pswp__caption__center {\n && {\n text-align: center;\n }\n}\n"],["\n.browser-name-ios-webview {\n .pswp__top-bar {\n padding-top: calc(env(safe-area-inset-top));\n height: calc(initial + env(safe-area-inset-top));\n\n .pswp__counter {\n padding-top: env(safe-area-inset-top);\n }\n }\n}\n\n.pswp__caption__center {\n && {\n text-align: center;\n }\n}\n"])));var templateObject_1$L$1;var PhotoGrid=function PhotoGrid(_a){var images=_a.images,imageUrlResolver=_a.imageUrlResolver,disableRoundedCorners=_a.disableRoundedCorners,gridBackgroundColor=_a.gridBackgroundColor,className=_a.className;var formatMessage=useIntl().formatMessage;var _b=useState$2(null),fullScreenItemIndex=_b[0],setFullScreenItemIndex=_b[1];var palette=useContext(ThemeContext$1).theme.palette;if(!images||images.length===0){return null;}var showMoreImagesIndicator=images.length>4;var hasMultiImages=images.length>1;var firstImage=images[0];return jsxs(Host$l$1,__assign$1({"data-multi-images":hasMultiImages,className:className,singleImageHeight:firstImage.height,singleImageWidth:firstImage.width},{children:[jsx$1("div",__assign$1({"data-gallery-wrapper":true},{children:hasMultiImages?jsxs(Fragment,{children:[jsx$1(Gallery,__assign$1({backgroundColor:gridBackgroundColor!==null&&gridBackgroundColor!==void 0?gridBackgroundColor:palette.neutralLight,applyRoundedCorners:!disableRoundedCorners},{children:images.slice(0,4).map(function(image,index){return jsx$1(ImageItem,__assign$1({href:image.previewUrl,onClick:function(e){e.stopPropagation();e.preventDefault();handleOpenFullScreen(index);},"aria-label":formatMessage({id:'AriaLabel.viewImageGallery'}),"data-clickable-overlay":true},{children:jsx$1(StyledImage$1,{src:image.previewUrl,imageFit:ImageFit.centerCover,alt:image.imageTitle||''},void 0)}),index);})}),void 0),showMoreImagesIndicator&&jsxs(MoreIndicator,__assign$1({onClick:function(){return handleOpenFullScreen(4);}},{children:["+",images.length-4]}),void 0)]},void 0):jsx$1(SingleImagePreview,{image:firstImage,onClick:function(){return handleOpenFullScreen(0);},disableRoundedCorners:disableRoundedCorners},void 0)}),void 0),jsx$1(FullScreenImageViewer,{images:images,selectedIndex:fullScreenItemIndex,hidden:fullScreenItemIndex==null,onClose:handleCloseFullScreen,imageUrlResolver:imageUrlResolver},void 0)]}),void 0);function handleOpenFullScreen(index){setFullScreenItemIndex(index);}function handleCloseFullScreen(){setFullScreenItemIndex(null);}};var SingleImagePreview=function SingleImagePreview(_a){var image=_a.image,onClick=_a.onClick,disableRoundedCorners=_a.disableRoundedCorners;var formatMessage=useIntl().formatMessage;return jsx$1(SingleImageHost,__assign$1({href:image.previewUrl,onClick:function(e){e.stopPropagation();e.preventDefault();onClick();},applyRoundedCorners:!disableRoundedCorners,"aria-label":formatMessage({id:'AriaLabel.viewImage'}),"data-clickable-overlay":true},{children:jsx$1("img",{src:image.previewUrl,alt:""},void 0)}),void 0);};var Host$l$1=_styled.div.withConfig({displayName:"PhotoGrid__Host",componentId:"sc-flk193-0"})(templateObject_2$v$1||(templateObject_2$v$1=__makeTemplateObject$1(["\n overflow: hidden;\n width: 100%;\n\n position: relative;\n\n &:after {\n content: '';\n display: block;\n font-size: 0;\n }\n\n > [data-gallery-wrapper] {\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n }\n\n &[data-multi-images='false'] {\n [data-gallery-wrapper] {\n display: flex;\n }\n\n ","\n }\n\n &[data-multi-images='true'] {\n &:after {\n padding-bottom: calc(2 / 3 * 100%); // fixed image area aspect ratio 3:2\n }\n }\n"],["\n overflow: hidden;\n width: 100%;\n\n position: relative;\n\n &:after {\n content: '';\n display: block;\n font-size: 0;\n }\n\n > [data-gallery-wrapper] {\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n }\n\n &[data-multi-images='false'] {\n [data-gallery-wrapper] {\n display: flex;\n }\n\n ","\n }\n\n &[data-multi-images='true'] {\n &:after {\n padding-bottom: calc(2 / 3 * 100%); // fixed image area aspect ratio 3:2\n }\n }\n"])),function(p){return p.singleImageWidth&&p.singleImageHeight&&css$2(templateObject_1$K$1||(templateObject_1$K$1=__makeTemplateObject$1(["\n &:after {\n // fallback for old browsers - that do not suport min function\n // the image aspect ratio is maintained\n padding-bottom: calc(\n ","* 100%\n );\n\n // the image can have any aspect ratio from a 1:1 aspect ratio to any wider aspect ratio,\n // but it cannot get \"taller\" than 1:1\n @supports (padding-bottom: min(100%, ","px)) {\n padding-bottom: min(\n min(100%, ","px, ","px),\n calc(\n ","*\n min(100%, ","px)\n )\n );\n }\n }\n "],["\n &:after {\n // fallback for old browsers - that do not suport min function\n // the image aspect ratio is maintained\n padding-bottom: calc(\n ","* 100%\n );\n\n // the image can have any aspect ratio from a 1:1 aspect ratio to any wider aspect ratio,\n // but it cannot get \"taller\" than 1:1\n @supports (padding-bottom: min(100%, ","px)) {\n padding-bottom: min(\n min(100%, ","px, ","px),\n calc(\n ","*\n min(100%, ","px)\n )\n );\n }\n }\n "])),p.singleImageHeight/p.singleImageWidth,p.singleImageWidth,p.singleImageHeight,p.singleImageWidth,p.singleImageHeight/p.singleImageWidth,p.singleImageWidth);});var SingleImageHost=_styled.a.withConfig({displayName:"PhotoGrid__SingleImageHost",componentId:"sc-flk193-1"})(templateObject_4$e$1||(templateObject_4$e$1=__makeTemplateObject$1(["\n display: flex;\n align-items: center;\n justify-content: center;\n height: auto;\n\n max-height: 100%;\n\n overflow: hidden;\n\n // fallback for old browsers\n width: 100%;\n\n @supports (height: min(100%, 0px)) {\n width: auto;\n }\n\n img {\n max-width: 100%;\n height: 100%;\n width: 100%;\n\n @supports (height: min(100%, 0px)) {\n height: auto;\n width: auto;\n }\n }\n\n position: relative;\n\n &::before {\n content: '';\n position: absolute;\n width: 100%;\n height: 100%;\n z-index: 1;\n }\n\n &:focus {\n &::before {\n outline-offset: -10px !important;\n }\n\n img {\n opacity: 0.6;\n }\n }\n\n ","\n"],["\n display: flex;\n align-items: center;\n justify-content: center;\n height: auto;\n\n max-height: 100%;\n\n overflow: hidden;\n\n // fallback for old browsers\n width: 100%;\n\n @supports (height: min(100%, 0px)) {\n width: auto;\n }\n\n img {\n max-width: 100%;\n height: 100%;\n width: 100%;\n\n @supports (height: min(100%, 0px)) {\n height: auto;\n width: auto;\n }\n }\n\n position: relative;\n\n &::before {\n content: '';\n position: absolute;\n width: 100%;\n height: 100%;\n z-index: 1;\n }\n\n &:focus {\n &::before {\n outline-offset: -10px !important;\n }\n\n img {\n opacity: 0.6;\n }\n }\n\n ","\n"])),function(p){return p.applyRoundedCorners&&css$2(templateObject_3$m$1||(templateObject_3$m$1=__makeTemplateObject$1(["\n border-radius: 10px;\n "],["\n border-radius: 10px;\n "])));});var Gallery=_styled.div.withConfig({displayName:"PhotoGrid__Gallery",componentId:"sc-flk193-2"})(templateObject_6$7$2||(templateObject_6$7$2=__makeTemplateObject$1(["\n width: 100%;\n height: 100%;\n overflow: hidden;\n\n background-color: ",";\n\n display: grid;\n grid-template-columns: repeat(2, 1fr);\n grid-template-rows: repeat(2, 1fr);\n\n // case: gallery with 3 images\n // the first image will span across the 2 grid tracks (2 rows)\n > a:first-child:nth-last-child(3) {\n grid-row: auto / span 2;\n }\n\n // case: gallery with 2 images\n // the images will span across the 2 grid tracks (2 rows)\n > a:first-child:nth-last-child(2),\n > a:nth-child(2):last-child {\n grid-row: auto / span 2;\n }\n\n ","\n"],["\n width: 100%;\n height: 100%;\n overflow: hidden;\n\n background-color: ",";\n\n display: grid;\n grid-template-columns: repeat(2, 1fr);\n grid-template-rows: repeat(2, 1fr);\n\n // case: gallery with 3 images\n // the first image will span across the 2 grid tracks (2 rows)\n > a:first-child:nth-last-child(3) {\n grid-row: auto / span 2;\n }\n\n // case: gallery with 2 images\n // the images will span across the 2 grid tracks (2 rows)\n > a:first-child:nth-last-child(2),\n > a:nth-child(2):last-child {\n grid-row: auto / span 2;\n }\n\n ","\n"])),function(p){return p.backgroundColor;},function(p){return p.applyRoundedCorners&&css$2(templateObject_5$a$2||(templateObject_5$a$2=__makeTemplateObject$1(["\n border-radius: 10px;\n "],["\n border-radius: 10px;\n "])));});var ImageItem=_styled.a.withConfig({displayName:"PhotoGrid__ImageItem",componentId:"sc-flk193-3"})(templateObject_7$3$2||(templateObject_7$3$2=__makeTemplateObject$1(["\n display: block;\n position: relative;\n\n &::before {\n content: '';\n position: absolute;\n width: 100%;\n height: 100%;\n z-index: 1;\n }\n\n &:focus {\n &::before {\n outline-offset: -10px !important;\n }\n\n img {\n opacity: 0.6;\n }\n }\n"],["\n display: block;\n position: relative;\n\n &::before {\n content: '';\n position: absolute;\n width: 100%;\n height: 100%;\n z-index: 1;\n }\n\n &:focus {\n &::before {\n outline-offset: -10px !important;\n }\n\n img {\n opacity: 0.6;\n }\n }\n"])));var StyledImage$1=_styled(Image$1).withConfig({displayName:"PhotoGrid__StyledImage",componentId:"sc-flk193-4"})(templateObject_8$3$2||(templateObject_8$3$2=__makeTemplateObject$1(["\n height: 100%;\n"],["\n height: 100%;\n"])));var MoreIndicator=_styled(DefaultButton).withConfig({displayName:"PhotoGrid__MoreIndicator",componentId:"sc-flk193-5"})(templateObject_9$2$2||(templateObject_9$2$2=__makeTemplateObject$1(["\n && {\n margin: 0;\n padding: 0;\n border: 0;\n width: auto;\n height: auto;\n color: white;\n background: transparent;\n\n &:hover {\n background: transparent;\n }\n }\n\n position: absolute;\n bottom: 15px;\n right: 15px;\n\n font-size: ","px;\n @media (min-width: ","px) {\n font-size: ","px;\n }\n\n @supports (filter: drop-shadow(0 1px 2px #000000cc)) {\n filter: drop-shadow(0 1px 2px #000000cc);\n }\n\n @supports not (filter: drop-shadow(0 1px 2px #000000cc)) {\n text-shadow: 0 1px 2px #000000cc;\n }\n"],["\n && {\n margin: 0;\n padding: 0;\n border: 0;\n width: auto;\n height: auto;\n color: white;\n background: transparent;\n\n &:hover {\n background: transparent;\n }\n }\n\n position: absolute;\n bottom: 15px;\n right: 15px;\n\n font-size: ","px;\n @media (min-width: ","px) {\n font-size: ","px;\n }\n\n @supports (filter: drop-shadow(0 1px 2px #000000cc)) {\n filter: drop-shadow(0 1px 2px #000000cc);\n }\n\n @supports not (filter: drop-shadow(0 1px 2px #000000cc)) {\n text-shadow: 0 1px 2px #000000cc;\n }\n"])),fontSizeMedium,minScreenSize.small,fontSizeLarge+3);var templateObject_1$K$1,templateObject_2$v$1,templateObject_3$m$1,templateObject_4$e$1,templateObject_5$a$2,templateObject_6$7$2,templateObject_7$3$2,templateObject_8$3$2,templateObject_9$2$2;function showPhoto(url,title){{return;}}var IconHeaderButton=function IconHeaderButton(_a){var icon=_a.icon,isActive=_a.isActive,disabled=_a.disabled,tooltipResourceKey=_a.tooltipResourceKey,onClick=_a.onClick,link=_a.link,className=_a.className,rest=__rest$1(_a,["icon","isActive","disabled","tooltipResourceKey","onClick","link","className"]);var formatMessage=useIntl().formatMessage;if(!link&&!onClick){return null;}var allClassNames=classNames('header-button',className);var IconElement=!link?jsx$1(Button$1,__assign$1({className:allClassNames,disabled:disabled,onClick:function(e){return onClick(e.currentTarget);},iconProps:{iconName:icon},ariaLabel:formatMessage({id:tooltipResourceKey}),"data-button-type":"header-btn",isActive:isActive},rest),void 0):jsx$1(StyledLink$2,__assign$1({className:allClassNames,to:link},rest,{children:jsx$1(Icon,{iconName:icon},void 0)}),void 0);return jsx$1(Host$k,__assign$1({className:"tooltip-container"},{children:jsx$1(Tooltip,__assign$1({resourceKey:tooltipResourceKey},{children:IconElement}),void 0)}),void 0);};var Host$k=_styled.div.withConfig({displayName:"IconHeaderButton__Host",componentId:"sc-1p61ffo-0"})(templateObject_1$J$1||(templateObject_1$J$1=__makeTemplateObject$1(["\n height: 100%;\n"],["\n height: 100%;\n"])));var Button$1=_styled(IconButton$1).withConfig({displayName:"IconHeaderButton__Button",componentId:"sc-1p61ffo-1"})(templateObject_4$d$2||(templateObject_4$d$2=__makeTemplateObject$1(["\n && {\n display: flex;\n padding: 0 5px;\n background-color: transparent;\n height: 100%;\n margin: 0 -1.5px; // this removes the \"gap\" between two side by side active buttons\n\n ",";\n ","\n }\n"],["\n && {\n display: flex;\n padding: 0 5px;\n background-color: transparent;\n height: 100%;\n margin: 0 -1.5px; // this removes the \"gap\" between two side by side active buttons\n\n ",";\n ","\n }\n"])),function(p){return !p.isActive&&css$2(templateObject_2$u$1||(templateObject_2$u$1=__makeTemplateObject$1(["\n color: ",";\n "],["\n color: ",";\n "])),p.theme.textColors.onPrimary);},function(p){return p.isActive&&css$2(templateObject_3$l$1||(templateObject_3$l$1=__makeTemplateObject$1(["\n background-color: ",";\n color: ",";\n\n &&:hover {\n background-color: ",";\n color: ",";\n }\n "],["\n background-color: ",";\n color: ",";\n\n &&:hover {\n background-color: ",";\n color: ",";\n }\n "])),p.theme.palette.themeSecondary,p.theme.textColors.onSecondary,p.theme.palette.themeSecondary,p.theme.textColors.onSecondary);});var StyledLink$2=_styled(Link$4).withConfig({displayName:"IconHeaderButton__StyledLink",componentId:"sc-1p61ffo-2"})(templateObject_6$6$2||(templateObject_6$6$2=__makeTemplateObject$1(["\n && {\n height: 100%;\n ",";\n }\n"],["\n && {\n height: 100%;\n ",";\n }\n"])),function(p){return css$2(templateObject_5$9$2||(templateObject_5$9$2=__makeTemplateObject$1(["\n color: ",";\n "],["\n color: ",";\n "])),p.theme.textColors.onPrimary);});var templateObject_1$J$1,templateObject_2$u$1,templateObject_3$l$1,templateObject_4$d$2,templateObject_5$9$2,templateObject_6$6$2;// a string of all valid unicode whitespaces
77685
+ },[hidden,selectedIndex]);return jsxs(Fragment,{children:[jsx$1(GeneralFixes,{},void 0),jsxs("div",__assign$1({ref:host,className:"pswp",tabIndex:-1,role:"dialog","aria-hidden":"true"},{children:[jsx$1("div",{className:"pswp__bg"},void 0),jsxs("div",__assign$1({className:"pswp__scroll-wrap"},{children:[jsxs("div",__assign$1({className:"pswp__container"},{children:[jsx$1("div",{className:"pswp__item"},void 0),jsx$1("div",{className:"pswp__item"},void 0),jsx$1("div",{className:"pswp__item"},void 0)]}),void 0),jsxs("div",__assign$1({className:"pswp__ui pswp__ui--hidden"},{children:[jsxs("div",__assign$1({className:"pswp__top-bar"},{children:[jsx$1("div",{className:"pswp__counter"},void 0),jsx$1("button",{className:"pswp__button pswp__button--close",title:formatMessage({id:'ImageViewer.closeCaption'})},void 0),jsx$1("button",{className:"pswp__button pswp__button--fs",title:formatMessage({id:'ImageViewer.toggleFullscreenCaption'})},void 0),jsx$1("div",__assign$1({className:"pswp__preloader"},{children:jsx$1("div",__assign$1({className:"pswp__preloader__icn"},{children:jsx$1("div",__assign$1({className:"pswp__preloader__cut"},{children:jsx$1("div",{className:"pswp__preloader__donut"},void 0)}),void 0)}),void 0)}),void 0)]}),void 0),jsx$1("div",__assign$1({className:"pswp__share-modal pswp__share-modal--hidden pswp__single-tap"},{children:jsx$1("div",{className:"pswp__share-tooltip"},void 0)}),void 0),jsx$1("button",{className:"pswp__button pswp__button--arrow--left",title:formatMessage({id:'ImageView.previousCaption'})},void 0),jsx$1("button",{className:"pswp__button pswp__button--arrow--right",title:formatMessage({id:'ImageView.nextCaption'})},void 0),jsx$1("div",__assign$1({className:"pswp__caption"},{children:jsx$1("div",{className:"pswp__caption__center"},void 0)}),void 0)]}),void 0)]}),void 0)]}),void 0)]},void 0);function initializeGallery(){var gallery=new PhotoSwipe(host.current,PhotoSwipeUiDefault,images.map(function(i){return {src:i.large,msrc:i.thumbnail,w:i.width,h:i.height,title:i.caption};}),{index:selectedIndex});gallery.listen('close',onClose);gallery.init();return gallery;}};var GeneralFixes=createGlobalStyle(templateObject_1$L$1||(templateObject_1$L$1=__makeTemplateObject$1(["\n.browser-name-ios-webview {\n .pswp__top-bar {\n padding-top: calc(env(safe-area-inset-top));\n height: calc(initial + env(safe-area-inset-top));\n\n .pswp__counter {\n padding-top: env(safe-area-inset-top);\n }\n }\n}\n\n.pswp__caption__center {\n && {\n text-align: center;\n }\n}\n"],["\n.browser-name-ios-webview {\n .pswp__top-bar {\n padding-top: calc(env(safe-area-inset-top));\n height: calc(initial + env(safe-area-inset-top));\n\n .pswp__counter {\n padding-top: env(safe-area-inset-top);\n }\n }\n}\n\n.pswp__caption__center {\n && {\n text-align: center;\n }\n}\n"])));var templateObject_1$L$1;var PhotoGrid=function PhotoGrid(_a){var images=_a.images,imageUrlResolver=_a.imageUrlResolver,disableRoundedCorners=_a.disableRoundedCorners,gridBackgroundColor=_a.gridBackgroundColor,className=_a.className;var formatMessage=useIntl().formatMessage;var _b=useState$2(null),fullScreenItemIndex=_b[0],setFullScreenItemIndex=_b[1];var palette=useContext(ThemeContext$1).theme.palette;if(!images||images.length===0){return null;}var showMoreImagesIndicator=images.length>4;var hasMultiImages=images.length>1;var firstImage=images[0];return jsxs(Host$l$1,__assign$1({"data-multi-images":hasMultiImages,className:className,singleImageHeight:firstImage.height,singleImageWidth:firstImage.width},{children:[jsx$1("div",__assign$1({"data-gallery-wrapper":true},{children:hasMultiImages?jsxs(Fragment,{children:[jsx$1(Gallery,__assign$1({backgroundColor:gridBackgroundColor!==null&&gridBackgroundColor!==void 0?gridBackgroundColor:palette.neutralLight,applyRoundedCorners:!disableRoundedCorners},{children:images.slice(0,4).map(function(image,index){return jsx$1(ImageItem,__assign$1({href:image.previewUrl,onClick:function(e){e.stopPropagation();e.preventDefault();handleOpenFullScreen(index);},"aria-label":formatMessage({id:'AriaLabel.viewImageGallery'}),"data-clickable-overlay":true},{children:jsx$1(StyledImage$1,{src:image.previewUrl,imageFit:ImageFit.centerCover,alt:image.imageTitle||''},void 0)}),index);})}),void 0),showMoreImagesIndicator&&jsxs(MoreIndicator,__assign$1({onClick:function(){return handleOpenFullScreen(4);}},{children:["+",images.length-4]}),void 0)]},void 0):jsx$1(SingleImagePreview,{image:firstImage,onClick:function(){return handleOpenFullScreen(0);},disableRoundedCorners:disableRoundedCorners},void 0)}),void 0),jsx$1(FullScreenImageViewer,{images:images,selectedIndex:fullScreenItemIndex,hidden:fullScreenItemIndex==null,onClose:handleCloseFullScreen,imageUrlResolver:imageUrlResolver},void 0)]}),void 0);function handleOpenFullScreen(index){setFullScreenItemIndex(index);}function handleCloseFullScreen(){setFullScreenItemIndex(null);}};var SingleImagePreview=function SingleImagePreview(_a){var image=_a.image,onClick=_a.onClick,disableRoundedCorners=_a.disableRoundedCorners;var formatMessage=useIntl().formatMessage;return jsx$1(SingleImageHost,__assign$1({href:image.previewUrl,onClick:function(e){e.stopPropagation();e.preventDefault();onClick();},applyRoundedCorners:!disableRoundedCorners,"aria-label":formatMessage({id:'AriaLabel.viewImage'}),"data-clickable-overlay":true},{children:jsx$1("img",{src:image.previewUrl,alt:""},void 0)}),void 0);};var Host$l$1=_styled.div.withConfig({displayName:"PhotoGrid__Host",componentId:"sc-flk193-0"})(templateObject_2$v$1||(templateObject_2$v$1=__makeTemplateObject$1(["\n overflow: hidden;\n width: 100%;\n\n position: relative;\n\n &:after {\n content: '';\n display: block;\n font-size: 0;\n }\n\n > [data-gallery-wrapper] {\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n }\n\n &[data-multi-images='false'] {\n [data-gallery-wrapper] {\n display: flex;\n }\n\n ","\n }\n\n &[data-multi-images='true'] {\n &:after {\n padding-bottom: calc(2 / 3 * 100%); // fixed image area aspect ratio 3:2\n }\n }\n"],["\n overflow: hidden;\n width: 100%;\n\n position: relative;\n\n &:after {\n content: '';\n display: block;\n font-size: 0;\n }\n\n > [data-gallery-wrapper] {\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n }\n\n &[data-multi-images='false'] {\n [data-gallery-wrapper] {\n display: flex;\n }\n\n ","\n }\n\n &[data-multi-images='true'] {\n &:after {\n padding-bottom: calc(2 / 3 * 100%); // fixed image area aspect ratio 3:2\n }\n }\n"])),function(p){return p.singleImageWidth&&p.singleImageHeight&&css$2(templateObject_1$K$1||(templateObject_1$K$1=__makeTemplateObject$1(["\n &:after {\n // fallback for old browsers - that do not suport min function\n // the image aspect ratio is maintained\n padding-bottom: calc(\n ","* 100%\n );\n\n // the image can have any aspect ratio from a 1:1 aspect ratio to any wider aspect ratio,\n // but it cannot get \"taller\" than 1:1\n @supports (padding-bottom: min(100%, ","px)) {\n padding-bottom: min(\n min(100%, ","px, ","px),\n calc(\n ","*\n min(100%, ","px)\n )\n );\n }\n }\n "],["\n &:after {\n // fallback for old browsers - that do not suport min function\n // the image aspect ratio is maintained\n padding-bottom: calc(\n ","* 100%\n );\n\n // the image can have any aspect ratio from a 1:1 aspect ratio to any wider aspect ratio,\n // but it cannot get \"taller\" than 1:1\n @supports (padding-bottom: min(100%, ","px)) {\n padding-bottom: min(\n min(100%, ","px, ","px),\n calc(\n ","*\n min(100%, ","px)\n )\n );\n }\n }\n "])),p.singleImageHeight/p.singleImageWidth,p.singleImageWidth,p.singleImageHeight,p.singleImageWidth,p.singleImageHeight/p.singleImageWidth,p.singleImageWidth);});var SingleImageHost=_styled.a.withConfig({displayName:"PhotoGrid__SingleImageHost",componentId:"sc-flk193-1"})(templateObject_4$e$1||(templateObject_4$e$1=__makeTemplateObject$1(["\n display: flex;\n align-items: center;\n justify-content: center;\n height: auto;\n\n max-height: 100%;\n\n overflow: hidden;\n\n // fallback for old browsers\n width: 100%;\n\n @supports (height: min(100%, 0px)) {\n width: auto;\n }\n\n img {\n max-width: 100%;\n height: 100%;\n width: 100%;\n\n @supports (height: min(100%, 0px)) {\n height: auto;\n width: auto;\n }\n }\n\n position: relative;\n\n &::before {\n content: '';\n position: absolute;\n width: 100%;\n height: 100%;\n z-index: 1;\n }\n\n &:focus {\n &::before {\n outline-offset: -10px !important;\n }\n\n img {\n opacity: 0.6;\n }\n }\n\n ","\n"],["\n display: flex;\n align-items: center;\n justify-content: center;\n height: auto;\n\n max-height: 100%;\n\n overflow: hidden;\n\n // fallback for old browsers\n width: 100%;\n\n @supports (height: min(100%, 0px)) {\n width: auto;\n }\n\n img {\n max-width: 100%;\n height: 100%;\n width: 100%;\n\n @supports (height: min(100%, 0px)) {\n height: auto;\n width: auto;\n }\n }\n\n position: relative;\n\n &::before {\n content: '';\n position: absolute;\n width: 100%;\n height: 100%;\n z-index: 1;\n }\n\n &:focus {\n &::before {\n outline-offset: -10px !important;\n }\n\n img {\n opacity: 0.6;\n }\n }\n\n ","\n"])),function(p){return p.applyRoundedCorners&&css$2(templateObject_3$m$1||(templateObject_3$m$1=__makeTemplateObject$1(["\n border-radius: 10px;\n "],["\n border-radius: 10px;\n "])));});var Gallery=_styled.div.withConfig({displayName:"PhotoGrid__Gallery",componentId:"sc-flk193-2"})(templateObject_6$7$2||(templateObject_6$7$2=__makeTemplateObject$1(["\n width: 100%;\n height: 100%;\n overflow: hidden;\n\n background-color: ",";\n\n display: grid;\n grid-template-columns: repeat(2, 1fr);\n grid-template-rows: repeat(2, 1fr);\n\n // case: gallery with 3 images\n // the first image will span across the 2 grid tracks (2 rows)\n > a:first-child:nth-last-child(3) {\n grid-row: auto / span 2;\n }\n\n // case: gallery with 2 images\n // the images will span across the 2 grid tracks (2 rows)\n > a:first-child:nth-last-child(2),\n > a:nth-child(2):last-child {\n grid-row: auto / span 2;\n }\n\n ","\n"],["\n width: 100%;\n height: 100%;\n overflow: hidden;\n\n background-color: ",";\n\n display: grid;\n grid-template-columns: repeat(2, 1fr);\n grid-template-rows: repeat(2, 1fr);\n\n // case: gallery with 3 images\n // the first image will span across the 2 grid tracks (2 rows)\n > a:first-child:nth-last-child(3) {\n grid-row: auto / span 2;\n }\n\n // case: gallery with 2 images\n // the images will span across the 2 grid tracks (2 rows)\n > a:first-child:nth-last-child(2),\n > a:nth-child(2):last-child {\n grid-row: auto / span 2;\n }\n\n ","\n"])),function(p){return p.backgroundColor;},function(p){return p.applyRoundedCorners&&css$2(templateObject_5$a$2||(templateObject_5$a$2=__makeTemplateObject$1(["\n border-radius: 10px;\n "],["\n border-radius: 10px;\n "])));});var ImageItem=_styled.a.withConfig({displayName:"PhotoGrid__ImageItem",componentId:"sc-flk193-3"})(templateObject_7$3$2||(templateObject_7$3$2=__makeTemplateObject$1(["\n display: block;\n position: relative;\n\n &::before {\n content: '';\n position: absolute;\n width: 100%;\n height: 100%;\n z-index: 1;\n }\n\n &:focus {\n &::before {\n outline-offset: -10px !important;\n }\n\n img {\n opacity: 0.6;\n }\n }\n"],["\n display: block;\n position: relative;\n\n &::before {\n content: '';\n position: absolute;\n width: 100%;\n height: 100%;\n z-index: 1;\n }\n\n &:focus {\n &::before {\n outline-offset: -10px !important;\n }\n\n img {\n opacity: 0.6;\n }\n }\n"])));var StyledImage$1=_styled(Image$1).withConfig({displayName:"PhotoGrid__StyledImage",componentId:"sc-flk193-4"})(templateObject_8$3$2||(templateObject_8$3$2=__makeTemplateObject$1(["\n height: 100%;\n"],["\n height: 100%;\n"])));var MoreIndicator=_styled(DefaultButton).withConfig({displayName:"PhotoGrid__MoreIndicator",componentId:"sc-flk193-5"})(templateObject_9$2$2||(templateObject_9$2$2=__makeTemplateObject$1(["\n && {\n margin: 0;\n padding: 0;\n border: 0;\n width: auto;\n height: auto;\n color: white;\n background: transparent;\n\n &:hover {\n background: transparent;\n }\n }\n\n position: absolute;\n bottom: 15px;\n right: 15px;\n\n font-size: ","px;\n @media (min-width: ","px) {\n font-size: ","px;\n }\n\n @supports (filter: drop-shadow(0 1px 2px #000000cc)) {\n filter: drop-shadow(0 1px 2px #000000cc);\n }\n\n @supports not (filter: drop-shadow(0 1px 2px #000000cc)) {\n text-shadow: 0 1px 2px #000000cc;\n }\n"],["\n && {\n margin: 0;\n padding: 0;\n border: 0;\n width: auto;\n height: auto;\n color: white;\n background: transparent;\n\n &:hover {\n background: transparent;\n }\n }\n\n position: absolute;\n bottom: 15px;\n right: 15px;\n\n font-size: ","px;\n @media (min-width: ","px) {\n font-size: ","px;\n }\n\n @supports (filter: drop-shadow(0 1px 2px #000000cc)) {\n filter: drop-shadow(0 1px 2px #000000cc);\n }\n\n @supports not (filter: drop-shadow(0 1px 2px #000000cc)) {\n text-shadow: 0 1px 2px #000000cc;\n }\n"])),fontSizeMedium,minScreenSize.small,fontSizeLarge+3);var templateObject_1$K$1,templateObject_2$v$1,templateObject_3$m$1,templateObject_4$e$1,templateObject_5$a$2,templateObject_6$7$2,templateObject_7$3$2,templateObject_8$3$2,templateObject_9$2$2;function showPhoto(url,title){{return;}}var IconHeaderButton=function IconHeaderButton(_a){var icon=_a.icon,isActive=_a.isActive,disabled=_a.disabled,tooltipResourceKey=_a.tooltipResourceKey,onClick=_a.onClick,link=_a.link,className=_a.className,rest=__rest$1(_a,["icon","isActive","disabled","tooltipResourceKey","onClick","link","className"]);var formatMessage=useIntl().formatMessage;if(!link&&!onClick){return null;}var allClassNames=classNames('header-button',className);var IconElement=!link?jsx$1(Button$1,__assign$1({className:allClassNames,disabled:disabled,onClick:function(e){return onClick(e.currentTarget);},iconProps:{iconName:icon},ariaLabel:formatMessage({id:tooltipResourceKey}),"data-button-type":"header-btn",isActive:isActive},rest),void 0):jsx$1(StyledLink$2,__assign$1({className:allClassNames,to:link},rest,{children:jsx$1(Icon,{iconName:icon},void 0)}),void 0);return jsx$1(Host$k$1,__assign$1({className:"tooltip-container"},{children:jsx$1(Tooltip,__assign$1({resourceKey:tooltipResourceKey},{children:IconElement}),void 0)}),void 0);};var Host$k$1=_styled.div.withConfig({displayName:"IconHeaderButton__Host",componentId:"sc-1p61ffo-0"})(templateObject_1$J$1||(templateObject_1$J$1=__makeTemplateObject$1(["\n height: 100%;\n"],["\n height: 100%;\n"])));var Button$1=_styled(IconButton$1).withConfig({displayName:"IconHeaderButton__Button",componentId:"sc-1p61ffo-1"})(templateObject_4$d$2||(templateObject_4$d$2=__makeTemplateObject$1(["\n && {\n display: flex;\n padding: 0 5px;\n background-color: transparent;\n height: 100%;\n margin: 0 -1.5px; // this removes the \"gap\" between two side by side active buttons\n\n ",";\n ","\n }\n"],["\n && {\n display: flex;\n padding: 0 5px;\n background-color: transparent;\n height: 100%;\n margin: 0 -1.5px; // this removes the \"gap\" between two side by side active buttons\n\n ",";\n ","\n }\n"])),function(p){return !p.isActive&&css$2(templateObject_2$u$1||(templateObject_2$u$1=__makeTemplateObject$1(["\n color: ",";\n "],["\n color: ",";\n "])),p.theme.textColors.onPrimary);},function(p){return p.isActive&&css$2(templateObject_3$l$1||(templateObject_3$l$1=__makeTemplateObject$1(["\n background-color: ",";\n color: ",";\n\n &&:hover {\n background-color: ",";\n color: ",";\n }\n "],["\n background-color: ",";\n color: ",";\n\n &&:hover {\n background-color: ",";\n color: ",";\n }\n "])),p.theme.palette.themeSecondary,p.theme.textColors.onSecondary,p.theme.palette.themeSecondary,p.theme.textColors.onSecondary);});var StyledLink$2=_styled(Link$4).withConfig({displayName:"IconHeaderButton__StyledLink",componentId:"sc-1p61ffo-2"})(templateObject_6$6$2||(templateObject_6$6$2=__makeTemplateObject$1(["\n && {\n height: 100%;\n ",";\n }\n"],["\n && {\n height: 100%;\n ",";\n }\n"])),function(p){return css$2(templateObject_5$9$2||(templateObject_5$9$2=__makeTemplateObject$1(["\n color: ",";\n "],["\n color: ",";\n "])),p.theme.textColors.onPrimary);});var templateObject_1$J$1,templateObject_2$u$1,templateObject_3$l$1,templateObject_4$d$2,templateObject_5$9$2,templateObject_6$6$2;// a string of all valid unicode whitespaces
77685
77686
  // eslint-disable-next-line max-len
77686
77687
  var whitespaces$2$2='\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';var requireObjectCoercible$e=requireObjectCoercible$9$1;var whitespaces$1$2=whitespaces$2$2;var whitespace$2='['+whitespaces$1$2+']';var ltrim$2=RegExp('^'+whitespace$2+whitespace$2+'*');var rtrim$2=RegExp(whitespace$2+whitespace$2+'*$');// `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
77687
77688
  var createMethod$5=function(TYPE){return function($this){var string=String(requireObjectCoercible$e($this));if(TYPE&1)string=string.replace(ltrim$2,'');if(TYPE&2)string=string.replace(rtrim$2,'');return string;};};var stringTrim$2={// `String.prototype.{ trimLeft, trimStart }` methods
@@ -77696,16 +77697,16 @@ var stringTrimForced$2=function(METHOD_NAME){return fails$k(function(){return !!
77696
77697
  // https://tc39.github.io/ecma262/#sec-string.prototype.trim
77697
77698
  $$1$2({target:'String',proto:true,forced:forcedStringTrimMethod$2('trim')},{trim:function trim(){return $trim$2(this);}});var TextLink=function TextLink(_a){var url=_a.url,target=_a.target,ariaLabel=_a.ariaLabel,children=_a.children,className=_a.className,style=_a.style,rest=__rest$1(_a,["url","target","ariaLabel","children","className","style"]);useFeatures();var webAppUrls=useSubscriptionWebAppUrls();var _b=useContext(LinkContext);_b.onOpenExternalLink;var tryGetInternalLink=_b.tryGetInternalLink;var internalLink=!target&&tryGetInternalLink(url,webAppUrls);if(internalLink){return jsx$1(Link,__assign$1({className:className,to:internalLink,"aria-label":ariaLabel,style:style},rest,{children:children}),void 0);}return jsx$1(ExternalLinkHandler,__assign$1({url:url,target:target,className:className,ariaLabel:ariaLabel,style:style},rest,{children:children}),void 0);};var ExternalLinkHandler=function ExternalLinkHandler(_a){var url=_a.url,target=_a.target,ariaLabel=_a.ariaLabel,onClick=_a.onClick,className=_a.className,children=_a.children,style=_a.style,rest=__rest$1(_a,["url","target","ariaLabel","onClick","className","children","style"]);return jsx$1(ExternalLink$2,__assign$1({href:url,onClick:function(e){return onClick===null||onClick===void 0?void 0:onClick(e);},className:className,target:target===undefined?'_blank':target,rel:"noopener noreferrer","aria-label":ariaLabel,style:style},rest,{children:children}),void 0);};var ToolbarIconButtonWithToolTip=function ToolbarIconButtonWithToolTip(_a){var _b;var iconName=_a.iconName,ariaLabelText=_a.ariaLabel,ariaLabelResourceKey=_a.ariaLabelResourceKey,onClick=_a.onClick,to=_a.to,target=_a.target,tooltipText=_a.tooltipText,tooltipResourceKey=_a.tooltipResourceKey,disabled=_a.disabled,className=_a.className,rest=__rest$1(_a,["iconName","ariaLabel","ariaLabelResourceKey","onClick","to","target","tooltipText","tooltipResourceKey","disabled","className"]);var formatMessage=useIntl().formatMessage;var ariaLabel=ariaLabelText||((_b=ariaLabelResourceKey===null||ariaLabelResourceKey===void 0?void 0:ariaLabelResourceKey.trim())===null||_b===void 0?void 0:_b.length)>0&&formatMessage({id:ariaLabelResourceKey});return jsxs(Tooltip,__assign$1({resourceKey:tooltipResourceKey,text:tooltipText},{children:[to&&!onClick&&jsx$1(StyledLink$1$1,__assign$1({url:to,ariaLabel:ariaLabel,target:target},rest,{children:jsx$1(Icon,{iconName:iconName,className:className},void 0)}),void 0),onClick&&!to&&jsx$1(StyledIconButton$3$1,__assign$1({disabled:disabled,iconProps:{iconName:iconName},onClick:onClick,className:className,ariaLabel:ariaLabel},rest),void 0),onClick&&to&&jsx$1(StyledExternalLink,__assign$1({url:to,target:target,ariaLabel:ariaLabel,onClick:function(e){e.stopPropagation();e.preventDefault();onClick();}},{children:jsx$1(Icon,{iconName:iconName,className:className},void 0)}),void 0)]}),void 0);};var LinkStyle$2=css$2(templateObject_1$I$1||(templateObject_1$I$1=__makeTemplateObject$1(["\n display: flex;\n align-items: center;\n justify-content: center;\n height: 32px;\n width: 32px;\n text-decoration: none !important;\n"],["\n display: flex;\n align-items: center;\n justify-content: center;\n height: 32px;\n width: 32px;\n text-decoration: none !important;\n"])));var StyledLink$1$1=_styled(TextLink).withConfig({displayName:"ToolbarIconButtonWithToolTip__StyledLink",componentId:"sc-148nazl-0"})(templateObject_2$t$1||(templateObject_2$t$1=__makeTemplateObject$1(["\n ","\n"],["\n ","\n"])),LinkStyle$2);var StyledExternalLink=_styled(ExternalLinkHandler).withConfig({displayName:"ToolbarIconButtonWithToolTip__StyledExternalLink",componentId:"sc-148nazl-1"})(templateObject_3$k$1||(templateObject_3$k$1=__makeTemplateObject$1(["\n ","\n"],["\n ","\n"])),LinkStyle$2);var StyledIconButton$3$1=_styled(IconButton$1).withConfig({displayName:"ToolbarIconButtonWithToolTip__StyledIconButton",componentId:"sc-148nazl-2"})(templateObject_5$8$2||(templateObject_5$8$2=__makeTemplateObject$1(["\n border-radius: 0;\n\n ","\n"],["\n border-radius: 0;\n\n ","\n"])),function(p){return p.active&&css$2(templateObject_4$c$2||(templateObject_4$c$2=__makeTemplateObject$1(["\n border-color: ",";\n "],["\n border-color: ",";\n "])),p.theme.palette.themePrimary);});var ToolbarIconButton=_styled(ToolbarIconButtonWithToolTip).withConfig({displayName:"ToolbarIconButtonWithToolTip__ToolbarIconButton",componentId:"sc-148nazl-3"})(templateObject_6$5$2||(templateObject_6$5$2=__makeTemplateObject$1(["\n background-color: transparent;\n &:not([disabled]) {\n color: ",";\n }\n"],["\n background-color: transparent;\n &:not([disabled]) {\n color: ",";\n }\n"])),function(p){return p.theme.textColors.default;});var templateObject_1$I$1,templateObject_2$t$1,templateObject_3$k$1,templateObject_4$c$2,templateObject_5$8$2,templateObject_6$5$2;var Search=function Search(props){var intl=useIntl();var _a=useState$2(null),searchText=_a[0],setSearchText=_a[1];var location=useLocation$1();var textColors=useContext(ThemeContext$1).theme.textColors;var searchInputRef=useRef$1();useEffect$1(function(){addBackButtonListener(handleBack);setTimeout(function(){var _a;return searchInputRef&&((_a=searchInputRef.current)===null||_a===void 0?void 0:_a.focus());});return function(){removeBackButtonListener(handleBack);};// eslint-disable-next-line react-hooks/exhaustive-deps
77698
77699
  },[]);useEffect$1(function(){setSearchText('');// eslint-disable-next-line react-hooks/exhaustive-deps
77699
- },[location.pathname]);return jsxs(Host$j,__assign$1({className:classNames('search-field',props.className),useLightTheme:props.useLightTheme},{children:[jsx$1(StyledTextField$2,{className:"search-input",useLightTheme:props.useLightTheme,default:true,value:searchText||props.searchText||'',onChange:function(_,value){return handleChange(value);},onKeyDown:handleKeyDown,autoComplete:"off",autoFocus:true,borderless:true,placeholder:props.placeholder||intl.formatMessage({id:'TopBar.search'}),componentRef:function(input){return searchInputRef.current=input;},ariaLabel:intl.formatMessage({id:'TopBar.search'}),"data-search-input":true},void 0),props.searching&&jsx$1(StyledSpinner$1$1,{className:"search-spinner"},void 0),jsx$1(CancelButton$1,{"data-cancel-search-button":true,iconProps:{iconName:'Cancel'},onClick:function(){var _a;setSearchText(null);(_a=props.onClear)===null||_a===void 0?void 0:_a.call(props);},color:!props.useLightTheme&&textColors.onPrimary},void 0)]}),void 0);function handleKeyDown(event){if(event.key==='Enter'&&props.onExecuteSearch){props.onExecuteSearch(searchText);}if(event.key==='Escape'){handleChange('');}}function handleChange(searchText){var _a;setSearchText(searchText);(_a=props.onChange)===null||_a===void 0?void 0:_a.call(props,searchText);}function handleBack(){if(searchText||props.searchText){handleChange('');return true;}return false;}};var StyledTextField$2=_styled(TextField).withConfig({displayName:"Search__StyledTextField",componentId:"sc-17f35gt-0"})(templateObject_3$j$1||(templateObject_3$j$1=__makeTemplateObject$1(["\n ","\n"],["\n ","\n"])),function(p){return p.useLightTheme?css$2(templateObject_1$H$1||(templateObject_1$H$1=__makeTemplateObject$1(["\n .ms-TextField-field {\n color: ",";\n ",";\n }\n "],["\n .ms-TextField-field {\n color: ",";\n ",";\n }\n "])),function(p){return p.theme.textColors.default;},InputPlaceholder("color: "+p.theme.textColors.default)):css$2(templateObject_2$s$1||(templateObject_2$s$1=__makeTemplateObject$1(["\n .ms-TextField-field {\n color: ",";\n ",";\n }\n "],["\n .ms-TextField-field {\n color: ",";\n ",";\n }\n "])),function(p){return p.theme.textColors.onPrimary;},InputPlaceholder("color: "+p.theme.textColors.onPrimary));});var StyledSpinner$1$1=_styled(Spinner$1).withConfig({displayName:"Search__StyledSpinner",componentId:"sc-17f35gt-1"})(templateObject_4$b$2||(templateObject_4$b$2=__makeTemplateObject$1(["\n display: flex;\n align-items: center;\n padding-right: 8px;\n\n color: ",";\n background-color: ",";\n"],["\n display: flex;\n align-items: center;\n padding-right: 8px;\n\n color: ",";\n background-color: ",";\n"])),function(p){return p.theme.textColors.onPrimary;},function(p){return p.theme.palette.themeDarker;});var Host$j=_styled.div.withConfig({displayName:"Search__Host",componentId:"sc-17f35gt-2"})(templateObject_7$2$2||(templateObject_7$2$2=__makeTemplateObject$1(["\n flex: 1 1 auto;\n height: 100%;\n\n display: flex;\n flex-flow: row nowrap;\n align-items: stretch;\n\n > .ms-TextField {\n flex: 1 1 auto;\n display: flex;\n flex-flow: row nowrap;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 0;\n\n > .ms-TextField-wrapper {\n flex: 1 0 auto;\n\n .ms-TextField-fieldGroup {\n border: none;\n background: none;\n\n > input {\n border: 0;\n height: 100%;\n font-size: 18px;\n\n &::-ms-clear {\n display: none;\n }\n }\n }\n }\n }\n\n input {\n &.ms-TextField-field {\n min-width: 100%;\n width: 30px;\n }\n\n ",";\n }\n\n i {\n display: flex;\n justify-content: space-around;\n flex-flow: row nowrap;\n align-items: center;\n\n margin-right: 1em;\n margin-left: 0.5em;\n cursor: pointer;\n }\n\n button {\n height: 100%;\n margin: 0 4px;\n }\n\n ","\n"],["\n flex: 1 1 auto;\n height: 100%;\n\n display: flex;\n flex-flow: row nowrap;\n align-items: stretch;\n\n > .ms-TextField {\n flex: 1 1 auto;\n display: flex;\n flex-flow: row nowrap;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 0;\n\n > .ms-TextField-wrapper {\n flex: 1 0 auto;\n\n .ms-TextField-fieldGroup {\n border: none;\n background: none;\n\n > input {\n border: 0;\n height: 100%;\n font-size: 18px;\n\n &::-ms-clear {\n display: none;\n }\n }\n }\n }\n }\n\n input {\n &.ms-TextField-field {\n min-width: 100%;\n width: 30px;\n }\n\n ",";\n }\n\n i {\n display: flex;\n justify-content: space-around;\n flex-flow: row nowrap;\n align-items: center;\n\n margin-right: 1em;\n margin-left: 0.5em;\n cursor: pointer;\n }\n\n button {\n height: 100%;\n margin: 0 4px;\n }\n\n ","\n"])),InputPlaceholder("\n font-size: inherit;\n opacity: 0.5;\n "),function(p){return p.useLightTheme?css$2(templateObject_5$7$2||(templateObject_5$7$2=__makeTemplateObject$1(["\n background-color: ",";\n "],["\n background-color: ",";\n "])),function(p){return p.theme.palette.neutralLighter;}):css$2(templateObject_6$4$2||(templateObject_6$4$2=__makeTemplateObject$1(["\n background-color: ",";\n "],["\n background-color: ",";\n "])),function(p){return p.theme.palette.themeDarker;});});var CancelButton$1=_styled(IconButton).withConfig({displayName:"Search__CancelButton",componentId:"sc-17f35gt-3"})(templateObject_8$2$2||(templateObject_8$2$2=__makeTemplateObject$1(["\n align-self: center;\n"],["\n align-self: center;\n"])));var SearchBox=function SearchBox(_a){var onSearchInputFieldVisibilityChanged=_a.onSearchInputFieldVisibilityChanged,isToolbarMode=_a.isToolbarMode,onExecuteSearch=_a.onExecuteSearch,onSearchTextChange=_a.onSearchTextChange,searchText=_a.searchText,showSearchBoxInput=_a.showSearchBoxInput,className=_a.className;var _b=useState$2(!!searchText),showSearchInputFieldState=_b[0],setShowSearchInputField=_b[1];var showSearchInputField=showSearchBoxInput||showSearchInputFieldState||!!searchText;// this use effect is required, if the state does not change via a manual toggle
77700
+ },[location.pathname]);return jsxs(Host$j$1,__assign$1({className:classNames('search-field',props.className),useLightTheme:props.useLightTheme},{children:[jsx$1(StyledTextField$2,{className:"search-input",useLightTheme:props.useLightTheme,default:true,value:searchText||props.searchText||'',onChange:function(_,value){return handleChange(value);},onKeyDown:handleKeyDown,autoComplete:"off",autoFocus:true,borderless:true,placeholder:props.placeholder||intl.formatMessage({id:'TopBar.search'}),componentRef:function(input){return searchInputRef.current=input;},ariaLabel:intl.formatMessage({id:'TopBar.search'}),"data-search-input":true},void 0),props.searching&&jsx$1(StyledSpinner$1$1,{className:"search-spinner"},void 0),jsx$1(CancelButton$1,{"data-cancel-search-button":true,iconProps:{iconName:'Cancel'},onClick:function(){var _a;setSearchText(null);(_a=props.onClear)===null||_a===void 0?void 0:_a.call(props);},color:!props.useLightTheme&&textColors.onPrimary},void 0)]}),void 0);function handleKeyDown(event){if(event.key==='Enter'&&props.onExecuteSearch){props.onExecuteSearch(searchText);}if(event.key==='Escape'){handleChange('');}}function handleChange(searchText){var _a;setSearchText(searchText);(_a=props.onChange)===null||_a===void 0?void 0:_a.call(props,searchText);}function handleBack(){if(searchText||props.searchText){handleChange('');return true;}return false;}};var StyledTextField$2=_styled(TextField).withConfig({displayName:"Search__StyledTextField",componentId:"sc-17f35gt-0"})(templateObject_3$j$1||(templateObject_3$j$1=__makeTemplateObject$1(["\n ","\n"],["\n ","\n"])),function(p){return p.useLightTheme?css$2(templateObject_1$H$1||(templateObject_1$H$1=__makeTemplateObject$1(["\n .ms-TextField-field {\n color: ",";\n ",";\n }\n "],["\n .ms-TextField-field {\n color: ",";\n ",";\n }\n "])),function(p){return p.theme.textColors.default;},InputPlaceholder("color: "+p.theme.textColors.default)):css$2(templateObject_2$s$1||(templateObject_2$s$1=__makeTemplateObject$1(["\n .ms-TextField-field {\n color: ",";\n ",";\n }\n "],["\n .ms-TextField-field {\n color: ",";\n ",";\n }\n "])),function(p){return p.theme.textColors.onPrimary;},InputPlaceholder("color: "+p.theme.textColors.onPrimary));});var StyledSpinner$1$1=_styled(Spinner$1).withConfig({displayName:"Search__StyledSpinner",componentId:"sc-17f35gt-1"})(templateObject_4$b$2||(templateObject_4$b$2=__makeTemplateObject$1(["\n display: flex;\n align-items: center;\n padding-right: 8px;\n\n color: ",";\n background-color: ",";\n"],["\n display: flex;\n align-items: center;\n padding-right: 8px;\n\n color: ",";\n background-color: ",";\n"])),function(p){return p.theme.textColors.onPrimary;},function(p){return p.theme.palette.themeDarker;});var Host$j$1=_styled.div.withConfig({displayName:"Search__Host",componentId:"sc-17f35gt-2"})(templateObject_7$2$2||(templateObject_7$2$2=__makeTemplateObject$1(["\n flex: 1 1 auto;\n height: 100%;\n\n display: flex;\n flex-flow: row nowrap;\n align-items: stretch;\n\n > .ms-TextField {\n flex: 1 1 auto;\n display: flex;\n flex-flow: row nowrap;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 0;\n\n > .ms-TextField-wrapper {\n flex: 1 0 auto;\n\n .ms-TextField-fieldGroup {\n border: none;\n background: none;\n\n > input {\n border: 0;\n height: 100%;\n font-size: 18px;\n\n &::-ms-clear {\n display: none;\n }\n }\n }\n }\n }\n\n input {\n &.ms-TextField-field {\n min-width: 100%;\n width: 30px;\n }\n\n ",";\n }\n\n i {\n display: flex;\n justify-content: space-around;\n flex-flow: row nowrap;\n align-items: center;\n\n margin-right: 1em;\n margin-left: 0.5em;\n cursor: pointer;\n }\n\n button {\n height: 100%;\n margin: 0 4px;\n }\n\n ","\n"],["\n flex: 1 1 auto;\n height: 100%;\n\n display: flex;\n flex-flow: row nowrap;\n align-items: stretch;\n\n > .ms-TextField {\n flex: 1 1 auto;\n display: flex;\n flex-flow: row nowrap;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 0;\n\n > .ms-TextField-wrapper {\n flex: 1 0 auto;\n\n .ms-TextField-fieldGroup {\n border: none;\n background: none;\n\n > input {\n border: 0;\n height: 100%;\n font-size: 18px;\n\n &::-ms-clear {\n display: none;\n }\n }\n }\n }\n }\n\n input {\n &.ms-TextField-field {\n min-width: 100%;\n width: 30px;\n }\n\n ",";\n }\n\n i {\n display: flex;\n justify-content: space-around;\n flex-flow: row nowrap;\n align-items: center;\n\n margin-right: 1em;\n margin-left: 0.5em;\n cursor: pointer;\n }\n\n button {\n height: 100%;\n margin: 0 4px;\n }\n\n ","\n"])),InputPlaceholder("\n font-size: inherit;\n opacity: 0.5;\n "),function(p){return p.useLightTheme?css$2(templateObject_5$7$2||(templateObject_5$7$2=__makeTemplateObject$1(["\n background-color: ",";\n "],["\n background-color: ",";\n "])),function(p){return p.theme.palette.neutralLighter;}):css$2(templateObject_6$4$2||(templateObject_6$4$2=__makeTemplateObject$1(["\n background-color: ",";\n "],["\n background-color: ",";\n "])),function(p){return p.theme.palette.themeDarker;});});var CancelButton$1=_styled(IconButton).withConfig({displayName:"Search__CancelButton",componentId:"sc-17f35gt-3"})(templateObject_8$2$2||(templateObject_8$2$2=__makeTemplateObject$1(["\n align-self: center;\n"],["\n align-self: center;\n"])));var SearchBox=function SearchBox(_a){var onSearchInputFieldVisibilityChanged=_a.onSearchInputFieldVisibilityChanged,isToolbarMode=_a.isToolbarMode,onExecuteSearch=_a.onExecuteSearch,onSearchTextChange=_a.onSearchTextChange,searchText=_a.searchText,showSearchBoxInput=_a.showSearchBoxInput,className=_a.className;var _b=useState$2(!!searchText),showSearchInputFieldState=_b[0],setShowSearchInputField=_b[1];var showSearchInputField=showSearchBoxInput||showSearchInputFieldState||!!searchText;// this use effect is required, if the state does not change via a manual toggle
77700
77701
  // but instead via a property
77701
77702
  useEffect$1(function(){onSearchInputFieldVisibilityChanged===null||onSearchInputFieldVisibilityChanged===void 0?void 0:onSearchInputFieldVisibilityChanged(showSearchInputField);// eslint-disable-next-line react-hooks/exhaustive-deps
77702
- },[showSearchInputField]);return jsxs(Fragment,{children:[showSearchInputField&&jsx$1(Search,{onChange:onSearchTextChange,onExecuteSearch:onExecuteSearch,searchText:searchText,onClear:function(){onSearchTextChange===null||onSearchTextChange===void 0?void 0:onSearchTextChange('');onToggle(false);},className:className,useLightTheme:isToolbarMode},void 0),!showSearchInputField&&(isToolbarMode?jsx$1(ToolbarIconButton,{iconName:"Search",onClick:function(){return onToggle(true);},tooltipResourceKey:"TopBar.search",ariaLabelResourceKey:"TopBar.search"},void 0):jsx$1(IconHeaderButton,{icon:"Search",onClick:function(){return onToggle(true);},tooltipResourceKey:"TopBar.search"},void 0))]},void 0);function onToggle(isVisible){setShowSearchInputField(isVisible);onSearchInputFieldVisibilityChanged===null||onSearchInputFieldVisibilityChanged===void 0?void 0:onSearchInputFieldVisibilityChanged(isVisible);}};var templateObject_1$H$1,templateObject_2$s$1,templateObject_3$j$1,templateObject_4$b$2,templateObject_5$7$2,templateObject_6$4$2,templateObject_7$2$2,templateObject_8$2$2;var TableSortOrder;(function(TableSortOrder){TableSortOrder["ASC"]="SortUp";TableSortOrder["DESC"]="SortDown";})(TableSortOrder||(TableSortOrder={}));_styled(Icon).withConfig({displayName:"SortableTable__Order",componentId:"sc-6tqdpa-0"})(templateObject_1$G$1||(templateObject_1$G$1=__makeTemplateObject$1(["\n position: absolute;\n right: 0;\n"],["\n position: absolute;\n right: 0;\n"])));_styled.span.withConfig({displayName:"SortableTable__Title",componentId:"sc-6tqdpa-1"})(templateObject_4$a$2||(templateObject_4$a$2=__makeTemplateObject$1(["\n position: relative;\n padding: 0 5px;\n ","\n"],["\n position: relative;\n padding: 0 5px;\n ","\n"])),function(p){return p.orderBy?css$2(templateObject_2$r$1||(templateObject_2$r$1=__makeTemplateObject$1(["\n padding-right: 18px;\n "],["\n padding-right: 18px;\n "]))):css$2(templateObject_3$i$1||(templateObject_3$i$1=__makeTemplateObject$1(["\n padding-left: 18px;\n "],["\n padding-left: 18px;\n "])));});_styled.th.withConfig({displayName:"SortableTable__ColumnHeader",componentId:"sc-6tqdpa-2"})(templateObject_5$6$2||(templateObject_5$6$2=__makeTemplateObject$1(["\n text-align: right;\n padding: 10px 5px;\n white-space: nowrap;\n\n :hover {\n cursor: ",";\n }\n\n :first-child {\n text-align: left;\n\n span {\n padding-left: 0;\n padding-right: 15px;\n }\n }\n"],["\n text-align: right;\n padding: 10px 5px;\n white-space: nowrap;\n\n :hover {\n cursor: ",";\n }\n\n :first-child {\n text-align: left;\n\n span {\n padding-left: 0;\n padding-right: 15px;\n }\n }\n"])),function(_a){var isLoading=_a.isLoading,disableSort=_a.disableSort;return isLoading?'wait':disableSort?'default':'pointer';});_styled.td.withConfig({displayName:"SortableTable__Cell",componentId:"sc-6tqdpa-3"})(templateObject_6$3$2||(templateObject_6$3$2=__makeTemplateObject$1(["\n text-align: right;\n padding: 2px 5px;\n white-space: ",";\n\n :first-child {\n text-align: left;\n }\n"],["\n text-align: right;\n padding: 2px 5px;\n white-space: ",";\n\n :first-child {\n text-align: left;\n }\n"])),function(props){return props.noWrap?'nowrap':'';});var Row$1=_styled.tr.withConfig({displayName:"SortableTable__Row",componentId:"sc-6tqdpa-4"})(templateObject_7$1$2||(templateObject_7$1$2=__makeTemplateObject$1(["\n :nth-child(odd) {\n background: ",";\n }\n"],["\n :nth-child(odd) {\n background: ",";\n }\n"])),function(p){return p.theme.palette.neutralLighterAlt;});_styled.table.withConfig({displayName:"SortableTable__Table",componentId:"sc-6tqdpa-5"})(templateObject_8$1$2||(templateObject_8$1$2=__makeTemplateObject$1(["\n width: 100%;\n border-collapse: collapse;\n\n :hover {\n cursor: ",";\n }\n\n "," {\n transition: opacity 0.1s linear;\n opacity: ",";\n }\n"],["\n width: 100%;\n border-collapse: collapse;\n\n :hover {\n cursor: ",";\n }\n\n "," {\n transition: opacity 0.1s linear;\n opacity: ",";\n }\n"])),function(_a){var isLoading=_a.isLoading;return isLoading?'wait':'default';},Row$1,function(_a){var isLoading=_a.isLoading;return isLoading?'0.6':'1';});_styled(Spinner).withConfig({displayName:"SortableTable__Loading",componentId:"sc-6tqdpa-6"})(templateObject_9$1$2||(templateObject_9$1$2=__makeTemplateObject$1(["\n margin: 80px 0 100px;\n"],["\n margin: 80px 0 100px;\n"])));var templateObject_1$G$1,templateObject_2$r$1,templateObject_3$i$1,templateObject_4$a$2,templateObject_5$6$2,templateObject_6$3$2,templateObject_7$1$2,templateObject_8$1$2,templateObject_9$1$2;var ToggleWithLabel=function ToggleWithLabel(props){return jsx$1(StyledToggle,__assign$1({},props,{"data-toggle-button":true}),void 0);};var StyledToggle=_styled(Toggle).withConfig({displayName:"ToggleWithLabel__StyledToggle",componentId:"sc-lcovfq-0"})(templateObject_1$F$1||(templateObject_1$F$1=__makeTemplateObject$1(["\n display: flex;\n align-items: center;\n\n > label {\n order: 1;\n margin-left: 15px;\n }\n\n &.is-checked.is-enabled {\n button:hover {\n background-color: ",";\n }\n }\n"],["\n display: flex;\n align-items: center;\n\n > label {\n order: 1;\n margin-left: 15px;\n }\n\n &.is-checked.is-enabled {\n button:hover {\n background-color: ",";\n }\n }\n"])),function(p){return p.theme.semanticColors.inputBackgroundCheckedHovered;});var templateObject_1$F$1;var unreadCommentHighlight=css$2(templateObject_1$E$1||(templateObject_1$E$1=__makeTemplateObject$1(["\n position: relative;\n\n &::after {\n content: '';\n position: absolute;\n top: 3px;\n left: 100%;\n display: block;\n width: 12px;\n height: 12px;\n transform: translate(-50%, -50%);\n border-radius: 50%;\n background-color: ",";\n }\n"],["\n position: relative;\n\n &::after {\n content: '';\n position: absolute;\n top: 3px;\n left: 100%;\n display: block;\n width: 12px;\n height: 12px;\n transform: translate(-50%, -50%);\n border-radius: 50%;\n background-color: ",";\n }\n"])),function(p){return p.theme.palette.accent;});var templateObject_1$E$1;function getGroupName(group,user,intl){return group.translations[user.preferredUiLanguage]||group.translations[getPreferredContentLanguage(user)]||group.name||intl.formatMessage({id:'Groups.defaultName'});}_styled.div.withConfig({displayName:"VerificationStatusIcon__Host",componentId:"sc-b3nb8-0"})(templateObject_2$q$1||(templateObject_2$q$1=__makeTemplateObject$1(["\n display: flex;\n align-items: center;\n\n ","\n"],["\n display: flex;\n align-items: center;\n\n ","\n"])),function(p){return p.isInvalid&&css$2(templateObject_1$D$1||(templateObject_1$D$1=__makeTemplateObject$1(["\n color: ",";\n "],["\n color: ",";\n "])),function(p){return p.theme.palette.redDark;});});_styled(Icon).withConfig({displayName:"VerificationStatusIcon__StatusIcon",componentId:"sc-b3nb8-1"})(templateObject_3$h$1||(templateObject_3$h$1=__makeTemplateObject$1(["\n margin-right: ","px;\n"],["\n margin-right: ","px;\n"])),spacingS);var templateObject_1$D$1,templateObject_2$q$1,templateObject_3$h$1;var OpacityAnimation=function OpacityAnimation(_a){var enterDuration=_a.enterDuration,leaveDuration=_a.leaveDuration,children=_a.children,style=_a.style,className=_a.className;var hasEnterDuration=!!enterDuration;var hasLeaveDuration=!!leaveDuration;var animationName="common-opacity-animation_"+enterDuration+"_"+leaveDuration;return jsxs(Fragment,{children:[jsx$1(AnimationStyle,{name:animationName,enterDuration:enterDuration,leaveDuration:leaveDuration},void 0),jsx$1(reactAddonsCssTransitionGroup,__assign$1({style:style,className:className,transitionName:animationName,transitionAppear:hasEnterDuration,transitionEnter:hasEnterDuration,transitionLeave:hasLeaveDuration,transitionLeaveTimeout:leaveDuration,transitionAppearTimeout:enterDuration,transitionEnterTimeout:enterDuration},{children:children}),void 0)]},void 0);};var AnimationStyle=createGlobalStyle(templateObject_1$C$1||(templateObject_1$C$1=__makeTemplateObject$1(["\n ."," {\n &-enter, &-apear {\n opacity: 0;\n &-active {\n opacity: 1;\n transition: opacity ","ms ease-in;\n }\n }\n &-leave {\n opacity: 1;\n &-active {\n opacity: 0;\n transition: opacity ","ms ease-in;\n }\n }\n }\n"],["\n ."," {\n &-enter, &-apear {\n opacity: 0;\n &-active {\n opacity: 1;\n transition: opacity ","ms ease-in;\n }\n }\n &-leave {\n opacity: 1;\n &-active {\n opacity: 0;\n transition: opacity ","ms ease-in;\n }\n }\n }\n"])),function(p){return p.name;},function(p){return p.enterDuration;},function(p){return p.leaveDuration;});var templateObject_1$C$1;var AutoTranslateButton=function AutoTranslateButton(_a){var contentLanguageCode=_a.contentLanguageCode,originalContent=_a.originalContent,content=_a.content,onTranslate=_a.onTranslate,onContentChange=_a.onContentChange,tooltipResourceKey=_a.tooltipResourceKey,showLabel=_a.showLabel;var formatMessage=useIntl().formatMessage;var user=useCurrentUser();var features=useFeatures();var _b=useState$2(null),autoTranslatedContent=_b[0],setAutoTranslatedContent=_b[1];var _c=useState$2(originalContent===content),isOriginalContent=_c[0],setIsOriginalContent=_c[1];var showError=useNotificationContext().showError;var preferredContentLanguageCode=getPreferredContentLanguage(user);useEffect$1(function(){return setAutoTranslatedContent(null);},[originalContent]);if(!features.automaticTranslation){return null;}var label=formatMessage({id:'Generic.translate'});var shouldShowTranslateButton=contentLanguageCode&&contentLanguageCode!==preferredContentLanguageCode&&allAvailableContentLanguages.includes(preferredContentLanguageCode)&&!contentLanguagesWithoutAutomaticTranslation.includes(preferredContentLanguageCode);if(!shouldShowTranslateButton){return null;}return jsx$1(Tooltip,__assign$1({resourceKey:isOriginalContent?'Generic.translateTo':tooltipResourceKey,values:{language:formatMessage({id:"Generic.languages."+preferredContentLanguageCode})}},{children:jsx$1(StyledActionButton$3,__assign$1({"aria-label":showLabel?null:label,"data-translate-content-button":true,className:"ms-fontColor-neutralSecondary",iconProps:{iconName:'World'},onClick:handleTranslate},{children:showLabel&&label}),void 0)}),void 0);function handleTranslate(){return __awaiter$1(this,void 0,void 0,function(){var translation;return __generator$1(this,function(_b){switch(_b.label){case 0:if(!isOriginalContent){onContentChange(originalContent);setIsOriginalContent(true);return [2/*return*/];}if(!autoTranslatedContent)return [3/*break*/,1];onContentChange(autoTranslatedContent);setIsOriginalContent(false);return [3/*break*/,4];case 1:_b.trys.push([1,3,,4]);return [4/*yield*/,onTranslate(preferredContentLanguageCode)];case 2:translation=_b.sent();onContentChange(translation);setAutoTranslatedContent(translation);setIsOriginalContent(false);return [3/*break*/,4];case 3:_b.sent();showError('Generic.error');return [3/*break*/,4];case 4:return [2/*return*/];}});});}};var StyledActionButton$3=_styled(ActionButton)(templateObject_1$B$1||(templateObject_1$B$1=__makeTemplateObject$1(["\n &&& {\n i {\n color: ",";\n }\n }\n"],["\n &&& {\n i {\n color: ",";\n }\n }\n"])),function(p){return p.theme.textColors.default;});var templateObject_1$B$1;var ChoiceGroup=_styled(ChoiceGroup$1).withConfig({displayName:"ChoiceGroup",componentId:"sc-11bpj01-0"})(templateObject_1$A$1||(templateObject_1$A$1=__makeTemplateObject$1(["\n .ms-ChoiceField-field.is-checked {\n &:hover {\n &::before,\n &:after {\n border-color: ",";\n }\n }\n }\n"],["\n .ms-ChoiceField-field.is-checked {\n &:hover {\n &::before,\n &:after {\n border-color: ",";\n }\n }\n }\n"])),function(p){return p.theme.palette.accent;});var templateObject_1$A$1;var CommentActionMenu=function CommentActionMenu(_a){var comment=_a.comment,showEdit=_a.showEdit,showDelete=_a.showDelete,onDelete=_a.onDelete,isEditMode=_a.isEditMode,toggleEditMode=_a.toggleEditMode,originalContent=_a.originalContent,currentContent=_a.currentContent,setContent=_a.setContent,handleTranslate=_a.handleTranslate,showAutoTranslate=_a.showAutoTranslate,onReply=_a.onReply,disabled=_a.disabled;var formatMessage=useIntl().formatMessage;var _b=useState$2(false),showMenuButtons=_b[0],setShowMenuButtons=_b[1];var menuButton=useRef$1(null);return jsxs(Fragment,{children:[jsx$1("div",__assign$1({ref:menuButton},{children:jsx$1(MenuButton$1,{"data-menu-button":comment.id,iconProps:{iconName:'MoreVertical'},onClick:function(){return setShowMenuButtons(!showMenuButtons);},ariaLabel:formatMessage({id:'AriaLabel.contextMenuButton'}),disabled:disabled},void 0)}),void 0),showMenuButtons&&jsx$1(StyledCallout$4,__assign$1({"data-context-menu":true,target:menuButton.current,onDismiss:function(){return setShowMenuButtons(false);}},{children:jsxs(Buttons$4,{children:[jsx$1(Tooltip,__assign$1({resourceKey:'Comment.replyButton.tooltip',values:{name:comment.sender.displayName}},{children:jsx$1(StyledActionButton$2,{"data-reply-button":comment.id,iconProps:{iconName:'Reply'},onClick:handleReply,text:formatMessage({id:'Comment.replyButton'})},void 0)}),void 0),showAutoTranslate&&jsx$1(AutoTranslateButton,{"data-auto-translate-button":comment.id,originalContent:originalContent,onContentChange:function(content){setShowMenuButtons(false);setContent(content);},content:currentContent,tooltipResourceKey:"Comment.translate.showOriginal",onTranslate:handleTranslate,contentLanguageCode:comment.contentLanguageCode,showLabel:true},void 0),showEdit&&jsx$1(Tooltip,__assign$1({resourceKey:"Comment.edit.tooltip"},{children:jsx$1(StyledActionButton$2,{"data-edit-button":comment.id,iconProps:{iconName:'Edit'},onClick:function(){toggleEditMode(true);setShowMenuButtons(false);},text:formatMessage({id:'Generic.edit'}),disabled:!comment.id||isEditMode},void 0)}),void 0),showDelete&&jsx$1(Tooltip,__assign$1({resourceKey:"Comment.delete.tooltip"},{children:jsx$1(StyledActionButton$2,{"data-delete-button":comment.id,iconProps:{iconName:'Delete'},onClick:function(){onDelete(comment);setShowMenuButtons(false);},text:formatMessage({id:'Generic.Delete'}),disabled:!comment.id||isEditMode},void 0)}),void 0)]},void 0)}),void 0)]},void 0);function handleReply(){onReply===null||onReply===void 0?void 0:onReply(comment.id,comment.sender);setShowMenuButtons(false);}};var Buttons$4=_styled.div.withConfig({displayName:"CommentActionMenu__Buttons",componentId:"sc-qsk1nc-0"})(templateObject_1$z$1||(templateObject_1$z$1=__makeTemplateObject$1(["\n display: flex;\n flex-direction: column;\n"],["\n display: flex;\n flex-direction: column;\n"])));var MenuButton$1=_styled(IconButton).withConfig({displayName:"CommentActionMenu__MenuButton",componentId:"sc-qsk1nc-1"})(templateObject_2$p$1||(templateObject_2$p$1=__makeTemplateObject$1(["\n && {\n width: auto;\n padding: 0;\n\n &[disabled] {\n background: transparent;\n }\n\n i {\n margin: 0;\n font-size: ","px;\n }\n }\n"],["\n && {\n width: auto;\n padding: 0;\n\n &[disabled] {\n background: transparent;\n }\n\n i {\n margin: 0;\n font-size: ","px;\n }\n }\n"])),fontSizeMedium+2);var StyledActionButton$2=_styled(ActionButton).withConfig({displayName:"CommentActionMenu__StyledActionButton",componentId:"sc-qsk1nc-2"})(templateObject_3$g$1||(templateObject_3$g$1=__makeTemplateObject$1(["\n &&& {\n i {\n color: ",";\n }\n }\n"],["\n &&& {\n i {\n color: ",";\n }\n }\n"])),function(p){return p.theme.textColors.default;});var StyledCallout$4=_styled(Callout).withConfig({displayName:"CommentActionMenu__StyledCallout",componentId:"sc-qsk1nc-3"})(templateObject_4$9$2||(templateObject_4$9$2=__makeTemplateObject$1(["\n padding: ","px;\n"],["\n padding: ","px;\n"])),spacingS);var templateObject_1$z$1,templateObject_2$p$1,templateObject_3$g$1,templateObject_4$9$2;var DeleteAttachmentButton=_styled(IconButton$1).withConfig({displayName:"DeleteAttachmentButton",componentId:"sc-d7hswf-0"})(templateObject_1$y$1||(templateObject_1$y$1=__makeTemplateObject$1(["\n && {\n padding: ","px;\n color: ",";\n\n &:hover {\n color: ",";\n }\n\n &:disabled {\n background-color: transparent;\n }\n\n i {\n font-size: 14px;\n }\n }\n"],["\n && {\n padding: ","px;\n color: ",";\n\n &:hover {\n color: ",";\n }\n\n &:disabled {\n background-color: transparent;\n }\n\n i {\n font-size: 14px;\n }\n }\n"])),spacingXs,function(p){return p.theme.textColors.default;},function(p){return p.theme.textColors.default;});var templateObject_1$y$1;var ToggleAllButtons=function ToggleAllButtons(_a){var toggleAll=_a.toggleAll,className=_a.className;var accent=useContext(ThemeContext$1).theme.palette.accent;return jsxs(Host$h$2,__assign$1({className:className},{children:[jsx$1(StyledButton$1$1,__assign$1({onClick:function(){return toggleAll(true);},"data-button-toggle":"selectAll",color:accent},{children:jsx$1(FormattedMessage$1,{id:"Generic.SelectAll"},void 0)}),void 0),jsx$1(StyledButton$1$1,__assign$1({onClick:function(){return toggleAll(false);},"data-button-toggle":"clearAll",color:accent},{children:jsx$1(FormattedMessage$1,{id:"Generic.ClearAll"},void 0)}),void 0)]}),void 0);};var Host$h$2=_styled.div.withConfig({displayName:"ToggleAllButtons__Host",componentId:"sc-kbn3b4-0"})(templateObject_1$x$1||(templateObject_1$x$1=__makeTemplateObject$1(["\n margin-bottom: ","px;\n"],["\n margin-bottom: ","px;\n"])),spacingS);var StyledButton$1$1=_styled(ActionButton).withConfig({displayName:"ToggleAllButtons__StyledButton",componentId:"sc-kbn3b4-1"})(templateObject_2$o$1||(templateObject_2$o$1=__makeTemplateObject$1(["\n && {\n height: 20px;\n padding-left: 0;\n padding-right: 8px;\n font-size: 10pt;\n }\n"],["\n && {\n height: 20px;\n padding-left: 0;\n padding-right: 8px;\n font-size: 10pt;\n }\n"])));var templateObject_1$x$1,templateObject_2$o$1;var InternalTopActionButton=function InternalTopActionButton(props){var iconName=props.iconName,textKey=props.textKey,navLinkProps=__rest$1(props,["iconName","textKey"]);return jsxs(NavLink,__assign$1({},navLinkProps,{children:[iconName&&jsx$1(Icon,{iconName:iconName},void 0),jsx$1(FormattedMessage$1,{id:textKey},void 0)]}),void 0);};_styled(InternalTopActionButton).withConfig({displayName:"TopActionButton",componentId:"sc-1lam7c6-0"})(templateObject_1$w$1||(templateObject_1$w$1=__makeTemplateObject$1(["\n && {\n font-size: initial;\n font-weight: bold;\n margin: 0 0 ","px 0;\n\n display: flex;\n align-items: center;\n align-self: flex-start;\n\n color: ",";\n }\n\n > i {\n padding-right: 8px;\n }\n"],["\n && {\n font-size: initial;\n font-weight: bold;\n margin: 0 0 ","px 0;\n\n display: flex;\n align-items: center;\n align-self: flex-start;\n\n color: ",";\n }\n\n > i {\n padding-right: 8px;\n }\n"])),spacingS,function(p){return p.theme.palette.accent;});var templateObject_1$w$1;_styled(IconButton).withConfig({displayName:"HeaderMenuButton__MenuButton",componentId:"sc-170vvq2-0"})(templateObject_1$v$1||(templateObject_1$v$1=__makeTemplateObject$1([""],[""])));var templateObject_1$v$1;var ChannelTitle=function ChannelTitle(_a){var language=_a.language,channelOrName=_a.channel,role=_a.role,className=_a.className;var user=useCurrentUser();var channels=useContext(LazySubscriptionContext).channels;var displayValue=getChannelDisplayName(channels,channelOrName,user,language);return jsx$1(Host$g$2,__assign$1({title:displayValue,className:className,role:role},{children:displayValue}),void 0);};var Host$g$2=_styled.span.withConfig({displayName:"ChannelTitle__Host",componentId:"sc-1lqd4of-0"})(templateObject_1$u$2||(templateObject_1$u$2=__makeTemplateObject$1(["\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n"],["\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n"])));var ChannelTitles=function ChannelTitles(_a){var channels=_a.channels,language=_a.language;return jsx$1(Fragment,{children:channels.map(function(c,index){var channelKey=isChannel$1(c)?c.id:c;return jsxs("span",{children:[index>0&&', ',jsx$1(ChannelTitle,{channel:c,language:language},void 0)]},channelKey);})},void 0);};function isChannel$1(value){return value.id!=null;}function getChannelDisplayName(allChannels,channelOrName,user,language){// Render the channel name if the channel details have not been loaded yet.
77703
+ },[showSearchInputField]);return jsxs(Fragment,{children:[showSearchInputField&&jsx$1(Search,{onChange:onSearchTextChange,onExecuteSearch:onExecuteSearch,searchText:searchText,onClear:function(){onSearchTextChange===null||onSearchTextChange===void 0?void 0:onSearchTextChange('');onToggle(false);},className:className,useLightTheme:isToolbarMode},void 0),!showSearchInputField&&(isToolbarMode?jsx$1(ToolbarIconButton,{iconName:"Search",onClick:function(){return onToggle(true);},tooltipResourceKey:"TopBar.search",ariaLabelResourceKey:"TopBar.search"},void 0):jsx$1(IconHeaderButton,{icon:"Search",onClick:function(){return onToggle(true);},tooltipResourceKey:"TopBar.search"},void 0))]},void 0);function onToggle(isVisible){setShowSearchInputField(isVisible);onSearchInputFieldVisibilityChanged===null||onSearchInputFieldVisibilityChanged===void 0?void 0:onSearchInputFieldVisibilityChanged(isVisible);}};var templateObject_1$H$1,templateObject_2$s$1,templateObject_3$j$1,templateObject_4$b$2,templateObject_5$7$2,templateObject_6$4$2,templateObject_7$2$2,templateObject_8$2$2;var TableSortOrder;(function(TableSortOrder){TableSortOrder["ASC"]="SortUp";TableSortOrder["DESC"]="SortDown";})(TableSortOrder||(TableSortOrder={}));_styled(Icon).withConfig({displayName:"SortableTable__Order",componentId:"sc-6tqdpa-0"})(templateObject_1$G$1||(templateObject_1$G$1=__makeTemplateObject$1(["\n position: absolute;\n right: 0;\n"],["\n position: absolute;\n right: 0;\n"])));_styled.span.withConfig({displayName:"SortableTable__Title",componentId:"sc-6tqdpa-1"})(templateObject_4$a$2||(templateObject_4$a$2=__makeTemplateObject$1(["\n position: relative;\n padding: 0 5px;\n ","\n"],["\n position: relative;\n padding: 0 5px;\n ","\n"])),function(p){return p.orderBy?css$2(templateObject_2$r$1||(templateObject_2$r$1=__makeTemplateObject$1(["\n padding-right: 18px;\n "],["\n padding-right: 18px;\n "]))):css$2(templateObject_3$i$1||(templateObject_3$i$1=__makeTemplateObject$1(["\n padding-left: 18px;\n "],["\n padding-left: 18px;\n "])));});_styled.th.withConfig({displayName:"SortableTable__ColumnHeader",componentId:"sc-6tqdpa-2"})(templateObject_5$6$2||(templateObject_5$6$2=__makeTemplateObject$1(["\n text-align: right;\n padding: 10px 5px;\n white-space: nowrap;\n\n :hover {\n cursor: ",";\n }\n\n :first-child {\n text-align: left;\n\n span {\n padding-left: 0;\n padding-right: 15px;\n }\n }\n"],["\n text-align: right;\n padding: 10px 5px;\n white-space: nowrap;\n\n :hover {\n cursor: ",";\n }\n\n :first-child {\n text-align: left;\n\n span {\n padding-left: 0;\n padding-right: 15px;\n }\n }\n"])),function(_a){var isLoading=_a.isLoading,disableSort=_a.disableSort;return isLoading?'wait':disableSort?'default':'pointer';});_styled.td.withConfig({displayName:"SortableTable__Cell",componentId:"sc-6tqdpa-3"})(templateObject_6$3$2||(templateObject_6$3$2=__makeTemplateObject$1(["\n text-align: right;\n padding: 2px 5px;\n white-space: ",";\n\n :first-child {\n text-align: left;\n }\n"],["\n text-align: right;\n padding: 2px 5px;\n white-space: ",";\n\n :first-child {\n text-align: left;\n }\n"])),function(props){return props.noWrap?'nowrap':'';});var Row$1=_styled.tr.withConfig({displayName:"SortableTable__Row",componentId:"sc-6tqdpa-4"})(templateObject_7$1$2||(templateObject_7$1$2=__makeTemplateObject$1(["\n :nth-child(odd) {\n background: ",";\n }\n"],["\n :nth-child(odd) {\n background: ",";\n }\n"])),function(p){return p.theme.palette.neutralLighterAlt;});_styled.table.withConfig({displayName:"SortableTable__Table",componentId:"sc-6tqdpa-5"})(templateObject_8$1$2||(templateObject_8$1$2=__makeTemplateObject$1(["\n width: 100%;\n border-collapse: collapse;\n\n :hover {\n cursor: ",";\n }\n\n "," {\n transition: opacity 0.1s linear;\n opacity: ",";\n }\n"],["\n width: 100%;\n border-collapse: collapse;\n\n :hover {\n cursor: ",";\n }\n\n "," {\n transition: opacity 0.1s linear;\n opacity: ",";\n }\n"])),function(_a){var isLoading=_a.isLoading;return isLoading?'wait':'default';},Row$1,function(_a){var isLoading=_a.isLoading;return isLoading?'0.6':'1';});_styled(Spinner).withConfig({displayName:"SortableTable__Loading",componentId:"sc-6tqdpa-6"})(templateObject_9$1$2||(templateObject_9$1$2=__makeTemplateObject$1(["\n margin: 80px 0 100px;\n"],["\n margin: 80px 0 100px;\n"])));var templateObject_1$G$1,templateObject_2$r$1,templateObject_3$i$1,templateObject_4$a$2,templateObject_5$6$2,templateObject_6$3$2,templateObject_7$1$2,templateObject_8$1$2,templateObject_9$1$2;var ToggleWithLabel=function ToggleWithLabel(props){return jsx$1(StyledToggle,__assign$1({},props,{"data-toggle-button":true}),void 0);};var StyledToggle=_styled(Toggle).withConfig({displayName:"ToggleWithLabel__StyledToggle",componentId:"sc-lcovfq-0"})(templateObject_1$F$1||(templateObject_1$F$1=__makeTemplateObject$1(["\n display: flex;\n align-items: center;\n\n > label {\n order: 1;\n margin-left: 15px;\n }\n\n &.is-checked.is-enabled {\n button:hover {\n background-color: ",";\n }\n }\n"],["\n display: flex;\n align-items: center;\n\n > label {\n order: 1;\n margin-left: 15px;\n }\n\n &.is-checked.is-enabled {\n button:hover {\n background-color: ",";\n }\n }\n"])),function(p){return p.theme.semanticColors.inputBackgroundCheckedHovered;});var templateObject_1$F$1;var unreadCommentHighlight=css$2(templateObject_1$E$1||(templateObject_1$E$1=__makeTemplateObject$1(["\n position: relative;\n\n &::after {\n content: '';\n position: absolute;\n top: 3px;\n left: 100%;\n display: block;\n width: 12px;\n height: 12px;\n transform: translate(-50%, -50%);\n border-radius: 50%;\n background-color: ",";\n }\n"],["\n position: relative;\n\n &::after {\n content: '';\n position: absolute;\n top: 3px;\n left: 100%;\n display: block;\n width: 12px;\n height: 12px;\n transform: translate(-50%, -50%);\n border-radius: 50%;\n background-color: ",";\n }\n"])),function(p){return p.theme.palette.accent;});var templateObject_1$E$1;function getGroupName(group,user,intl){return group.translations[user.preferredUiLanguage]||group.translations[getPreferredContentLanguage(user)]||group.name||intl.formatMessage({id:'Groups.defaultName'});}_styled.div.withConfig({displayName:"VerificationStatusIcon__Host",componentId:"sc-b3nb8-0"})(templateObject_2$q$1||(templateObject_2$q$1=__makeTemplateObject$1(["\n display: flex;\n align-items: center;\n\n ","\n"],["\n display: flex;\n align-items: center;\n\n ","\n"])),function(p){return p.isInvalid&&css$2(templateObject_1$D$1||(templateObject_1$D$1=__makeTemplateObject$1(["\n color: ",";\n "],["\n color: ",";\n "])),function(p){return p.theme.palette.redDark;});});_styled(Icon).withConfig({displayName:"VerificationStatusIcon__StatusIcon",componentId:"sc-b3nb8-1"})(templateObject_3$h$1||(templateObject_3$h$1=__makeTemplateObject$1(["\n margin-right: ","px;\n"],["\n margin-right: ","px;\n"])),spacingS);var templateObject_1$D$1,templateObject_2$q$1,templateObject_3$h$1;var OpacityAnimation=function OpacityAnimation(_a){var enterDuration=_a.enterDuration,leaveDuration=_a.leaveDuration,children=_a.children,style=_a.style,className=_a.className;var hasEnterDuration=!!enterDuration;var hasLeaveDuration=!!leaveDuration;var animationName="common-opacity-animation_"+enterDuration+"_"+leaveDuration;return jsxs(Fragment,{children:[jsx$1(AnimationStyle,{name:animationName,enterDuration:enterDuration,leaveDuration:leaveDuration},void 0),jsx$1(reactAddonsCssTransitionGroup,__assign$1({style:style,className:className,transitionName:animationName,transitionAppear:hasEnterDuration,transitionEnter:hasEnterDuration,transitionLeave:hasLeaveDuration,transitionLeaveTimeout:leaveDuration,transitionAppearTimeout:enterDuration,transitionEnterTimeout:enterDuration},{children:children}),void 0)]},void 0);};var AnimationStyle=createGlobalStyle(templateObject_1$C$1||(templateObject_1$C$1=__makeTemplateObject$1(["\n ."," {\n &-enter, &-apear {\n opacity: 0;\n &-active {\n opacity: 1;\n transition: opacity ","ms ease-in;\n }\n }\n &-leave {\n opacity: 1;\n &-active {\n opacity: 0;\n transition: opacity ","ms ease-in;\n }\n }\n }\n"],["\n ."," {\n &-enter, &-apear {\n opacity: 0;\n &-active {\n opacity: 1;\n transition: opacity ","ms ease-in;\n }\n }\n &-leave {\n opacity: 1;\n &-active {\n opacity: 0;\n transition: opacity ","ms ease-in;\n }\n }\n }\n"])),function(p){return p.name;},function(p){return p.enterDuration;},function(p){return p.leaveDuration;});var templateObject_1$C$1;var AutoTranslateButton=function AutoTranslateButton(_a){var contentLanguageCode=_a.contentLanguageCode,originalContent=_a.originalContent,content=_a.content,onTranslate=_a.onTranslate,onContentChange=_a.onContentChange,tooltipResourceKey=_a.tooltipResourceKey,showLabel=_a.showLabel;var formatMessage=useIntl().formatMessage;var user=useCurrentUser();var features=useFeatures();var _b=useState$2(null),autoTranslatedContent=_b[0],setAutoTranslatedContent=_b[1];var _c=useState$2(originalContent===content),isOriginalContent=_c[0],setIsOriginalContent=_c[1];var showError=useNotificationContext().showError;var preferredContentLanguageCode=getPreferredContentLanguage(user);useEffect$1(function(){return setAutoTranslatedContent(null);},[originalContent]);if(!features.automaticTranslation){return null;}var label=formatMessage({id:'Generic.translate'});var shouldShowTranslateButton=contentLanguageCode&&contentLanguageCode!==preferredContentLanguageCode&&allAvailableContentLanguages.includes(preferredContentLanguageCode)&&!contentLanguagesWithoutAutomaticTranslation.includes(preferredContentLanguageCode);if(!shouldShowTranslateButton){return null;}return jsx$1(Tooltip,__assign$1({resourceKey:isOriginalContent?'Generic.translateTo':tooltipResourceKey,values:{language:formatMessage({id:"Generic.languages."+preferredContentLanguageCode})}},{children:jsx$1(StyledActionButton$3,__assign$1({"aria-label":showLabel?null:label,"data-translate-content-button":true,className:"ms-fontColor-neutralSecondary",iconProps:{iconName:'World'},onClick:handleTranslate},{children:showLabel&&label}),void 0)}),void 0);function handleTranslate(){return __awaiter$1(this,void 0,void 0,function(){var translation;return __generator$1(this,function(_b){switch(_b.label){case 0:if(!isOriginalContent){onContentChange(originalContent);setIsOriginalContent(true);return [2/*return*/];}if(!autoTranslatedContent)return [3/*break*/,1];onContentChange(autoTranslatedContent);setIsOriginalContent(false);return [3/*break*/,4];case 1:_b.trys.push([1,3,,4]);return [4/*yield*/,onTranslate(preferredContentLanguageCode)];case 2:translation=_b.sent();onContentChange(translation);setAutoTranslatedContent(translation);setIsOriginalContent(false);return [3/*break*/,4];case 3:_b.sent();showError('Generic.error');return [3/*break*/,4];case 4:return [2/*return*/];}});});}};var StyledActionButton$3=_styled(ActionButton)(templateObject_1$B$1||(templateObject_1$B$1=__makeTemplateObject$1(["\n &&& {\n i {\n color: ",";\n }\n }\n"],["\n &&& {\n i {\n color: ",";\n }\n }\n"])),function(p){return p.theme.textColors.default;});var templateObject_1$B$1;var ChoiceGroup=_styled(ChoiceGroup$1).withConfig({displayName:"ChoiceGroup",componentId:"sc-11bpj01-0"})(templateObject_1$A$1||(templateObject_1$A$1=__makeTemplateObject$1(["\n .ms-ChoiceField-field.is-checked {\n &:hover {\n &::before,\n &:after {\n border-color: ",";\n }\n }\n }\n"],["\n .ms-ChoiceField-field.is-checked {\n &:hover {\n &::before,\n &:after {\n border-color: ",";\n }\n }\n }\n"])),function(p){return p.theme.palette.accent;});var templateObject_1$A$1;var CommentActionMenu=function CommentActionMenu(_a){var comment=_a.comment,showEdit=_a.showEdit,showDelete=_a.showDelete,onDelete=_a.onDelete,isEditMode=_a.isEditMode,toggleEditMode=_a.toggleEditMode,originalContent=_a.originalContent,currentContent=_a.currentContent,setContent=_a.setContent,handleTranslate=_a.handleTranslate,showAutoTranslate=_a.showAutoTranslate,onReply=_a.onReply,disabled=_a.disabled;var formatMessage=useIntl().formatMessage;var _b=useState$2(false),showMenuButtons=_b[0],setShowMenuButtons=_b[1];var menuButton=useRef$1(null);return jsxs(Fragment,{children:[jsx$1("div",__assign$1({ref:menuButton},{children:jsx$1(MenuButton$1,{"data-menu-button":comment.id,iconProps:{iconName:'MoreVertical'},onClick:function(){return setShowMenuButtons(!showMenuButtons);},ariaLabel:formatMessage({id:'AriaLabel.contextMenuButton'}),disabled:disabled},void 0)}),void 0),showMenuButtons&&jsx$1(StyledCallout$4,__assign$1({"data-context-menu":true,target:menuButton.current,onDismiss:function(){return setShowMenuButtons(false);}},{children:jsxs(Buttons$5,{children:[jsx$1(Tooltip,__assign$1({resourceKey:'Comment.replyButton.tooltip',values:{name:comment.sender.displayName}},{children:jsx$1(StyledActionButton$2,{"data-reply-button":comment.id,iconProps:{iconName:'Reply'},onClick:handleReply,text:formatMessage({id:'Comment.replyButton'})},void 0)}),void 0),showAutoTranslate&&jsx$1(AutoTranslateButton,{"data-auto-translate-button":comment.id,originalContent:originalContent,onContentChange:function(content){setShowMenuButtons(false);setContent(content);},content:currentContent,tooltipResourceKey:"Comment.translate.showOriginal",onTranslate:handleTranslate,contentLanguageCode:comment.contentLanguageCode,showLabel:true},void 0),showEdit&&jsx$1(Tooltip,__assign$1({resourceKey:"Comment.edit.tooltip"},{children:jsx$1(StyledActionButton$2,{"data-edit-button":comment.id,iconProps:{iconName:'Edit'},onClick:function(){toggleEditMode(true);setShowMenuButtons(false);},text:formatMessage({id:'Generic.edit'}),disabled:!comment.id||isEditMode},void 0)}),void 0),showDelete&&jsx$1(Tooltip,__assign$1({resourceKey:"Comment.delete.tooltip"},{children:jsx$1(StyledActionButton$2,{"data-delete-button":comment.id,iconProps:{iconName:'Delete'},onClick:function(){onDelete(comment);setShowMenuButtons(false);},text:formatMessage({id:'Generic.Delete'}),disabled:!comment.id||isEditMode},void 0)}),void 0)]},void 0)}),void 0)]},void 0);function handleReply(){onReply===null||onReply===void 0?void 0:onReply(comment.id,comment.sender);setShowMenuButtons(false);}};var Buttons$5=_styled.div.withConfig({displayName:"CommentActionMenu__Buttons",componentId:"sc-qsk1nc-0"})(templateObject_1$z$1||(templateObject_1$z$1=__makeTemplateObject$1(["\n display: flex;\n flex-direction: column;\n"],["\n display: flex;\n flex-direction: column;\n"])));var MenuButton$1=_styled(IconButton).withConfig({displayName:"CommentActionMenu__MenuButton",componentId:"sc-qsk1nc-1"})(templateObject_2$p$1||(templateObject_2$p$1=__makeTemplateObject$1(["\n && {\n width: auto;\n padding: 0;\n\n &[disabled] {\n background: transparent;\n }\n\n i {\n margin: 0;\n font-size: ","px;\n }\n }\n"],["\n && {\n width: auto;\n padding: 0;\n\n &[disabled] {\n background: transparent;\n }\n\n i {\n margin: 0;\n font-size: ","px;\n }\n }\n"])),fontSizeMedium+2);var StyledActionButton$2=_styled(ActionButton).withConfig({displayName:"CommentActionMenu__StyledActionButton",componentId:"sc-qsk1nc-2"})(templateObject_3$g$1||(templateObject_3$g$1=__makeTemplateObject$1(["\n &&& {\n i {\n color: ",";\n }\n }\n"],["\n &&& {\n i {\n color: ",";\n }\n }\n"])),function(p){return p.theme.textColors.default;});var StyledCallout$4=_styled(Callout).withConfig({displayName:"CommentActionMenu__StyledCallout",componentId:"sc-qsk1nc-3"})(templateObject_4$9$2||(templateObject_4$9$2=__makeTemplateObject$1(["\n padding: ","px;\n"],["\n padding: ","px;\n"])),spacingS);var templateObject_1$z$1,templateObject_2$p$1,templateObject_3$g$1,templateObject_4$9$2;var DeleteAttachmentButton=_styled(IconButton$1).withConfig({displayName:"DeleteAttachmentButton",componentId:"sc-d7hswf-0"})(templateObject_1$y$1||(templateObject_1$y$1=__makeTemplateObject$1(["\n && {\n padding: ","px;\n color: ",";\n\n &:hover {\n color: ",";\n }\n\n &:disabled {\n background-color: transparent;\n }\n\n i {\n font-size: 14px;\n }\n }\n"],["\n && {\n padding: ","px;\n color: ",";\n\n &:hover {\n color: ",";\n }\n\n &:disabled {\n background-color: transparent;\n }\n\n i {\n font-size: 14px;\n }\n }\n"])),spacingXs,function(p){return p.theme.textColors.default;},function(p){return p.theme.textColors.default;});var templateObject_1$y$1;var ToggleAllButtons=function ToggleAllButtons(_a){var toggleAll=_a.toggleAll,className=_a.className;var accent=useContext(ThemeContext$1).theme.palette.accent;return jsxs(Host$h$1,__assign$1({className:className},{children:[jsx$1(StyledButton$1$1,__assign$1({onClick:function(){return toggleAll(true);},"data-button-toggle":"selectAll",color:accent},{children:jsx$1(FormattedMessage$1,{id:"Generic.SelectAll"},void 0)}),void 0),jsx$1(StyledButton$1$1,__assign$1({onClick:function(){return toggleAll(false);},"data-button-toggle":"clearAll",color:accent},{children:jsx$1(FormattedMessage$1,{id:"Generic.ClearAll"},void 0)}),void 0)]}),void 0);};var Host$h$1=_styled.div.withConfig({displayName:"ToggleAllButtons__Host",componentId:"sc-kbn3b4-0"})(templateObject_1$x$1||(templateObject_1$x$1=__makeTemplateObject$1(["\n margin-bottom: ","px;\n"],["\n margin-bottom: ","px;\n"])),spacingS);var StyledButton$1$1=_styled(ActionButton).withConfig({displayName:"ToggleAllButtons__StyledButton",componentId:"sc-kbn3b4-1"})(templateObject_2$o$1||(templateObject_2$o$1=__makeTemplateObject$1(["\n && {\n height: 20px;\n padding-left: 0;\n padding-right: 8px;\n font-size: 10pt;\n }\n"],["\n && {\n height: 20px;\n padding-left: 0;\n padding-right: 8px;\n font-size: 10pt;\n }\n"])));var templateObject_1$x$1,templateObject_2$o$1;var InternalTopActionButton=function InternalTopActionButton(props){var iconName=props.iconName,textKey=props.textKey,navLinkProps=__rest$1(props,["iconName","textKey"]);return jsxs(NavLink,__assign$1({},navLinkProps,{children:[iconName&&jsx$1(Icon,{iconName:iconName},void 0),jsx$1(FormattedMessage$1,{id:textKey},void 0)]}),void 0);};_styled(InternalTopActionButton).withConfig({displayName:"TopActionButton",componentId:"sc-1lam7c6-0"})(templateObject_1$w$1||(templateObject_1$w$1=__makeTemplateObject$1(["\n && {\n font-size: initial;\n font-weight: bold;\n margin: 0 0 ","px 0;\n\n display: flex;\n align-items: center;\n align-self: flex-start;\n\n color: ",";\n }\n\n > i {\n padding-right: 8px;\n }\n"],["\n && {\n font-size: initial;\n font-weight: bold;\n margin: 0 0 ","px 0;\n\n display: flex;\n align-items: center;\n align-self: flex-start;\n\n color: ",";\n }\n\n > i {\n padding-right: 8px;\n }\n"])),spacingS,function(p){return p.theme.palette.accent;});var templateObject_1$w$1;_styled(IconButton).withConfig({displayName:"HeaderMenuButton__MenuButton",componentId:"sc-170vvq2-0"})(templateObject_1$v$1||(templateObject_1$v$1=__makeTemplateObject$1([""],[""])));var templateObject_1$v$1;var ChannelTitle=function ChannelTitle(_a){var language=_a.language,channelOrName=_a.channel,role=_a.role,className=_a.className;var user=useCurrentUser();var channels=useContext(LazySubscriptionContext).channels;var displayValue=getChannelDisplayName(channels,channelOrName,user,language);return jsx$1(Host$g$2,__assign$1({title:displayValue,className:className,role:role},{children:displayValue}),void 0);};var Host$g$2=_styled.span.withConfig({displayName:"ChannelTitle__Host",componentId:"sc-1lqd4of-0"})(templateObject_1$u$2||(templateObject_1$u$2=__makeTemplateObject$1(["\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n"],["\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n"])));var ChannelTitles=function ChannelTitles(_a){var channels=_a.channels,language=_a.language;return jsx$1(Fragment,{children:channels.map(function(c,index){var channelKey=isChannel$1(c)?c.id:c;return jsxs("span",{children:[index>0&&', ',jsx$1(ChannelTitle,{channel:c,language:language},void 0)]},channelKey);})},void 0);};function isChannel$1(value){return value.id!=null;}function getChannelDisplayName(allChannels,channelOrName,user,language){// Render the channel name if the channel details have not been loaded yet.
77703
77704
  if(allChannels==null&&!isChannel$1(channelOrName)){return channelOrName;}var channel=isChannel$1(channelOrName)?channelOrName:allChannels.find(function(c){return c.name===channelOrName||c.id===channelOrName;})||{name:channelOrName};if(channel==null){return null;}if(!language){language=getPreferredContentLanguage(user);}var translations=channel.translations||allChannels!=null&&allChannels.filter(function(c){return c.id===channel.id;}).map(function(c){return c.translations;})[0]||{};return language&&translations[language]||translations[user.subscription.defaultLanguage]||channel.name;}var templateObject_1$u$2;_styled(ChannelTitle).withConfig({displayName:"ChannelItem__StyledChannelTitle",componentId:"sc-bumcwu-0"})(templateObject_1$t$2||(templateObject_1$t$2=__makeTemplateObject$1(["\n margin-left: ","px;\n flex: 1 1 auto;\n font-size: ",";\n font-weight: bold;\n"],["\n margin-left: ","px;\n flex: 1 1 auto;\n font-size: ",";\n font-weight: bold;\n"])),function(p){return p.applyMargin?'37':'0';},fontSizeLarge);_styled.div.withConfig({displayName:"ChannelItem__Host",componentId:"sc-bumcwu-1"})(templateObject_2$n$1||(templateObject_2$n$1=__makeTemplateObject$1(["\n display: flex;\n flex-direction: row;\n align-items: center;\n box-sizing: border-box;\n min-height: 62px;\n padding: ","px ","px;\n\n ","\n\n .channel-drag-source {\n display: flex;\n align-items: center;\n flex: 0 0 auto;\n margin-right: 12px;\n\n i {\n font-size: ","px;\n }\n }\n"],["\n display: flex;\n flex-direction: row;\n align-items: center;\n box-sizing: border-box;\n min-height: 62px;\n padding: ","px ","px;\n\n ","\n\n .channel-drag-source {\n display: flex;\n align-items: center;\n flex: 0 0 auto;\n margin-right: 12px;\n\n i {\n font-size: ","px;\n }\n }\n"])),spacingS,spacingS+5,CardBorderInline(2,2),fontSizeLarge);_styled(IconButton).withConfig({displayName:"ChannelItem__StyledIconButton",componentId:"sc-bumcwu-2"})(templateObject_3$f$1||(templateObject_3$f$1=__makeTemplateObject$1(["\n i {\n font-size: ","px;\n }\n"],["\n i {\n font-size: ","px;\n }\n"])),fontSizeLarge);var templateObject_1$t$2,templateObject_2$n$1,templateObject_3$f$1;var ChannelList$1=function ChannelList(_a){var channels=_a.channels,language=_a.language,channelStyleDefinition=_a.channelStyleDefinition,_b=_a.visibleChannelsCount,visibleChannelsCount=_b===void 0?3:_b,onChannelClick=_a.onChannelClick,className=_a.className;if(!channels||channels.length===0){return null;}var showMoreIndicator=channels.length>visibleChannelsCount;return jsxs(Host$e$2,__assign$1({className:className,"data-has-more-indicator":showMoreIndicator},{children:[jsx$1(DisplayedChannels,{channels:channels.slice(0,visibleChannelsCount),language:language,channelStyleDefinition:channelStyleDefinition,onChannelClick:onChannelClick},void 0),showMoreIndicator&&jsx$1(AdditionalChannelsIndicator,{channels:channels.slice(visibleChannelsCount),language:language,styleDefinition:channelStyleDefinition,onChannelClick:onChannelClick},void 0)]}),void 0);};var DisplayedChannels=function DisplayedChannels(_a){var channels=_a.channels,language=_a.language,channelStyleDefinition=_a.channelStyleDefinition,onChannelClick=_a.onChannelClick;return jsx$1(ChannelsHost,__assign$1({"data-channels":true},{children:channels.map(function(c){var Title=jsx$1(ChannelTitle,{channel:c,language:language},void 0);if(onChannelClick){return jsx$1(ClickableChannelTitle,__assign$1({bubbleCount:channels.length,backgroundColor:channelStyleDefinition===null||channelStyleDefinition===void 0?void 0:channelStyleDefinition.backgroundColor,color:channelStyleDefinition===null||channelStyleDefinition===void 0?void 0:channelStyleDefinition.color,onClick:function(){return onChannelClick(c);},"data-rounded-outline":true},{children:Title}),c);}return jsx$1(StyledChannelTitle$1,__assign$1({bubbleCount:channels.length,backgroundColor:channelStyleDefinition===null||channelStyleDefinition===void 0?void 0:channelStyleDefinition.backgroundColor,color:channelStyleDefinition===null||channelStyleDefinition===void 0?void 0:channelStyleDefinition.color},{children:Title}),c);})}),void 0);};var AdditionalChannelsIndicator=function AdditionalChannelsIndicator(_a){var channels=_a.channels,language=_a.language,styleDefinition=_a.styleDefinition,onChannelClick=_a.onChannelClick;var ref=useRef$1();var _b=useState$2(false),showCallout=_b[0],setShowCallout=_b[1];return jsxs(Fragment,{children:[jsx$1(IndicatorHost,__assign$1({ref:ref,backgroundColor:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.backgroundColor,color:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.color},{children:jsx$1(Indicator,__assign$1({onClick:function(){return setShowCallout(true);}},{children:"+"+channels.length}),void 0)}),void 0),showCallout&&jsx$1(StyledCallout$3,__assign$1({target:ref.current,onDismiss:function(){return setShowCallout(false);}},{children:jsx$1(CalloutList,{children:channels.map(function(c){return jsx$1("li",{children:onChannelClick?jsx$1(ActionButton,__assign$1({onClick:function(){return onChannelClick(c);}},{children:jsx$1(ChannelTitle,{channel:c,language:language},void 0)}),void 0):jsx$1(ChannelTitle,{channel:c,language:language},void 0)},c);})},void 0)}),void 0)]},void 0);};var BubbleGap=spacingXs;var IndicatorWidth=50;// We calculate the space available to show the channel bubbles based on the following factors:
77704
77705
  // The full width of the container => 100%
77705
77706
  // Minus the indicator width which might not be there in the case we have 3 channels or less
77706
77707
  var Host$e$2=_styled.div(templateObject_1$s$2||(templateObject_1$s$2=__makeTemplateObject$1(["\n display: flex;\n width: 100%;\n\n &[data-has-more-indicator='true'] {\n [data-channels] {\n width: calc(100% - ","px);\n }\n }\n\n &[data-has-more-indicator='false'] {\n [data-channels] {\n width: 100%;\n }\n }\n"],["\n display: flex;\n width: 100%;\n\n &[data-has-more-indicator='true'] {\n [data-channels] {\n width: calc(100% - ","px);\n }\n }\n\n &[data-has-more-indicator='false'] {\n [data-channels] {\n width: 100%;\n }\n }\n"])),IndicatorWidth+BubbleGap);var ChannelsHost=_styled.div(templateObject_2$m$1||(templateObject_2$m$1=__makeTemplateObject$1(["\n display: flex;\n align-items: center;\n"],["\n display: flex;\n align-items: center;\n"])));// Max channel width: Divide the space by the number of bubbles we need to display minus bubble gap - 6px
77707
- var ClickableChannelTitle=_styled(ActionButton)(templateObject_3$e$2||(templateObject_3$e$2=__makeTemplateObject$1(["\n z-index: 1;\n height: inherit;\n padding: 0;\n\n ","\n span {\n width: 100%;\n }\n"],["\n z-index: 1;\n height: inherit;\n padding: 0;\n\n ","\n span {\n width: 100%;\n }\n"])),function(p){return BubbleStyle(p.bubbleCount,p.backgroundColor,p.color);});var StyledChannelTitle$1=_styled.span(templateObject_4$8$2||(templateObject_4$8$2=__makeTemplateObject$1(["\n ","\n"],["\n ","\n"])),function(p){return BubbleStyle(p.bubbleCount,p.backgroundColor,p.color);});var BubbleStyle=function BubbleStyle(bubbleCount,backgroundColor,color){return css$2(templateObject_7$o||(templateObject_7$o=__makeTemplateObject$1(["\n ","\n\n ","\n\n ","\n "],["\n ","\n\n ","\n\n ","\n "])),bubbleCount&&css$2(templateObject_5$5$2||(templateObject_5$5$2=__makeTemplateObject$1(["\n max-width: calc(100% / "," - ","px);\n "],["\n max-width: calc(100% / "," - ","px);\n "])),bubbleCount,BubbleGap),bubbleCount&&bubbleCount>1&&css$2(templateObject_6$2$2||(templateObject_6$2$2=__makeTemplateObject$1(["\n margin-right: ","px;\n "],["\n margin-right: ","px;\n "])),BubbleGap),HighlightBubble({backgroundColor:backgroundColor,color:color}));};var IndicatorHost=_styled.div(templateObject_8$m||(templateObject_8$m=__makeTemplateObject$1(["\n z-index: 1;\n margin-left: ","px;\n\n ","\n"],["\n z-index: 1;\n margin-left: ","px;\n\n ","\n"])),BubbleGap,function(p){return HighlightBubble({backgroundColor:p.backgroundColor,color:p.color});});var Indicator=_styled(ActionButton)(templateObject_9$g||(templateObject_9$g=__makeTemplateObject$1(["\n &&& {\n height: auto;\n color: inherit;\n padding: 0;\n }\n"],["\n &&& {\n height: auto;\n color: inherit;\n padding: 0;\n }\n"])));var StyledCallout$3=_styled(Callout)(templateObject_10$e||(templateObject_10$e=__makeTemplateObject$1(["\n padding: ","px;\n"],["\n padding: ","px;\n"])),spacingXs);var CalloutList=_styled.ul(templateObject_11$9||(templateObject_11$9=__makeTemplateObject$1(["\n margin: 0;\n padding: 0;\n list-style: none;\n"],["\n margin: 0;\n padding: 0;\n list-style: none;\n"])));var templateObject_1$s$2,templateObject_2$m$1,templateObject_3$e$2,templateObject_4$8$2,templateObject_5$5$2,templateObject_6$2$2,templateObject_7$o,templateObject_8$m,templateObject_9$g,templateObject_10$e,templateObject_11$9;_styled('div').withConfig({displayName:"ChannelSelector__Host",componentId:"sc-2h27u4-0"})(templateObject_1$r$2||(templateObject_1$r$2=__makeTemplateObject$1(["\n width: 100%;\n"],["\n width: 100%;\n"])));var templateObject_1$r$2;var ClickableChannelTitles=function ClickableChannelTitles(_a){var channels=_a.channels,buildChannelFilterUrl=_a.buildChannelFilterUrl,language=_a.language,channelBackgroundColor=_a.channelBackgroundColor,onClick=_a.onClick,className=_a.className;if(!(channels===null||channels===void 0?void 0:channels.length)){return null;}return jsx$1(Host$c$1,__assign$1({className:className,"data-channels":channels.join(',')},{children:channels.map(function(c){var channelKey=isChannel(c)?c.id:c;var title=jsx$1(ChannelBubble,__assign$1({backgroundColor:channelBackgroundColor},{children:jsx$1(ChannelTitle,{channel:c,language:language},void 0)}),void 0);return jsxs("li",{children:[buildChannelFilterUrl&&jsx$1(ChannelLink,__assign$1({"data-channel":true,to:buildChannelFilterUrl(isChannel(c)?c.name:c),"data-rounded-outline":true},{children:title}),void 0),onClick&&jsx$1(StyledActionButton$1,__assign$1({"data-rounded-outline":true,onClick:function(){return onClick(isChannel(c)?c.name:c);}},{children:title}),void 0),!onClick&&!buildChannelFilterUrl&&jsx$1(ChannelBubbleWrapper,{children:title},void 0)]},channelKey);})}),void 0);};function isChannel(value){return value.id!=null;}var Host$c$1=_styled.ul.withConfig({displayName:"ClickableChannelTitles__Host",componentId:"sc-1a7ny18-0"})(templateObject_1$q$2||(templateObject_1$q$2=__makeTemplateObject$1(["\n display: flex;\n flex-wrap: wrap;\n font-size: ","px;\n\n &&& {\n margin: 0;\n padding: 0;\n list-style: none;\n\n li {\n margin: 0;\n span {\n white-space: break-spaces;\n }\n }\n }\n"],["\n display: flex;\n flex-wrap: wrap;\n font-size: ","px;\n\n &&& {\n margin: 0;\n padding: 0;\n list-style: none;\n\n li {\n margin: 0;\n span {\n white-space: break-spaces;\n }\n }\n }\n"])),fontSizeSmall);var ChannelBubble=_styled.div.withConfig({displayName:"ClickableChannelTitles__ChannelBubble",componentId:"sc-1a7ny18-1"})(templateObject_2$l$1||(templateObject_2$l$1=__makeTemplateObject$1(["\n ","\n"],["\n ","\n"])),function(p){return p.backgroundColor?HighlightBubble({backgroundColor:p.backgroundColor}):HighlightBubble();});var ChannelLink=_styled(NavLink).withConfig({displayName:"ClickableChannelTitles__ChannelLink",componentId:"sc-1a7ny18-2"})(templateObject_3$d$2||(templateObject_3$d$2=__makeTemplateObject$1(["\n position: relative;\n z-index: 1;\n color: ",";\n display: inline-block;\n margin: 2px ","px 2px 0;\n"],["\n position: relative;\n z-index: 1;\n color: ",";\n display: inline-block;\n margin: 2px ","px 2px 0;\n"])),function(p){return p.theme.textColors.default;},spacingXs);var ChannelBubbleWrapper=_styled.span.withConfig({displayName:"ClickableChannelTitles__ChannelBubbleWrapper",componentId:"sc-1a7ny18-3"})(templateObject_4$7$2||(templateObject_4$7$2=__makeTemplateObject$1(["\n display: block;\n margin: 2px ","px 2px 0;\n"],["\n display: block;\n margin: 2px ","px 2px 0;\n"])),spacingXs);var StyledActionButton$1=_styled(ActionButton).withConfig({displayName:"ClickableChannelTitles__StyledActionButton",componentId:"sc-1a7ny18-4"})(templateObject_5$4$2||(templateObject_5$4$2=__makeTemplateObject$1(["\n && {\n height: auto;\n padding: 0;\n margin: 2px ","px 2px 0;\n }\n"],["\n && {\n height: auto;\n padding: 0;\n margin: 2px ","px 2px 0;\n }\n"])),spacingXs);var templateObject_1$q$2,templateObject_2$l$1,templateObject_3$d$2,templateObject_4$7$2,templateObject_5$4$2;var ToolbarSearch=function ToolbarSearch(_a){var searchText=_a.searchText,onSearchTextChange=_a.onSearchTextChange,onExecuteSearch=_a.onExecuteSearch,onSearchIconClick=_a.onSearchIconClick,onSearchInputFieldVisibilityChanged=_a.onSearchInputFieldVisibilityChanged;return jsxs(Fragment,{children:[jsx$1(SearchBoxLargeScreen,{children:jsx$1(SearchBox,{searchText:searchText,onSearchTextChange:onSearchTextChange,onExecuteSearch:onExecuteSearch,onSearchInputFieldVisibilityChanged:onSearchInputFieldVisibilityChanged,isToolbarMode:true},void 0)},void 0),jsx$1(SearchIconSmallScreen,{children:jsx$1(ToolbarIconButton,{iconName:"Search",onClick:onSearchIconClick,tooltipResourceKey:"TopBar.search",ariaLabelResourceKey:"TopBar.search"},void 0)},void 0)]},void 0);};var SearchBoxLargeScreen=_styled.div.withConfig({displayName:"ToolbarSearch__SearchBoxLargeScreen",componentId:"sc-1f480ry-0"})(templateObject_1$p$2||(templateObject_1$p$2=__makeTemplateObject$1(["\n display: flex;\n justify-content: flex-end;\n max-width: 300px;\n flex-grow: 1;\n @media (max-width: ","px) {\n display: none;\n }\n"],["\n display: flex;\n justify-content: flex-end;\n max-width: 300px;\n flex-grow: 1;\n @media (max-width: ","px) {\n display: none;\n }\n"])),maxScreenSize.medium);var SearchIconSmallScreen=_styled.div.withConfig({displayName:"ToolbarSearch__SearchIconSmallScreen",componentId:"sc-1f480ry-1"})(templateObject_2$k$1||(templateObject_2$k$1=__makeTemplateObject$1(["\n @media (min-width: ","px) {\n display: none;\n }\n"],["\n @media (min-width: ","px) {\n display: none;\n }\n"])),minScreenSize.medium);var templateObject_1$p$2,templateObject_2$k$1;var Toolbar$1=function Toolbar(_a){var leftSide=_a.leftSide,hideLeftSide=_a.hideLeftSide,rightSide=_a.rightSide,hideRightSide=_a.hideRightSide,search=_a.search,className=_a.className,children=_a.children;var _b=useState$2(false),isSearchInputFieldVisible=_b[0],setIsSearchInputFieldVisible=_b[1];return jsxs(Host$b$2,__assign$1({className:className,"data-content-toolbar":true},{children:[jsxs(Row,{children:[leftSide&&!hideLeftSide&&jsx$1(LeftSide,{children:leftSide},void 0),(rightSide||search)&&!hideRightSide&&jsxs(RightSide,{children:[search&&jsx$1(ToolbarSearch,{searchText:search.searchText,onSearchTextChange:search.onSearchTextChange,onExecuteSearch:search.onExecuteSearch,onSearchIconClick:handleSearchIconClick,onSearchInputFieldVisibilityChanged:function(isVisible){return setIsSearchInputFieldVisible(isVisible);}},void 0),rightSide]},void 0)]},void 0),children,search&&isSearchInputFieldVisible&&jsx$1(SearchInputRow,{children:jsx$1(Search,{onClear:handleClearSearch,searchText:search.searchText,onChange:search.onSearchTextChange,onExecuteSearch:search.onExecuteSearch,useLightTheme:true},void 0)},void 0)]}),void 0);function handleSearchIconClick(){var shouldShowSearch=!isSearchInputFieldVisible;if(shouldShowSearch){setIsSearchInputFieldVisible(true);}else {handleClearSearch();}}function handleClearSearch(){var _a;(_a=search.onSearchTextChange)===null||_a===void 0?void 0:_a.call(search,'');setIsSearchInputFieldVisible(false);}};var Host$b$2=_styled.div.withConfig({displayName:"Toolbar__Host",componentId:"sc-16ftbxt-0"})(templateObject_1$o$2||(templateObject_1$o$2=__makeTemplateObject$1(["\n display: flex;\n flex: 1 1 auto;\n flex-direction: column;\n justify-content: center;\n background-color: ",";\n box-shadow: 1px 1px 4px grey;\n padding: ","px;\n min-height: 36px;\n\n // min-width required if you want to use overflow:hidden or similar stuff on parent elements\n // see: https://stackoverflow.com/questions/43809612/prevent-a-child-element-from-overflowing-its-parent-in-flexbox\n min-width: 0;\n"],["\n display: flex;\n flex: 1 1 auto;\n flex-direction: column;\n justify-content: center;\n background-color: ",";\n box-shadow: 1px 1px 4px grey;\n padding: ","px;\n min-height: 36px;\n\n // min-width required if you want to use overflow:hidden or similar stuff on parent elements\n // see: https://stackoverflow.com/questions/43809612/prevent-a-child-element-from-overflowing-its-parent-in-flexbox\n min-width: 0;\n"])),function(p){return p.theme.palette.white;},spacingXxs);var LeftSide=_styled.div.withConfig({displayName:"Toolbar__LeftSide",componentId:"sc-16ftbxt-1"})(templateObject_2$j$2||(templateObject_2$j$2=__makeTemplateObject$1(["\n display: flex;\n\n flex-wrap: nowrap;\n flex: 1 1 auto;\n\n min-width: 0;\n"],["\n display: flex;\n\n flex-wrap: nowrap;\n flex: 1 1 auto;\n\n min-width: 0;\n"])));var RightSide=_styled.div.withConfig({displayName:"Toolbar__RightSide",componentId:"sc-16ftbxt-2"})(templateObject_3$c$2||(templateObject_3$c$2=__makeTemplateObject$1(["\n display: flex;\n align-items: center;\n justify-content: flex-end;\n flex: 1 1 auto;\n"],["\n display: flex;\n align-items: center;\n justify-content: flex-end;\n flex: 1 1 auto;\n"])));var Row=_styled.div.withConfig({displayName:"Toolbar__Row",componentId:"sc-16ftbxt-3"})(templateObject_4$6$2||(templateObject_4$6$2=__makeTemplateObject$1(["\n display: flex;\n flex: 1 1 auto;\n\n min-width: 0;\n"],["\n display: flex;\n flex: 1 1 auto;\n\n min-width: 0;\n"])));var SearchInputRow=_styled.div.withConfig({displayName:"Toolbar__SearchInputRow",componentId:"sc-16ftbxt-4"})(templateObject_5$3$2||(templateObject_5$3$2=__makeTemplateObject$1(["\n display: flex;\n width: 100%;\n @media (min-width: ","px) {\n display: none;\n }\n"],["\n display: flex;\n width: 100%;\n @media (min-width: ","px) {\n display: none;\n }\n"])),minScreenSize.medium);var templateObject_1$o$2,templateObject_2$j$2,templateObject_3$c$2,templateObject_4$6$2,templateObject_5$3$2;_styled(Toolbar$1).withConfig({displayName:"ChromelessToolbar__StyledToolbar",componentId:"sc-1vovywb-0"})(templateObject_1$n$2||(templateObject_1$n$2=__makeTemplateObject$1(["\n margin-bottom: ","px;\n"],["\n margin-bottom: ","px;\n"])),spacingM);createGlobalStyle(templateObject_2$i$2||(templateObject_2$i$2=__makeTemplateObject$1(["\n [data-detail-page-container] {\n [data-content-toolbar] {\n @media (max-width: ","px) {\n margin-top: ","px;\n }\n }\n }\n"],["\n [data-detail-page-container] {\n [data-content-toolbar] {\n @media (max-width: ","px) {\n margin-top: ","px;\n }\n }\n }\n"])),minScreenSize.large,spacingM);var templateObject_1$n$2,templateObject_2$i$2;// todo: Apply this to all pages and make sure it works in IE
77708
- _styled.p.withConfig({displayName:"PageDescription",componentId:"sc-xcsmz7-0"})(templateObject_1$m$2||(templateObject_1$m$2=__makeTemplateObject$1(["\n display: flex;\n flex-wrap: wrap;\n margin: 0;\n line-height: 1.5em;\n span {\n flex: 1 1 100%;\n }\n"],["\n display: flex;\n flex-wrap: wrap;\n margin: 0;\n line-height: 1.5em;\n span {\n flex: 1 1 100%;\n }\n"])));var templateObject_1$m$2;_styled.div.withConfig({displayName:"DragSource__Host",componentId:"sc-qzjyds-0"})(templateObject_1$l$2||(templateObject_1$l$2=__makeTemplateObject$1([""],[""])));var templateObject_1$l$2;var EmojiButton=function EmojiButton(_a){var onEmojiSelected=_a.onEmojiSelected,disabled=_a.disabled;var iconButton=useRef$1(null);var _b=useState$2(false),showCallout=_b[0],setShowCallout=_b[1];var formatMessage=useIntl().formatMessage;return jsxs(Fragment,{children:[jsx$1(ButtonWrapper,__assign$1({ref:iconButton},{children:jsx$1(IconButton,{"data-emoji-button":true,iconProps:{iconName:'Emoji2'},onClick:function(){return setShowCallout(true);},disabled:disabled,ariaLabel:formatMessage({id:'AriaLabel.emojiButton'})},void 0)}),void 0),showCallout&&jsx$1(StyledCallout$2$1,__assign$1({directionalHint:DirectionalHint.topCenter,target:iconButton.current,onDismiss:function(){return setShowCallout(false);},isBeakVisible:false,gapSpace:10,preventDismissOnScroll:true},{children:jsx$1(EmojiPicker,{onSelect:handleSelect},void 0)}),void 0)]},void 0);function handleSelect(emoji){setShowCallout(false);onEmojiSelected(emoji.native);}};var ButtonWrapper=_styled.div.withConfig({displayName:"EmojiButton__ButtonWrapper",componentId:"sc-1eq2zlz-0"})(templateObject_1$k$2||(templateObject_1$k$2=__makeTemplateObject$1([""],[""])));var StyledCallout$2$1=_styled(Callout).withConfig({displayName:"EmojiButton__StyledCallout",componentId:"sc-1eq2zlz-1"})(templateObject_2$h$2||(templateObject_2$h$2=__makeTemplateObject$1(["\n border-radius: 10px;\n padding: 5px;\n"],["\n border-radius: 10px;\n padding: 5px;\n"])));var LazyEmojiPicker=/*#__PURE__*/lazy$1(function(){return import('./EmojiPicker.esm.esm.js');});var EmojiPicker=function EmojiPicker(_a){var onSelect=_a.onSelect;var windowSize=useWindowSize$2();return jsx$1(Suspense,__assign$1({fallback:jsx$1(EmojiPickerSuspenseHost,__assign$1({isSmaller:windowSize.width<minScreenSize.small},{children:jsx$1(Spinner,{},void 0)}),void 0)},{children:jsx$1(LazyEmojiPicker,{onSelect:onSelect},void 0)}),void 0);};var EmojiPickerSuspenseHost=_styled.div.withConfig({displayName:"EmojiButton__EmojiPickerSuspenseHost",componentId:"sc-1eq2zlz-2"})(templateObject_3$b$2||(templateObject_3$b$2=__makeTemplateObject$1(["\n // we set an initial width which is similar to what the emoji picker will be once it's loaded\n // we have to do this so the callout is rendered in the correct place\n width: ","px;\n height: 400px;\n"],["\n // we set an initial width which is similar to what the emoji picker will be once it's loaded\n // we have to do this so the callout is rendered in the correct place\n width: ","px;\n height: 400px;\n"])),function(p){return p.isSmaller?319:400;});var templateObject_1$k$2,templateObject_2$h$2,templateObject_3$b$2;var GiphyAttribution=function GiphyAttribution(){var env=useConfiguration();return jsx$1(AttributionHost,{children:jsx$1("a",__assign$1({href:"https://giphy.com",target:"_blank",rel:"noreferrer"},{children:jsx$1("img",{src:env.webAppUrl+"/assets/giphy/PoweredBy_200px-White_HorizText.png",alt:"Giphy Attribution"},void 0)}),void 0)},void 0);};var AttributionHost=_styled.div(templateObject_1$j$2||(templateObject_1$j$2=__makeTemplateObject$1(["\n text-align: right;\n margin-top: ","px;\n"],["\n text-align: right;\n margin-top: ","px;\n"])),spacingXs);var templateObject_1$j$2;var GifSelector=function GifSelector(_a){var _b,_c;var onGifClick=_a.onGifClick,className=_a.className;var clientConfig=useClientConfig();var formatMessage=useIntl().formatMessage;var gf=new dist$1.GiphyFetch(clientConfig.giphy.apiKey);var _d=useState$2(null),searchText=_d[0],setSearchText=_d[1];var debouncedSearchText=useDebounce(searchText,500)[0];var windowSize=useWindowSize$2();var _e=usePromise$2(getGifs,null,[debouncedSearchText]),gifs=_e[0],loading=_e[1];var gifSize=windowSize.width<550?80:100;return jsxs(Host$9$1,__assign$1({className:className},{children:[jsx$1(SearchBox$1,{placeholder:formatMessage({id:'Gif.searchPlaceHolder'}),iconProps:{iconName:'Search'},onChange:function(_,v){return setSearchText(v);},autoFocus:true},void 0),jsxs(GifContainer,__assign$1({columnWidth:gifSize},{children:[loading&&jsx$1(Spinner,{delay:300},void 0),((_b=gifs===null||gifs===void 0?void 0:gifs.data)===null||_b===void 0?void 0:_b.length)===0&&jsx$1(FormattedMessage$1,{id:"Generic.noResultsFound"},void 0),(_c=gifs===null||gifs===void 0?void 0:gifs.data)===null||_c===void 0?void 0:_c.map(function(g){return jsx$1(ClickableGif,{gif:g,width:gifSize,height:gifSize,noLink:true,hideAttribution:true,onGifClick:onGifClick},g.id);})]}),void 0)]}),void 0);function getGifs(){if(!debouncedSearchText){return gf.trending({limit:21});}return gf.search(debouncedSearchText,{limit:21});}};var Host$9$1=_styled.div.withConfig({displayName:"GifSelector__Host",componentId:"sc-lame6k-0"})(templateObject_1$i$2||(templateObject_1$i$2=__makeTemplateObject$1(["\n padding: ","px;\n"],["\n padding: ","px;\n"])),spacingXs);var GifContainer=_styled.div.withConfig({displayName:"GifSelector__GifContainer",componentId:"sc-lame6k-1"})(templateObject_2$g$2||(templateObject_2$g$2=__makeTemplateObject$1(["\n margin-top: ","px;\n display: grid;\n grid-template-columns: repeat(auto-fit, ","px);\n grid-gap: ","px;\n justify-content: space-around;\n"],["\n margin-top: ","px;\n display: grid;\n grid-template-columns: repeat(auto-fit, ","px);\n grid-gap: ","px;\n justify-content: space-around;\n"])),spacingS,function(p){return p.columnWidth;},spacingXs);var ClickableGif=_styled(dist$4.Gif).withConfig({displayName:"GifSelector__ClickableGif",componentId:"sc-lame6k-2"})(templateObject_3$a$2||(templateObject_3$a$2=__makeTemplateObject$1(["\n cursor: pointer;\n"],["\n cursor: pointer;\n"])));var templateObject_1$i$2,templateObject_2$g$2,templateObject_3$a$2;var GifSelectorCallout=function GifSelectorCallout(_a){var target=_a.target,onGifClick=_a.onGifClick,onDismiss=_a.onDismiss;return jsxs(StyledCallout$1$1,__assign$1({directionalHint:DirectionalHint.topCenter,target:target,onDismiss:onDismiss,isBeakVisible:false,gapSpace:10,preventDismissOnResize:true,preventDismissOnScroll:true},{children:[jsx$1(StyledGifSelector,{onGifClick:onGifClick},void 0),jsx$1(GiphyAttribution,{},void 0)]}),void 0);};var StyledCallout$1$1=_styled(Callout)(templateObject_1$h$2||(templateObject_1$h$2=__makeTemplateObject$1(["\n border-radius: 10px;\n padding: 5px;\n width: 360px;\n height: 450px;\n"],["\n border-radius: 10px;\n padding: 5px;\n width: 360px;\n height: 450px;\n"])));var StyledGifSelector=_styled(GifSelector)(templateObject_2$f$2||(templateObject_2$f$2=__makeTemplateObject$1(["\n overflow-y: auto;\n height: 400px;\n"],["\n overflow-y: auto;\n height: 400px;\n"])));var templateObject_1$h$2,templateObject_2$f$2;createGlobalStyle(templateObject_1$g$2||(templateObject_1$g$2=__makeTemplateObject$1(["\n .lt-reach.dialog-gif-selector {\n .ms-Dialog-main {\n width: 400px !important;\n\n @media (max-width: ","px) {\n width: 100% !important;\n }\n }\n}\n"],["\n .lt-reach.dialog-gif-selector {\n .ms-Dialog-main {\n width: 400px !important;\n\n @media (max-width: ","px) {\n width: 100% !important;\n }\n }\n}\n"])),maxScreenSize.small);_styled(GifSelector).withConfig({displayName:"GifSelectorDialog__StyledDialogGifSelector",componentId:"sc-t6p48w-0"})(templateObject_2$e$2||(templateObject_2$e$2=__makeTemplateObject$1(["\n margin-top: ","px;\n"],["\n margin-top: ","px;\n"])),spacingS);var templateObject_1$g$2,templateObject_2$e$2;var GifButton=function GifButton(_a){var disabled=_a.disabled,onGifClick=_a.onGifClick;var features=useFeatures();var formatMessage=useIntl().formatMessage;var refGifButton=useRef$1();var _b=useState$2(false),showGifSelector=_b[0],setShowGifSelector=_b[1];if(!features.giphy){return null;}return jsxs(Fragment,{children:[jsx$1("div",__assign$1({ref:refGifButton},{children:jsx$1(IconButton,{iconProps:{iconName:'Gif'},onClick:function(){return setShowGifSelector(true);},disabled:disabled,"data-button-type":"gif",ariaLabel:formatMessage({id:'AriaLabel.gifButton'})},void 0)}),void 0),showGifSelector&&jsx$1(Fragment,{children:jsx$1(GifSelectorCallout,{target:refGifButton.current,onGifClick:handleGifClick,onDismiss:function(){return setShowGifSelector(false);}},void 0)},void 0)]},void 0);function handleGifClick(gif){setShowGifSelector(false);onGifClick({id:gif.id.toString(),filename:gif.title,url:gif.embed_url,type:AttachmentType.Giphy});}};var GifView=function GifView(_a){var gifInfo=_a.gifInfo,className=_a.className;var clientConfig=useClientConfig();var _b=useState$2(),gif=_b[0],setGif=_b[1];useEffect$1(function(){var gf=new dist$1.GiphyFetch(clientConfig.giphy.apiKey);gf.gif(gifInfo.id).then(function(r){return setGif(r.data);});},[clientConfig.giphy.apiKey,gifInfo.id]);if(!gif){return null;}return jsx$1(Host$8$1,__assign$1({className:className},{children:jsx$1(StyledGif,{gif:gif,width:300,noLink:true,hideAttribution:true},void 0)}),void 0);};var Host$8$1=_styled.div(templateObject_1$f$2||(templateObject_1$f$2=__makeTemplateObject$1([""],[""])));var StyledGif=_styled(dist$4.Gif)(templateObject_2$d$2||(templateObject_2$d$2=__makeTemplateObject$1(["\n && {\n max-width: 100%;\n }\n\n @media (max-width: ","px) {\n /* because the style is inline set we need to overwrite it via !important */\n width: auto !important;\n height: auto !important;\n > div {\n width: auto !important;\n height: auto !important;\n\n img {\n max-width: 100%;\n height: auto;\n }\n }\n }\n"],["\n && {\n max-width: 100%;\n }\n\n @media (max-width: ","px) {\n /* because the style is inline set we need to overwrite it via !important */\n width: auto !important;\n height: auto !important;\n > div {\n width: auto !important;\n height: auto !important;\n\n img {\n max-width: 100%;\n height: auto;\n }\n }\n }\n"])),maxScreenSize.small);var templateObject_1$f$2,templateObject_2$d$2;var GifEditList=function GifEditList(_a){var attachments=_a.attachments,onDeleteClick=_a.onDeleteClick,className=_a.className;var formatMessage=useIntl().formatMessage;var gifs=attachments.filter(function(a){return a.type===AttachmentType.Giphy;});if(gifs.length===0){return null;}return jsx$1(Host$7$1,__assign$1({className:className,"data-gif-attachment-list":true},{children:gifs.map(function(gif){return jsx$1(StyledAttachmentHost$1,__assign$1({domIdentifier:"gif",deleteButton:jsx$1(DeleteAttachmentButton,{"data-remove-attachment-button":gif.id,iconProps:{iconName:'ChromeClose'},onClick:function(){return onDeleteClick(gif);},ariaLabel:formatMessage({id:'AriaLabel.removeAttachmentButton'})},void 0)},{children:jsx$1(GifView,{gifInfo:gif},void 0)}),gif.id);})}),void 0);};var Host$7$1=_styled.div.withConfig({displayName:"GifEditList__Host",componentId:"sc-95dldh-0"})(templateObject_1$e$2||(templateObject_1$e$2=__makeTemplateObject$1(["\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n padding-bottom: ","px;\n"],["\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n padding-bottom: ","px;\n"])),spacingM);var StyledAttachmentHost$1=_styled(AttachmentHost).withConfig({displayName:"GifEditList__StyledAttachmentHost",componentId:"sc-95dldh-1"})(templateObject_2$c$2||(templateObject_2$c$2=__makeTemplateObject$1(["\n width: auto;\n"],["\n width: auto;\n"])));var templateObject_1$e$2,templateObject_2$c$2;var GifList=function GifList(_a){var attachments=_a.attachments,className=_a.className;var gifs=attachments.filter(function(a){return a.type===AttachmentType.Giphy;});if(gifs.length===0){return null;}return jsx$1(Host$6$1,__assign$1({className:className,"data-gif-url-preview":gifs[0].id},{children:jsx$1(StyledAttachmentHost,{children:jsx$1(GifView,{gifInfo:gifs[0]},void 0)},void 0)}),void 0);};var Host$6$1=_styled.div.withConfig({displayName:"GifList__Host",componentId:"sc-8gg7fj-0"})(templateObject_1$d$2||(templateObject_1$d$2=__makeTemplateObject$1(["\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n"],["\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n"])));var StyledAttachmentHost=_styled(AttachmentHost).withConfig({displayName:"GifList__StyledAttachmentHost",componentId:"sc-8gg7fj-1"})(templateObject_2$b$2||(templateObject_2$b$2=__makeTemplateObject$1(["\n width: auto;\n margin: ","px 0 0 0;\n"],["\n width: auto;\n margin: ","px 0 0 0;\n"])),spacingS);var templateObject_1$d$2,templateObject_2$b$2;var PageViewType;(function(PageViewType){PageViewType["PostsGroupView"]="PostsGroupView";})(PageViewType||(PageViewType={}));function usePageViewTracker(basePath,itemId,viewType){var _this=this;var user=useCurrentUser();var sendBeacon=useBeaconHandler();var onRequestToken=useContext(AuthenticationContext).onRequestToken;var performanceTimer=usePerformanceTimer();var viewEndCallback=useRef$1(function(){return null;});useBeforeUnload$2(trackViewEnd);useEffect$1(function(){(function(){return __awaiter$1(_this,void 0,void 0,function(){var currentToken;return __generator$1(this,function(_a){switch(_a.label){case 0:if(!itemId||!user){return [2/*return*/];}return [4/*yield*/,onRequestToken()];case 1:currentToken=_a.sent();viewEndCallback.current=trackPageView(basePath,user.subscription.id,itemId,viewType,currentToken);return [2/*return*/];}});});})();return function(){return trackViewEnd();};// eslint-disable-next-line react-hooks/exhaustive-deps
77708
+ var ClickableChannelTitle=_styled(ActionButton)(templateObject_3$e$2||(templateObject_3$e$2=__makeTemplateObject$1(["\n z-index: 1;\n height: inherit;\n padding: 0;\n\n ","\n span {\n width: 100%;\n }\n"],["\n z-index: 1;\n height: inherit;\n padding: 0;\n\n ","\n span {\n width: 100%;\n }\n"])),function(p){return BubbleStyle(p.bubbleCount,p.backgroundColor,p.color);});var StyledChannelTitle$1=_styled.span(templateObject_4$8$2||(templateObject_4$8$2=__makeTemplateObject$1(["\n ","\n"],["\n ","\n"])),function(p){return BubbleStyle(p.bubbleCount,p.backgroundColor,p.color);});var BubbleStyle=function BubbleStyle(bubbleCount,backgroundColor,color){return css$2(templateObject_7$n||(templateObject_7$n=__makeTemplateObject$1(["\n ","\n\n ","\n\n ","\n "],["\n ","\n\n ","\n\n ","\n "])),bubbleCount&&css$2(templateObject_5$5$2||(templateObject_5$5$2=__makeTemplateObject$1(["\n max-width: calc(100% / "," - ","px);\n "],["\n max-width: calc(100% / "," - ","px);\n "])),bubbleCount,BubbleGap),bubbleCount&&bubbleCount>1&&css$2(templateObject_6$2$2||(templateObject_6$2$2=__makeTemplateObject$1(["\n margin-right: ","px;\n "],["\n margin-right: ","px;\n "])),BubbleGap),HighlightBubble({backgroundColor:backgroundColor,color:color}));};var IndicatorHost=_styled.div(templateObject_8$l||(templateObject_8$l=__makeTemplateObject$1(["\n z-index: 1;\n margin-left: ","px;\n\n ","\n"],["\n z-index: 1;\n margin-left: ","px;\n\n ","\n"])),BubbleGap,function(p){return HighlightBubble({backgroundColor:p.backgroundColor,color:p.color});});var Indicator=_styled(ActionButton)(templateObject_9$g||(templateObject_9$g=__makeTemplateObject$1(["\n &&& {\n height: auto;\n color: inherit;\n padding: 0;\n }\n"],["\n &&& {\n height: auto;\n color: inherit;\n padding: 0;\n }\n"])));var StyledCallout$3=_styled(Callout)(templateObject_10$e||(templateObject_10$e=__makeTemplateObject$1(["\n padding: ","px;\n"],["\n padding: ","px;\n"])),spacingXs);var CalloutList=_styled.ul(templateObject_11$9||(templateObject_11$9=__makeTemplateObject$1(["\n margin: 0;\n padding: 0;\n list-style: none;\n"],["\n margin: 0;\n padding: 0;\n list-style: none;\n"])));var templateObject_1$s$2,templateObject_2$m$1,templateObject_3$e$2,templateObject_4$8$2,templateObject_5$5$2,templateObject_6$2$2,templateObject_7$n,templateObject_8$l,templateObject_9$g,templateObject_10$e,templateObject_11$9;_styled('div').withConfig({displayName:"ChannelSelector__Host",componentId:"sc-2h27u4-0"})(templateObject_1$r$2||(templateObject_1$r$2=__makeTemplateObject$1(["\n width: 100%;\n"],["\n width: 100%;\n"])));var templateObject_1$r$2;var ClickableChannelTitles=function ClickableChannelTitles(_a){var channels=_a.channels,buildChannelFilterUrl=_a.buildChannelFilterUrl,language=_a.language,channelBackgroundColor=_a.channelBackgroundColor,onClick=_a.onClick,className=_a.className;if(!(channels===null||channels===void 0?void 0:channels.length)){return null;}return jsx$1(Host$c$1,__assign$1({className:className,"data-channels":channels.join(',')},{children:channels.map(function(c){var channelKey=isChannel(c)?c.id:c;var title=jsx$1(ChannelBubble,__assign$1({backgroundColor:channelBackgroundColor},{children:jsx$1(ChannelTitle,{channel:c,language:language},void 0)}),void 0);return jsxs("li",{children:[buildChannelFilterUrl&&jsx$1(ChannelLink,__assign$1({"data-channel":true,to:buildChannelFilterUrl(isChannel(c)?c.name:c),"data-rounded-outline":true},{children:title}),void 0),onClick&&jsx$1(StyledActionButton$1,__assign$1({"data-rounded-outline":true,onClick:function(){return onClick(isChannel(c)?c.name:c);}},{children:title}),void 0),!onClick&&!buildChannelFilterUrl&&jsx$1(ChannelBubbleWrapper,{children:title},void 0)]},channelKey);})}),void 0);};function isChannel(value){return value.id!=null;}var Host$c$1=_styled.ul.withConfig({displayName:"ClickableChannelTitles__Host",componentId:"sc-1a7ny18-0"})(templateObject_1$q$2||(templateObject_1$q$2=__makeTemplateObject$1(["\n display: flex;\n flex-wrap: wrap;\n font-size: ","px;\n\n &&& {\n margin: 0;\n padding: 0;\n list-style: none;\n\n li {\n margin: 0;\n span {\n white-space: break-spaces;\n }\n }\n }\n"],["\n display: flex;\n flex-wrap: wrap;\n font-size: ","px;\n\n &&& {\n margin: 0;\n padding: 0;\n list-style: none;\n\n li {\n margin: 0;\n span {\n white-space: break-spaces;\n }\n }\n }\n"])),fontSizeSmall);var ChannelBubble=_styled.div.withConfig({displayName:"ClickableChannelTitles__ChannelBubble",componentId:"sc-1a7ny18-1"})(templateObject_2$l$1||(templateObject_2$l$1=__makeTemplateObject$1(["\n ","\n"],["\n ","\n"])),function(p){return p.backgroundColor?HighlightBubble({backgroundColor:p.backgroundColor}):HighlightBubble();});var ChannelLink=_styled(NavLink).withConfig({displayName:"ClickableChannelTitles__ChannelLink",componentId:"sc-1a7ny18-2"})(templateObject_3$d$2||(templateObject_3$d$2=__makeTemplateObject$1(["\n position: relative;\n z-index: 1;\n color: ",";\n display: inline-block;\n margin: 2px ","px 2px 0;\n"],["\n position: relative;\n z-index: 1;\n color: ",";\n display: inline-block;\n margin: 2px ","px 2px 0;\n"])),function(p){return p.theme.textColors.default;},spacingXs);var ChannelBubbleWrapper=_styled.span.withConfig({displayName:"ClickableChannelTitles__ChannelBubbleWrapper",componentId:"sc-1a7ny18-3"})(templateObject_4$7$2||(templateObject_4$7$2=__makeTemplateObject$1(["\n display: block;\n margin: 2px ","px 2px 0;\n"],["\n display: block;\n margin: 2px ","px 2px 0;\n"])),spacingXs);var StyledActionButton$1=_styled(ActionButton).withConfig({displayName:"ClickableChannelTitles__StyledActionButton",componentId:"sc-1a7ny18-4"})(templateObject_5$4$2||(templateObject_5$4$2=__makeTemplateObject$1(["\n && {\n height: auto;\n padding: 0;\n margin: 2px ","px 2px 0;\n }\n"],["\n && {\n height: auto;\n padding: 0;\n margin: 2px ","px 2px 0;\n }\n"])),spacingXs);var templateObject_1$q$2,templateObject_2$l$1,templateObject_3$d$2,templateObject_4$7$2,templateObject_5$4$2;var ToolbarSearch=function ToolbarSearch(_a){var searchText=_a.searchText,onSearchTextChange=_a.onSearchTextChange,onExecuteSearch=_a.onExecuteSearch,onSearchIconClick=_a.onSearchIconClick,onSearchInputFieldVisibilityChanged=_a.onSearchInputFieldVisibilityChanged;return jsxs(Fragment,{children:[jsx$1(SearchBoxLargeScreen,{children:jsx$1(SearchBox,{searchText:searchText,onSearchTextChange:onSearchTextChange,onExecuteSearch:onExecuteSearch,onSearchInputFieldVisibilityChanged:onSearchInputFieldVisibilityChanged,isToolbarMode:true},void 0)},void 0),jsx$1(SearchIconSmallScreen,{children:jsx$1(ToolbarIconButton,{iconName:"Search",onClick:onSearchIconClick,tooltipResourceKey:"TopBar.search",ariaLabelResourceKey:"TopBar.search"},void 0)},void 0)]},void 0);};var SearchBoxLargeScreen=_styled.div.withConfig({displayName:"ToolbarSearch__SearchBoxLargeScreen",componentId:"sc-1f480ry-0"})(templateObject_1$p$2||(templateObject_1$p$2=__makeTemplateObject$1(["\n display: flex;\n justify-content: flex-end;\n max-width: 300px;\n flex-grow: 1;\n @media (max-width: ","px) {\n display: none;\n }\n"],["\n display: flex;\n justify-content: flex-end;\n max-width: 300px;\n flex-grow: 1;\n @media (max-width: ","px) {\n display: none;\n }\n"])),maxScreenSize.medium);var SearchIconSmallScreen=_styled.div.withConfig({displayName:"ToolbarSearch__SearchIconSmallScreen",componentId:"sc-1f480ry-1"})(templateObject_2$k$1||(templateObject_2$k$1=__makeTemplateObject$1(["\n @media (min-width: ","px) {\n display: none;\n }\n"],["\n @media (min-width: ","px) {\n display: none;\n }\n"])),minScreenSize.medium);var templateObject_1$p$2,templateObject_2$k$1;var Toolbar$1=function Toolbar(_a){var leftSide=_a.leftSide,hideLeftSide=_a.hideLeftSide,rightSide=_a.rightSide,hideRightSide=_a.hideRightSide,search=_a.search,className=_a.className,children=_a.children;var _b=useState$2(false),isSearchInputFieldVisible=_b[0],setIsSearchInputFieldVisible=_b[1];return jsxs(Host$b$2,__assign$1({className:className,"data-content-toolbar":true},{children:[jsxs(Row,{children:[leftSide&&!hideLeftSide&&jsx$1(LeftSide$1,{children:leftSide},void 0),(rightSide||search)&&!hideRightSide&&jsxs(RightSide$1,{children:[search&&jsx$1(ToolbarSearch,{searchText:search.searchText,onSearchTextChange:search.onSearchTextChange,onExecuteSearch:search.onExecuteSearch,onSearchIconClick:handleSearchIconClick,onSearchInputFieldVisibilityChanged:function(isVisible){return setIsSearchInputFieldVisible(isVisible);}},void 0),rightSide]},void 0)]},void 0),children,search&&isSearchInputFieldVisible&&jsx$1(SearchInputRow,{children:jsx$1(Search,{onClear:handleClearSearch,searchText:search.searchText,onChange:search.onSearchTextChange,onExecuteSearch:search.onExecuteSearch,useLightTheme:true},void 0)},void 0)]}),void 0);function handleSearchIconClick(){var shouldShowSearch=!isSearchInputFieldVisible;if(shouldShowSearch){setIsSearchInputFieldVisible(true);}else {handleClearSearch();}}function handleClearSearch(){var _a;(_a=search.onSearchTextChange)===null||_a===void 0?void 0:_a.call(search,'');setIsSearchInputFieldVisible(false);}};var Host$b$2=_styled.div.withConfig({displayName:"Toolbar__Host",componentId:"sc-16ftbxt-0"})(templateObject_1$o$2||(templateObject_1$o$2=__makeTemplateObject$1(["\n display: flex;\n flex: 1 1 auto;\n flex-direction: column;\n justify-content: center;\n background-color: ",";\n box-shadow: 1px 1px 4px grey;\n padding: ","px;\n min-height: 36px;\n\n // min-width required if you want to use overflow:hidden or similar stuff on parent elements\n // see: https://stackoverflow.com/questions/43809612/prevent-a-child-element-from-overflowing-its-parent-in-flexbox\n min-width: 0;\n"],["\n display: flex;\n flex: 1 1 auto;\n flex-direction: column;\n justify-content: center;\n background-color: ",";\n box-shadow: 1px 1px 4px grey;\n padding: ","px;\n min-height: 36px;\n\n // min-width required if you want to use overflow:hidden or similar stuff on parent elements\n // see: https://stackoverflow.com/questions/43809612/prevent-a-child-element-from-overflowing-its-parent-in-flexbox\n min-width: 0;\n"])),function(p){return p.theme.palette.white;},spacingXxs);var LeftSide$1=_styled.div.withConfig({displayName:"Toolbar__LeftSide",componentId:"sc-16ftbxt-1"})(templateObject_2$j$2||(templateObject_2$j$2=__makeTemplateObject$1(["\n display: flex;\n\n flex-wrap: nowrap;\n flex: 1 1 auto;\n\n min-width: 0;\n"],["\n display: flex;\n\n flex-wrap: nowrap;\n flex: 1 1 auto;\n\n min-width: 0;\n"])));var RightSide$1=_styled.div.withConfig({displayName:"Toolbar__RightSide",componentId:"sc-16ftbxt-2"})(templateObject_3$c$2||(templateObject_3$c$2=__makeTemplateObject$1(["\n display: flex;\n align-items: center;\n justify-content: flex-end;\n flex: 1 1 auto;\n"],["\n display: flex;\n align-items: center;\n justify-content: flex-end;\n flex: 1 1 auto;\n"])));var Row=_styled.div.withConfig({displayName:"Toolbar__Row",componentId:"sc-16ftbxt-3"})(templateObject_4$6$2||(templateObject_4$6$2=__makeTemplateObject$1(["\n display: flex;\n flex: 1 1 auto;\n\n min-width: 0;\n"],["\n display: flex;\n flex: 1 1 auto;\n\n min-width: 0;\n"])));var SearchInputRow=_styled.div.withConfig({displayName:"Toolbar__SearchInputRow",componentId:"sc-16ftbxt-4"})(templateObject_5$3$2||(templateObject_5$3$2=__makeTemplateObject$1(["\n display: flex;\n width: 100%;\n @media (min-width: ","px) {\n display: none;\n }\n"],["\n display: flex;\n width: 100%;\n @media (min-width: ","px) {\n display: none;\n }\n"])),minScreenSize.medium);var templateObject_1$o$2,templateObject_2$j$2,templateObject_3$c$2,templateObject_4$6$2,templateObject_5$3$2;_styled(Toolbar$1).withConfig({displayName:"ChromelessToolbar__StyledToolbar",componentId:"sc-1vovywb-0"})(templateObject_1$n$2||(templateObject_1$n$2=__makeTemplateObject$1(["\n margin-bottom: ","px;\n"],["\n margin-bottom: ","px;\n"])),spacingM);createGlobalStyle(templateObject_2$i$2||(templateObject_2$i$2=__makeTemplateObject$1(["\n [data-detail-page-container] {\n [data-content-toolbar] {\n @media (max-width: ","px) {\n margin-top: ","px;\n }\n }\n }\n"],["\n [data-detail-page-container] {\n [data-content-toolbar] {\n @media (max-width: ","px) {\n margin-top: ","px;\n }\n }\n }\n"])),minScreenSize.large,spacingM);var templateObject_1$n$2,templateObject_2$i$2;// todo: Apply this to all pages and make sure it works in IE
77709
+ _styled.p.withConfig({displayName:"PageDescription",componentId:"sc-xcsmz7-0"})(templateObject_1$m$2||(templateObject_1$m$2=__makeTemplateObject$1(["\n display: flex;\n flex-wrap: wrap;\n margin: 0;\n line-height: 1.5em;\n span {\n flex: 1 1 100%;\n }\n"],["\n display: flex;\n flex-wrap: wrap;\n margin: 0;\n line-height: 1.5em;\n span {\n flex: 1 1 100%;\n }\n"])));var templateObject_1$m$2;_styled.div.withConfig({displayName:"DragSource__Host",componentId:"sc-qzjyds-0"})(templateObject_1$l$2||(templateObject_1$l$2=__makeTemplateObject$1([""],[""])));var templateObject_1$l$2;var EmojiButton=function EmojiButton(_a){var onEmojiSelected=_a.onEmojiSelected,disabled=_a.disabled;var iconButton=useRef$1(null);var _b=useState$2(false),showCallout=_b[0],setShowCallout=_b[1];var formatMessage=useIntl().formatMessage;return jsxs(Fragment,{children:[jsx$1(ButtonWrapper,__assign$1({ref:iconButton},{children:jsx$1(IconButton,{"data-emoji-button":true,iconProps:{iconName:'Emoji2'},onClick:function(){return setShowCallout(true);},disabled:disabled,ariaLabel:formatMessage({id:'AriaLabel.emojiButton'})},void 0)}),void 0),showCallout&&jsx$1(StyledCallout$2,__assign$1({directionalHint:DirectionalHint.topCenter,target:iconButton.current,onDismiss:function(){return setShowCallout(false);},isBeakVisible:false,gapSpace:10,preventDismissOnScroll:true,styles:{calloutMain:{padding:spacingS-5}}},{children:jsx$1(EmojiPicker,{onSelect:handleSelect},void 0)}),void 0)]},void 0);function handleSelect(emoji){setShowCallout(false);onEmojiSelected(emoji.native);}};var ButtonWrapper=_styled.div.withConfig({displayName:"EmojiButton__ButtonWrapper",componentId:"sc-1eq2zlz-0"})(templateObject_1$k$2||(templateObject_1$k$2=__makeTemplateObject$1([""],[""])));var StyledCallout$2=_styled(Callout).withConfig({displayName:"EmojiButton__StyledCallout",componentId:"sc-1eq2zlz-1"})(templateObject_2$h$2||(templateObject_2$h$2=__makeTemplateObject$1(["\n border-radius: 10px;\n overflow: hidden;\n"],["\n border-radius: 10px;\n overflow: hidden;\n"])));var LazyEmojiPicker=/*#__PURE__*/lazy$1(function(){return import('./EmojiPicker.esm.esm.js');});var EmojiPicker=function EmojiPicker(_a){var onSelect=_a.onSelect;var windowSize=useWindowSize$2();return jsx$1(Suspense,__assign$1({fallback:jsx$1(EmojiPickerSuspenseHost,__assign$1({isSmaller:windowSize.width<minScreenSize.small},{children:jsx$1(Spinner,{},void 0)}),void 0)},{children:jsx$1(LazyEmojiPicker,{onSelect:onSelect},void 0)}),void 0);};var EmojiPickerSuspenseHost=_styled.div.withConfig({displayName:"EmojiButton__EmojiPickerSuspenseHost",componentId:"sc-1eq2zlz-2"})(templateObject_3$b$2||(templateObject_3$b$2=__makeTemplateObject$1(["\n // we set an initial width which is similar to what the emoji picker will be once it's loaded\n // we have to do this so the callout is rendered in the correct place\n width: ","px;\n height: 400px;\n"],["\n // we set an initial width which is similar to what the emoji picker will be once it's loaded\n // we have to do this so the callout is rendered in the correct place\n width: ","px;\n height: 400px;\n"])),function(p){return p.isSmaller?319:400;});var templateObject_1$k$2,templateObject_2$h$2,templateObject_3$b$2;var GiphyAttribution=function GiphyAttribution(){var env=useConfiguration();return jsx$1(AttributionHost,{children:jsx$1("a",__assign$1({href:"https://giphy.com",target:"_blank",rel:"noreferrer"},{children:jsx$1("img",{src:env.webAppUrl+"/assets/giphy/PoweredBy_200px-White_HorizText.png",alt:"Giphy Attribution"},void 0)}),void 0)},void 0);};var AttributionHost=_styled.div(templateObject_1$j$2||(templateObject_1$j$2=__makeTemplateObject$1(["\n text-align: right;\n margin-top: ","px;\n"],["\n text-align: right;\n margin-top: ","px;\n"])),spacingXs);var templateObject_1$j$2;var GifSelector=function GifSelector(_a){var _b,_c;var onGifClick=_a.onGifClick,className=_a.className;var clientConfig=useClientConfig();var formatMessage=useIntl().formatMessage;var gf=new dist$1.GiphyFetch(clientConfig.giphy.apiKey);var _d=useState$2(null),searchText=_d[0],setSearchText=_d[1];var debouncedSearchText=useDebounce(searchText,500)[0];var windowSize=useWindowSize$2();var _e=usePromise$2(getGifs,null,[debouncedSearchText]),gifs=_e[0],loading=_e[1];var gifSize=windowSize.width<550?80:100;return jsxs(Host$9$1,__assign$1({className:className},{children:[jsx$1(SearchBox$1,{placeholder:formatMessage({id:'Gif.searchPlaceHolder'}),iconProps:{iconName:'Search'},onChange:function(_,v){return setSearchText(v);},autoFocus:true},void 0),jsxs(GifContainer,__assign$1({columnWidth:gifSize},{children:[loading&&jsx$1(Spinner,{delay:300},void 0),((_b=gifs===null||gifs===void 0?void 0:gifs.data)===null||_b===void 0?void 0:_b.length)===0&&jsx$1(FormattedMessage$1,{id:"Generic.noResultsFound"},void 0),(_c=gifs===null||gifs===void 0?void 0:gifs.data)===null||_c===void 0?void 0:_c.map(function(g){return jsx$1(ClickableGif,{gif:g,width:gifSize,height:gifSize,noLink:true,hideAttribution:true,onGifClick:onGifClick},g.id);})]}),void 0)]}),void 0);function getGifs(){if(!debouncedSearchText){return gf.trending({limit:21});}return gf.search(debouncedSearchText,{limit:21});}};var Host$9$1=_styled.div.withConfig({displayName:"GifSelector__Host",componentId:"sc-lame6k-0"})(templateObject_1$i$2||(templateObject_1$i$2=__makeTemplateObject$1(["\n padding: ","px;\n"],["\n padding: ","px;\n"])),spacingXs);var GifContainer=_styled.div.withConfig({displayName:"GifSelector__GifContainer",componentId:"sc-lame6k-1"})(templateObject_2$g$2||(templateObject_2$g$2=__makeTemplateObject$1(["\n margin-top: ","px;\n display: grid;\n grid-template-columns: repeat(auto-fit, ","px);\n grid-gap: ","px;\n justify-content: space-around;\n"],["\n margin-top: ","px;\n display: grid;\n grid-template-columns: repeat(auto-fit, ","px);\n grid-gap: ","px;\n justify-content: space-around;\n"])),spacingS,function(p){return p.columnWidth;},spacingXs);var ClickableGif=_styled(dist$4.Gif).withConfig({displayName:"GifSelector__ClickableGif",componentId:"sc-lame6k-2"})(templateObject_3$a$2||(templateObject_3$a$2=__makeTemplateObject$1(["\n cursor: pointer;\n"],["\n cursor: pointer;\n"])));var templateObject_1$i$2,templateObject_2$g$2,templateObject_3$a$2;var GifSelectorCallout=function GifSelectorCallout(_a){var target=_a.target,onGifClick=_a.onGifClick,onDismiss=_a.onDismiss;return jsxs(StyledCallout$1$1,__assign$1({directionalHint:DirectionalHint.topCenter,target:target,onDismiss:onDismiss,isBeakVisible:false,gapSpace:10,preventDismissOnResize:true,preventDismissOnScroll:true,styles:{calloutMain:{padding:spacingS-5}}},{children:[jsx$1(StyledGifSelector,{onGifClick:onGifClick},void 0),jsx$1(GiphyAttribution,{},void 0)]}),void 0);};var StyledCallout$1$1=_styled(Callout)(templateObject_1$h$2||(templateObject_1$h$2=__makeTemplateObject$1(["\n border-radius: 10px;\n overflow: hidden;\n width: 360px;\n height: 450px;\n"],["\n border-radius: 10px;\n overflow: hidden;\n width: 360px;\n height: 450px;\n"])));var StyledGifSelector=_styled(GifSelector)(templateObject_2$f$2||(templateObject_2$f$2=__makeTemplateObject$1(["\n overflow-y: auto;\n height: 400px;\n"],["\n overflow-y: auto;\n height: 400px;\n"])));var templateObject_1$h$2,templateObject_2$f$2;createGlobalStyle(templateObject_1$g$2||(templateObject_1$g$2=__makeTemplateObject$1(["\n .lt-reach.dialog-gif-selector {\n .ms-Dialog-main {\n width: 400px !important;\n\n @media (max-width: ","px) {\n width: 100% !important;\n }\n }\n}\n"],["\n .lt-reach.dialog-gif-selector {\n .ms-Dialog-main {\n width: 400px !important;\n\n @media (max-width: ","px) {\n width: 100% !important;\n }\n }\n}\n"])),maxScreenSize.small);_styled(GifSelector).withConfig({displayName:"GifSelectorDialog__StyledDialogGifSelector",componentId:"sc-t6p48w-0"})(templateObject_2$e$2||(templateObject_2$e$2=__makeTemplateObject$1(["\n margin-top: ","px;\n"],["\n margin-top: ","px;\n"])),spacingS);var templateObject_1$g$2,templateObject_2$e$2;var GifButton=function GifButton(_a){var disabled=_a.disabled,onGifClick=_a.onGifClick;var features=useFeatures();var formatMessage=useIntl().formatMessage;var refGifButton=useRef$1();var _b=useState$2(false),showGifSelector=_b[0],setShowGifSelector=_b[1];if(!features.giphy){return null;}return jsxs("div",{children:[jsx$1("div",__assign$1({ref:refGifButton},{children:jsx$1(IconButton,{iconProps:{iconName:'Gif'},onClick:function(){return setShowGifSelector(true);},disabled:disabled,"data-button-type":"gif",ariaLabel:formatMessage({id:'AriaLabel.gifButton'})},void 0)}),void 0),showGifSelector&&jsx$1(Fragment,{children:jsx$1(GifSelectorCallout,{target:refGifButton.current,onGifClick:handleGifClick,onDismiss:function(){return setShowGifSelector(false);}},void 0)},void 0)]},void 0);function handleGifClick(gif){setShowGifSelector(false);onGifClick({id:gif.id.toString(),filename:gif.title,url:gif.embed_url,type:AttachmentType.Giphy});}};var GifView=function GifView(_a){var gifInfo=_a.gifInfo,className=_a.className;var clientConfig=useClientConfig();var _b=useState$2(),gif=_b[0],setGif=_b[1];useEffect$1(function(){var gf=new dist$1.GiphyFetch(clientConfig.giphy.apiKey);gf.gif(gifInfo.id).then(function(r){return setGif(r.data);});},[clientConfig.giphy.apiKey,gifInfo.id]);if(!gif){return null;}return jsx$1(Host$8$1,__assign$1({className:className},{children:jsx$1(StyledGif,{gif:gif,width:300,noLink:true,hideAttribution:true},void 0)}),void 0);};var Host$8$1=_styled.div(templateObject_1$f$2||(templateObject_1$f$2=__makeTemplateObject$1([""],[""])));var StyledGif=_styled(dist$4.Gif)(templateObject_2$d$2||(templateObject_2$d$2=__makeTemplateObject$1(["\n && {\n max-width: 100%;\n }\n\n @media (max-width: ","px) {\n /* because the style is inline set we need to overwrite it via !important */\n width: auto !important;\n height: auto !important;\n > div {\n width: auto !important;\n height: auto !important;\n\n img {\n max-width: 100%;\n height: auto;\n }\n }\n }\n"],["\n && {\n max-width: 100%;\n }\n\n @media (max-width: ","px) {\n /* because the style is inline set we need to overwrite it via !important */\n width: auto !important;\n height: auto !important;\n > div {\n width: auto !important;\n height: auto !important;\n\n img {\n max-width: 100%;\n height: auto;\n }\n }\n }\n"])),maxScreenSize.small);var templateObject_1$f$2,templateObject_2$d$2;var GifEditList=function GifEditList(_a){var attachments=_a.attachments,onDeleteClick=_a.onDeleteClick,className=_a.className;var formatMessage=useIntl().formatMessage;var gifs=attachments.filter(function(a){return a.type===AttachmentType.Giphy;});if(gifs.length===0){return null;}return jsx$1(Host$7$1,__assign$1({className:className,"data-gif-attachment-list":true},{children:gifs.map(function(gif){return jsx$1(StyledAttachmentHost$1,__assign$1({domIdentifier:"gif",deleteButton:jsx$1(DeleteAttachmentButton,{"data-remove-attachment-button":gif.id,iconProps:{iconName:'ChromeClose'},onClick:function(){return onDeleteClick(gif);},ariaLabel:formatMessage({id:'AriaLabel.removeAttachmentButton'})},void 0)},{children:jsx$1(GifView,{gifInfo:gif},void 0)}),gif.id);})}),void 0);};var Host$7$1=_styled.div.withConfig({displayName:"GifEditList__Host",componentId:"sc-95dldh-0"})(templateObject_1$e$2||(templateObject_1$e$2=__makeTemplateObject$1(["\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n"],["\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n"])));var StyledAttachmentHost$1=_styled(AttachmentHost).withConfig({displayName:"GifEditList__StyledAttachmentHost",componentId:"sc-95dldh-1"})(templateObject_2$c$2||(templateObject_2$c$2=__makeTemplateObject$1(["\n width: auto;\n"],["\n width: auto;\n"])));var templateObject_1$e$2,templateObject_2$c$2;var GifList=function GifList(_a){var attachments=_a.attachments,className=_a.className;var gifs=attachments.filter(function(a){return a.type===AttachmentType.Giphy;});if(gifs.length===0){return null;}return jsx$1(Host$6$1,__assign$1({className:className,"data-gif-url-preview":gifs[0].id},{children:jsx$1(StyledAttachmentHost,{children:jsx$1(GifView,{gifInfo:gifs[0]},void 0)},void 0)}),void 0);};var Host$6$1=_styled.div.withConfig({displayName:"GifList__Host",componentId:"sc-8gg7fj-0"})(templateObject_1$d$2||(templateObject_1$d$2=__makeTemplateObject$1(["\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n"],["\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n"])));var StyledAttachmentHost=_styled(AttachmentHost).withConfig({displayName:"GifList__StyledAttachmentHost",componentId:"sc-8gg7fj-1"})(templateObject_2$b$2||(templateObject_2$b$2=__makeTemplateObject$1(["\n width: auto;\n margin: ","px 0 0 0;\n"],["\n width: auto;\n margin: ","px 0 0 0;\n"])),spacingS);var templateObject_1$d$2,templateObject_2$b$2;var PageViewType;(function(PageViewType){PageViewType["PostsGroupView"]="PostsGroupView";})(PageViewType||(PageViewType={}));function usePageViewTracker(basePath,itemId,viewType){var _this=this;var user=useCurrentUser();var sendBeacon=useBeaconHandler();var onRequestToken=useContext(AuthenticationContext).onRequestToken;var performanceTimer=usePerformanceTimer();var viewEndCallback=useRef$1(function(){return null;});useBeforeUnload$2(trackViewEnd);useEffect$1(function(){(function(){return __awaiter$1(_this,void 0,void 0,function(){var currentToken;return __generator$1(this,function(_a){switch(_a.label){case 0:if(!itemId||!user){return [2/*return*/];}return [4/*yield*/,onRequestToken()];case 1:currentToken=_a.sent();viewEndCallback.current=trackPageView(basePath,user.subscription.id,itemId,viewType,currentToken);return [2/*return*/];}});});})();return function(){return trackViewEnd();};// eslint-disable-next-line react-hooks/exhaustive-deps
77709
77710
  },[itemId,basePath,viewType]);function trackViewEnd(){if(viewEndCallback.current){viewEndCallback.current();}}function trackPageView(basePath,subscriptionId,itemId,viewType,accessToken){var sessionId=uuid_1$1.v4().toString();sendBeacon("/"+basePath+"/"+itemId+"/views/"+sessionId,accessToken,subscriptionId,{viewType:viewType});performanceTimer.start();var wasEndSessionExecuted=false;return function(){// only execute it once
77710
77711
  if(wasEndSessionExecuted){return;}wasEndSessionExecuted=true;var duration=performanceTimer.end();sendBeacon("/"+basePath+"/"+itemId+"/views/"+sessionId+"/duration",accessToken,subscriptionId,{duration:duration,viewType:viewType});};}}function useUserPropertyDefinitionsHandler(){var user=useCurrentUser();var formatMessage=useIntl().formatMessage;var defaultProperties={displayName:{},mobilePhone:{iconName:'cellPhone'},jobTitle:{iconName:'contactCard'},company:{iconName:'EMI'},address:{iconName:'MapPin'},notes:{iconName:'ContactInfo'}};return {getPropertyLabel:getLabel,getPropertyIcon:getIcon};function getLabel(definition){var language=getPreferredSupportedUiLanguage(user.preferredUiLanguage);var translations=definition.translations||{};var defaultPropertyNames=Object.keys(defaultProperties);return language&&translations[language]||translations[user.subscription.defaultLanguage]||definition.label||defaultPropertyNames.some(function(p){return p===definition.name;})&&formatMessage({id:"Generic."+definition.name})||definition.name;}function getIcon(definition){var _a,_b;return (_b=(_a=defaultProperties[definition.name])===null||_a===void 0?void 0:_a.iconName)!==null&&_b!==void 0?_b:'UserOptional';}}var IconWithCallout=function IconWithCallout(props){var _a;var _b;var iconRef=useRef$1(null);var _c=useState$2(false),showCallout=_c[0],setShowCallout=_c[1];return jsxs(Host$5$2,__assign$1({className:props.className},(_a={},_a[props.dataAttribute]=true,_a),{ref:iconRef},{children:[jsx$1(StyledIconButton$1,{"data-icon-with-callout":true,iconProps:{iconName:props.icon},onClick:handleIconClick,ariaLabel:props.ariaLabel,disabled:props.disabled},void 0),showCallout&&jsx$1(StyledCallout$5,__assign$1({className:"icon-with-callout-content",target:iconRef,directionalHint:// DirectionalHint.topLeftEdge has the value "0". Hence we cannot use the || operator...
77711
77712
  props.directionalHint==null?DirectionalHint.rightCenter:props.directionalHint,gapSpace:4,onDismiss:handleCalloutDismiss,calloutWidth:(_b=props.calloutWidth)!==null&&_b!==void 0?_b:0},{children:props.children}),void 0)]}),void 0);function handleIconClick(){return __awaiter$1(this,void 0,void 0,function(){var _a,_b;return __generator$1(this,function(_c){switch(_c.label){case 0:_a=props.disabled;if(_a)return [3/*break*/,3];_b=props.onIconClick;if(!_b)return [3/*break*/,2];return [4/*yield*/,props.onIconClick()];case 1:_b=_c.sent();_c.label=2;case 2:_a=_b;_c.label=3;case 3:if(_a){return [2/*return*/];}setShowCallout(!showCallout);return [2/*return*/];}});});}function handleCalloutDismiss(){var _a;setShowCallout(false);(_a=props.onCalloutDismissed)===null||_a===void 0?void 0:_a.call(props);}};var Host$5$2=_styled.div.withConfig({displayName:"IconWithCallout__Host",componentId:"sc-1jmscz2-0"})(templateObject_1$c$2||(templateObject_1$c$2=__makeTemplateObject$1(["\n display: flex;\n align-items: center;\n"],["\n display: flex;\n align-items: center;\n"])));var StyledIconButton$1=_styled(IconButton).withConfig({displayName:"IconWithCallout__StyledIconButton",componentId:"sc-1jmscz2-1"})(templateObject_2$a$2||(templateObject_2$a$2=__makeTemplateObject$1(["\n width: auto;\n height: auto;\n padding: 0;\n\n &[disabled] {\n background: transparent;\n }\n"],["\n width: auto;\n height: auto;\n padding: 0;\n\n &[disabled] {\n background: transparent;\n }\n"])));var StyledCallout$5=_styled(Callout).withConfig({displayName:"IconWithCallout__StyledCallout",componentId:"sc-1jmscz2-2"})(templateObject_3$9$2||(templateObject_3$9$2=__makeTemplateObject$1(["\n && {\n font-family: 'Roboto', sans-serif;\n padding: 10px;\n max-width: 700px !important;\n\n h2 {\n margin: 10px;\n }\n }\n"],["\n && {\n font-family: 'Roboto', sans-serif;\n padding: 10px;\n max-width: 700px !important;\n\n h2 {\n margin: 10px;\n }\n }\n"])));var templateObject_1$c$2,templateObject_2$a$2,templateObject_3$9$2;var inlineObjectsClassNames={file:'news-inline-file',image:'news-inline-image',video:'video-view-container',code:'news-inline-code',quote:'news-inline-quote'};function isNullOrWhitespace(s,isHtml){if(isHtml===void 0){isHtml=false;}return s==null||s.trim().length===0||isHtml&&isEmptyHtml(s);}// all inline objects are wrapped in a div
@@ -77729,7 +77730,7 @@ loadFirstTwoPages();// eslint-disable-next-line react-hooks/exhaustive-deps
77729
77730
  setCurrentPageIndex(currentPageIndex+pageSize);if(!(state.hasNextPage&&currentPageIndex===lastFetchedPageIndex-pageSize))return [3/*break*/,2];return [4/*yield*/,loadNextPage(state.paginationToken)];case 1:_a.sent();setLastFetchedPageIndex(lastFetchedPageIndex+pageSize);_a.label=2;case 2:return [2/*return*/];}});});}}_styled.p.withConfig({displayName:"PaginationStatus__AllLoadedStatus",componentId:"sc-ykj2ti-0"})(templateObject_1$9$2||(templateObject_1$9$2=__makeTemplateObject$1(["\n margin: 0;\n text-align: center;\n color: ",";\n"],["\n margin: 0;\n text-align: center;\n color: ",";\n"])),function(p){return p.theme.palette.neutralSecondary;});_styled.div.withConfig({displayName:"PaginationStatus__Host",componentId:"sc-ykj2ti-1"})(templateObject_2$7$2||(templateObject_2$7$2=__makeTemplateObject$1(["\n margin: ","px 0;\n\n > * {\n margin: 0;\n }\n"],["\n margin: ","px 0;\n\n > * {\n margin: 0;\n }\n"])),spacingXl);_styled.div.withConfig({displayName:"PaginationStatus__LoadStatusPlaceholder",componentId:"sc-ykj2ti-2"})(templateObject_3$6$2||(templateObject_3$6$2=__makeTemplateObject$1(["\n height: ","px;\n"],["\n height: ","px;\n"])),spacingM);var templateObject_1$9$2,templateObject_2$7$2,templateObject_3$6$2;var PullToRefreshContext=/*#__PURE__*/createContext(null);function refreshScripts(node){var scripts=node.querySelectorAll('script');for(var i=0;i<scripts.length;i++){var currentScript=scripts[i];var refreshedScript=document.createElement('script');refreshedScript.type='text/javascript';if(currentScript.src&&currentScript.src.length){refreshedScript.src=currentScript.src;}else {var scriptContent=document.createTextNode(currentScript.innerHTML);refreshedScript.appendChild(scriptContent);}var parent_1=scripts[i].parentElement;parent_1.insertBefore(refreshedScript,currentScript);parent_1.removeChild(currentScript);}}var ToolbarNoBorderDropdownStyles=css$2(templateObject_1$8$2||(templateObject_1$8$2=__makeTemplateObject$1(["\n .ms-Dropdown,\n .ms-Dropdown-title {\n border: none;\n &:focus::after {\n border: none;\n }\n }\n\n .ms-Dropdown-title,\n .ms-Dropdown-caretDownWrapper {\n line-height: 32px;\n }\n"],["\n .ms-Dropdown,\n .ms-Dropdown-title {\n border: none;\n &:focus::after {\n border: none;\n }\n }\n\n .ms-Dropdown-title,\n .ms-Dropdown-caretDownWrapper {\n line-height: 32px;\n }\n"])));var ToolbarDropdownStyles=css$2(templateObject_2$6$2||(templateObject_2$6$2=__makeTemplateObject$1(["\n ","\n\n @media (min-width: ","px) {\n padding-right: ","px;\n }\n"],["\n ","\n\n @media (min-width: ","px) {\n padding-right: ","px;\n }\n"])),ToolbarNoBorderDropdownStyles,minScreenSize.medium,spacingM);var ToolbarOptionStyles=css$2(templateObject_3$5$2||(templateObject_3$5$2=__makeTemplateObject$1(["\n display: flex;\n align-items: center;\n min-height: 35px;\n width: 100%;\n\n span {\n color: ",";\n }\n\n i {\n width: 50px;\n font-size: 16px;\n color: ",";\n text-align: center;\n }\n"],["\n display: flex;\n align-items: center;\n min-height: 35px;\n width: 100%;\n\n span {\n color: ",";\n }\n\n i {\n width: 50px;\n font-size: 16px;\n color: ",";\n text-align: center;\n }\n"])),function(p){return p.theme.textColors.default;},function(p){return p.theme.textColors.default;});var ToolbarGlobalDropdownStyles=css$2(templateObject_4$3$2||(templateObject_4$3$2=__makeTemplateObject$1(["\n .content-toolbar-dropdown {\n min-width: 300px;\n .ms-Dropdown-item {\n padding: 0;\n border: 0;\n > span {\n width: 100%;\n }\n }\n\n @media (max-width: ","px) {\n max-width: 80% !important;\n }\n }\n"],["\n .content-toolbar-dropdown {\n min-width: 300px;\n .ms-Dropdown-item {\n padding: 0;\n border: 0;\n > span {\n width: 100%;\n }\n }\n\n @media (max-width: ","px) {\n max-width: 80% !important;\n }\n }\n"])),maxScreenSize.medium);var templateObject_1$8$2,templateObject_2$6$2,templateObject_3$5$2,templateObject_4$3$2;var allChannelsKey='AllChannels';var bookmarksKey='Bookmarks';var manageChannelsKey='ManageChannels';var ToolbarChannelSelector=function ToolbarChannelSelector(_a){var getInitialSelectedKeyProp=_a.getInitialSelectedKey,bookmarkOption=_a.bookmarkOption,manageChannelsOption=_a.manageChannelsOption,allChannelsOption=_a.allChannelsOption,channelsOptions=_a.channelsOptions;var user=useCurrentUser();var channels=useContext(LazySubscriptionContext).channels;var formatMessage=useIntl().formatMessage;var dropDownOptions=getOptions();var _b=useState$2(function(){return getInitialSelectedKey();}),selectedKey=_b[0],setSelectedKey=_b[1];return jsxs(Fragment,{children:[jsx$1(GlobalDropdownCalloutStyle,{},void 0),jsx$1(StyledDropdown$1,{options:dropDownOptions,onRenderOption:renderDropDownOption,selectedKey:selectedKey,onChange:handleOnChange,calloutProps:{className:'content-toolbar-dropdown'},responsiveMode:ResponsiveMode.large,ariaLabel:formatMessage({id:'AriaLabel.toolbarChannelSelector'})},void 0)]},void 0);function renderDropDownOption(option){if(option.data.onSelected){return jsxs(OptionSpan,{children:[jsx$1(Icon,{iconName:option.data.iconName},void 0),jsx$1("span",{children:option.text},void 0)]},option.key);}return jsxs(DropdownNavLink,__assign$1({to:option.data.pathname,exact:option.data.exact,isActive:option.key===selectedKey?function(){return true;}:undefined},{children:[jsx$1(Icon,{iconName:option.data.iconName},void 0),jsx$1("span",{children:option.text},void 0)]}),option.key);}function getInitialSelectedKey(){return (getInitialSelectedKeyProp===null||getInitialSelectedKeyProp===void 0?void 0:getInitialSelectedKeyProp(dropDownOptions))||allChannelsKey;}function getOptions(){var options=[];if(allChannelsOption){options.push({key:allChannelsKey,text:formatMessage({id:'Channels.All'}),data:{pathname:allChannelsOption.to,iconName:'Org',exact:true,onSelected:allChannelsOption.onSelected}});}if(channelsOptions){var channelsToUse=(!channelsOptions.availableChannels?user.channels.filter(function(c){return c.isPinnedToNavigation;}):(channels||[]).filter(function(c){return channelsOptions.availableChannels.some(function(nameOrId){return c.id===nameOrId||c.name===nameOrId;});})).map(function(c){return c;});options=options.concat.apply(options,channelsToUse.map(function(c){return getChannelOption(c);}));}if(bookmarkOption){options.push({key:bookmarksKey,text:formatMessage({id:'Generic.bookmarks'}),data:{pathname:bookmarkOption.to,iconName:'DoubleBookmark',exact:true,onSelected:bookmarkOption.onSelected}});}if(manageChannelsOption){options.push({key:manageChannelsKey,text:formatMessage({id:'PageMenu.manageUserChannels'}),data:{pathname:manageChannelsOption.to,iconName:'CollapseMenu',exact:true,onSelected:manageChannelsOption.onSelected}});}return options;}function getChannelOption(channel){var _a;return {key:channel.id,text:getChannelDisplayName(channels,channel,user),data:{pathname:(_a=channelsOptions.to)===null||_a===void 0?void 0:_a.call(channelsOptions,channel),iconName:'Org',exact:false,channelName:channel.name,onSelected:channelsOptions.onSelected?function(){return channelsOptions.onSelected(channel);}:null}};}function handleOnChange(_,option){var _a,_b;setSelectedKey(option.key.toString());(_b=(_a=option.data)===null||_a===void 0?void 0:_a.onSelected)===null||_b===void 0?void 0:_b.call(_a);}};var GlobalDropdownCalloutStyle=createGlobalStyle(templateObject_1$7$1||(templateObject_1$7$1=__makeTemplateObject$1(["\n ","\n"],["\n ","\n"])),ToolbarGlobalDropdownStyles);var StyledDropdown$1=_styled(Dropdown).withConfig({displayName:"ToolbarChannelSelector__StyledDropdown",componentId:"sc-fwvaya-0"})(templateObject_2$5$2||(templateObject_2$5$2=__makeTemplateObject$1(["\n ","\n display: flex;\n align-items: center;\n"],["\n ","\n display: flex;\n align-items: center;\n"])),ToolbarDropdownStyles);var DropdownNavLink=_styled(NavLink).withConfig({displayName:"ToolbarChannelSelector__DropdownNavLink",componentId:"sc-fwvaya-1"})(templateObject_3$4$2||(templateObject_3$4$2=__makeTemplateObject$1(["\n ","\n"],["\n ","\n"])),ToolbarOptionStyles);var OptionSpan=_styled.span.withConfig({displayName:"ToolbarChannelSelector__OptionSpan",componentId:"sc-fwvaya-2"})(templateObject_4$2$2||(templateObject_4$2$2=__makeTemplateObject$1(["\n ",";\n"],["\n ",";\n"])),ToolbarOptionStyles);var templateObject_1$7$1,templateObject_2$5$2,templateObject_3$4$2,templateObject_4$2$2;var ToolbarMarkAllNewsAsReadButton=function ToolbarMarkAllNewsAsReadButton(_a){var onMarkAsReadStarted=_a.onMarkAsReadStarted,onMarkAsReadFinished=_a.onMarkAsReadFinished,disabled=_a.disabled,unreadCount=_a.unreadCount;return jsx$1(ToolbarMarkAllAsReadButton,{itemType:ItemResourceTypes.News,disabled:disabled,onMarkAsReadStarted:onMarkAsReadStarted,onMarkAsReadFinished:onMarkAsReadFinished,unreadCount:unreadCount},void 0);};var ToolbarMarkAllEventsAsReadButton=function ToolbarMarkAllEventsAsReadButton(_a){var onMarkAsReadStarted=_a.onMarkAsReadStarted,onMarkAsReadFinished=_a.onMarkAsReadFinished,disabled=_a.disabled,unreadCount=_a.unreadCount;return jsx$1(ToolbarMarkAllAsReadButton,{itemType:ItemResourceTypes.Events,disabled:disabled,onMarkAsReadStarted:onMarkAsReadStarted,onMarkAsReadFinished:onMarkAsReadFinished,unreadCount:unreadCount},void 0);};var ToolbarMarkAllAsReadButton=function ToolbarMarkAllAsReadButton(_a){var itemType=_a.itemType,onMarkAsReadStarted=_a.onMarkAsReadStarted,onMarkAsReadFinished=_a.onMarkAsReadFinished,disabled=_a.disabled,unreadCount=_a.unreadCount;var features=useFeatures();var clearUnreadItems=useClearUnreadItems(itemType,{onStarted:onMarkAsReadStarted,onFinished:onMarkAsReadFinished},unreadCount);if(!features.unreadTracking){return null;}return jsx$1(ToolbarIconButton,{tooltipResourceKey:"Generic.UnreadItems.markAllAsRead",onClick:clearUnreadItems,iconName:"Read",disabled:disabled,ariaLabelResourceKey:"Generic.UnreadItems.markAllAsRead","data-clear-unread-items":true},void 0);};var ToolbarManageButton=function ToolbarManageButton(_a){var onClick=_a.onClick,to=_a.to,disabled=_a.disabled;return jsx$1(ToolbarIconButton,{tooltipResourceKey:"Generic.showManageView",disabled:disabled,iconName:"edit",to:to===null||to===void 0?void 0:to.url,target:to===null||to===void 0?void 0:to.target,onClick:onClick,"data-toolbar-manage-button":true,ariaLabelResourceKey:"AriaLabel.goToManageView"},void 0);};var ToolbarCloseButton=function ToolbarCloseButton(_a){var onClick=_a.onClick,to=_a.to;return jsx$1(ToolbarIconButton,{iconName:"Cancel",onClick:onClick,to:to===null||to===void 0?void 0:to.url,target:to===null||to===void 0?void 0:to.target,tooltipResourceKey:"Generic.close",ariaLabelResourceKey:"Generic.close","data-toolbar-close-button":true},void 0);};function useAttachmentsApi(){var _a=useApiFactory(),createApiUrl=_a.createApiUrl,fetchFromApi=_a.fetchFromApi;var onRequestToken=useContext(AuthenticationContext).onRequestToken;return useMemo(function(){return {uploadImage:uploadImage,uploadFile:uploadFile,getFileUrl:getFileUrl,getImageUrl:getImageUrl,getChatMessageImageUrl:getChatMessageImageUrl};function uploadImage(basePath,subscriptionId,imageId,containerId,file){return __awaiter$1(this,void 0,void 0,function(){var fd,token,config;return __generator$1(this,function(_a){switch(_a.label){case 0:fd=new FormData();fd.append('image',file,file.name||"image."+lite.getExtension(file.type));return [4/*yield*/,onRequestToken()];case 1:token=_a.sent();config={method:'POST',body:fd,headers:{authorization:'Bearer '+token,'subscription-id':subscriptionId}};return [2/*return*/,fetchFromApi(basePath+"/attachments/"+containerId+"/images/"+imageId,config)];}});});}function uploadFile(basePath,subscriptionId,fileId,containerId,file){return __awaiter$1(this,void 0,void 0,function(){var fd,token,config;return __generator$1(this,function(_a){switch(_a.label){case 0:fd=new FormData();fd.append('file',file);return [4/*yield*/,onRequestToken()];case 1:token=_a.sent();config={method:'POST',body:fd,headers:{authorization:'Bearer '+token,'subscription-id':subscriptionId}};return [2/*return*/,fetchFromApi(basePath+"/attachments/"+containerId+"/files/"+fileId,config)];}});});}function getFileUrl(basePath,subscriptionId,item,fileId,token){token!==null&&token!==void 0?token:token=item.fileAccessToken;if(!token){return null;}return createApiUrl(basePath+"/attachments/"+item.attachmentContainerId+"/files/"+fileId,{subscriptionId:subscriptionId,access_token:token});}function getImageUrl(basePath,subscriptionId,item,imageId,width,height){return getImageInternal(basePath,subscriptionId,item.fileAccessToken,item.attachmentContainerId,imageId,width,height);}function getChatMessageImageUrl(basePath,subscriptionId,message,imageId,width,height){return getImageInternal(basePath,subscriptionId,message.fileAccessToken,message.attachmentContainerId,imageId,width,height);}function getImageInternal(basePath,subscriptionId,accessToken,attachmentContainerId,imageId,width,height){var url;if(width==null){url=basePath+"/attachments/"+attachmentContainerId+"/images/"+imageId;}else if(width==='default'){url=basePath+"/attachments/"+attachmentContainerId+"/images/"+imageId+"/default";}else {url=basePath+"/attachments/"+attachmentContainerId+"/images/"+imageId+"/"+width+"/"+(height||'');}return createApiUrl(url,{subscriptionId:subscriptionId,access_token:accessToken});}},[onRequestToken,fetchFromApi,createApiUrl]);}function useLanguageApi(){var api=useApi();return useMemo(function(){var cachedLanguages=null;return {getAllLanguages:getAllLanguages,getAllLanguagesLocalized:getAllLanguagesLocalized,resolveActiveLanguages:resolveActiveLanguages,resolveUserLanguage:resolveUserLanguage};function getAllLanguages(){return cachedLanguages||(cachedLanguages=api.all('languages').getAll().then(function(result){return result.body().map(function(language){return language.data();});}));}function getAllLanguagesLocalized(intl){return __awaiter$1(this,void 0,void 0,function(){var ls;return __generator$1(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,getAllLanguages()];case 1:ls=_a.sent();return [2/*return*/,getLocalizedLanguages.apply(void 0,__spreadArray$1([intl],ls))];}});});}function resolveActiveLanguages(subscription){return __awaiter$1(this,void 0,void 0,function(){var allLanguages;return __generator$1(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,getAllLanguages()];case 1:allLanguages=_a.sent();return [2/*return*/,allLanguages.filter(function(l){return subscription.languages.find(function(al){return al.code===l.code;});})];}});});}function resolveUserLanguage(user){return __awaiter$1(this,void 0,void 0,function(){var activeLanguages,allLanguages;return __generator$1(this,function(_a){switch(_a.label){case 0:activeLanguages=user.subscription.languages;return [4/*yield*/,getAllLanguages()];case 1:allLanguages=_a.sent();return [2/*return*/,allLanguages.filter(function(l){return activeLanguages.find(function(al){return al.code===l.code;});})];}});});}},[api]);}createGlobalStyle(templateObject_1$6$2||(templateObject_1$6$2=__makeTemplateObject$1(["\n *:not(input):not(textarea) {\n -webkit-user-select: none; /* disable selection/Copy of UIWebView */\n -webkit-touch-callout: none; /* disable the IOS popup when long-press on a link */\n }\n"],["\n *:not(input):not(textarea) {\n -webkit-user-select: none; /* disable selection/Copy of UIWebView */\n -webkit-touch-callout: none; /* disable the IOS popup when long-press on a link */\n }\n"])));var templateObject_1$6$2;function useVideosApi(){var createApiUrl=useApiFactory().createApiUrl;return useMemo(function(){return {getVideoThumbnailUrl:getVideoThumbnailUrl,getBannerVideoThumbnailUrl:getBannerVideoThumbnailUrl};function getVideoThumbnailUrl(token,subscriptionId,videoSource,videoId){return createApiUrl("/videos/"+videoId+"/thumbnail",{access_token:token,subscriptionId:subscriptionId,videoSource:videoSource});}function getBannerVideoThumbnailUrl(token,itemId,subscriptionId,resourceType){return createApiUrl("/"+resourceType+"/"+itemId+"/videos/banner/thumbnail",{access_token:token,subscriptionId:subscriptionId});}},[createApiUrl]);}var UserAvatarUpdateTriggerAction=/** @class */function(){function UserAvatarUpdateTriggerAction(){this.type=UserAvatarUpdateTriggerAction.type;}UserAvatarUpdateTriggerAction.create=function(upn){var dispatch=new UserAvatarUpdateTriggerAction();dispatch.upn=upn;return dispatch;};UserAvatarUpdateTriggerAction.type='user_avatar_update';return UserAvatarUpdateTriggerAction;}();var Avatar=function Avatar(props){var features=useFeatures();var _a=useState$2(null),avatarUrl=_a[0],setAvatarUrl=_a[1];var getUserAvatarUrl=useAccountApi().getUserAvatarUrl;useListener(UserAvatarUpdateTriggerAction.type,function(action){if(action.upn===props.upn){loadAvatar(props.upn,props.tenantId);}return false;},[props.upn]);useEffect$1(function(){var subscription=loadAvatar(props.upn,props.tenantId);return function(){return subscription===null||subscription===void 0?void 0:subscription.unsubscribe();};// eslint-disable-next-line react-hooks/exhaustive-deps
77730
77731
  },[props.upn]);if(!features.avatars){return null;}var imageInitials=getInitials(props.text||props.displayName||props.upn);return jsx$1(StyledPersona,__assign$1({},props,{"data-avatar":true,text:props.text,imageUrl:avatarUrl,imageShouldFadeIn:false,imageInitials:imageInitials,initialsColor:getPersonaInitialsColor(imageInitials),secondaryText:isHiddenMail(props.secondaryText)?null:props.secondaryText}),void 0);function loadAvatar(upn,tenantId){if(upn==null){setAvatarUrl(null);return null;}return getUserAvatarUrl(upn,tenantId).subscribe(function(url){setAvatarUrl(url);});}};var StyledPersona=_styled(Persona).withConfig({displayName:"Avatar__StyledPersona",componentId:"sc-1r8d14y-0"})(templateObject_1$5$2||(templateObject_1$5$2=__makeTemplateObject$1(["\n && {\n .ms-Persona-image {\n img {\n max-width: 100%;\n width: auto;\n height: auto;\n }\n }\n }\n"],["\n && {\n .ms-Persona-image {\n img {\n max-width: 100%;\n width: auto;\n height: auto;\n }\n }\n }\n"])));var templateObject_1$5$2;var UserPropertyWrapper=function UserPropertyWrapper(_a){var className=_a.className,iconName=_a.iconName,tooltipResourceKey=_a.tooltipResourceKey,tooltipText=_a.tooltipText,children=_a.children;if(!children){return null;}return jsxs(PropertyContainer,__assign$1({className:className},{children:[iconName&&jsx$1(Tooltip,__assign$1({resourceKey:tooltipResourceKey,text:tooltipText},{children:jsx$1(StyledIcon$9,{iconName:iconName},"icon")}),void 0),children]}),void 0);};var StyledIcon$9=_styled(Icon).withConfig({displayName:"UserPropertyWrapper__StyledIcon",componentId:"sc-yfrgje-0"})(templateObject_1$4$2||(templateObject_1$4$2=__makeTemplateObject$1(["\n && {\n cursor: default;\n display: flex;\n padding-right: 8px;\n padding-top: 1px;\n }\n"],["\n && {\n cursor: default;\n display: flex;\n padding-right: 8px;\n padding-top: 1px;\n }\n"])));var PropertyContainer=_styled.div.withConfig({displayName:"UserPropertyWrapper__PropertyContainer",componentId:"sc-yfrgje-1"})(templateObject_2$4$2||(templateObject_2$4$2=__makeTemplateObject$1(["\n display: flex;\n max-width: 100%;\n"],["\n display: flex;\n max-width: 100%;\n"])));var templateObject_1$4$2,templateObject_2$4$2;var EmailProperty=function EmailProperty(_a){var email=_a.email;if(isHiddenMail(email)){return null;}return jsx$1(UserPropertyWrapper,__assign$1({iconName:"mail",tooltipResourceKey:"Generic.mail"},{children:jsx$1(StyledAnchor,__assign$1({href:"mailto:"+email},{children:email}),void 0)}),void 0);};var MobilePhoneProperty=function MobilePhoneProperty(_a){var value=_a.value;var formatMessage=useIntl().formatMessage;if(value==null){return null;}return jsx$1(UserPropertyWrapper,__assign$1({iconName:"cellPhone",tooltipResourceKey:"Generic.mobilePhone"},{children:jsx$1(StyledAnchor,__assign$1({href:"tel:"+value},{children:formatMessage({id:'Generic.callMobile'},{number:value})}),void 0)}),void 0);};var OfficePhoneProperty=function OfficePhoneProperty(_a){var value=_a.value;var formatMessage=useIntl().formatMessage;if(value==null){return null;}value=typeof value=='string'?[value]:value;return jsx$1(Fragment,{children:value.map(function(number,index){return jsx$1(UserPropertyWrapper,__assign$1({iconName:"phone",tooltipResourceKey:"Generic.businessPhone"},{children:jsx$1(StyledAnchor,__assign$1({href:"tel:"+number},{children:formatMessage({id:'Generic.callOffice'},{number:number})}),void 0)}),number+index);})},void 0);};var LocationProperty=function LocationProperty(_a){var value=_a.value,tooltipResourceKey=_a.tooltipResourceKey;if(value==null){return null;}return jsx$1(UserPropertyWrapper,__assign$1({iconName:"MapPin",tooltipResourceKey:tooltipResourceKey||'Generic.Location'},{children:jsx$1(StyledAnchor,__assign$1({target:"_blank",rel:"noopener noreferrer",href:getGoogleMapsSearchLink(value)},{children:value}),void 0)}),void 0);};var DepartmentProperty=function DepartmentProperty(_a){var value=_a.value;if(value==null){return null;}return jsx$1(UserPropertyWrapper,__assign$1({iconName:"workforceManagement",tooltipResourceKey:"Generic.department"},{children:value}),void 0);};var JobTitleProperty=function JobTitleProperty(_a){var value=_a.value;if(value==null){return null;}return jsx$1(UserPropertyWrapper,__assign$1({iconName:"contactCard",tooltipResourceKey:"Generic.jobTitle"},{children:value}),void 0);};var ChatMessageProperty=function ChatMessageProperty(_a){var value=_a.value;var buildPath=useSubscriptionHandlePathBuilder().buildPath;var features=useFeatures();if(!(value===null||value===void 0?void 0:value.userId)||!features.chat){return null;}var user={id:value.userId,displayName:value.displayName,userPrincipalName:value.userPrincipalName};return jsx$1(UserPropertyWrapper,__assign$1({iconName:"Chat",tooltipResourceKey:"Generic.sendChatMessage"},{children:jsx$1(StyledLink$3,__assign$1({to:buildPath('chats/new')+"?"+queryString.stringify({userId:user.id,userDisplayName:user.displayName,userPrincipalName:user.userPrincipalName})},{children:jsx$1(FormattedMessage$1,{id:"Generic.sendChatMessage"},void 0)}),void 0)}),void 0);};var AnchorStyle=css$2(templateObject_1$3$2||(templateObject_1$3$2=__makeTemplateObject$1(["\n color: ",";\n &:hover {\n text-decoration: underline;\n }\n"],["\n color: ",";\n &:hover {\n text-decoration: underline;\n }\n"])),function(p){return p.theme.palette.accent;});var StyledAnchor=_styled.a.withConfig({displayName:"UserProperties__StyledAnchor",componentId:"sc-1aw5jcq-0"})(templateObject_2$3$2||(templateObject_2$3$2=__makeTemplateObject$1(["\n ","\n"],["\n ","\n"])),AnchorStyle);var StyledLink$3=_styled(Link$4).withConfig({displayName:"UserProperties__StyledLink",componentId:"sc-1aw5jcq-1"})(templateObject_3$3$2||(templateObject_3$3$2=__makeTemplateObject$1(["\n ","\n"],["\n ","\n"])),AnchorStyle);var propertyComponentMap={mobilePhone:MobilePhoneProperty,department:DepartmentProperty,address:LocationProperty};var templateObject_1$3$2,templateObject_2$3$2,templateObject_3$3$2;var UserProperty=function UserProperty(_a){var className=_a.className,value=_a.value,definition=_a.definition;var _b=useUserPropertyDefinitionsHandler(),getPropertyLabel=_b.getPropertyLabel,getPropertyIcon=_b.getPropertyIcon;if(value==null){return null;}var label=getPropertyLabel(definition);var icon=getPropertyIcon(definition);var component=propertyComponentMap[definition.name];if(component){return/*#__PURE__*/createElement$a(component,{value:value});}return jsx$1(UserPropertyWrapper,__assign$1({iconName:icon,tooltipText:label,className:className},{children:value}),void 0);};var GraphUserProperties=function GraphUserProperties(_a){var _b,_c,_d,_e,_f;var user=_a.user,_g=_a.ignoredProperties,ignoredProperties=_g===void 0?[]:_g;return jsxs(Fragment,{children:[!ignoredProperties.includes('department')&&jsx$1(DepartmentProperty,{value:(_b=user.properties)===null||_b===void 0?void 0:_b.department},void 0),!ignoredProperties.includes('jobTitle')&&jsx$1(JobTitleProperty,{value:(_c=user.properties)===null||_c===void 0?void 0:_c.jobTitle},void 0),!ignoredProperties.includes('mobilePhone')&&jsx$1(MobilePhoneProperty,{value:(_d=user.properties)===null||_d===void 0?void 0:_d.mobilePhone},void 0),!ignoredProperties.includes('businessPhones')&&jsx$1(OfficePhoneProperty,{value:(_e=user.properties)===null||_e===void 0?void 0:_e.businessPhones},void 0),!ignoredProperties.includes('chatMessage')&&jsx$1(ChatMessageProperty,{value:user},void 0),!ignoredProperties.includes('officeLocation')&&jsx$1(LocationProperty,{value:(_f=user.properties)===null||_f===void 0?void 0:_f.officeLocation},void 0)]},void 0);};var UserProperties=function UserProperties(_a){var user=_a.user,_b=_a.ignoredProperties,ignoredProperties=_b===void 0?[]:_b;var currentUser=useCurrentUser();return jsxs(Fragment,{children:[!ignoredProperties.includes('chatMessage')&&jsx$1(ChatMessageProperty,{value:user},void 0),currentUser.subscription.userPropertyDefinitions.filter(function(p){return !ignoredProperties.includes(p.name);}).map(function(definition){var _a;return jsx$1(UserProperty,{definition:definition,value:(_a=user.properties)===null||_a===void 0?void 0:_a[definition.name]},definition.name);})]},void 0);};var avatarProperties=['displayName','department','jobTitle'];var UserDetails=function UserDetails(_a){var _b;var upn=_a.upn,showAvatar=_a.showAvatar,id=_a.id;var _c=useAccountApi(),getUserInfo=_c.getUserInfo,getUserInfoById=_c.getUserInfoById;var _d=usePromise$2(function(){return upn?getUserInfo(upn):getUserInfoById(id);},null,[upn,id]),userInfo=_d[0],isLoading=_d[1],error=_d[2];if(error){return jsx$1(ErrorContainer$2,{children:upn?jsx$1(FormattedMessage$1,{id:"Profile.CannotLoadInfo",values:{upn:upn}},void 0):jsx$1(FormattedMessage$1,{id:"Profile.CannotLoadInfoByUserId"},void 0)},void 0);}if(isLoading){return jsx$1(StyledSpinner$4,{},void 0);}var ignoredProperties=showAvatar?avatarProperties:[];return jsxs(Host$1$1,__assign$1({"data-user-details":true},{children:[showAvatar&&jsx$1(Avatar,{upn:userInfo.userPrincipalName,size:PersonaSize.large,text:userInfo.displayName||userInfo.userPrincipalName,secondaryText:userInfo.properties&&userInfo.properties.department,tertiaryText:userInfo.properties&&userInfo.properties.jobTitle},void 0),jsxs(ContactCard,{children:[jsx$1(EmailProperty,{email:(_b=userInfo.mail)!==null&&_b!==void 0?_b:userInfo.userPrincipalName},void 0),userInfo.isDirectoryUser?jsx$1(GraphUserProperties,{user:userInfo,ignoredProperties:ignoredProperties},void 0):jsx$1(UserProperties,{user:userInfo,ignoredProperties:ignoredProperties},void 0)]},void 0)]}),void 0);};var ErrorContainer$2=_styled.div.withConfig({displayName:"UserDetails__ErrorContainer",componentId:"sc-uqfudb-0"})(templateObject_1$2$2||(templateObject_1$2$2=__makeTemplateObject$1(["\n padding: 20px;\n"],["\n padding: 20px;\n"])));var Host$1$1=_styled.div.withConfig({displayName:"UserDetails__Host",componentId:"sc-uqfudb-1"})(templateObject_2$2$2||(templateObject_2$2$2=__makeTemplateObject$1(["\n font-size: ","px;\n .ms-Persona {\n margin-bottom: 8px;\n }\n\n .persona-card-children {\n cursor: pointer;\n }\n"],["\n font-size: ","px;\n .ms-Persona {\n margin-bottom: 8px;\n }\n\n .persona-card-children {\n cursor: pointer;\n }\n"])),fontSizeSmall);var ContactCard=_styled.div.withConfig({displayName:"UserDetails__ContactCard",componentId:"sc-uqfudb-2"})(templateObject_3$2$2||(templateObject_3$2$2=__makeTemplateObject$1(["\n display: flex;\n flex: 1 1 auto;\n flex-flow: column;\n > div {\n &:not(:last-child) {\n padding-bottom: ","px;\n }\n }\n"],["\n display: flex;\n flex: 1 1 auto;\n flex-flow: column;\n > div {\n &:not(:last-child) {\n padding-bottom: ","px;\n }\n }\n"])),spacingS);var StyledSpinner$4=_styled(Spinner).withConfig({displayName:"UserDetails__StyledSpinner",componentId:"sc-uqfudb-3"})(templateObject_4$1$2||(templateObject_4$1$2=__makeTemplateObject$1(["\n padding: 20px 80px;\n"],["\n padding: 20px 80px;\n"])));var templateObject_1$2$2,templateObject_2$2$2,templateObject_3$2$2,templateObject_4$1$2;var PersonaCard=function PersonaCard(_a){var upn=_a.upn,className=_a.className,children=_a.children,readOnly=_a.readOnly,domIdentifier=_a.domIdentifier;var childrenContainer=useRef$1(null);var user=useCurrentUser();var _b=useState$2(false),showCallout=_b[0],setShowCallout=_b[1];if(readOnly){return jsx$1(Label$1,__assign$1({className:className},{children:children}),void 0);}return jsxs(Fragment,{children:[jsx$1(Label$1,__assign$1({ref:childrenContainer,className:className},{children:jsx$1(StyledButton,__assign$1({"data-persona-button":domIdentifier,"data-rounded-outline":domIdentifier==='avatar'&&50,className:"persona-card-children",onClick:function(e){e.preventDefault();setShowCallout(!showCallout);},ariaLabel:upn},{children:children}),"children")}),void 0),showCallout&&!user.isPublicUser&&jsx$1(Callout,__assign$1({className:"persona-card-callout",directionalHint:DirectionalHint.bottomCenter,isBeakVisible:true,onDismiss:function(){return setShowCallout(false);},target:childrenContainer.current},{children:jsx$1(CalloutHost,{children:jsx$1(UserDetails,{upn:upn,showAvatar:true},void 0)},void 0)}),"callout")]},void 0);};var CalloutHost=_styled.div.withConfig({displayName:"PersonaCard__CalloutHost",componentId:"sc-g7cgoc-0"})(templateObject_1$1$2||(templateObject_1$1$2=__makeTemplateObject$1(["\n padding: ","px ","px;\n max-width: 300px;\n\n @media (min-width: ","px) {\n max-width: 450px;\n }\n"],["\n padding: ","px ","px;\n max-width: 300px;\n\n @media (min-width: ","px) {\n max-width: 450px;\n }\n"])),spacingM-5,spacingM,minScreenSize.medium);var Label$1=_styled.div.withConfig({displayName:"PersonaCard__Label",componentId:"sc-g7cgoc-1"})(templateObject_2$1$2||(templateObject_2$1$2=__makeTemplateObject$1(["\n display: inline-flex;\n align-items: flex-start;\n font-weight: inherit;\n"],["\n display: inline-flex;\n align-items: flex-start;\n font-weight: inherit;\n"])));var StyledButton=_styled(ActionButton$1).withConfig({displayName:"PersonaCard__StyledButton",componentId:"sc-g7cgoc-2"})(templateObject_3$1$2||(templateObject_3$1$2=__makeTemplateObject$1(["\n && {\n margin: 0;\n padding: 0;\n border: 0;\n min-width: auto;\n height: auto;\n background-color: transparent;\n color: inherit;\n font-weight: inherit;\n\n &:hover {\n background-color: transparent;\n color: inherit;\n }\n\n .ms-Button-label {\n margin: 0;\n font-weight: inherit;\n }\n }\n"],["\n && {\n margin: 0;\n padding: 0;\n border: 0;\n min-width: auto;\n height: auto;\n background-color: transparent;\n color: inherit;\n font-weight: inherit;\n\n &:hover {\n background-color: transparent;\n color: inherit;\n }\n\n .ms-Button-label {\n margin: 0;\n font-weight: inherit;\n }\n }\n"])));var templateObject_1$1$2,templateObject_2$1$2,templateObject_3$1$2;var _path$2,_path2$2;function _extends$2$1(){_extends$2$1=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends$2$1.apply(this,arguments);}var SvgGenericError=function SvgGenericError(props){return/*#__PURE__*/React$d.createElement("svg",_extends$2$1({height:24,width:24,xmlns:"http://www.w3.org/2000/svg"},props),_path$2||(_path$2=/*#__PURE__*/React$d.createElement("path",{d:"M0 0h24v24H0z",fill:"none"})),_path2$2||(_path2$2=/*#__PURE__*/React$d.createElement("path",{d:"M14.59 8 12 10.59 9.41 8 8 9.41 10.59 12 8 14.59 9.41 16 12 13.41 14.59 16 16 14.59 13.41 12 16 9.41 14.59 8zM12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"})));};var _path$1,_path2$1,_path3$1,_path4$1,_path5,_path6,_path7,_path8,_path9,_path10,_path11,_path12,_path13;function _extends$1$1(){_extends$1$1=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends$1$1.apply(this,arguments);}var Svg404=function Svg404(props){return/*#__PURE__*/React$d.createElement("svg",_extends$1$1({xmlns:"http://www.w3.org/2000/svg",width:1000,height:500,xmlSpace:"preserve"},props),/*#__PURE__*/React$d.createElement("linearGradient",{id:"404_svg__a",gradientUnits:"userSpaceOnUse",x1:594.738,y1:340.93,x2:608.738,y2:397.597},/*#__PURE__*/React$d.createElement("stop",{offset:0,style:{stopColor:"#fff"}}),/*#__PURE__*/React$d.createElement("stop",{offset:1,style:{stopColor:"#a3a3a3"}})),_path$1||(_path$1=/*#__PURE__*/React$d.createElement("path",{fill:"url(#404_svg__a)",stroke:"#000",strokeWidth:4,strokeMiterlimit:10,d:"M882.59 268.468c21 32.432 1.741 59.432-13.259 63.072l-544.98 138.4-19.863-52"})),_path2$1||(_path2$1=/*#__PURE__*/React$d.createElement("path",{fill:"#FFF",stroke:"#000",strokeWidth:4,strokeMiterlimit:10,d:"M309.589 459.468 108.158 144.484 615.943 80.06"})),_path3$1||(_path3$1=/*#__PURE__*/React$d.createElement("path",{fill:"#FFF",stroke:"#000",strokeWidth:4,strokeMiterlimit:10,d:"M314.589 449.468 113.158 134.484 620.943 70.06"})),_path4$1||(_path4$1=/*#__PURE__*/React$d.createElement("path",{fill:"#FFF",stroke:"#000",strokeWidth:4,strokeMiterlimit:10,d:"M319.589 439.468 118.158 124.484 625.943 60.06"})),_path5||(_path5=/*#__PURE__*/React$d.createElement("path",{fill:"#FFF",stroke:"#000",strokeWidth:4,strokeMiterlimit:10,d:"M324.589 429.468 123.158 114.484 630.943 50.06"})),_path6||(_path6=/*#__PURE__*/React$d.createElement("path",{fill:"#FFF",stroke:"#000",strokeWidth:4,strokeMiterlimit:10,d:"M329.589 419.468 128.158 104.484 635.943 40.06"})),_path7||(_path7=/*#__PURE__*/React$d.createElement("path",{fill:"#FFF",stroke:"#000",strokeWidth:4,strokeMiterlimit:10,d:"M883.331 268.717 640.943 30.06 133.158 94.484l201.431 314.984"})),_path8||(_path8=/*#__PURE__*/React$d.createElement("path",{d:"m460.648 259.928-36.604 7.674L291.683 90.101l34.537-4.586z"})),_path9||(_path9=/*#__PURE__*/React$d.createElement("path",{d:"m401.208 182.809-163.089 28.484-69.033-104.912 37.759-5.013 52.715 76.977 122.712-20.106zM780.762 192.823l-27.785 5.824-147.145-150.26 26.932-3.576z"})),_path10||(_path10=/*#__PURE__*/React$d.createElement("path",{d:"m715.806 127.861-124.515 21.747-80.4-88.615 29.13-3.868 60.7 65.318 94.23-15.438zM563.239 237.975c-43.759 9.164-102.574-11.135-128.653-44.308l-45.591-57.995c-23.313-29.652-6.746-57.597 34.888-63.126 40.312-5.352 91.604 12.096 116.271 39.62l48.08 53.651c27.409 30.584 17.228 63.315-24.995 72.158zM441.853 93.878c-23.922 3.402-32.813 19.678-19.137 36.551l46.203 57.014c15.023 18.54 48.042 29.891 72.821 25.009 24.283-4.784 30.85-23.296 15.387-40.995l-47.628-54.522c-14.12-16.164-44.171-26.395-67.646-23.057zM527.416 340.863l-188.091 46.762-5.374-8.268 187.682-45.974zM707.02 296.212l-160.457 39.892-5.819-7.402 160.212-39.246zM861.95 257.694l-138.494 34.432-6.083-6.692 138.363-33.893zM515.896 325.966l-187.27 45.196-5.275-8.118 186.858-44.435zM694.942 282.752l-159.968 38.607-5.723-7.279 159.723-37.978zM849.57 245.433l-138.232 33.361-5.988-6.589 138.097-32.837zM504.568 311.314l-186.447 43.682-5.183-7.975 186.037-42.938zM683.051 269.501l-159.476 37.361-5.628-7.161 159.229-36.75zM837.369 233.348l-137.962 32.32-5.897-6.486 137.824-31.813zM493.428 296.907l-185.626 42.211-5.092-7.835 185.217-41.49zM671.344 256.452l-158.98 36.15-5.535-7.042 158.728-35.557zM825.344 221.436l-137.686 31.305-5.808-6.388 137.545-30.81z"})),_path11||(_path11=/*#__PURE__*/React$d.createElement("path",{fill:"#FFF",stroke:"#000",strokeWidth:4,strokeMiterlimit:10,d:"M334.589 409.468c21 32.432-4.239 77.377-25 50"})),_path12||(_path12=/*#__PURE__*/React$d.createElement("path",{fill:"#FFF",stroke:"#000",strokeWidth:4,strokeMiterlimit:10,d:"M329.589 419.468c12.838 19.236-6.238 40-15 30"})),_path13||(_path13=/*#__PURE__*/React$d.createElement("path",{fill:"#FFF",stroke:"#000",strokeWidth:4,strokeMiterlimit:10,d:"M324.589 429.468c6 10-1.631 16-5 10"})));};var _path,_path2,_circle,_circle2,_circle3,_path3,_path4;function _extends$8(){_extends$8=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends$8.apply(this,arguments);}var Svg403=function Svg403(props){return/*#__PURE__*/React$d.createElement("svg",_extends$8({xmlns:"http://www.w3.org/2000/svg",width:1000,height:700,xmlSpace:"preserve"},props),_path||(_path=/*#__PURE__*/React$d.createElement("path",{fill:"#CCC",stroke:"#000",strokeWidth:4,strokeMiterlimit:10,d:"M291.15 264.771 339.471 223h321.334l48.321 42.428"})),_path2||(_path2=/*#__PURE__*/React$d.createElement("path",{fill:"#FFF",stroke:"#000",strokeWidth:4,strokeMiterlimit:10,d:"M291 267h418v418H291z"})),_circle||(_circle=/*#__PURE__*/React$d.createElement("circle",{fill:"#E6E6E6",stroke:"#000",strokeWidth:4,strokeMiterlimit:10,cx:500.44,cy:473.349,r:166.456})),/*#__PURE__*/React$d.createElement("linearGradient",{id:"403_svg__a",gradientUnits:"userSpaceOnUse",x1:500.439,y1:340.568,x2:500.439,y2:606.898},/*#__PURE__*/React$d.createElement("stop",{offset:0,style:{stopColor:"#fff"}}),/*#__PURE__*/React$d.createElement("stop",{offset:1,style:{stopColor:"#9e9e9e"}})),_circle2||(_circle2=/*#__PURE__*/React$d.createElement("circle",{fill:"url(#403_svg__a)",stroke:"#000",strokeWidth:2,strokeMiterlimit:10,cx:500.439,cy:473.349,r:133.165})),_circle3||(_circle3=/*#__PURE__*/React$d.createElement("circle",{fill:"#FFF",stroke:"#000",strokeWidth:4,strokeMiterlimit:10,cx:500.44,cy:473.349,r:106.532})),_path3||(_path3=/*#__PURE__*/React$d.createElement("path",{fill:"#FFF",stroke:"#000",strokeWidth:4,strokeMiterlimit:10,d:"M623 251.979c-13.344 0-24-4.776-24-18.12v-70.332c0-55.126-44.713-99.974-100-99.974s-100 44.848-100 99.974v69.124c0 13.344-11.156 18.12-24.5 18.12s-24.5-4.776-24.5-18.12v-69.124c0-81.77 66.569-148.295 148.5-148.295 81.932 0 148.5 66.525 148.5 148.295v70.332c0 13.344-10.656 18.12-24 18.12z"})),_path4||(_path4=/*#__PURE__*/React$d.createElement("path",{fill:"none",stroke:"#000",strokeWidth:2,strokeMiterlimit:10,d:"M500 308v33M334 474h34M500 641v-34M668 476h-34M382.008 356.022l23.917 23.917M382.862 590.929l23.917-23.918M617.767 591.782l-23.917-23.917M619.477 356.022l-23.918 23.917"})));};var ErrorType;(function(ErrorType){ErrorType["GenericError"]="genericError";ErrorType["Error404"]="error404";ErrorType["Error403"]="error403";})(ErrorType||(ErrorType={}));/**
77731
77732
  * Large alert. Template for 404, 403 etc.
77732
- */function PageAlert(props){return jsx$1(Host$Z,__assign$1({"data-page-alert":true},{children:jsxs(Content$a,{children:[props.errorType&&jsx$1(SvgContainer,__assign$1({onClick:props.onClick},{children:props.errorType===ErrorType.GenericError?jsx$1(SvgGenericError,{},void 0):props.errorType===ErrorType.Error403?jsx$1(Svg403,{},void 0):jsx$1(Svg404,{},void 0)}),void 0),jsx$1(Text,{children:props.alertText},void 0),jsx$1(AdditionalContent,{children:props.children},void 0)]},void 0)}),void 0);}var Host$Z=_styled.div.withConfig({displayName:"PageAlert__Host",componentId:"sc-gj7gx6-0"})(templateObject_1$2s||(templateObject_1$2s=__makeTemplateObject$1(["\n display: flex;\n flex-flow: column nowrap;\n align-items: stretch;\n flex: 1 0 100%;\n height: 100%;\n background-color: ",";\n"],["\n display: flex;\n flex-flow: column nowrap;\n align-items: stretch;\n flex: 1 0 100%;\n height: 100%;\n background-color: ",";\n"])),function(p){return p.theme.palette.white;});var Content$a=_styled.div.withConfig({displayName:"PageAlert__Content",componentId:"sc-gj7gx6-1"})(templateObject_2$1D||(templateObject_2$1D=__makeTemplateObject$1(["\n padding: 30px;\n text-align: center;\n"],["\n padding: 30px;\n text-align: center;\n"])));var SvgContainer=_styled.div.withConfig({displayName:"PageAlert__SvgContainer",componentId:"sc-gj7gx6-2"})(templateObject_3$16||(templateObject_3$16=__makeTemplateObject$1(["\n margin: 1rem auto;\n width: 100%;\n opacity: 0.7;\n\n > svg {\n height: auto;\n width: 10rem;\n }\n"],["\n margin: 1rem auto;\n width: 100%;\n opacity: 0.7;\n\n > svg {\n height: auto;\n width: 10rem;\n }\n"])));var Text=_styled.p.withConfig({displayName:"PageAlert__Text",componentId:"sc-gj7gx6-3"})(templateObject_4$N||(templateObject_4$N=__makeTemplateObject$1(["\n width: 200px;\n min-width: 100%;\n color: black;\n"],["\n width: 200px;\n min-width: 100%;\n color: black;\n"])));var AdditionalContent=_styled.div.withConfig({displayName:"PageAlert__AdditionalContent",componentId:"sc-gj7gx6-4"})(templateObject_5$F||(templateObject_5$F=__makeTemplateObject$1(["\n margin: auto;\n max-width: 400px;\n"],["\n margin: auto;\n max-width: 400px;\n"])));_styled.div.withConfig({displayName:"PageAlert__CenteredAlert",componentId:"sc-gj7gx6-5"})(templateObject_6$u||(templateObject_6$u=__makeTemplateObject$1(["\n display: flex;\n justify-content: space-around;\n"],["\n display: flex;\n justify-content: space-around;\n"])));var templateObject_1$2s,templateObject_2$1D,templateObject_3$16,templateObject_4$N,templateObject_5$F,templateObject_6$u;var propTypes$1={exports:{}};/*
77733
+ */function PageAlert(props){return jsx$1(Host$Z,__assign$1({"data-page-alert":true},{children:jsxs(Content$a,{children:[props.errorType&&jsx$1(SvgContainer,__assign$1({onClick:props.onClick},{children:props.errorType===ErrorType.GenericError?jsx$1(SvgGenericError,{},void 0):props.errorType===ErrorType.Error403?jsx$1(Svg403,{},void 0):jsx$1(Svg404,{},void 0)}),void 0),jsx$1(Text,{children:props.alertText},void 0),jsx$1(AdditionalContent,{children:props.children},void 0)]},void 0)}),void 0);}var Host$Z=_styled.div.withConfig({displayName:"PageAlert__Host",componentId:"sc-gj7gx6-0"})(templateObject_1$2t||(templateObject_1$2t=__makeTemplateObject$1(["\n display: flex;\n flex-flow: column nowrap;\n align-items: stretch;\n flex: 1 0 100%;\n height: 100%;\n background-color: ",";\n"],["\n display: flex;\n flex-flow: column nowrap;\n align-items: stretch;\n flex: 1 0 100%;\n height: 100%;\n background-color: ",";\n"])),function(p){return p.theme.palette.white;});var Content$a=_styled.div.withConfig({displayName:"PageAlert__Content",componentId:"sc-gj7gx6-1"})(templateObject_2$1E||(templateObject_2$1E=__makeTemplateObject$1(["\n padding: 30px;\n text-align: center;\n"],["\n padding: 30px;\n text-align: center;\n"])));var SvgContainer=_styled.div.withConfig({displayName:"PageAlert__SvgContainer",componentId:"sc-gj7gx6-2"})(templateObject_3$17||(templateObject_3$17=__makeTemplateObject$1(["\n margin: 1rem auto;\n width: 100%;\n opacity: 0.7;\n\n > svg {\n height: auto;\n width: 10rem;\n }\n"],["\n margin: 1rem auto;\n width: 100%;\n opacity: 0.7;\n\n > svg {\n height: auto;\n width: 10rem;\n }\n"])));var Text=_styled.p.withConfig({displayName:"PageAlert__Text",componentId:"sc-gj7gx6-3"})(templateObject_4$N||(templateObject_4$N=__makeTemplateObject$1(["\n width: 200px;\n min-width: 100%;\n color: black;\n"],["\n width: 200px;\n min-width: 100%;\n color: black;\n"])));var AdditionalContent=_styled.div.withConfig({displayName:"PageAlert__AdditionalContent",componentId:"sc-gj7gx6-4"})(templateObject_5$F||(templateObject_5$F=__makeTemplateObject$1(["\n margin: auto;\n max-width: 400px;\n"],["\n margin: auto;\n max-width: 400px;\n"])));_styled.div.withConfig({displayName:"PageAlert__CenteredAlert",componentId:"sc-gj7gx6-5"})(templateObject_6$u||(templateObject_6$u=__makeTemplateObject$1(["\n display: flex;\n justify-content: space-around;\n"],["\n display: flex;\n justify-content: space-around;\n"])));var templateObject_1$2t,templateObject_2$1E,templateObject_3$17,templateObject_4$N,templateObject_5$F,templateObject_6$u;var propTypes$1={exports:{}};/*
77733
77734
  object-assign
77734
77735
  (c) Sindre Sorhus
77735
77736
  @license MIT
@@ -77950,9 +77951,9 @@ var AuthenticationContextProvider = function AuthenticationContextProvider(_a) {
77950
77951
  }), void 0);
77951
77952
  };
77952
77953
 
77953
- var version$1 = "0.3.79";
77954
- var buildId = "101918";
77955
- var commitId = "6d9b587af8e8a9780f5cc9caf31482e6466250d3";
77954
+ var version$1 = "0.3.80";
77955
+ var buildId = "101989";
77956
+ var commitId = "884dd2cad28b0183b443d69323250b9a6959b8d2";
77956
77957
  var isCustomerBuild = false;
77957
77958
  var buildInfo = {
77958
77959
  version: version$1,
@@ -78550,14 +78551,14 @@ var GenericErrorPage = function GenericErrorPage(_a) {
78550
78551
  var DetailsContainer = _styled.div.withConfig({
78551
78552
  displayName: "ReachErrorProvider__DetailsContainer",
78552
78553
  componentId: "sc-15225g3-0"
78553
- })(templateObject_1$2r || (templateObject_1$2r = __makeTemplateObject$l(["\n margin-top: ", "px;\n"], ["\n margin-top: ", "px;\n"])), spacingM);
78554
+ })(templateObject_1$2s || (templateObject_1$2s = __makeTemplateObject$l(["\n margin-top: ", "px;\n"], ["\n margin-top: ", "px;\n"])), spacingM);
78554
78555
 
78555
78556
  var Details = _styled.p.withConfig({
78556
78557
  displayName: "ReachErrorProvider__Details",
78557
78558
  componentId: "sc-15225g3-1"
78558
- })(templateObject_2$1C || (templateObject_2$1C = __makeTemplateObject$l(["\n opacity: 0.4;\n font-size: small;\n"], ["\n opacity: 0.4;\n font-size: small;\n"])));
78559
+ })(templateObject_2$1D || (templateObject_2$1D = __makeTemplateObject$l(["\n opacity: 0.4;\n font-size: small;\n"], ["\n opacity: 0.4;\n font-size: small;\n"])));
78559
78560
 
78560
- var templateObject_1$2r, templateObject_2$1C;
78561
+ var templateObject_1$2s, templateObject_2$1D;
78561
78562
 
78562
78563
  var ReachLinkContextProvider = function ReachLinkContextProvider(_a) {
78563
78564
  var children = _a.children;
@@ -121817,10 +121818,10 @@ return "@[@"+user.displayName+"]("+user.id+")";}var ContentDisplay=function Cont
121817
121818
  if(path==null&&port==null){var segments=urlMatch.split('.');if(segments.length<2){return null;}var lastSegment=segments[segments.length-1];var domainName=segments[segments.length-2];if(// all segments must not be empty
121818
121819
  segments.some(function(s){return s==='';})||// domainName must at least be 3 characters
121819
121820
  domainName.length<3||// last segment may not be a number
121820
- lastSegment.match(/^\d+$/)){return null;}}if(!linkify.match(urlMatch)){return null;}return {url:"https://"+urlMatch,label:urlMatch};}function transformContent(content){var matches=__spreadArray([],Array.from(getAllMatches(content,regex)));var result=[];var lastStart=0;for(var _i=0,matches_1=matches;_i<matches_1.length;_i++){var match=matches_1[_i];result.push(content.substring(lastStart,match.index));var email=match[2];var urlMatch=match[3];var protocol=match[4];var port=match[6];var path=match[7];var fullMention=match[8];var name_1=match[10];var id=match[11];var hashtag=match[12];var d3Link=match[14];var link=getLink(email,urlMatch,protocol,path,port);result.push(__assign({fullMatch:match[0],isLineBreak:match[1]!=null,hashtag:hashtag,link:d3Link?{url:d3Link}:link},fullMention&&{mention:{name:name_1,id:id}}));lastStart=match.index+match[0].length;}result.push(content.substring(lastStart));return result;}var Mention=function Mention(_a){var userDisplayName=_a.userDisplayName,userId=_a.userId;var _b=useState$2(false),showUserInfo=_b[0],setShowUserInfo=_b[1];var mentionContainer=useRef$1(null);return jsxs(Fragment,{children:[jsx$1(MentionHost,__assign({"data-mention":true,onClick:function(){return setShowUserInfo(true);},ref:mentionContainer},{children:userDisplayName}),void 0),showUserInfo&&jsx$1(Callout,__assign({target:mentionContainer.current,directionalHint:DirectionalHint.bottomCenter,onDismiss:function(){return setShowUserInfo(false);},calloutMaxWidth:300},{children:jsx$1(CalloutContent,{children:jsx$1(UserDetails,{upn:null,id:userId,showAvatar:true},void 0)},void 0)}),void 0)]},void 0);};var MentionHost=_styled.span.withConfig({displayName:"ContentDisplay__MentionHost",componentId:"sc-1yxe01n-0"})(templateObject_1$2p||(templateObject_1$2p=__makeTemplateObject(["\n font-weight: bold;\n cursor: pointer;\n color: ",";\n"],["\n font-weight: bold;\n cursor: pointer;\n color: ",";\n"])),function(p){return p.theme.palette.accent;});var CalloutContent=_styled.div.withConfig({displayName:"ContentDisplay__CalloutContent",componentId:"sc-1yxe01n-1"})(templateObject_2$1A||(templateObject_2$1A=__makeTemplateObject(["\n padding: ","px ","px;\n"],["\n padding: ","px ","px;\n"])),spacingM-5,spacingM);var HashtagLink=_styled(Link).withConfig({displayName:"ContentDisplay__HashtagLink",componentId:"sc-1yxe01n-2"})(templateObject_3$14||(templateObject_3$14=__makeTemplateObject(["\n && {\n font-weight: bold;\n text-decoration: none;\n }\n"],["\n && {\n font-weight: bold;\n text-decoration: none;\n }\n"])));var templateObject_1$2p,templateObject_2$1A,templateObject_3$14;var NeutralCheckBox=_styled(Checkbox).withConfig({displayName:"NeutralCheckbox__NeutralCheckBox",componentId:"sc-18jxdgn-0"})(templateObject_1$2o||(templateObject_1$2o=__makeTemplateObject(["\n display: inline-block;\n &.is-checked .ms-Checkbox-checkbox {\n border-color: #656565;\n background-color: #919191;\n }\n"],["\n display: inline-block;\n &.is-checked .ms-Checkbox-checkbox {\n border-color: #656565;\n background-color: #919191;\n }\n"])));var templateObject_1$2o;var EventResponseTriggerAction=/** @class */function(){function EventResponseTriggerAction(){this.type=EventResponseTriggerAction.type;}EventResponseTriggerAction.create=function(itemId,response,locationId,onBehalfOfUpn){var dispatch=new EventResponseTriggerAction();dispatch.itemId=itemId;dispatch.response=response;dispatch.locationId=locationId;dispatch.onBehalfOfUpn=onBehalfOfUpn;return dispatch;};EventResponseTriggerAction.type='update_event_response';return EventResponseTriggerAction;}();var RegisterFullSeriesTriggerAction=/** @class */function(){function RegisterFullSeriesTriggerAction(){this.type=RegisterFullSeriesTriggerAction.type;}RegisterFullSeriesTriggerAction.create=function(recurrenceSeriesId,response){var dispatch=new RegisterFullSeriesTriggerAction();dispatch.recurrenceSeriesId=recurrenceSeriesId;dispatch.response=response;return dispatch;};RegisterFullSeriesTriggerAction.type='update_register_button_state';return RegisterFullSeriesTriggerAction;}();var FollowCommentsTriggerAction=/** @class */function(){function FollowCommentsTriggerAction(){this.type=FollowCommentsTriggerAction.type;}FollowCommentsTriggerAction.create=function(itemId,followState){var dispatch=new FollowCommentsTriggerAction();dispatch.itemId=itemId;dispatch.followState=followState;return dispatch;};FollowCommentsTriggerAction.type='update_follow_comments';return FollowCommentsTriggerAction;}();var ForbiddenErrorTriggerAction=/** @class */function(){function ForbiddenErrorTriggerAction(){this.type=ForbiddenErrorTriggerAction.type;}ForbiddenErrorTriggerAction.create=function(){return new ForbiddenErrorTriggerAction();};ForbiddenErrorTriggerAction.type='forbidden_error';return ForbiddenErrorTriggerAction;}();var PromptPublicUserLoginAction=/** @class */function(){function PromptPublicUserLoginAction(){this.type=ForbiddenErrorTriggerAction.type;}PromptPublicUserLoginAction.create=function(){return new ForbiddenErrorTriggerAction();};return PromptPublicUserLoginAction;}();var commentCreatedSubject=new Subject();var onCommentCreated$=commentCreatedSubject.asObservable();function useCommentApi(){var api=useApi();return useMemo(function(){return {createComment:createComment,createEditorComment:createEditorComment,listComments:listComments,getCommentReplies:getCommentReplies,getCommentThread:getCommentThread,getEditorConversations:getEditorConversations,translateComment:translateComment,deleteComment:deleteComment,deleteEditorComment:deleteEditorComment,toggleCommentLike:toggleCommentLike,updateComment:updateComment,onCommentCreated$:onCommentCreated$};function createComment(type,scope,itemId,comment){return api.all(getRoute(scope,itemId,type)).post(comment).then(function(result){commentCreatedSubject.next(itemId);return result.body().data();});}function createEditorComment(itemId,comment){return api.all(getRoute(ConversationScope.Editor,itemId)).post(comment).then(function(result){commentCreatedSubject.next(itemId);return result.body().data();});}function listComments(type,scope,itemId,filter){return api.custom(getRoute(scope,itemId,type,null,filter)).get().then(function(res){return res.body().data();});}function getCommentReplies(type,scope,itemId,commentId,filter){return api.custom(getRoute(scope,itemId,type,commentId,filter,true)).get().then(function(res){return res.body().data();});}function getCommentThread(type,itemId,commentId){return api.custom(type+"/"+itemId+"/comments/"+commentId+"/thread").get().then(function(res){return res.body().data();});}function getEditorConversations(itemId){return api.all(getRoute(ConversationScope.Editor,itemId)).getAll().then(function(res){return res.body().map(function(comment){return comment.data();});});}function translateComment(type,scope,itemId,commentId,targetLanguage){return api.custom(getRoute(scope,itemId,type,commentId)+"/"+(type===ItemResourceTypes.Posts?'content':'contents')+"/"+targetLanguage).get().then(function(res){return res.body().data();});}function deleteComment(type,scope,itemId,commentId){return api// note: commentId is passed as argument for delete method
121821
+ lastSegment.match(/^\d+$/)){return null;}}if(!linkify.match(urlMatch)){return null;}return {url:"https://"+urlMatch,label:urlMatch};}function transformContent(content){var matches=__spreadArray([],Array.from(getAllMatches(content,regex)));var result=[];var lastStart=0;for(var _i=0,matches_1=matches;_i<matches_1.length;_i++){var match=matches_1[_i];result.push(content.substring(lastStart,match.index));var email=match[2];var urlMatch=match[3];var protocol=match[4];var port=match[6];var path=match[7];var fullMention=match[8];var name_1=match[10];var id=match[11];var hashtag=match[12];var d3Link=match[14];var link=getLink(email,urlMatch,protocol,path,port);result.push(__assign({fullMatch:match[0],isLineBreak:match[1]!=null,hashtag:hashtag,link:d3Link?{url:d3Link}:link},fullMention&&{mention:{name:name_1,id:id}}));lastStart=match.index+match[0].length;}result.push(content.substring(lastStart));return result;}var Mention=function Mention(_a){var userDisplayName=_a.userDisplayName,userId=_a.userId;var _b=useState$2(false),showUserInfo=_b[0],setShowUserInfo=_b[1];var mentionContainer=useRef$1(null);return jsxs(Fragment,{children:[jsx$1(MentionHost,__assign({"data-mention":true,onClick:function(){return setShowUserInfo(true);},ref:mentionContainer},{children:userDisplayName}),void 0),showUserInfo&&jsx$1(Callout,__assign({target:mentionContainer.current,directionalHint:DirectionalHint.bottomCenter,onDismiss:function(){return setShowUserInfo(false);},calloutMaxWidth:300},{children:jsx$1(CalloutContent,{children:jsx$1(UserDetails,{upn:null,id:userId,showAvatar:true},void 0)},void 0)}),void 0)]},void 0);};var MentionHost=_styled.span.withConfig({displayName:"ContentDisplay__MentionHost",componentId:"sc-1yxe01n-0"})(templateObject_1$2q||(templateObject_1$2q=__makeTemplateObject(["\n font-weight: bold;\n cursor: pointer;\n color: ",";\n"],["\n font-weight: bold;\n cursor: pointer;\n color: ",";\n"])),function(p){return p.theme.palette.accent;});var CalloutContent=_styled.div.withConfig({displayName:"ContentDisplay__CalloutContent",componentId:"sc-1yxe01n-1"})(templateObject_2$1B||(templateObject_2$1B=__makeTemplateObject(["\n padding: ","px ","px;\n"],["\n padding: ","px ","px;\n"])),spacingM-5,spacingM);var HashtagLink=_styled(Link).withConfig({displayName:"ContentDisplay__HashtagLink",componentId:"sc-1yxe01n-2"})(templateObject_3$15||(templateObject_3$15=__makeTemplateObject(["\n && {\n font-weight: bold;\n text-decoration: none;\n }\n"],["\n && {\n font-weight: bold;\n text-decoration: none;\n }\n"])));var templateObject_1$2q,templateObject_2$1B,templateObject_3$15;var NeutralCheckBox=_styled(Checkbox).withConfig({displayName:"NeutralCheckbox__NeutralCheckBox",componentId:"sc-18jxdgn-0"})(templateObject_1$2p||(templateObject_1$2p=__makeTemplateObject(["\n display: inline-block;\n &.is-checked .ms-Checkbox-checkbox {\n border-color: #656565;\n background-color: #919191;\n }\n"],["\n display: inline-block;\n &.is-checked .ms-Checkbox-checkbox {\n border-color: #656565;\n background-color: #919191;\n }\n"])));var templateObject_1$2p;var EventResponseTriggerAction=/** @class */function(){function EventResponseTriggerAction(){this.type=EventResponseTriggerAction.type;}EventResponseTriggerAction.create=function(itemId,response,locationId,onBehalfOfUpn){var dispatch=new EventResponseTriggerAction();dispatch.itemId=itemId;dispatch.response=response;dispatch.locationId=locationId;dispatch.onBehalfOfUpn=onBehalfOfUpn;return dispatch;};EventResponseTriggerAction.type='update_event_response';return EventResponseTriggerAction;}();var RegisterFullSeriesTriggerAction=/** @class */function(){function RegisterFullSeriesTriggerAction(){this.type=RegisterFullSeriesTriggerAction.type;}RegisterFullSeriesTriggerAction.create=function(recurrenceSeriesId,response){var dispatch=new RegisterFullSeriesTriggerAction();dispatch.recurrenceSeriesId=recurrenceSeriesId;dispatch.response=response;return dispatch;};RegisterFullSeriesTriggerAction.type='update_register_button_state';return RegisterFullSeriesTriggerAction;}();var FollowCommentsTriggerAction=/** @class */function(){function FollowCommentsTriggerAction(){this.type=FollowCommentsTriggerAction.type;}FollowCommentsTriggerAction.create=function(itemId,followState){var dispatch=new FollowCommentsTriggerAction();dispatch.itemId=itemId;dispatch.followState=followState;return dispatch;};FollowCommentsTriggerAction.type='update_follow_comments';return FollowCommentsTriggerAction;}();var ForbiddenErrorTriggerAction=/** @class */function(){function ForbiddenErrorTriggerAction(){this.type=ForbiddenErrorTriggerAction.type;}ForbiddenErrorTriggerAction.create=function(){return new ForbiddenErrorTriggerAction();};ForbiddenErrorTriggerAction.type='forbidden_error';return ForbiddenErrorTriggerAction;}();var PromptPublicUserLoginAction=/** @class */function(){function PromptPublicUserLoginAction(){this.type=ForbiddenErrorTriggerAction.type;}PromptPublicUserLoginAction.create=function(){return new ForbiddenErrorTriggerAction();};return PromptPublicUserLoginAction;}();var commentCreatedSubject=new Subject();var onCommentCreated$=commentCreatedSubject.asObservable();function useCommentApi(){var api=useApi();return useMemo(function(){return {createComment:createComment,createEditorComment:createEditorComment,listComments:listComments,getCommentReplies:getCommentReplies,getCommentThread:getCommentThread,getEditorConversations:getEditorConversations,translateComment:translateComment,deleteComment:deleteComment,deleteEditorComment:deleteEditorComment,toggleCommentLike:toggleCommentLike,updateComment:updateComment,onCommentCreated$:onCommentCreated$};function createComment(type,scope,itemId,comment){return api.all(getRoute(scope,itemId,type)).post(comment).then(function(result){commentCreatedSubject.next(itemId);return result.body().data();});}function createEditorComment(itemId,comment){return api.all(getRoute(ConversationScope.Editor,itemId)).post(comment).then(function(result){commentCreatedSubject.next(itemId);return result.body().data();});}function listComments(type,scope,itemId,filter){return api.custom(getRoute(scope,itemId,type,null,filter)).get().then(function(res){return res.body().data();});}function getCommentReplies(type,scope,itemId,commentId,filter){return api.custom(getRoute(scope,itemId,type,commentId,filter,true)).get().then(function(res){return res.body().data();});}function getCommentThread(type,itemId,commentId){return api.custom(type+"/"+itemId+"/comments/"+commentId+"/thread").get().then(function(res){return res.body().data();});}function getEditorConversations(itemId){return api.all(getRoute(ConversationScope.Editor,itemId)).getAll().then(function(res){return res.body().map(function(comment){return comment.data();});});}function translateComment(type,scope,itemId,commentId,targetLanguage){return api.custom(getRoute(scope,itemId,type,commentId)+"/"+(type===ItemResourceTypes.Posts?'content':'contents')+"/"+targetLanguage).get().then(function(res){return res.body().data();});}function deleteComment(type,scope,itemId,commentId){return api// note: commentId is passed as argument for delete method
121821
121822
  .all(getRoute(scope,itemId,type)).delete(commentId);}function deleteEditorComment(itemId,commentId){return api// note: commentId is passed as argument for delete method
121822
121823
  .all(getRoute(ConversationScope.Editor,itemId)).delete(commentId);}function toggleCommentLike(commentId,isLiked){if(isLiked){return api.custom("comments/"+commentId+"/feedback/like").put({});}else {return api.custom("comments/"+commentId+"/feedback/like").delete();}}function updateComment(scope,itemId,commentId,content,attachments,type){return api.all(getRoute(scope,itemId,type,commentId)).put('',{id:commentId,content:content,parentItemId:itemId,attachments:attachments});}},[api]);}function getRoute(scope,itemId,type,commentId,filter,isThread){var baseRoute='';switch(scope){case ConversationScope.Editor:baseRoute="editor/"+itemId+"/messages";break;case ConversationScope.Public:baseRoute=type+"/"+itemId+"/comments";break;case ConversationScope.Posts:baseRoute=type+"/"+itemId+"/comments";break;default:throw new Error('Cannot determine route for unsupported scope '+scope);}var route=commentId?baseRoute+"/"+commentId:baseRoute;route=isThread?baseRoute+"/"+commentId+"/replies":route;return filter?route+"?"+queryString.stringify(filter):route;}var FollowComments=function FollowComments(props){var user=useCurrentUser();var _a=useManageCurrentUserApi(),getFollowCommentsStatus=_a.getFollowCommentsStatus,toggleFollowComments=_a.toggleFollowComments;var formatMessage=useIntl().formatMessage;var buildPath=useSubscriptionHandlePathBuilder().buildPath;var isSavingRef=useRef$1(false);var currentToastIdRef=useRef$1(null);var onCommentCreated$=useCommentApi().onCommentCreated$;var _b=useNotificationContext(),dismissToast=_b.dismissToast,showToast=_b.showToast,showError=_b.showError;var _c=usePromise$2(function(){return getFollowCommentsStatus(props.itemId,props.type,props.scope);},false),isFollowing=_c[0],setIsFollowing=_c[3];useListener(FollowCommentsTriggerAction.type,function(action){if(action.itemId!==props.itemId){return false;}setIsFollowing(action.followState);return true;},[setIsFollowing,props.itemId]);useEffect$1(function(){var subscription=onCommentCreated$.pipe(filter(function(id){return id===props.itemId;}),tap(function(){return handleCommentCreated();})).subscribe(function(){return null;});return function(){return subscription.unsubscribe();};// eslint-disable-next-line react-hooks/exhaustive-deps
121823
- },[isFollowing,props.itemId,props.scope]);var showWarning=isFollowing&&hasDisabledNotificationSettings();var followLabelStringResourceKey=props.scope===ConversationScope.Public?'Comment.followLabel':'Comment.followEditorLabel';return jsxs(Host$Y,__assign({className:props.className},{children:[jsx$1(NeutralCheckBox,{checked:isFollowing,onChange:function(_e,checked){return handleOnChange(checked);},label:formatMessage({id:followLabelStringResourceKey})},void 0),showWarning&&jsxs(WarningContainer,__assign({className:"ms-font-m"},{children:[jsx$1(Icon,{className:"ms-fontColor-red",iconName:"warning"},void 0),jsxs(WarningMessage,{children:[jsx$1(FormattedMessage$1,{id:"Profile.notificationSettings.conversationsDisabled"},void 0),!props.hideProfileUrl&&jsxs(Fragment,{children:["\u00A0",jsx$1(Link,__assign({to:buildPath('/user')},{children:jsx$1(FormattedMessage$1,{id:"Profile.notificationSettings.conversationsDisabledChangeSettings"},void 0)}),void 0)]},void 0)]},void 0)]}),void 0)]}),void 0);function handleCommentCreated(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,updateFollow(true)];case 1:_a.sent();return [2/*return*/];}});});}function handleOnChange(newFollowState){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,updateFollow(newFollowState)];case 1:_a.sent();if(currentToastIdRef.current){dismissToast(currentToastIdRef.current);}currentToastIdRef.current=showToast(newFollowState?'Comment.followSuccessful':'Comment.unfollowSuccessful');return [2/*return*/];}});});}function updateFollow(newFollowState){return __awaiter(this,void 0,void 0,function(){var error_1;return __generator(this,function(_a){switch(_a.label){case 0:if(isSavingRef.current){return [2/*return*/];}if(newFollowState===isFollowing){return [2/*return*/];}setIsFollowing(newFollowState);isSavingRef.current=true;_a.label=1;case 1:_a.trys.push([1,3,4,5]);return [4/*yield*/,toggleFollowComments(props.itemId,props.type,props.scope,newFollowState)];case 2:_a.sent();return [3/*break*/,5];case 3:error_1=_a.sent();logger.error(error_1);showError('Generic.error');return [3/*break*/,5];case 4:isSavingRef.current=false;return [7/*endfinally*/];case 5:return [2/*return*/];}});});}function hasDisabledNotificationSettings(){var notificationSettings=user.notificationTypeSettings||{};return notificationSettings.comments===NotificationType.None;}};var Host$Y=_styled.div.withConfig({displayName:"FollowComments__Host",componentId:"sc-1vcax52-0"})(templateObject_1$2n||(templateObject_1$2n=__makeTemplateObject([""],[""])));var WarningContainer=_styled.div.withConfig({displayName:"FollowComments__WarningContainer",componentId:"sc-1vcax52-1"})(templateObject_2$1z||(templateObject_2$1z=__makeTemplateObject(["\n margin-top: ","px;\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n width: 100%;\n i {\n font-size: 1.5em;\n margin-right: 7px;\n }\n"],["\n margin-top: ","px;\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n width: 100%;\n i {\n font-size: 1.5em;\n margin-right: 7px;\n }\n"])),spacingS);var WarningMessage=_styled.div.withConfig({displayName:"FollowComments__WarningMessage",componentId:"sc-1vcax52-2"})(templateObject_3$13||(templateObject_3$13=__makeTemplateObject(["\n flex: 1;\n"],["\n flex: 1;\n"])));var templateObject_1$2n,templateObject_2$1z,templateObject_3$13;// a string of all valid unicode whitespaces
121824
+ },[isFollowing,props.itemId,props.scope]);var showWarning=isFollowing&&hasDisabledNotificationSettings();var followLabelStringResourceKey=props.scope===ConversationScope.Public?'Comment.followLabel':'Comment.followEditorLabel';return jsxs(Host$Y,__assign({className:props.className},{children:[jsx$1(NeutralCheckBox,{checked:isFollowing,onChange:function(_e,checked){return handleOnChange(checked);},label:formatMessage({id:followLabelStringResourceKey})},void 0),showWarning&&jsxs(WarningContainer,__assign({className:"ms-font-m"},{children:[jsx$1(Icon,{className:"ms-fontColor-red",iconName:"warning"},void 0),jsxs(WarningMessage,{children:[jsx$1(FormattedMessage$1,{id:"Profile.notificationSettings.conversationsDisabled"},void 0),!props.hideProfileUrl&&jsxs(Fragment,{children:["\u00A0",jsx$1(Link,__assign({to:buildPath('/user')},{children:jsx$1(FormattedMessage$1,{id:"Profile.notificationSettings.conversationsDisabledChangeSettings"},void 0)}),void 0)]},void 0)]},void 0)]}),void 0)]}),void 0);function handleCommentCreated(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,updateFollow(true)];case 1:_a.sent();return [2/*return*/];}});});}function handleOnChange(newFollowState){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,updateFollow(newFollowState)];case 1:_a.sent();if(currentToastIdRef.current){dismissToast(currentToastIdRef.current);}currentToastIdRef.current=showToast(newFollowState?'Comment.followSuccessful':'Comment.unfollowSuccessful');return [2/*return*/];}});});}function updateFollow(newFollowState){return __awaiter(this,void 0,void 0,function(){var error_1;return __generator(this,function(_a){switch(_a.label){case 0:if(isSavingRef.current){return [2/*return*/];}if(newFollowState===isFollowing){return [2/*return*/];}setIsFollowing(newFollowState);isSavingRef.current=true;_a.label=1;case 1:_a.trys.push([1,3,4,5]);return [4/*yield*/,toggleFollowComments(props.itemId,props.type,props.scope,newFollowState)];case 2:_a.sent();return [3/*break*/,5];case 3:error_1=_a.sent();logger.error(error_1);showError('Generic.error');return [3/*break*/,5];case 4:isSavingRef.current=false;return [7/*endfinally*/];case 5:return [2/*return*/];}});});}function hasDisabledNotificationSettings(){var notificationSettings=user.notificationTypeSettings||{};return notificationSettings.comments===NotificationType.None;}};var Host$Y=_styled.div.withConfig({displayName:"FollowComments__Host",componentId:"sc-1vcax52-0"})(templateObject_1$2o||(templateObject_1$2o=__makeTemplateObject([""],[""])));var WarningContainer=_styled.div.withConfig({displayName:"FollowComments__WarningContainer",componentId:"sc-1vcax52-1"})(templateObject_2$1A||(templateObject_2$1A=__makeTemplateObject(["\n margin-top: ","px;\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n width: 100%;\n i {\n font-size: 1.5em;\n margin-right: 7px;\n }\n"],["\n margin-top: ","px;\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n width: 100%;\n i {\n font-size: 1.5em;\n margin-right: 7px;\n }\n"])),spacingS);var WarningMessage=_styled.div.withConfig({displayName:"FollowComments__WarningMessage",componentId:"sc-1vcax52-2"})(templateObject_3$14||(templateObject_3$14=__makeTemplateObject(["\n flex: 1;\n"],["\n flex: 1;\n"])));var templateObject_1$2o,templateObject_2$1A,templateObject_3$14;// a string of all valid unicode whitespaces
121824
121825
  // eslint-disable-next-line max-len
121825
121826
  var whitespaces$3='\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';var requireObjectCoercible$5=requireObjectCoercible$b;var whitespaces$2$1=whitespaces$3;var whitespace$1='['+whitespaces$2$1+']';var ltrim$1=RegExp('^'+whitespace$1+whitespace$1+'*');var rtrim$1=RegExp(whitespace$1+whitespace$1+'*$');// `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
121826
121827
  var createMethod$1$1=function(TYPE){return function($this){var string=String(requireObjectCoercible$5($this));if(TYPE&1)string=string.replace(ltrim$1,'');if(TYPE&2)string=string.replace(rtrim$1,'');return string;};};var stringTrim$1={// `String.prototype.{ trimLeft, trimStart }` methods
@@ -122036,11 +122037,11 @@ if(nativeCreateObjectURL)redefine$3(URLConstructor,'createObjectURL',function cr
122036
122037
  if(nativeRevokeObjectURL)redefine$3(URLConstructor,'revokeObjectURL',function revokeObjectURL(url){return nativeRevokeObjectURL.apply(NativeURL,arguments);});}setToStringTag$1(URLConstructor,'URL');$$a({global:true,forced:!USE_NATIVE_URL,sham:!DESCRIPTORS$4},{URL:URLConstructor});var $$9=_export;var getOwnPropertyDescriptor$1=objectGetOwnPropertyDescriptor.f;var toLength$5=toLength$a;var notARegExp=notARegexp;var requireObjectCoercible$3$1=requireObjectCoercible$b;var correctIsRegExpLogic=correctIsRegexpLogic;var nativeStartsWith=''.startsWith;var min$2=Math.min;var CORRECT_IS_REGEXP_LOGIC=correctIsRegExpLogic('startsWith');// https://github.com/zloirock/core-js/pull/702
122037
122038
  var MDN_POLYFILL_BUG=!CORRECT_IS_REGEXP_LOGIC&&!!function(){var descriptor=getOwnPropertyDescriptor$1(String.prototype,'startsWith');return descriptor&&!descriptor.writable;}();// `String.prototype.startsWith` method
122038
122039
  // https://tc39.github.io/ecma262/#sec-string.prototype.startswith
122039
- $$9({target:'String',proto:true,forced:!MDN_POLYFILL_BUG&&!CORRECT_IS_REGEXP_LOGIC},{startsWith:function startsWith(searchString/* , position = 0 */){var that=String(requireObjectCoercible$3$1(this));notARegExp(searchString);var index=toLength$5(min$2(arguments.length>1?arguments[1]:undefined,that.length));var search=String(searchString);return nativeStartsWith?nativeStartsWith.call(that,search,index):that.slice(index,index+search.length)===search;}});var mentionRegex=/[@#](\[(.+?)]\((.+?)\))/gi;var CommentInput=/*#__PURE__*/forwardRef(function(_a,ref){var disabled=_a.disabled,onEnter=_a.onEnter,onCtrlEnter=_a.onCtrlEnter,buttons=_a.buttons,content=_a.content,onChange=_a.onChange,onFocus=_a.onFocus,autoFocus=_a.autoFocus,className=_a.className,mentionSearchHandler=_a.mentionSearchHandler,inputTheme=_a.inputTheme,placeHolderStringResourceKey=_a.placeHolderStringResourceKey,placeHolderStringResourceValues=_a.placeHolderStringResourceValues;var formatMessage=useIntl().formatMessage;var handleSearch=useMentionsSearch(mentionSearchHandler,handleSearchComplete);var inputRef=useRef$1(null);var hostRef=useRef$1(null);// exists only for e2e tests, so we know when the focus has been set
122040
- var _b=useState$2(false),didInitialFocus=_b[0],setDidInitialFocus=_b[1];var screenSize=useWindowSize$2();var inputPlaceholder=screenSize.width>maxScreenSize.medium?'PostMessage.inputPlaceholder':'PostMessage.inputPlaceholder.mobile';useImperativeHandle(ref,function(){return inputRef.current;},[inputRef]);useEffect$1(function(){if(autoFocus&&inputRef.current&&!didInitialFocus&&!disabled){// HACK: it seems as the react-mentions input does not like setting the focus
122040
+ $$9({target:'String',proto:true,forced:!MDN_POLYFILL_BUG&&!CORRECT_IS_REGEXP_LOGIC},{startsWith:function startsWith(searchString/* , position = 0 */){var that=String(requireObjectCoercible$3$1(this));notARegExp(searchString);var index=toLength$5(min$2(arguments.length>1?arguments[1]:undefined,that.length));var search=String(searchString);return nativeStartsWith?nativeStartsWith.call(that,search,index):that.slice(index,index+search.length)===search;}});var mentionRegex=/[@#](\[(.+?)]\((.+?)\))/gi;var CommentInput=/*#__PURE__*/forwardRef(function(_a,ref){var disabled=_a.disabled,onEnter=_a.onEnter,onCtrlEnter=_a.onCtrlEnter,buttons=_a.buttons,content=_a.content,onChange=_a.onChange,onFocus=_a.onFocus,autoFocus=_a.autoFocus,className=_a.className,mentionSearchHandler=_a.mentionSearchHandler,placeHolderStringResourceKey=_a.placeHolderStringResourceKey,placeHolderStringResourceValues=_a.placeHolderStringResourceValues,disableBoxShadow=_a.disableBoxShadow,ariaLabel=_a.ariaLabel,additionalInputControl=_a.additionalInputControl;var formatMessage=useIntl().formatMessage;var handleSearch=useMentionsSearch(mentionSearchHandler,handleSearchComplete);var inputRef=useRef$1(null);var hostRef=useRef$1(null);// exists only for e2e tests, so we know when the focus has been set
122041
+ var _b=useState$2(false),didInitialFocus=_b[0],setDidInitialFocus=_b[1];var showEmojiButton=!env.isNativeMobileApp;useImperativeHandle(ref,function(){return inputRef.current;},[inputRef]);useEffect$1(function(){if(autoFocus&&inputRef.current&&!didInitialFocus&&!disabled){// HACK: it seems as the react-mentions input does not like setting the focus
122041
122042
  // right away. Postpone it for a couple of ms
122042
122043
  // Unfortunately autoFocus={true} is not supported
122043
- setTimeout(function(){focusOnEnd(inputRef.current);setDidInitialFocus(true);});}},[inputRef,autoFocus,didInitialFocus,disabled]);return jsxs(Host$X,__assign({ref:hostRef,className:classNames('comment-input__host',className),scheme:inputTheme,"data-comment-input":true,"data-did-initial-focus":didInitialFocus},{children:[jsx$1(InputContainer,__assign({scheme:inputTheme},{children:jsx$1(MentionsInput$1,__assign({className:"comment-input",value:content,singleLine:false,allowSpaceInQuery:true,onKeyDown:handleKeyDown,onChange:function(event){return onChange(event.target.value);},placeholder:getPlaceholder(),disabled:disabled,inputRef:inputRef,allowSuggestionsAboveCursor:true,onFocus:onFocus},{children:jsx$1(Mention$1,{trigger:"@",data:handleSearch,appendSpaceOnAdd:true,renderSuggestion:function(s){var userSuggestion=s;return jsx$1(Avatar,{upn:userSuggestion.upn,text:userSuggestion.displayName,secondaryText:userSuggestion.upn},s.id);}},void 0)}),void 0)}),void 0),jsxs(Buttons$3,{children:[jsx$1(EmojiButton,{onEmojiSelected:handleAddEmoji,disabled:disabled},void 0),buttons&&buttons]},void 0)]}),void 0);function handleAddEmoji(emoji){var mentionMatches=__spreadArray([],Array.from(getAllMatches(content,mentionRegex)));var cursorPosition=getCorrectCursorPosition(inputRef.current.selectionStart,mentionMatches);var end=getCorrectCursorPosition(inputRef.current.selectionEnd,mentionMatches);var before=content.substring(0,cursorPosition);var after=content.substring(end);onChange(before+emoji+after);setTimeout(function(){inputRef.current.focus();inputRef.current.setSelectionRange(cursorPosition+2,cursorPosition+2);},0);}function getCorrectCursorPosition(cursorPosition,matches){// this method is required because for the user visible content in the textbox will look like this:
122044
+ setTimeout(function(){focusOnEnd(inputRef.current);setDidInitialFocus(true);});}},[inputRef,autoFocus,didInitialFocus,disabled]);return jsxs(Host$X,__assign({ref:hostRef,className:classNames('comment-input__host',className),"data-comment-input":true,"data-did-initial-focus":didInitialFocus,disableBoxShadow:disableBoxShadow},{children:[jsxs(InputContainer,{children:[jsx$1(MentionsInput$1,__assign({className:"comment-input",value:content,singleLine:false,allowSpaceInQuery:true,onKeyDown:handleKeyDown,onChange:function(event){return onChange(event.target.value);},placeholder:getPlaceholder(),disabled:disabled,inputRef:inputRef,allowSuggestionsAboveCursor:true,onFocus:onFocus,"aria-label":ariaLabel},{children:jsx$1(Mention$1,{trigger:"@",data:handleSearch,appendSpaceOnAdd:true,renderSuggestion:function(s){var userSuggestion=s;return jsx$1(Avatar,{upn:userSuggestion.upn,text:userSuggestion.displayName,secondaryText:userSuggestion.upn},s.id);}},void 0)}),void 0),additionalInputControl]},void 0),jsxs(Buttons$4,{children:[((buttons===null||buttons===void 0?void 0:buttons.leftSide)||showEmojiButton)&&jsx$1(Fragment,{children:jsxs(LeftSide,{children:[buttons===null||buttons===void 0?void 0:buttons.leftSide,jsx$1(EmojiButton,{onEmojiSelected:handleAddEmoji,disabled:disabled},void 0)]},void 0)},void 0),(buttons===null||buttons===void 0?void 0:buttons.rightSide)&&jsx$1(RightSide,{children:buttons.rightSide},void 0)]},void 0)]}),void 0);function handleAddEmoji(emoji){var mentionMatches=__spreadArray([],Array.from(getAllMatches(content,mentionRegex)));var cursorPosition=getCorrectCursorPosition(inputRef.current.selectionStart,mentionMatches);var end=getCorrectCursorPosition(inputRef.current.selectionEnd,mentionMatches);var before=content.substring(0,cursorPosition);var after=content.substring(end);onChange(before+emoji+after);setTimeout(function(){inputRef.current.focus();inputRef.current.setSelectionRange(cursorPosition+2,cursorPosition+2);},0);}function getCorrectCursorPosition(cursorPosition,matches){// this method is required because for the user visible content in the textbox will look like this:
122044
122045
  // hallo @Shimp Pansen how are you?
122045
122046
  // while the internal value looks like this:
122046
122047
  // hallo @[@Shimp Pansen](60a25c30cfc17a0c3b5f2d53) how are you?
@@ -122059,12 +122060,8 @@ suggestionsContainer.style.maxWidth=hostRect.width-4+"px";// this block fixes th
122059
122060
  // probably because we have a "custom" input box, the calculation of the
122060
122061
  // the mention library is not entirely correct, therefore we add our own
122061
122062
  // top / bottom values
122062
- if(inputBox.top<500){suggestionsContainer.style.top=inputBox.height-10+"px";}else {suggestionsContainer.style.bottom=inputBox.height+"px";suggestionsContainer.style.top='unset';}}function getPlaceholder(){var placeholder=formatMessage({id:placeHolderStringResourceKey||inputPlaceholder},placeHolderStringResourceValues);if(!onCtrlEnter){return placeholder;}var browserHint=formatMessage({id:'PostMessage.inputPlaceholderHint'},{keyName:'CTRL'});return placeholder+" "+browserHint;}});function useMentionsSearch(mentionSearchHandler,handleSearchComplete){var _this=this;var searchSubject=useRef$1(new Subject());useEffect$1(function(){var subscription=searchSubject.current.pipe(debounceTime(500),switchMap(function(args){return __awaiter(_this,void 0,void 0,function(){var users;return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,mentionSearchHandler(args.searchText)];case 1:users=_a.sent();args.updateSuggestions(users.map(function(u){return {id:u.id,upn:u.userPrincipalName,displayName:u.displayName,display:'@'+u.displayName};}));return [2/*return*/,users];}});});})).subscribe(function(){return handleSearchComplete();});return function(){subscription&&subscription.unsubscribe();};// eslint-disable-next-line react-hooks/exhaustive-deps
122063
- },[]);return function(searchText,updateSuggestions){searchSubject.current.next({searchText:searchText,updateSuggestions:updateSuggestions});};}function getBackgroundColor(theme){switch(theme){case'dark':return defaultPageBackgroundColor;default:case'light':return '#fff';}}var Host$X=_styled.div.withConfig({displayName:"CommentInput__Host",componentId:"sc-777bqz-0"})(templateObject_1$2m||(templateObject_1$2m=__makeTemplateObject(["\n display: flex;\n position: relative;\n flex-wrap: wrap;\n flex: 1 1 auto;\n background-color: ",";\n border: 1px solid #656565;\n\n textarea {\n font-family: 'Roboto', sans-serif !important;\n font-size: 14px;\n line-height: ","px;\n }\n\n .comment-input__suggestions {\n @media (max-width: ","px) {\n max-height: 300px;\n overflow-y: auto;\n padding-right: ","px;\n }\n\n &__list {\n background-color: white;\n border: 1px solid rgba(0, 0, 0, 0.15);\n width: 100%;\n }\n &__item {\n padding: 5px 15px;\n border-bottom: 1px solid rgba(0, 0, 0, 0.15);\n\n &:last-of-type {\n border-bottom: none;\n }\n\n &--focused {\n background-color: ",";\n }\n }\n }\n"],["\n display: flex;\n position: relative;\n flex-wrap: wrap;\n flex: 1 1 auto;\n background-color: ",";\n border: 1px solid #656565;\n\n textarea {\n font-family: 'Roboto', sans-serif !important;\n font-size: 14px;\n line-height: ","px;\n }\n\n .comment-input__suggestions {\n @media (max-width: ","px) {\n max-height: 300px;\n overflow-y: auto;\n padding-right: ","px;\n }\n\n &__list {\n background-color: white;\n border: 1px solid rgba(0, 0, 0, 0.15);\n width: 100%;\n }\n &__item {\n padding: 5px 15px;\n border-bottom: 1px solid rgba(0, 0, 0, 0.15);\n\n &:last-of-type {\n border-bottom: none;\n }\n\n &--focused {\n background-color: ",";\n }\n }\n }\n"])),function(_a){var scheme=_a.scheme;return getBackgroundColor(scheme);},spacingM,maxScreenSize.medium,spacingXxs,defaultPageBackgroundColor);var Buttons$3=_styled.div.withConfig({displayName:"CommentInput__Buttons",componentId:"sc-777bqz-1"})(templateObject_2$1y||(templateObject_2$1y=__makeTemplateObject(["\n display: flex;\n align-items: flex-end;\n padding-bottom: 2px;\n margin: 0 ","px 0 ","px;\n\n && button {\n background-color: transparent;\n\n i {\n font-size: 22px;\n }\n }\n"],["\n display: flex;\n align-items: flex-end;\n padding-bottom: 2px;\n margin: 0 ","px 0 ","px;\n\n && button {\n background-color: transparent;\n\n i {\n font-size: 22px;\n }\n }\n"])),spacingXs,spacingXxs);var InputContainer=_styled.div.withConfig({displayName:"CommentInput__InputContainer",componentId:"sc-777bqz-2"})(templateObject_3$12||(templateObject_3$12=__makeTemplateObject(["\n flex: 1;\n\n display: flex;\n flex-direction: column;\n justify-content: center;\n\n .comment-input {\n &__control {\n background-color: transparent;\n font-size: 14px;\n font-weight: normal;\n border: none;\n }\n &__input {\n /*\n * on small screens the MentionsInput renders a margin-left: -3px directly on the element\n * Use !important to remove the minus margin to match our layout.\n */\n margin: 0 !important;\n padding: 5px;\n outline: 0;\n border: 0;\n }\n &__highlighter {\n padding: 5px;\n border: 0;\n font-family: 'Roboto', sans-serif !important;\n font-size: 14px;\n line-height: ","px;\n\n strong {\n ","\n }\n }\n }\n"],["\n flex: 1;\n\n display: flex;\n flex-direction: column;\n justify-content: center;\n\n .comment-input {\n &__control {\n background-color: transparent;\n font-size: 14px;\n font-weight: normal;\n border: none;\n }\n &__input {\n /*\n * on small screens the MentionsInput renders a margin-left: -3px directly on the element\n * Use !important to remove the minus margin to match our layout.\n */\n margin: 0 !important;\n padding: 5px;\n outline: 0;\n border: 0;\n }\n &__highlighter {\n padding: 5px;\n border: 0;\n font-family: 'Roboto', sans-serif !important;\n font-size: 14px;\n line-height: ","px;\n\n strong {\n ","\n }\n }\n }\n"])),spacingM,"background-color: "+defaultPageBackgroundColor+";");var templateObject_1$2m,templateObject_2$1y,templateObject_3$12;var DropTarget=_styled.div.withConfig({displayName:"DropInfo__DropTarget",componentId:"sc-1ky6ew9-0"})(templateObject_1$2l||(templateObject_1$2l=__makeTemplateObject(["\n position: ",";\n top: ",";\n left: 0;\n right: 0;\n bottom: 0;\n z-index: ",";\n\n background-color: ",";\n\n display: flex;\n justify-content: center;\n"],["\n position: ",";\n top: ",";\n left: 0;\n right: 0;\n bottom: 0;\n z-index: ",";\n\n background-color: ",";\n\n display: flex;\n justify-content: center;\n"])),function(_a){var isLarge=_a.isLarge,isActive=_a.isActive;return isLarge&&isActive?'fixed':'absolute';},function(_a){var isLarge=_a.isLarge;return isLarge?headerHeight+"px":'0';},function(_a){var isActive=_a.isActive;return isActive?300:0;},function(_a){var isActive=_a.isActive;return isActive?'rgba(253, 253, 253, 0.95)':'transparent';});var DropInfo=function DropInfo(_a){var isLarge=_a.isLarge;return jsx$1(Host$W,__assign({isLarge:isLarge},{children:jsxs(CenteredContainer,__assign({isLarge:isLarge},{children:[jsx$1(StyledIcon$8,{isLarge:isLarge,iconName:"bulkUpload",className:"ms-fontColor-accent"},void 0),jsx$1(FormattedMessage$1,{id:"Generic.dragToUploadTitle",tagName:"h2"},void 0),jsx$1(FormattedMessage$1,{id:"Generic.dragToUploadDescription",tagName:"p"},void 0)]}),void 0)}),void 0);};var Host$W=_styled.div.withConfig({displayName:"DropInfo__Host",componentId:"sc-1ky6ew9-1"})(templateObject_2$1x||(templateObject_2$1x=__makeTemplateObject(["\n ",";\n ",";\n"],["\n ",";\n ",";\n"])),function(_a){var isLarge=_a.isLarge;return !isLarge&&'display: flex';},function(_a){var isLarge=_a.isLarge;return !isLarge&&'align-items: center';});var CenteredContainer=_styled.div.withConfig({displayName:"DropInfo__CenteredContainer",componentId:"sc-1ky6ew9-2"})(templateObject_3$11||(templateObject_3$11=__makeTemplateObject(["\n position: relative;\n top: ",";\n\n display: flex;\n flex-direction: column;\n align-items: center;\n\n h2 {\n margin-bottom: 0;\n }\n p {\n margin-top: 3px;\n }\n"],["\n position: relative;\n top: ",";\n\n display: flex;\n flex-direction: column;\n align-items: center;\n\n h2 {\n margin-bottom: 0;\n }\n p {\n margin-top: 3px;\n }\n"])),function(_a){var isLarge=_a.isLarge;return isLarge?'20%':0;});var StyledIcon$8=_styled(Icon).withConfig({displayName:"DropInfo__StyledIcon",componentId:"sc-1ky6ew9-3"})(templateObject_4$L||(templateObject_4$L=__makeTemplateObject(["\n font-size: ",";\n"],["\n font-size: ",";\n"])),function(p){return p.isLarge?'100px':'50px';});var templateObject_1$2l,templateObject_2$1x,templateObject_3$11,templateObject_4$L;var KeywordsPicker=function KeywordsPicker(props){var _a;var _b=useContext(LazySubscriptionContext),allKeywords=_b.allKeywords,selectedKeywordGroups=_b.selectedKeywordGroups;var availableKeywords=(_a=props.availableKeywords)!==null&&_a!==void 0?_a:allKeywords;if(!allKeywords||!selectedKeywordGroups||!availableKeywords){return null;}return jsx$1(KeywordsPickerInternal,__assign({},props,{availableKeywords:availableKeywords,selectedKeywordGroups:selectedKeywordGroups}),void 0);};var KeywordsPickerInternal=function KeywordsPickerInternal(_a){var selectedKeywordGroups=_a.selectedKeywordGroups,defaultKeywords=_a.defaultKeywords,availableKeywords=_a.availableKeywords,mandatoryKeywords=_a.mandatoryKeywords,onChangeKeywords=_a.onChangeKeywords;var pickerInputId=createId();var user=useCurrentUser();var mandatoryKeywordIds=(mandatoryKeywords===null||mandatoryKeywords===void 0?void 0:mandatoryKeywords.map(function(k){return k.id;}))||[];var _b=useState$2(),selectedItems=_b[0],setSelectedItems=_b[1];useEffect$1(function(){init();// eslint-disable-next-line react-hooks/exhaustive-deps
122064
- },[]);var allSuggestions=getAllSuggestions();var noKeywords=availableKeywords.length===0;return jsxs(Host$V,__assign({"data-keywords-picker":true},{children:[noKeywords&&jsx$1(FormattedMessage$1,{id:"KeywordPicker.noGroupsDefined"},void 0),!noKeywords&&jsxs(Fragment,{children:[jsxs(LabelHost,{children:[jsx$1("label",__assign({htmlFor:pickerInputId},{children:jsx$1(FormattedMessage$1,{id:"Keywords.picker.selectKeywords"},void 0)}),void 0),(mandatoryKeywords===null||mandatoryKeywords===void 0?void 0:mandatoryKeywords.length)>0&&jsx$1(MandatoryKeywordsInfoIcon,{},void 0)]},void 0),jsx$1(StyledTagPicker,{onResolveSuggestions:handleResolveKeywords,inputProps:{id:pickerInputId},selectedItems:selectedItems,onEmptyResolveSuggestions:getAllSuggestions,onChange:handleOnChange,pickerCalloutProps:{preventDismissOnResize:true},onRenderItem:function(item){return jsx$1(Tag,{item:item.item,onRemoveItem:removeItem},item.key);}},void 0)]},void 0)]}),void 0);function handleResolveKeywords(searchText,selectedItems){searchText=searchText===null||searchText===void 0?void 0:searchText.toLowerCase();return allSuggestions===null||allSuggestions===void 0?void 0:allSuggestions.filter(function(k){return (searchText.length===0||k.name.toLowerCase().indexOf(searchText)>-1)&&selectedItems.every(function(i){return i.name.toLowerCase().indexOf(searchText)===-1;});});}function init(){var flatDefaultKeywords=getFlatKeywordList(defaultKeywords)||[];var filteredKeywords=ensureMandatoryKeywords(mandatoryKeywords,flatDefaultKeywords);var availableKeywordIds=availableKeywords.map(function(k){return k.id;});filteredKeywords=filteredKeywords.filter(function(k){return availableKeywordIds.includes(k.id);});// it is possible an older post does not have any/all mandatory or available keywords of its group
122065
- // here we detect this (if the post is getting edited) and update the keywords accordingly
122066
- if(filteredKeywords.length!==flatDefaultKeywords.length){onChangeKeywords(filteredKeywords);}setSelectedItems(filteredKeywords.map(function(k){return {name:getKeywordDisplayValue(selectedKeywordGroups,user,k.groupId,k.name),key:k.id,isMandatory:mandatoryKeywordIds.includes(k.id)};}));}function getAllSuggestions(selectedItems){return availableKeywords===null||availableKeywords===void 0?void 0:availableKeywords.filter(function(k){return (selectedItems||[]).every(function(i){return i.key!==k.id;});}).map(function(k){return {key:k.id,name:getKeywordDisplayValue(selectedKeywordGroups,user,k.groupId,k.name)};});}function handleOnChange(items){var itemKeys=items.map(function(i){return i.key;});// this prevents the user from removing a mandatory keyword by using the backspace button
122067
- if(!mandatoryKeywordIds.every(function(id){return itemKeys.includes(id);})){return;}updateKeywords(items);}function removeItem(item){var filteredSelectedItems=selectedItems.filter(function(i){return i.key!==item.key;});updateKeywords(filteredSelectedItems);}function updateKeywords(items){setSelectedItems(items);var selectedItemIds=items.map(function(i){return i.key;});onChangeKeywords(availableKeywords.filter(function(k){return selectedItemIds.includes(k.id);}));}};var MandatoryKeywordsInfoIcon=function MandatoryKeywordsInfoIcon(){var formatMessage=useIntl().formatMessage;var _a=useState$2(false),showCallout=_a[0],setShowCallout=_a[1];var infoButtonRef=useRef$1();return jsxs("div",__assign({ref:infoButtonRef},{children:[jsx$1(StyledIconButton$7,{iconProps:{iconName:'Info'},onClick:function(){return setShowCallout(!showCallout);},ariaLabel:formatMessage({id:'Keywords.picker.tooltipAriaLabel'})},void 0),showCallout&&jsx$1(StyledCallout$1,__assign({onDismiss:function(){return setShowCallout(false);},target:infoButtonRef.current},{children:jsx$1(FormattedMessage$1,{id:"Keywords.picker.tooltip"},void 0)}),void 0)]}),void 0);};var Tag=function Tag(_a){var item=_a.item,onRemoveItem=_a.onRemoveItem;var formatMessage=useIntl().formatMessage;var canBeRemoved=!item.isMandatory;return jsxs(TagWrapper,__assign({"data-keyword-tag":item.name},{children:[jsx$1(KeywordName,{children:item.name},void 0),canBeRemoved&&jsx$1(RemoveTagButton,{iconProps:{iconName:'Cancel'},onClick:function(){return onRemoveItem(item);},ariaLabel:formatMessage({id:'AriaLabel.removeKeywordButton'}),"data-remove-keyword-button":true},void 0)]}),void 0);};var Host$V=_styled.div.withConfig({displayName:"KeywordsPicker__Host",componentId:"sc-5ec8mr-0"})(templateObject_1$2k||(templateObject_1$2k=__makeTemplateObject(["\n margin-top: ","px;\n padding: ","px;\n background-color: ",";\n"],["\n margin-top: ","px;\n padding: ","px;\n background-color: ",";\n"])),spacingS,spacingS,function(p){return p.theme.palette.white;});var LabelHost=_styled.div.withConfig({displayName:"KeywordsPicker__LabelHost",componentId:"sc-5ec8mr-1"})(templateObject_2$1w||(templateObject_2$1w=__makeTemplateObject(["\n display: flex;\n"],["\n display: flex;\n"])));var StyledIconButton$7=_styled(IconButton).withConfig({displayName:"KeywordsPicker__StyledIconButton",componentId:"sc-5ec8mr-2"})(templateObject_3$10||(templateObject_3$10=__makeTemplateObject(["\n height: 100%;\n"],["\n height: 100%;\n"])));var StyledCallout$1=_styled(Callout).withConfig({displayName:"KeywordsPicker__StyledCallout",componentId:"sc-5ec8mr-3"})(templateObject_4$K||(templateObject_4$K=__makeTemplateObject(["\n padding: ","px;\n"],["\n padding: ","px;\n"])),spacingS);var TagWrapper=_styled.div.withConfig({displayName:"KeywordsPicker__TagWrapper",componentId:"sc-5ec8mr-4"})(templateObject_5$D||(templateObject_5$D=__makeTemplateObject(["\n background-color: ",";\n line-height: 26px;\n margin-right: ","px;\n display: flex;\n font-size: ","px;\n"],["\n background-color: ",";\n line-height: 26px;\n margin-right: ","px;\n display: flex;\n font-size: ","px;\n"])),function(p){return p.theme.palette.neutralLight;},spacingXxs+1,fontSizeSmall);var KeywordName=_styled.span.withConfig({displayName:"KeywordsPicker__KeywordName",componentId:"sc-5ec8mr-5"})(templateObject_6$s||(templateObject_6$s=__makeTemplateObject(["\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n min-width: ","px;\n margin: 0 ","px;\n"],["\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n min-width: ","px;\n margin: 0 ","px;\n"])),spacingL,spacingXs+2);var RemoveTagButton=_styled(IconButton).withConfig({displayName:"KeywordsPicker__RemoveTagButton",componentId:"sc-5ec8mr-6"})(templateObject_7$m||(templateObject_7$m=__makeTemplateObject(["\n padding: 0 ","px;\n border-radius: 0 ","px ","px 0;\n width: ","px;\n height: auto;\n i {\n font-size: ","px;\n }\n"],["\n padding: 0 ","px;\n border-radius: 0 ","px ","px 0;\n width: ","px;\n height: auto;\n i {\n font-size: ","px;\n }\n"])),spacingXxs+1,spacingXxs-1,spacingXxs-1,spacingL,fontSizeSmaller);var StyledTagPicker=_styled(TagPicker).withConfig({displayName:"KeywordsPicker__StyledTagPicker",componentId:"sc-5ec8mr-7"})(templateObject_8$k||(templateObject_8$k=__makeTemplateObject(["\n margin-top: ","px;\n"],["\n margin-top: ","px;\n"])),spacingS);var templateObject_1$2k,templateObject_2$1w,templateObject_3$10,templateObject_4$K,templateObject_5$D,templateObject_6$s,templateObject_7$m,templateObject_8$k;var hasValidGenericUrlVideoSourcePrefix=function hasValidGenericUrlVideoSourcePrefix(url){return url&&getAdditionalVideoSources().filter(function(s){return url.startsWith(s.prefix);}).length>0;};var VideoUrlParser=/** @class */function(){function VideoUrlParser(url){this.url=url;this.source=null;this.id=null;this.isDirectVideoUrl=false;this.videoProperties=null;this.thumbnailUrl=null;if(hasValidGenericUrlVideoSourcePrefix(this.url)){this.source=VideoSource.GenericUrl;this.id=url;}else if(VideoUrlParser.microsoftStreamRegex.test(this.url)){this.source=VideoSource.MicrosoftStream;this.id=VideoUrlParser.microsoftStreamRegex.exec(this.url)[1];}else if(VideoUrlParser.ytRegex.test(this.url)){this.source=VideoSource.YouTube;this.id=VideoUrlParser.ytRegex.exec(this.url)[1];}else if(VideoUrlParser.vimeoRegex.test(this.url)){this.source=VideoSource.Vimeo;this.id=VideoUrlParser.vimeoRegex.exec(this.url)[1];}else if(VideoUrlParser.vimeoDirectLinkRegex.test(this.url)){this.source=VideoSource.Vimeo;this.id=VideoUrlParser.vimeoDirectLinkRegex.exec(this.url)[1];this.isDirectVideoUrl=true;}else if(VideoUrlParser.vimeoRedirectLinkRegex.test(this.url)){this.source=VideoSource.Vimeo;this.id=VideoUrlParser.vimeoRedirectLinkRegex.exec(this.url)[1];}else if(VideoUrlParser.kalturaRegex.test(this.url)){var regexMatches=VideoUrlParser.kalturaRegex.exec(this.url);this.source=VideoSource.Kaltura;this.id=regexMatches[1];this.videoProperties={sp:regexMatches[2],uiconfId:regexMatches[3],partnerId:regexMatches[4],entryId:regexMatches[5]};this.thumbnailUrl="https://cdnsecakmi.kaltura.com/p/"+this.id+"/thumbnail/entry_id/"+this.videoProperties.entryId+"/width/1000";}}//TODO handle the different error messages for cloud and onprem versions, i.e. what sources are permitted (see task 23570)
122063
+ if(inputBox.top<500){suggestionsContainer.style.top=inputBox.height-10+"px";}else {suggestionsContainer.style.bottom=inputBox.height+"px";suggestionsContainer.style.top='unset';}}function getPlaceholder(){var placeholder=formatMessage({id:placeHolderStringResourceKey||'CommentInput.placeholder'},placeHolderStringResourceValues);if(!onCtrlEnter){return placeholder;}var browserHint=formatMessage({id:'CommentInput.placeholderHint'},{keyName:'CTRL'});return placeholder+" "+browserHint;}});function useMentionsSearch(mentionSearchHandler,handleSearchComplete){var _this=this;var searchSubject=useRef$1(new Subject());useEffect$1(function(){var subscription=searchSubject.current.pipe(debounceTime(500),switchMap(function(args){return __awaiter(_this,void 0,void 0,function(){var users;return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,mentionSearchHandler(args.searchText)];case 1:users=_a.sent();args.updateSuggestions(users.map(function(u){return {id:u.id,upn:u.userPrincipalName,displayName:u.displayName,display:'@'+u.displayName};}));return [2/*return*/,users];}});});})).subscribe(function(){return handleSearchComplete();});return function(){subscription&&subscription.unsubscribe();};// eslint-disable-next-line react-hooks/exhaustive-deps
122064
+ },[]);return function(searchText,updateSuggestions){searchSubject.current.next({searchText:searchText,updateSuggestions:updateSuggestions});};}var Host$X=_styled.div.withConfig({displayName:"CommentInput__Host",componentId:"sc-777bqz-0"})(templateObject_2$1z||(templateObject_2$1z=__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n position: relative;\n ","\n\n textarea {\n font-family: 'Roboto', sans-serif !important;\n font-size: 14px;\n line-height: ","px;\n }\n\n .comment-input__suggestions {\n @media (max-width: ","px) {\n max-height: 300px;\n overflow-y: auto;\n padding-right: ","px;\n }\n\n &__list {\n background-color: white;\n border: 1px solid rgba(0, 0, 0, 0.15);\n width: 100%;\n }\n &__item {\n padding: 5px 15px;\n border-bottom: 1px solid rgba(0, 0, 0, 0.15);\n\n &:last-of-type {\n border-bottom: none;\n }\n\n &--focused {\n background-color: ",";\n }\n }\n }\n"],["\n display: flex;\n flex-direction: column;\n position: relative;\n ","\n\n textarea {\n font-family: 'Roboto', sans-serif !important;\n font-size: 14px;\n line-height: ","px;\n }\n\n .comment-input__suggestions {\n @media (max-width: ","px) {\n max-height: 300px;\n overflow-y: auto;\n padding-right: ","px;\n }\n\n &__list {\n background-color: white;\n border: 1px solid rgba(0, 0, 0, 0.15);\n width: 100%;\n }\n &__item {\n padding: 5px 15px;\n border-bottom: 1px solid rgba(0, 0, 0, 0.15);\n\n &:last-of-type {\n border-bottom: none;\n }\n\n &--focused {\n background-color: ",";\n }\n }\n }\n"])),function(p){return p.disableBoxShadow?css$2(templateObject_1$2n||(templateObject_1$2n=__makeTemplateObject(["\n border: 1px solid ",";\n "],["\n border: 1px solid ",";\n "])),function(p){return p.theme.palette.neutralTertiaryAlt;}):CardBorderInline(2,2);},spacingM,maxScreenSize.medium,spacingXxs,defaultPageBackgroundColor);var Buttons$4=_styled.div.withConfig({displayName:"CommentInput__Buttons",componentId:"sc-777bqz-1"})(templateObject_3$13||(templateObject_3$13=__makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n box-sizing: border-box;\n padding: ","px ","px;\n background-color: ",";\n\n && button {\n background-color: transparent;\n\n i {\n font-size: 22px;\n }\n }\n"],["\n display: flex;\n justify-content: space-between;\n box-sizing: border-box;\n padding: ","px ","px;\n background-color: ",";\n\n && button {\n background-color: transparent;\n\n i {\n font-size: 22px;\n }\n }\n"])),spacingXxs,spacingS+5,function(p){return p.theme.palette.neutralLighter;});var LeftSide=_styled.div.withConfig({displayName:"CommentInput__LeftSide",componentId:"sc-777bqz-2"})(templateObject_4$L||(templateObject_4$L=__makeTemplateObject(["\n display: flex;\n gap: ","px;\n\n @media (min-width: ","px) {\n gap: ","px;\n }\n"],["\n display: flex;\n gap: ","px;\n\n @media (min-width: ","px) {\n gap: ","px;\n }\n"])),spacingM+5,minScreenSize.medium,spacingS+5);var RightSide=_styled.div.withConfig({displayName:"CommentInput__RightSide",componentId:"sc-777bqz-3"})(templateObject_5$D||(templateObject_5$D=__makeTemplateObject(["\n display: flex;\n gap: ","px;\n margin-left: auto;\n"],["\n display: flex;\n gap: ","px;\n margin-left: auto;\n"])),spacingS);var InputContainer=_styled.div.withConfig({displayName:"CommentInput__InputContainer",componentId:"sc-777bqz-4"})(templateObject_6$s||(templateObject_6$s=__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n justify-content: center;\n padding: ","px ","px;\n background-color: ",";\n\n .comment-input {\n &__control {\n background-color: transparent;\n font-size: 14px;\n font-weight: normal;\n border: none;\n }\n &__input {\n /*\n * on small screens the MentionsInput renders a margin-left: -3px directly on the element\n * Use !important to remove the minus margin to match our layout.\n */\n margin: 0 !important;\n padding: 0;\n outline: 0;\n border: 0;\n }\n &__highlighter {\n padding: 0;\n border: 0;\n font-family: 'Roboto', sans-serif !important;\n font-size: 14px;\n line-height: ","px;\n\n strong {\n ","\n }\n }\n }\n"],["\n display: flex;\n flex-direction: column;\n justify-content: center;\n padding: ","px ","px;\n background-color: ",";\n\n .comment-input {\n &__control {\n background-color: transparent;\n font-size: 14px;\n font-weight: normal;\n border: none;\n }\n &__input {\n /*\n * on small screens the MentionsInput renders a margin-left: -3px directly on the element\n * Use !important to remove the minus margin to match our layout.\n */\n margin: 0 !important;\n padding: 0;\n outline: 0;\n border: 0;\n }\n &__highlighter {\n padding: 0;\n border: 0;\n font-family: 'Roboto', sans-serif !important;\n font-size: 14px;\n line-height: ","px;\n\n strong {\n ","\n }\n }\n }\n"])),spacingS,spacingS+5,function(p){return p.theme.palette.white;},spacingM,"background-color: "+defaultPageBackgroundColor+";");var templateObject_1$2n,templateObject_2$1z,templateObject_3$13,templateObject_4$L,templateObject_5$D,templateObject_6$s;var DropTarget=_styled.div.withConfig({displayName:"DropInfo__DropTarget",componentId:"sc-1ky6ew9-0"})(templateObject_1$2m||(templateObject_1$2m=__makeTemplateObject(["\n position: ",";\n top: ",";\n left: 0;\n right: 0;\n bottom: 0;\n z-index: ",";\n\n background-color: ",";\n\n display: flex;\n justify-content: center;\n"],["\n position: ",";\n top: ",";\n left: 0;\n right: 0;\n bottom: 0;\n z-index: ",";\n\n background-color: ",";\n\n display: flex;\n justify-content: center;\n"])),function(_a){var isLarge=_a.isLarge,isActive=_a.isActive;return isLarge&&isActive?'fixed':'absolute';},function(_a){var isLarge=_a.isLarge;return isLarge?headerHeight+"px":'0';},function(_a){var isActive=_a.isActive;return isActive?300:0;},function(_a){var isActive=_a.isActive;return isActive?'rgba(253, 253, 253, 0.95)':'transparent';});var DropInfo=function DropInfo(_a){var isLarge=_a.isLarge;return jsx$1(Host$W,__assign({isLarge:isLarge},{children:jsxs(CenteredContainer,__assign({isLarge:isLarge},{children:[jsx$1(StyledIcon$8,{isLarge:isLarge,iconName:"bulkUpload",className:"ms-fontColor-accent"},void 0),jsx$1(FormattedMessage$1,{id:"Generic.dragToUploadTitle",tagName:"h2"},void 0),jsx$1(FormattedMessage$1,{id:"Generic.dragToUploadDescription",tagName:"p"},void 0)]}),void 0)}),void 0);};var Host$W=_styled.div.withConfig({displayName:"DropInfo__Host",componentId:"sc-1ky6ew9-1"})(templateObject_2$1y||(templateObject_2$1y=__makeTemplateObject(["\n ",";\n ",";\n"],["\n ",";\n ",";\n"])),function(_a){var isLarge=_a.isLarge;return !isLarge&&'display: flex';},function(_a){var isLarge=_a.isLarge;return !isLarge&&'align-items: center';});var CenteredContainer=_styled.div.withConfig({displayName:"DropInfo__CenteredContainer",componentId:"sc-1ky6ew9-2"})(templateObject_3$12||(templateObject_3$12=__makeTemplateObject(["\n position: relative;\n top: ",";\n\n display: flex;\n flex-direction: column;\n align-items: center;\n\n h2 {\n margin-bottom: 0;\n }\n p {\n margin-top: 3px;\n }\n"],["\n position: relative;\n top: ",";\n\n display: flex;\n flex-direction: column;\n align-items: center;\n\n h2 {\n margin-bottom: 0;\n }\n p {\n margin-top: 3px;\n }\n"])),function(_a){var isLarge=_a.isLarge;return isLarge?'20%':0;});var StyledIcon$8=_styled(Icon).withConfig({displayName:"DropInfo__StyledIcon",componentId:"sc-1ky6ew9-3"})(templateObject_4$K||(templateObject_4$K=__makeTemplateObject(["\n font-size: ",";\n"],["\n font-size: ",";\n"])),function(p){return p.isLarge?'100px':'50px';});var templateObject_1$2m,templateObject_2$1y,templateObject_3$12,templateObject_4$K;var hasValidGenericUrlVideoSourcePrefix=function hasValidGenericUrlVideoSourcePrefix(url){return url&&getAdditionalVideoSources().filter(function(s){return url.startsWith(s.prefix);}).length>0;};var VideoUrlParser=/** @class */function(){function VideoUrlParser(url){this.url=url;this.source=null;this.id=null;this.isDirectVideoUrl=false;this.videoProperties=null;this.thumbnailUrl=null;if(hasValidGenericUrlVideoSourcePrefix(this.url)){this.source=VideoSource.GenericUrl;this.id=url;}else if(VideoUrlParser.microsoftStreamRegex.test(this.url)){this.source=VideoSource.MicrosoftStream;this.id=VideoUrlParser.microsoftStreamRegex.exec(this.url)[1];}else if(VideoUrlParser.ytRegex.test(this.url)){this.source=VideoSource.YouTube;this.id=VideoUrlParser.ytRegex.exec(this.url)[1];}else if(VideoUrlParser.vimeoRegex.test(this.url)){this.source=VideoSource.Vimeo;this.id=VideoUrlParser.vimeoRegex.exec(this.url)[1];}else if(VideoUrlParser.vimeoDirectLinkRegex.test(this.url)){this.source=VideoSource.Vimeo;this.id=VideoUrlParser.vimeoDirectLinkRegex.exec(this.url)[1];this.isDirectVideoUrl=true;}else if(VideoUrlParser.vimeoRedirectLinkRegex.test(this.url)){this.source=VideoSource.Vimeo;this.id=VideoUrlParser.vimeoRedirectLinkRegex.exec(this.url)[1];}else if(VideoUrlParser.kalturaRegex.test(this.url)){var regexMatches=VideoUrlParser.kalturaRegex.exec(this.url);this.source=VideoSource.Kaltura;this.id=regexMatches[1];this.videoProperties={sp:regexMatches[2],uiconfId:regexMatches[3],partnerId:regexMatches[4],entryId:regexMatches[5]};this.thumbnailUrl="https://cdnsecakmi.kaltura.com/p/"+this.id+"/thumbnail/entry_id/"+this.videoProperties.entryId+"/width/1000";}}//TODO handle the different error messages for cloud and onprem versions, i.e. what sources are permitted (see task 23570)
122068
122065
  VideoUrlParser.prototype.isValid=function(features){var _this=this;if(this.source==null||this.id==null){return false;}var sources=getVideoSources(features);return sources.findIndex(function(s){return s.type===_this.source;})>=0;};VideoUrlParser.ytRegex=/^.*(?:(?:youtu.be\/)|(?:v\/)|(?:\/u\/\w\/)|(?:embed\/)|(?:watch\?))\??v?=?([^#&?]*).*$/;VideoUrlParser.vimeoRegex=/.*?(?:vimeo.com\/){1}(?:video\/)?(\d+)/;// match first GUID after domain
122069
122066
  VideoUrlParser.microsoftStreamRegex=/.*web\.microsoftstream\.com.+?([0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})/i;VideoUrlParser.vimeoDirectLinkRegex=/.*?(?:player\.vimeo\.com\/external\/){1}(\d+)/;VideoUrlParser.vimeoRedirectLinkRegex=/.*?(?:player\.vimeo\.com\/progressive_redirect\/playback\/){1}(\d+)(?:\/.*)/;VideoUrlParser.kalturaRegex=/.+cdnapisec\.kaltura\.com\/p\/([0-9]+)\/sp\/([0-9]+)\/embedIframeJs\/uiconf_id\/([0-9]+)\/partner_id\/([0-9]+)(?:.*entry_id=(.+?(?=&|$)))/;return VideoUrlParser;}();function getVideoSources(features){var sources=[];if(features.editorYouTubeVideos){sources.push({type:VideoSource.YouTube,name:'YouTube'});}if(features.editorVimeoVideos){sources.push({type:VideoSource.Vimeo,name:'Vimeo'});}if(features.editorMicrosoftVideos){sources.push({type:VideoSource.MicrosoftStream,name:'Microsoft Stream'});}if(features.editorKalturaVideos){sources.push({type:VideoSource.Kaltura,name:'Kaltura'});}getAdditionalVideoSources().forEach(function(customSource){sources.push({type:VideoSource.GenericUrl,name:customSource.name});});return sources;}// this is wrapped, because the "appconfig" does not exist in the component library
122070
122067
  // we should probably provide a better fix for this => #38316
@@ -122175,7 +122172,7 @@ storage.set(cacheKey,apiPage_1).then(function(){return null;});if(!cachedPage){o
122175
122172
  apiItem.fileAccessToken=cachedItem.fileAccessToken;}});observer.next(apiPage_1);observer.complete();return [3/*break*/,4];case 3:err_1=_a.sent();observer.error(err_1);return [3/*break*/,4];case 4:return [2/*return*/];}});});})();});}function validateFileAccessTokens(page,modifyFunc){if(!page||!page.items){return;}page.items.forEach(function(item){var isTokenValid=isTokenStillValid(item.fileAccessToken);modifyFunc(isTokenValid,item);});}var NewsApiService=/** @class */function(){function NewsApiService(factory,subscriptionId,storage){var _this=this;this.factory=factory;this.storage=storage;this.trackExternalItem=function(itemId,itemType){return _this.api.custom(itemType+"/"+encodeURIComponent(itemId)+"/external_url/track").get().then(function(result){return result.body().data();});};this.getAllNews=function(filterDefinition,paginationToken){return fetchNewsItems('news',NewsApiService.allNewsCacheKey,_this.api,_this.storage,paginationToken,__assign(__assign({},filterDefinition||{}),{includePromoted:true}));};this.getAllUnreadNews=function(filterDefinition,paginationToken){return fetchNewsItems('news',NewsApiService.allNewsCacheKey,_this.api,_this.storage,paginationToken,__assign(__assign({},filterDefinition||{}),{unreadOnly:true,pageSize:0}));};this.getMyNews=function(filterDefinition,paginationToken){return fetchNewsItems('users/current/news',NewsApiService.newsCacheKey,_this.api,_this.storage,paginationToken,filterDefinition);};this.getMyUnreadNews=function(filterDefinition,paginationToken){return fetchNewsItems('users/current/news/unread',NewsApiService.myUnreadNewsCacheKey,_this.api,_this.storage,paginationToken,filterDefinition,true);};this.getBookmarks=function(filterDefinition){return fetchNewsItems('users/current/bookmarks',NewsApiService.bookmarksCacheKey,_this.api,_this.storage,null,filterDefinition,true);};this.getNewsFromCache=function(){return __awaiter(_this,void 0,void 0,function(){var _a;return __generator(this,function(_b){switch(_b.label){case 0:return [4/*yield*/,this.storage.getObject(NewsApiService.newsItemsCacheKey)];case 1:return [2/*return*/,(_a=_b.sent())!==null&&_a!==void 0?_a:[]];}});});};this.get=function(newsId){var getFromCache=function getFromCache(id){return __awaiter(_this,void 0,void 0,function(){var cache,hits;return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,this.getNewsFromCache()];case 1:cache=_a.sent();hits=cache.filter(function(i){return i.id===id;});return [2/*return*/,hits.length>0?hits[0]:null];}});});};var getFromApi=function getFromApi(id){return from(_this.api.all('news').get(id)).pipe(mergeMap(function(res){return updateItemCache(res.body().data());}));};var updateItemCache=function updateItemCache(item){return __awaiter(_this,void 0,void 0,function(){var fromCache,index,cacheItem,clonedCachedItem,clonedNewItem;return __generator(this,function(_a){switch(_a.label){case 0:if(item.statistics){itemStatisticsCache[item.id]=Promise.resolve(__assign({},item.statistics));}return [4/*yield*/,this.getNewsFromCache()];case 1:fromCache=_a.sent();index=fromCache.findIndex(function(i){return i.id===item.id;});if(index>-1){cacheItem=fromCache[index];if(isTokenStillValid(cacheItem.fileAccessToken)){clonedCachedItem=__assign({},cacheItem);delete clonedCachedItem.fileAccessToken;clonedNewItem=__assign({},item);delete clonedNewItem.fileAccessToken;if(JSON.stringify(clonedCachedItem)===JSON.stringify(clonedNewItem)){return [2/*return*/,null];}}fromCache.splice(index,1,item);}else {fromCache.push(item);}return [4/*yield*/,this.storage.set(NewsApiService.newsItemsCacheKey,fromCache)];case 2:_a.sent();return [2/*return*/,item];}});});};return concat(getFromCache(newsId),getFromApi(newsId)).pipe(filter(function(i){return i!=null;}),catchError(function(err){if(err.response&&err.response.statusCode===404){return of(null);}else {return throwError(err);}}));};this.getImageUrlWithToken=function(token,itemId,subscriptionId,resourceType,imageIdentifier,width,height){if(imageIdentifier===void 0){imageIdentifier='banner';}return _this.factory.createApiUrl("/"+resourceType+"/"+itemId+"/images/"+imageIdentifier+"/"+width+"/"+(height||''),{access_token:token,subscriptionId:subscriptionId});};this.getStatistics=function(newsId){if(!itemStatisticsCache[newsId]){itemStatisticsCache[newsId]=_this.api.custom("news/"+newsId+"/statistics").get().then(function(result){return result.body().data();}).then(function(result){var feedbackCountsKeys=Object.keys(result.feedbackCounts);return {bookmarkCount:result.bookmarkCount,likeCount:result.feedbackCounts[feedbackCountsKeys.find(function(k){return k==='like';})],commentCount:result.commentCount,confirmationCount:result.feedbackCounts[feedbackCountsKeys.find(function(k){return k==='confirm';})],readCount:result.readCount};});}return itemStatisticsCache[newsId];};this.refreshStatistics=function(itemId,delta){return __awaiter(_this,void 0,void 0,function(){var _this=this;return __generator(this,function(_a){switch(_a.label){case 0:// update statistics cache with new delta
122176
122173
  if(!itemStatisticsCache[itemId]){return [2/*return*/];}return [4/*yield*/,itemStatisticsCache[itemId].then(function(statistics){var updatedStatistics=NewsApiService.getUpdatedStatistics(statistics,delta);_this.tryUpdateStatisticsInCache(itemId,updatedStatistics).then(null,null);itemStatisticsCache[itemId]=Promise.resolve(updatedStatistics);onStatisticsUpdated.next(updatedStatistics);})];case 1:_a.sent();return [2/*return*/];}});});};this.tryUpdateStatisticsInCache=function(newsId,statistics){return __awaiter(_this,void 0,void 0,function(){var fromCache,index,item;return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,this.getNewsFromCache()];case 1:fromCache=_a.sent();index=fromCache.findIndex(function(i){return i.id===newsId;});item=fromCache[index];if(!item||!item.statistics){return [2/*return*/];}item.statistics=statistics;fromCache.splice(index,1,item);return [4/*yield*/,this.storage.set(NewsApiService.newsItemsCacheKey,fromCache)];case 2:_a.sent();return [2/*return*/];}});});};this.getExternalItemRoute=function(resourceType,itemId,accessToken){return _this.factory.createApiUrl("/"+resourceType+"/"+encodeURIComponent(itemId)+"/external_url",{access_token:accessToken});};this.api=factory.createApi(false,subscriptionId);}NewsApiService.getUpdatedStatistics=function(curr,delta){var _a,_b,_c,_d,_e,_f;return {bookmarkCount:curr.bookmarkCount+((_a=delta.bookmarkCount)!==null&&_a!==void 0?_a:0),commentCount:curr.commentCount+((_b=delta.commentCount)!==null&&_b!==void 0?_b:0),likeCount:curr.likeCount+((_c=delta.likeCount)!==null&&_c!==void 0?_c:0),confirmationCount:curr.confirmationCount+((_d=delta.confirmationCount)!==null&&_d!==void 0?_d:0),readCount:curr.readCount+((_e=delta.readCount)!==null&&_e!==void 0?_e:0),participantsCount:curr.participantsCount+((_f=delta.participantsCount)!==null&&_f!==void 0?_f:0)};};NewsApiService.bookmarksCacheKey='NewsService::BookmarksV2';NewsApiService.newsItemsCacheKey='NewsService::NewsItems';NewsApiService.newsCacheKey='NewsService::News';NewsApiService.allNewsCacheKey='NewsService::AllNews';NewsApiService.myUnreadNewsCacheKey='NewsService::MyUnreadNews';return NewsApiService;}();function useNewsApi(){var storage=useStorage();var factory=useApiFactory();var identifier=useContext(SubscriptionIdContext).identifier;return useMemo(function(){return new NewsApiService(factory,identifier===null||identifier===void 0?void 0:identifier.id,storage);},[factory,identifier,storage]);}function usePagesApi(){var api=useApi();var createApiUrl=useApiFactory().createApiUrl;return useMemo(function(){return {loadPage:loadPage,loadPageChildren:loadPageChildren,getRootPagesNavigation:getRootPagesNavigation,getPublishedRootPages:getPublishedRootPages,searchPublishedPages:searchPublishedPages,getSubpages:getSubpages,searchPages:searchPages,getDocumentFileUrl:getDocumentFileUrl,searchToc:searchToc};function loadPage(id){return api.all('pages').get(id,{includeNavigationContext:true}).then(function(response){var page=response.body().data();itemStatisticsCache[page.id]=Promise.resolve(__assign({},page.statistics));return page;});}function loadPageChildren(id){return api.all("pages/"+id+"/navigation/children").getAll().then(function(r){return r.body().map(function(g){return g.data();});});}function getRootPagesNavigation(){return api.all('pages').getAll().then(function(r){return r.body().map(function(g){return g.data();});});}function getPublishedRootPages(filter){var rootPagesFilter=__assign(__assign({},filter),{rootPagesOnly:true});return searchPages('pages',rootPagesFilter);}function searchPublishedPages(filter){return searchPages('pages',filter);}function getSubpages(parentId,filter){var subPagesFilter=__assign(__assign({},filter),{parentId:parentId});if(!subPagesFilter.pageSize){// return all subpages & documents
122177
122174
  subPagesFilter.pageSize=0;}return searchPages('pages',subPagesFilter);}function searchToc(basePath,searchValue){return searchPages(basePath,{pageSize:100,search:searchValue,searchInTitlesOnly:true});}function searchPages(basePath,filter){if(filter){filter=__assign({},filter);if(!filter.restrictToPageContext){delete filter.pageContextId;}// we never need / want to send this param to the API, only used for the UI
122178
- delete filter.restrictToPageContext;}var params=__assign(__assign({},filter),getCommaSeparatedKeywordsString(filter===null||filter===void 0?void 0:filter.keywords));return api.all(basePath+"/search").get('',params).then(function(result){return result.body().data();});}function getDocumentFileUrl(basePath,subscriptionId,pageId,fileId,language,token){return createApiUrl("/"+basePath+"/"+pageId+"/"+language+"/documents/"+fileId,{access_token:token,subscriptionId:subscriptionId});}},[api,createApiUrl]);}function usePostsApi(){var searchAccounts=useAccountApi().searchAccounts;var api=useApi();return useMemo(function(){return {createPost:createPost,togglePostLike:togglePostLike,getPosts:getPosts,updatePost:updatePost,deletePost:deletePost,getPost:getPost,getPostThread:getPostThread,translatePost:translatePost,searchPostMentionUsers:searchPostMentionUsers};function createPost(post){return api.all("posts").post(post).then(function(result){return result.body().data();});}function togglePostLike(postId,isLiked){if(isLiked){return api.custom("posts/"+postId+"/feedback/like").put({});}else {return api.custom("posts/"+postId+"/feedback/like").delete();}}function getPosts(filter){var groupIds=[];for(var _i=1;_i<arguments.length;_i++){groupIds[_i-1]=arguments[_i];}var params=__assign(__assign(__assign({},filter),{groupId:groupIds}),getCommaSeparatedKeywordsString(filter===null||filter===void 0?void 0:filter.keywords));return api.custom("posts?"+queryString.stringify(params)).get().then(function(res){return res.body().data();});}function updatePost(postId,content,attachments,keywords){return api.all('posts').patch(postId,{content:content,attachments:attachments,keywords:keywords}).then(function(result){return result.body().data();});}function deletePost(postId){return api.all("posts").delete(postId);}function getPost(postId){return api.all('posts').get(postId).then(function(result){return result.body().data();});}function getPostThread(postId,threadId){return api.custom("posts/"+postId+"/comments/"+threadId+"/thread").get().then(function(result){return result.body().data();});}function translatePost(postId,language){return api.custom("posts/"+postId+"/content/"+language).get().then(function(res){return res.body().data();});}function searchPostMentionUsers(searchText,postGroupId){return searchAccounts({search:searchText,type:AccountType.User,localOnly:true,groupId:[postGroupId],excludeApiUsers:true});}},[api,searchAccounts]);}function useEmbeddedObjectValidator(){var _this=this;var getPost=usePostsApi().getPost;var getNews=useNewsApi().get;var loadPage=usePagesApi().loadPage;var getEvent=useEventsApi().getEvent;return function(embeddedObject){return __awaiter(_this,void 0,void 0,function(){var _a,item,error_1;return __generator(this,function(_b){switch(_b.label){case 0:_b.trys.push([0,11,,12]);_a=embeddedObject.type;switch(_a){case AttachmentType.Post:return [3/*break*/,1];case AttachmentType.News:return [3/*break*/,3];case AttachmentType.Page:return [3/*break*/,5];case AttachmentType.Event:return [3/*break*/,7];}return [3/*break*/,9];case 1:return [4/*yield*/,getPost(embeddedObject.id)];case 2:_b.sent();return [2/*return*/,true];case 3:return [4/*yield*/,getNews(embeddedObject.id).toPromise()];case 4:item=_b.sent();return [2/*return*/,!!item];case 5:return [4/*yield*/,loadPage(embeddedObject.id)];case 6:_b.sent();return [2/*return*/,true];case 7:return [4/*yield*/,getEvent(embeddedObject.id)];case 8:_b.sent();return [2/*return*/,true];case 9:throw Error('Invalid type');case 10:return [3/*break*/,12];case 11:error_1=_b.sent();logger.error(error_1);return [2/*return*/,false];case 12:return [2/*return*/];}});});};}var RichCommentInput=/*#__PURE__*/forwardRef(function(_a,ref){var className=_a.className,buttons=_a.buttons,attachments=_a.attachments,deletedAttachmentUrls=_a.deletedAttachmentUrls,onAttachmentsChange=_a.onAttachmentsChange;_a.onDeleteAttachment;var allowAttachments=_a.allowAttachments,useLargeDropTarget=_a.useLargeDropTarget,disableDragAndDrop=_a.disableDragAndDrop;_a.allowKeywords;var defaultKeywords=_a.defaultKeywords,availableKeywords=_a.availableKeywords,mandatoryKeywords=_a.mandatoryKeywords,showKeywordsPicker=_a.showKeywordsPicker,onKeywordsChange=_a.onKeywordsChange,disableAddGif=_a.disableAddGif,disableAddFiles=_a.disableAddFiles,props=__rest(_a,["className","buttons","attachments","deletedAttachmentUrls","onAttachmentsChange","onDeleteAttachment","allowAttachments","useLargeDropTarget","disableDragAndDrop","allowKeywords","defaultKeywords","availableKeywords","mandatoryKeywords","showKeywordsPicker","onKeywordsChange","disableAddGif","disableAddFiles"]);var onDrop=useCallback(handleDropFiles,[attachments,onAttachmentsChange]);var _b=useDropzone({onDrop:onDrop}),getRootProps=_b.getRootProps,getInputProps=_b.getInputProps,open=_b.open,isDragActive=_b.isDragActive;var inputRef=useRef$1(null);var formatMessage=useIntl().formatMessage;useImperativeHandle(ref,function(){return inputRef.current;},[inputRef]);var user=useCurrentUser();var debouncedOnEmbeddedObjectsOrVideosChange=useDebouncedCallback(onEmbeddedObjectsOrVideosChange,500)[0];var validateEmbeddedObject=useEmbeddedObjectValidator();var isGifButtonDisabled=props.disabled||disableAddGif;var isAttachmentsButtonDisabled=props.disabled||disableAddFiles;if(props.disabled||!allowAttachments){return jsxs(Fragment,{children:[jsx$1(CommentInput,__assign({ref:inputRef,className:className,buttons:buttons},props),void 0),showKeywordsPicker&&!props.disabled&&jsx$1(KeywordsPicker,{defaultKeywords:defaultKeywords,availableKeywords:availableKeywords,mandatoryKeywords:mandatoryKeywords,onChangeKeywords:onKeywordsChange},void 0)]},void 0);}return jsxs("div",__assign({className:className},{children:[jsx$1("input",__assign({},getInputProps()),void 0),!disableDragAndDrop&&jsx$1(DropTarget,__assign({isActive:isDragActive,isLarge:useLargeDropTarget},getRootProps({onClick:function(e){return e.stopPropagation();}}),{"data-drop-target":true},{children:isDragActive&&jsx$1(DropInfo,{isLarge:useLargeDropTarget},void 0)}),void 0),jsx$1(CommentInput,__assign({},props,{onChange:handleChange,ref:inputRef,buttons:jsxs(Fragment,{children:[jsx$1(GifButton,{disabled:isGifButtonDisabled,onGifClick:handleGifClick},'gifButton'+isGifButtonDisabled),jsx$1(IconButton,{iconProps:{iconName:'Attach'},onClick:open,disabled:isAttachmentsButtonDisabled,"data-button-type":"attach",ariaLabel:formatMessage({id:'AriaLabel.attachmentsButton'})},'attachmentsButton'+isAttachmentsButtonDisabled),buttons]},void 0)}),void 0),showKeywordsPicker&&!props.disabled&&jsx$1(KeywordsPicker,{defaultKeywords:defaultKeywords,availableKeywords:availableKeywords,mandatoryKeywords:mandatoryKeywords,onChangeKeywords:onKeywordsChange},void 0)]}),void 0);function handleChange(content){props.onChange(content);debouncedOnEmbeddedObjectsOrVideosChange(content);}function onEmbeddedObjectsOrVideosChange(content){return __awaiter(this,void 0,void 0,function(){var existingAttachments,newAttachments,matchedVideoUrls,_i,matchedVideoUrls_1,matchedUrl,url,id,matchedEmbeddedObjects,_a,matchedEmbeddedObjects_1,matchedEmbeddedObject,url,isValid;return __generator(this,function(_b){switch(_b.label){case 0:existingAttachments=new Set(attachments.map(function(a){return a.url;}));newAttachments=[];matchedVideoUrls=__spreadArray([],Array.from(getAllVideosFromString(content)));for(_i=0,matchedVideoUrls_1=matchedVideoUrls;_i<matchedVideoUrls_1.length;_i++){matchedUrl=matchedVideoUrls_1[_i];url=matchedUrl.url;id=new VideoUrlParser(url).id;if(!existingAttachments.has(url)){newAttachments.push(__assign({id:id},matchedUrl));existingAttachments.add(url);}}matchedEmbeddedObjects=__spreadArray([],Array.from(getEmbeddedObjectsFromString(content)).filter(function(ob){return ob.subscriptionIdentifier===user.subscription.id||ob.subscriptionIdentifier===user.subscription.subscriptionHandle;}));_a=0,matchedEmbeddedObjects_1=matchedEmbeddedObjects;_b.label=1;case 1:if(!(_a<matchedEmbeddedObjects_1.length))return [3/*break*/,4];matchedEmbeddedObject=matchedEmbeddedObjects_1[_a];url=matchedEmbeddedObject.url;if(!(!existingAttachments.has(url)&&!(deletedAttachmentUrls===null||deletedAttachmentUrls===void 0?void 0:deletedAttachmentUrls.includes(url))))return [3/*break*/,3];return [4/*yield*/,validateEmbeddedObject(matchedEmbeddedObject)];case 2:isValid=_b.sent();if(isValid){newAttachments.push(__assign({},matchedEmbeddedObject));existingAttachments.add(url);}_b.label=3;case 3:_a++;return [3/*break*/,1];case 4:if(newAttachments.length!==0){onAttachmentsChange(attachments.concat(newAttachments));}return [2/*return*/];}});});}function handleGifClick(newAttachment){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){onAttachmentsChange(attachments.filter(function(attachment){return attachment.type!==AttachmentType.Giphy;}).concat(newAttachment));return [2/*return*/];});});}function handleDropFiles(dropResult){return __awaiter(this,void 0,void 0,function(){var newFiles,_i,_a,image,size;return __generator(this,function(_b){switch(_b.label){case 0:newFiles=dropResult.map(function(f){return {id:createId(),file:f,filename:f.name,previewUrl:URL.createObjectURL(f),type:f.type.startsWith('image/')?AttachmentType.Image:AttachmentType.File};});_i=0,_a=newFiles.filter(function(f){return f.type===AttachmentType.Image;});_b.label=1;case 1:if(!(_i<_a.length))return [3/*break*/,4];image=_a[_i];return [4/*yield*/,getImageSize(image.previewUrl)];case 2:size=_b.sent();image.width=size.width;image.height=size.height;_b.label=3;case 3:_i++;return [3/*break*/,1];case 4:onAttachmentsChange(attachments.concat(newFiles));return [2/*return*/];}});});}});var getMicrosoftStreamEmbedVideoUrl=function getMicrosoftStreamEmbedVideoUrl(id,autoPlay){if(autoPlay===void 0){autoPlay=false;}return "https://web.microsoftstream.com/embed/video/"+id+"?autoplay="+autoPlay+"&showInfo=true";};var getMicrosoftStreamVideoUrl=function getMicrosoftStreamVideoUrl(id){return "https://web.microsoftstream.com/video/"+id+"?autoplay=true";};var VideoElementGenerator=/** @class */function(){function VideoElementGenerator(videoInfo,iframeAreaLabel,autoplay,width,videoProperties){this.videoInfo=videoInfo;this.iframeAreaLabel=iframeAreaLabel;this.autoplay=autoplay;this.width=width;this.videoProperties=videoProperties;}VideoElementGenerator.prototype.getYouTubeVideoElement=function(){// <iframe
122175
+ delete filter.restrictToPageContext;}var params=__assign(__assign({},filter),getCommaSeparatedKeywordsString(filter===null||filter===void 0?void 0:filter.keywords));return api.all(basePath+"/search").get('',params).then(function(result){return result.body().data();});}function getDocumentFileUrl(basePath,subscriptionId,pageId,fileId,language,token){return createApiUrl("/"+basePath+"/"+pageId+"/"+language+"/documents/"+fileId,{access_token:token,subscriptionId:subscriptionId});}},[api,createApiUrl]);}function usePostsApi(){var searchAccounts=useAccountApi().searchAccounts;var api=useApi();return useMemo(function(){return {createPost:createPost,togglePostLike:togglePostLike,getPosts:getPosts,updatePost:updatePost,deletePost:deletePost,getPost:getPost,getPostThread:getPostThread,translatePost:translatePost,searchPostMentionUsers:searchPostMentionUsers};function createPost(post){return api.all("posts").post(post).then(function(result){return result.body().data();});}function togglePostLike(postId,isLiked){if(isLiked){return api.custom("posts/"+postId+"/feedback/like").put({});}else {return api.custom("posts/"+postId+"/feedback/like").delete();}}function getPosts(filter){var groupIds=[];for(var _i=1;_i<arguments.length;_i++){groupIds[_i-1]=arguments[_i];}var params=__assign(__assign(__assign({},filter),{groupId:groupIds}),getCommaSeparatedKeywordsString(filter===null||filter===void 0?void 0:filter.keywords));return api.custom("posts?"+queryString.stringify(params)).get().then(function(res){return res.body().data();});}function updatePost(postId,content,attachments,keywords){return api.all('posts').patch(postId,{content:content,attachments:attachments,keywords:keywords}).then(function(result){return result.body().data();});}function deletePost(postId){return api.all("posts").delete(postId);}function getPost(postId){return api.all('posts').get(postId).then(function(result){return result.body().data();});}function getPostThread(postId,threadId){return api.custom("posts/"+postId+"/comments/"+threadId+"/thread").get().then(function(result){return result.body().data();});}function translatePost(postId,language){return api.custom("posts/"+postId+"/content/"+language).get().then(function(res){return res.body().data();});}function searchPostMentionUsers(searchText,postGroupId){return searchAccounts({search:searchText,type:AccountType.User,localOnly:true,groupId:[postGroupId],excludeApiUsers:true});}},[api,searchAccounts]);}function useEmbeddedObjectValidator(){var _this=this;var getPost=usePostsApi().getPost;var getNews=useNewsApi().get;var loadPage=usePagesApi().loadPage;var getEvent=useEventsApi().getEvent;return function(embeddedObject){return __awaiter(_this,void 0,void 0,function(){var _a,item,error_1;return __generator(this,function(_b){switch(_b.label){case 0:_b.trys.push([0,11,,12]);_a=embeddedObject.type;switch(_a){case AttachmentType.Post:return [3/*break*/,1];case AttachmentType.News:return [3/*break*/,3];case AttachmentType.Page:return [3/*break*/,5];case AttachmentType.Event:return [3/*break*/,7];}return [3/*break*/,9];case 1:return [4/*yield*/,getPost(embeddedObject.id)];case 2:_b.sent();return [2/*return*/,true];case 3:return [4/*yield*/,getNews(embeddedObject.id).toPromise()];case 4:item=_b.sent();return [2/*return*/,!!item];case 5:return [4/*yield*/,loadPage(embeddedObject.id)];case 6:_b.sent();return [2/*return*/,true];case 7:return [4/*yield*/,getEvent(embeddedObject.id)];case 8:_b.sent();return [2/*return*/,true];case 9:throw Error('Invalid type');case 10:return [3/*break*/,12];case 11:error_1=_b.sent();logger.error(error_1);return [2/*return*/,false];case 12:return [2/*return*/];}});});};}var RichCommentInput=/*#__PURE__*/forwardRef(function(_a,ref){var className=_a.className,buttons=_a.buttons,attachments=_a.attachments,deletedAttachmentUrls=_a.deletedAttachmentUrls,onAttachmentsChange=_a.onAttachmentsChange;_a.onDeleteAttachment;var allowAttachments=_a.allowAttachments,useLargeDropTarget=_a.useLargeDropTarget,disableDragAndDrop=_a.disableDragAndDrop,disableAddGif=_a.disableAddGif,disableAddFiles=_a.disableAddFiles,props=__rest(_a,["className","buttons","attachments","deletedAttachmentUrls","onAttachmentsChange","onDeleteAttachment","allowAttachments","useLargeDropTarget","disableDragAndDrop","disableAddGif","disableAddFiles"]);var onDrop=useCallback(handleDropFiles,[attachments,onAttachmentsChange]);var _b=useDropzone({onDrop:onDrop}),getRootProps=_b.getRootProps,getInputProps=_b.getInputProps,open=_b.open,isDragActive=_b.isDragActive;var inputRef=useRef$1(null);var formatMessage=useIntl().formatMessage;useImperativeHandle(ref,function(){return inputRef.current;},[inputRef]);var user=useCurrentUser();var debouncedOnEmbeddedObjectsOrVideosChange=useDebouncedCallback(onEmbeddedObjectsOrVideosChange,500)[0];var validateEmbeddedObject=useEmbeddedObjectValidator();var isGifButtonDisabled=props.disabled||disableAddGif;var isAttachmentsButtonDisabled=props.disabled||disableAddFiles;if(props.disabled||!allowAttachments){return jsx$1(CommentInput,__assign({ref:inputRef,className:className,buttons:{leftSide:jsxs(Fragment,{children:[jsx$1(GifButton,{disabled:props.disabled,onGifClick:handleGifClick},'gifButton'),allowAttachments&&jsx$1(IconButton,{iconProps:{iconName:'Attach'},onClick:open,disabled:props.disabled,"data-button-type":"attach",ariaLabel:formatMessage({id:'AriaLabel.attachmentsButton'})},'attachmentsButton'),buttons.leftSide]},void 0),rightSide:buttons.rightSide}},props),void 0);}return jsxs("div",__assign({className:className},{children:[jsx$1("input",__assign({},getInputProps()),void 0),!disableDragAndDrop&&jsx$1(DropTarget,__assign({isActive:isDragActive,isLarge:useLargeDropTarget},getRootProps({onClick:function(e){return e.stopPropagation();}}),{"data-drop-target":true},{children:isDragActive&&jsx$1(DropInfo,{isLarge:useLargeDropTarget},void 0)}),void 0),jsx$1(CommentInput,__assign({},props,{onChange:handleChange,ref:inputRef,buttons:{leftSide:jsxs(Fragment,{children:[jsx$1(GifButton,{disabled:isGifButtonDisabled,onGifClick:handleGifClick},'gifButton'+isGifButtonDisabled),jsx$1(IconButton,{iconProps:{iconName:'Attach'},onClick:open,disabled:isAttachmentsButtonDisabled,"data-button-type":"attach",ariaLabel:formatMessage({id:'AriaLabel.attachmentsButton'})},'attachmentsButton'+isAttachmentsButtonDisabled),buttons.leftSide]},void 0),rightSide:buttons.rightSide}}),void 0)]}),void 0);function handleChange(content){props.onChange(content);debouncedOnEmbeddedObjectsOrVideosChange(content);}function onEmbeddedObjectsOrVideosChange(content){return __awaiter(this,void 0,void 0,function(){var existingAttachments,newAttachments,matchedVideoUrls,_i,matchedVideoUrls_1,matchedUrl,url,id,matchedEmbeddedObjects,_a,matchedEmbeddedObjects_1,matchedEmbeddedObject,url,isValid;return __generator(this,function(_b){switch(_b.label){case 0:existingAttachments=new Set(attachments.map(function(a){return a.url;}));newAttachments=[];matchedVideoUrls=__spreadArray([],Array.from(getAllVideosFromString(content)));for(_i=0,matchedVideoUrls_1=matchedVideoUrls;_i<matchedVideoUrls_1.length;_i++){matchedUrl=matchedVideoUrls_1[_i];url=matchedUrl.url;id=new VideoUrlParser(url).id;if(!existingAttachments.has(url)){newAttachments.push(__assign({id:id},matchedUrl));existingAttachments.add(url);}}matchedEmbeddedObjects=__spreadArray([],Array.from(getEmbeddedObjectsFromString(content)).filter(function(ob){return ob.subscriptionIdentifier===user.subscription.id||ob.subscriptionIdentifier===user.subscription.subscriptionHandle;}));_a=0,matchedEmbeddedObjects_1=matchedEmbeddedObjects;_b.label=1;case 1:if(!(_a<matchedEmbeddedObjects_1.length))return [3/*break*/,4];matchedEmbeddedObject=matchedEmbeddedObjects_1[_a];url=matchedEmbeddedObject.url;if(!(!existingAttachments.has(url)&&!(deletedAttachmentUrls===null||deletedAttachmentUrls===void 0?void 0:deletedAttachmentUrls.includes(url))))return [3/*break*/,3];return [4/*yield*/,validateEmbeddedObject(matchedEmbeddedObject)];case 2:isValid=_b.sent();if(isValid){newAttachments.push(__assign({},matchedEmbeddedObject));existingAttachments.add(url);}_b.label=3;case 3:_a++;return [3/*break*/,1];case 4:if(newAttachments.length!==0){onAttachmentsChange(attachments.concat(newAttachments));}return [2/*return*/];}});});}function handleGifClick(newAttachment){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){onAttachmentsChange(attachments.filter(function(attachment){return attachment.type!==AttachmentType.Giphy;}).concat(newAttachment));return [2/*return*/];});});}function handleDropFiles(dropResult){return __awaiter(this,void 0,void 0,function(){var newFiles,_i,_a,image,size;return __generator(this,function(_b){switch(_b.label){case 0:newFiles=dropResult.map(function(f){return {id:createId(),file:f,filename:f.name,previewUrl:URL.createObjectURL(f),type:f.type.startsWith('image/')?AttachmentType.Image:AttachmentType.File};});_i=0,_a=newFiles.filter(function(f){return f.type===AttachmentType.Image;});_b.label=1;case 1:if(!(_i<_a.length))return [3/*break*/,4];image=_a[_i];return [4/*yield*/,getImageSize(image.previewUrl)];case 2:size=_b.sent();image.width=size.width;image.height=size.height;_b.label=3;case 3:_i++;return [3/*break*/,1];case 4:onAttachmentsChange(attachments.concat(newFiles));return [2/*return*/];}});});}});var getMicrosoftStreamEmbedVideoUrl=function getMicrosoftStreamEmbedVideoUrl(id,autoPlay){if(autoPlay===void 0){autoPlay=false;}return "https://web.microsoftstream.com/embed/video/"+id+"?autoplay="+autoPlay+"&showInfo=true";};var getMicrosoftStreamVideoUrl=function getMicrosoftStreamVideoUrl(id){return "https://web.microsoftstream.com/video/"+id+"?autoplay=true";};var VideoElementGenerator=/** @class */function(){function VideoElementGenerator(videoInfo,iframeAreaLabel,autoplay,width,videoProperties){this.videoInfo=videoInfo;this.iframeAreaLabel=iframeAreaLabel;this.autoplay=autoplay;this.width=width;this.videoProperties=videoProperties;}VideoElementGenerator.prototype.getYouTubeVideoElement=function(){// <iframe
122179
122176
  // src="https://www.youtube.com/embed/{videoId}?ecver=1" frameborder="0" allowfullscreen>
122180
122177
  // </iframe>
122181
122178
  var iframe=document.createElement('iframe');iframe.setAttribute('aria-label',this.iframeAreaLabel);iframe.setAttribute('src',"https://www.youtube.com/embed/"+this.videoInfo.id+"?rel=0&autoplay="+(this.autoplay?'1':'0'));iframe.setAttribute('frameborder','0');iframe.setAttribute('allowfullscreen','');return iframe;};VideoElementGenerator.prototype.getVimeoVideoElement=function(){// <iframe src="https://player.vimeo.com/video/{videoId}"
@@ -122194,7 +122191,7 @@ return this.getVideoElement(getMicrosoftStreamEmbedVideoUrl(this.videoInfo.id,th
122194
122191
  // ></iframe>;
122195
122192
  var _a=this.videoProperties||{},sp=_a.sp,uiconfId=_a.uiconfId,partnerId=_a.partnerId,entryId=_a.entryId;var iframe=document.createElement('iframe');iframe.setAttribute('aria-label',this.iframeAreaLabel);iframe.setAttribute('src',"https://cdnapisec.kaltura.com/p/"+this.videoInfo.id+"/sp/"+sp+"/embedIframeJs/uiconf_id/"+uiconfId+"/partner_id/"+partnerId+"?iframeembed=true&playerId=kaltura_player&entry_id="+entryId);iframe.setAttribute('frameborder','0');iframe.setAttribute('allowfullscreen','');return iframe;};VideoElementGenerator.prototype.getGenericURLVideoElement=function(){var _a;// for generic URL videos, we treat the id as the URL
122196
122193
  var video=document.createElement('video');video.setAttribute('controls','');var source=document.createElement('source');source.setAttribute('src',(_a=this.videoInfo.url)!==null&&_a!==void 0?_a:this.videoInfo.id);if(this.autoplay){video.setAttribute('autoplay','');}if(this.width){video.setAttribute('width',this.width);}var noVideo=document.createTextNode('Your browser does not support the video tag');video.appendChild(source);video.appendChild(noVideo);return video;};VideoElementGenerator.prototype.getVideoElement=function(src){var iframe=document.createElement('iframe');iframe.setAttribute('src',src);iframe.setAttribute('frameborder','0');iframe.setAttribute('webkitallowfullscreen','');iframe.setAttribute('mozallowfullscreen','');iframe.setAttribute('allowfullscreen','');iframe.setAttribute('aria-label',this.iframeAreaLabel);return iframe;};VideoElementGenerator.prototype.getNotSupportedElement=function(){var content=document.createElement('div');content.innerText="The selected video cannot be played. The source is not supported.";return content;};VideoElementGenerator.getVideoElement=function(videoInfo,autoplay,width,iframeAreaLabel,videoProperties){var generator=new VideoElementGenerator(videoInfo,iframeAreaLabel||'',autoplay,width,videoProperties);switch(videoInfo.source){case VideoSource.YouTube:return generator.getYouTubeVideoElement();case VideoSource.Vimeo:return videoInfo.isDirectUrl?generator.getExternalVimeoVideoElement():generator.getVimeoVideoElement();case VideoSource.MicrosoftStream:return generator.getMicrosoftStreamVideoElement();case VideoSource.GenericUrl:return generator.getGenericURLVideoElement();case VideoSource.Kaltura:return generator.getKalturaVideoElement();default:return generator.getNotSupportedElement();}};VideoElementGenerator.getVideoType=function(videoInfo){switch(videoInfo.source){case VideoSource.YouTube:return 'YouTube';case VideoSource.Vimeo:return 'Vimeo';case VideoSource.MicrosoftStream:return 'Microsoft Stream';case VideoSource.GenericUrl:return 'Generic';case VideoSource.Kaltura:return 'Kaltura';default:return '';}};return VideoElementGenerator;}();var VideoView=function VideoView(_a){var videoInfo=_a.videoInfo,autoplay=_a.autoplay,width=_a.width,className=_a.className;var formatMessage=useIntl().formatMessage;var container=useRef$1();useEffect$1(function(){renderContents();// eslint-disable-next-line react-hooks/exhaustive-deps
122197
- },[videoInfo.id,videoInfo.source]);return jsx$1(Host$U,{className:classNames(className,inlineObjectsClassNames.video,videoInfo.source===VideoSource.YouTube?inlineObjectsClassNames.video+"--youtube":null),ref:container,"data-is-direct-url":!!videoInfo.isDirectUrl,applyBackground:videoInfo.source===VideoSource.Vimeo&&!videoInfo.isDirectUrl},void 0);function renderContents(){var _a;if(!container.current){return;}var videoProperties=(_a=new VideoUrlParser(videoInfo.url))===null||_a===void 0?void 0:_a.videoProperties;var iframeAreaLabel=formatMessage({id:'AriaLabel.videoElementGenerator.videoPreview'},{type:VideoElementGenerator.getVideoType(videoInfo)});container.current.innerHTML='';container.current.appendChild(VideoElementGenerator.getVideoElement(videoInfo,autoplay,width,iframeAreaLabel,videoProperties));}};var Host$U=_styled.div.withConfig({displayName:"VideoView__Host",componentId:"sc-1t89fhn-0"})(templateObject_2$1v||(templateObject_2$1v=__makeTemplateObject(["\n ","\n\n &.video-view-container {\n position: relative;\n width: 100%;\n display: block;\n overflow: hidden;\n z-index: 1;\n\n &:after {\n content: '';\n display: block;\n padding-bottom: calc(9 / 16 * 100%);\n font-size: 0; // fix for firefox\n }\n\n > * {\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n }\n\n &[data-is-direct-url='true'] {\n > [data-external-vimeo] {\n display: flex;\n\n > video {\n height: 100%;\n max-width: 100%;\n margin: 0 auto;\n }\n }\n }\n }\n"],["\n ","\n\n &.video-view-container {\n position: relative;\n width: 100%;\n display: block;\n overflow: hidden;\n z-index: 1;\n\n &:after {\n content: '';\n display: block;\n padding-bottom: calc(9 / 16 * 100%);\n font-size: 0; // fix for firefox\n }\n\n > * {\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n }\n\n &[data-is-direct-url='true'] {\n > [data-external-vimeo] {\n display: flex;\n\n > video {\n height: 100%;\n max-width: 100%;\n margin: 0 auto;\n }\n }\n }\n }\n"])),function(p){return p.applyBackground&&css$2(templateObject_1$2j||(templateObject_1$2j=__makeTemplateObject(["\n background-color: ",";\n "],["\n background-color: ",";\n "])),p.theme.palette.black);});var templateObject_1$2j,templateObject_2$1v;var VideoWithThumbnailView=function VideoWithThumbnailView(_a){var videoInfo=_a.videoInfo,videoThumbnailUrl=_a.videoThumbnailUrl,className=_a.className;var _b=useState$2(!videoInfo.isDirectUrl),showPlayer=_b[0],setShowPlayer=_b[1];if(showPlayer){return jsx$1(VideoView,{videoInfo:videoInfo,autoplay:videoInfo.isDirectUrl,className:className},void 0);}if(videoThumbnailUrl){return jsxs(Host$T,__assign({className:className},{children:[jsx$1(StyledImage,{src:videoThumbnailUrl,imageFit:ImageFit.cover,maximizeFrame:true},void 0),jsx$1(PlayButton,{onClick:function(){return setShowPlayer(true);},iconProps:{iconName:'MSNVideosSolid'}},void 0)]}),void 0);}return null;};var Host$T=_styled.div.withConfig({displayName:"VideoWithThumbnailView__Host",componentId:"sc-z8lt34-0"})(templateObject_1$2i||(templateObject_1$2i=__makeTemplateObject(["\n width: 100%;\n display: block;\n position: relative;\n\n &:after {\n content: '';\n display: block;\n padding-bottom: calc(9 / 16 * 100%);\n }\n"],["\n width: 100%;\n display: block;\n position: relative;\n\n &:after {\n content: '';\n display: block;\n padding-bottom: calc(9 / 16 * 100%);\n }\n"])));var StyledImage=_styled(Image$1).withConfig({displayName:"VideoWithThumbnailView__StyledImage",componentId:"sc-z8lt34-1"})(templateObject_2$1u||(templateObject_2$1u=__makeTemplateObject(["\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n"],["\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n"])));var PlayButton=_styled(IconButton$1).withConfig({displayName:"VideoWithThumbnailView__PlayButton",componentId:"sc-z8lt34-2"})(templateObject_3$$||(templateObject_3$$=__makeTemplateObject(["\n && {\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n\n // overlay styling\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n\n background-color: rgba(0, 0, 0, 0.33);\n\n // play icon styling\n i {\n font-size: 50px;\n color: rgba(255, 255, 255, 0.5);\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n\n &&:hover {\n background-color: rgba(0, 0, 0, 0.33);\n\n i {\n color: rgba(255, 255, 255, 0.85);\n }\n }\n }\n"],["\n && {\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n\n // overlay styling\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n\n background-color: rgba(0, 0, 0, 0.33);\n\n // play icon styling\n i {\n font-size: 50px;\n color: rgba(255, 255, 255, 0.5);\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n\n &&:hover {\n background-color: rgba(0, 0, 0, 0.33);\n\n i {\n color: rgba(255, 255, 255, 0.85);\n }\n }\n }\n"])));var templateObject_1$2i,templateObject_2$1u,templateObject_3$$;var VideoList=function VideoList(_a){var attachments=_a.attachments,onDeleteClick=_a.onDeleteClick,className=_a.className;var formatMessage=useIntl().formatMessage;var videos=attachments.filter(function(a){return a.type===AttachmentType.YouTubeVideo||a.type===AttachmentType.VimeoVideo;});if(videos.length===0){return null;}if(onDeleteClick){return jsx$1(Host$S,__assign({className:className,"data-video-attachment-list":true},{children:videos.map(function(video){return jsx$1(AttachmentHost,__assign({domIdentifier:"video",deleteButton:jsx$1(DeleteAttachmentButton,{"data-remove-attachment-button":video.id,iconProps:{iconName:'ChromeClose'},onClick:function(){onDeleteClick(video);},ariaLabel:formatMessage({id:'AriaLabel.removeAttachmentButton'})},void 0)},{children:jsx$1(VideoPreview,{video:video},void 0)}),video.id);})}),void 0);}var video=videos[0];return jsx$1(PreviewHost$1,__assign({className:className,domIdentifier:"video-url-preview-"+video.id},{children:jsx$1(VideoPreview,{video:video},void 0)}),void 0);};var VideoPreview=function VideoPreview(_a){var video=_a.video;var getVideoThumbnailUrl=useVideosApi().getVideoThumbnailUrl;var token=useCurrentToken();var user=useCurrentUser();var parser=new VideoUrlParser(video.url);var source=video.type===AttachmentType.YouTubeVideo?VideoSource.YouTube:VideoSource.Vimeo;var videoThumbnailUrl=parser.isDirectVideoUrl?getVideoThumbnailUrl(token,user.subscription.id,source,video.id):null;return jsx$1(VideoWithThumbnailView,{videoInfo:{id:video.id,source:source,url:video.url,isDirectUrl:parser.isDirectVideoUrl},videoThumbnailUrl:videoThumbnailUrl},void 0);};var Host$S=_styled.div.withConfig({displayName:"VideoList__Host",componentId:"sc-1cep2pw-0"})(templateObject_1$2h||(templateObject_1$2h=__makeTemplateObject(["\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n padding-bottom: ","px;\n"],["\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n padding-bottom: ","px;\n"])),spacingM);var PreviewHost$1=_styled(AttachmentHost).withConfig({displayName:"VideoList__PreviewHost",componentId:"sc-1cep2pw-1"})(templateObject_2$1t||(templateObject_2$1t=__makeTemplateObject(["\n margin: ","px 0 0 0;\n"],["\n margin: ","px 0 0 0;\n"])),spacingM);var templateObject_1$2h,templateObject_2$1t;var aFunction$1=aFunction$7;var toObject$1=toObject$7;var IndexedObject=indexedObject;var toLength$2=toLength$a;// `Array.prototype.{ reduce, reduceRight }` methods implementation
122194
+ },[videoInfo.id,videoInfo.source]);return jsx$1(Host$V,{className:classNames(className,inlineObjectsClassNames.video,videoInfo.source===VideoSource.YouTube?inlineObjectsClassNames.video+"--youtube":null),ref:container,"data-is-direct-url":!!videoInfo.isDirectUrl,applyBackground:videoInfo.source===VideoSource.Vimeo&&!videoInfo.isDirectUrl},void 0);function renderContents(){var _a;if(!container.current){return;}var videoProperties=(_a=new VideoUrlParser(videoInfo.url))===null||_a===void 0?void 0:_a.videoProperties;var iframeAreaLabel=formatMessage({id:'AriaLabel.videoElementGenerator.videoPreview'},{type:VideoElementGenerator.getVideoType(videoInfo)});container.current.innerHTML='';container.current.appendChild(VideoElementGenerator.getVideoElement(videoInfo,autoplay,width,iframeAreaLabel,videoProperties));}};var Host$V=_styled.div.withConfig({displayName:"VideoView__Host",componentId:"sc-1t89fhn-0"})(templateObject_2$1x||(templateObject_2$1x=__makeTemplateObject(["\n ","\n\n &.video-view-container {\n position: relative;\n width: 100%;\n display: block;\n overflow: hidden;\n z-index: 1;\n\n &:after {\n content: '';\n display: block;\n padding-bottom: calc(9 / 16 * 100%);\n font-size: 0; // fix for firefox\n }\n\n > * {\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n }\n\n &[data-is-direct-url='true'] {\n > [data-external-vimeo] {\n display: flex;\n\n > video {\n height: 100%;\n max-width: 100%;\n margin: 0 auto;\n }\n }\n }\n }\n"],["\n ","\n\n &.video-view-container {\n position: relative;\n width: 100%;\n display: block;\n overflow: hidden;\n z-index: 1;\n\n &:after {\n content: '';\n display: block;\n padding-bottom: calc(9 / 16 * 100%);\n font-size: 0; // fix for firefox\n }\n\n > * {\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n }\n\n &[data-is-direct-url='true'] {\n > [data-external-vimeo] {\n display: flex;\n\n > video {\n height: 100%;\n max-width: 100%;\n margin: 0 auto;\n }\n }\n }\n }\n"])),function(p){return p.applyBackground&&css$2(templateObject_1$2l||(templateObject_1$2l=__makeTemplateObject(["\n background-color: ",";\n "],["\n background-color: ",";\n "])),p.theme.palette.black);});var templateObject_1$2l,templateObject_2$1x;var VideoWithThumbnailView=function VideoWithThumbnailView(_a){var videoInfo=_a.videoInfo,videoThumbnailUrl=_a.videoThumbnailUrl,className=_a.className;var _b=useState$2(!videoInfo.isDirectUrl),showPlayer=_b[0],setShowPlayer=_b[1];if(showPlayer){return jsx$1(VideoView,{videoInfo:videoInfo,autoplay:videoInfo.isDirectUrl,className:className},void 0);}if(videoThumbnailUrl){return jsxs(Host$U,__assign({className:className},{children:[jsx$1(StyledImage,{src:videoThumbnailUrl,imageFit:ImageFit.cover,maximizeFrame:true},void 0),jsx$1(PlayButton,{onClick:function(){return setShowPlayer(true);},iconProps:{iconName:'MSNVideosSolid'}},void 0)]}),void 0);}return null;};var Host$U=_styled.div.withConfig({displayName:"VideoWithThumbnailView__Host",componentId:"sc-z8lt34-0"})(templateObject_1$2k||(templateObject_1$2k=__makeTemplateObject(["\n width: 100%;\n display: block;\n position: relative;\n\n &:after {\n content: '';\n display: block;\n padding-bottom: calc(9 / 16 * 100%);\n }\n"],["\n width: 100%;\n display: block;\n position: relative;\n\n &:after {\n content: '';\n display: block;\n padding-bottom: calc(9 / 16 * 100%);\n }\n"])));var StyledImage=_styled(Image$1).withConfig({displayName:"VideoWithThumbnailView__StyledImage",componentId:"sc-z8lt34-1"})(templateObject_2$1w||(templateObject_2$1w=__makeTemplateObject(["\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n"],["\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n"])));var PlayButton=_styled(IconButton$1).withConfig({displayName:"VideoWithThumbnailView__PlayButton",componentId:"sc-z8lt34-2"})(templateObject_3$11||(templateObject_3$11=__makeTemplateObject(["\n && {\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n\n // overlay styling\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n\n background-color: rgba(0, 0, 0, 0.33);\n\n // play icon styling\n i {\n font-size: 50px;\n color: rgba(255, 255, 255, 0.5);\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n\n &&:hover {\n background-color: rgba(0, 0, 0, 0.33);\n\n i {\n color: rgba(255, 255, 255, 0.85);\n }\n }\n }\n"],["\n && {\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n\n // overlay styling\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n\n background-color: rgba(0, 0, 0, 0.33);\n\n // play icon styling\n i {\n font-size: 50px;\n color: rgba(255, 255, 255, 0.5);\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n\n &&:hover {\n background-color: rgba(0, 0, 0, 0.33);\n\n i {\n color: rgba(255, 255, 255, 0.85);\n }\n }\n }\n"])));var templateObject_1$2k,templateObject_2$1w,templateObject_3$11;var VideoList=function VideoList(_a){var attachments=_a.attachments,onDeleteClick=_a.onDeleteClick,className=_a.className;var formatMessage=useIntl().formatMessage;var videos=attachments.filter(function(a){return a.type===AttachmentType.YouTubeVideo||a.type===AttachmentType.VimeoVideo;});if(videos.length===0){return null;}if(onDeleteClick){return jsx$1(Host$T,__assign({className:className,"data-video-attachment-list":true},{children:videos.map(function(video){return jsx$1(AttachmentHost,__assign({domIdentifier:"video",deleteButton:jsx$1(DeleteAttachmentButton,{"data-remove-attachment-button":video.id,iconProps:{iconName:'ChromeClose'},onClick:function(){onDeleteClick(video);},ariaLabel:formatMessage({id:'AriaLabel.removeAttachmentButton'})},void 0)},{children:jsx$1(VideoPreview,{video:video},void 0)}),video.id);})}),void 0);}var video=videos[0];return jsx$1(PreviewHost$1,__assign({className:className,domIdentifier:"video-url-preview-"+video.id},{children:jsx$1(VideoPreview,{video:video},void 0)}),void 0);};var VideoPreview=function VideoPreview(_a){var video=_a.video;var getVideoThumbnailUrl=useVideosApi().getVideoThumbnailUrl;var token=useCurrentToken();var user=useCurrentUser();var parser=new VideoUrlParser(video.url);var source=video.type===AttachmentType.YouTubeVideo?VideoSource.YouTube:VideoSource.Vimeo;var videoThumbnailUrl=parser.isDirectVideoUrl?getVideoThumbnailUrl(token,user.subscription.id,source,video.id):null;return jsx$1(VideoWithThumbnailView,{videoInfo:{id:video.id,source:source,url:video.url,isDirectUrl:parser.isDirectVideoUrl},videoThumbnailUrl:videoThumbnailUrl},void 0);};var Host$T=_styled.div.withConfig({displayName:"VideoList__Host",componentId:"sc-1cep2pw-0"})(templateObject_1$2j||(templateObject_1$2j=__makeTemplateObject(["\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n padding-bottom: ","px;\n"],["\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n padding-bottom: ","px;\n"])),spacingM);var PreviewHost$1=_styled(AttachmentHost).withConfig({displayName:"VideoList__PreviewHost",componentId:"sc-1cep2pw-1"})(templateObject_2$1v||(templateObject_2$1v=__makeTemplateObject(["\n margin: ","px 0 0 0;\n"],["\n margin: ","px 0 0 0;\n"])),spacingM);var templateObject_1$2j,templateObject_2$1v;var aFunction$1=aFunction$7;var toObject$1=toObject$7;var IndexedObject=indexedObject;var toLength$2=toLength$a;// `Array.prototype.{ reduce, reduceRight }` methods implementation
122198
122195
  var createMethod$4=function(IS_RIGHT){return function(that,callbackfn,argumentsLength,memo){aFunction$1(callbackfn);var O=toObject$1(that);var self=IndexedObject(O);var length=toLength$2(O.length);var index=IS_RIGHT?length-1:0;var i=IS_RIGHT?-1:1;if(argumentsLength<2)while(true){if(index in self){memo=self[index];index+=i;break;}index+=i;if(IS_RIGHT?index<0:length<=index){throw TypeError('Reduce of empty array with no initial value');}}for(;IS_RIGHT?index>=0:length>index;index+=i)if(index in self){memo=callbackfn(memo,self[index],index,O);}return memo;};};var arrayReduce={// `Array.prototype.reduce` method
122199
122196
  // https://tc39.github.io/ecma262/#sec-array.prototype.reduce
122200
122197
  left:createMethod$4(false),// `Array.prototype.reduceRight` method
@@ -122212,9 +122209,9 @@ if(typeof C=='function'&&(C===Array||isArray$1$1(C.prototype)))C=undefined;else
122212
122209
  // https://github.com/tc39/proposal-flatMap
122213
122210
  $$4({target:'Array',proto:true},{flatMap:function flatMap(callbackfn/* , thisArg */){var O=toObject(this);var sourceLen=toLength$b(O.length);var A;aFunction(callbackfn);A=arraySpeciesCreate(O,0);A.length=flattenIntoArray(A,O,O,sourceLen,0,1,callbackfn,arguments.length>1?arguments[1]:undefined);return A;}});// this method was added to unscopables after implementation
122214
122211
  // in popular engines, so it's moved to a separate module
122215
- var addToUnscopables=addToUnscopables$2;addToUnscopables('flatMap');var KeywordsInfo=function KeywordsInfo(_a){var keywords=_a.keywords,language=_a.language,className=_a.className,filterBaseUrl=_a.filterBaseUrl;var selectedKeywordGroups=useContext(LazySubscriptionContext).selectedKeywordGroups;if(selectedKeywordGroups==null){return null;}var availableKeywordGroups=selectedKeywordGroups===null||selectedKeywordGroups===void 0?void 0:selectedKeywordGroups.reduce(function(result,next){var _a;return __assign(__assign({},result),(_a={},_a[next.id]=next,_a));},{});var flatKeywords=getFlatKeywordList(keywords);var hasKeywords=flatKeywords&&flatKeywords.length>0;if(!hasKeywords){return null;}return jsx$1(Host$R,__assign({"data-keywords":true},{children:renderKeywords()}),void 0);function renderKeywords(){var keywordsGroupsIds=Object.keys(keywords||[]);return keywordsGroupsIds.filter(function(id){return availableKeywordGroups[id];}).map(function(groupId){return keywords[groupId].length>0&&jsx$1(KeywordsGroup,{groupId:groupId,groupName:availableKeywordGroups[groupId].name,language:language,keywords:keywords,className:className,filterBaseUrl:filterBaseUrl},groupId);});}};var KeywordsGroup=function KeywordsGroup(_a){var groupId=_a.groupId,groupName=_a.groupName,keywords=_a.keywords,language=_a.language,className=_a.className,filterBaseUrl=_a.filterBaseUrl;return jsxs(KeywordsList$1,__assign({className:classNames('ms-fontColor-neutralSecondaryAlt',className)},{children:[jsxs(KeywordsListTitle,{children:[jsx$1(KeywordTitle,{groupName:groupName,language:language},void 0),":"]},void 0),keywords[groupId].map(function(k){var Title=jsx$1(KeywordTitle,{groupName:groupName,keywordName:k.name,language:language},void 0);return jsx$1(KeywordsListItem,{children:filterBaseUrl?jsx$1(NavLink,__assign({"data-keyword":true,className:"ms-fontColor-neutralSecondaryAlt",to:filterBaseUrl+"?"+queryString.stringify({keywords:k.id})},{children:Title}),void 0):jsxs(Fragment,{children:[" ",Title," "]},void 0)},groupName+k.name);})]}),void 0);};var Host$R=_styled.div.withConfig({displayName:"KeywordsInfo__Host",componentId:"sc-woteiy-0"})(templateObject_1$2g||(templateObject_1$2g=__makeTemplateObject(["\n padding-right: ","px;\n flex: 1; /* IE fix */\n @media (min-width: 700px) {\n padding-right: ","px;\n }\n"],["\n padding-right: ","px;\n flex: 1; /* IE fix */\n @media (min-width: 700px) {\n padding-right: ","px;\n }\n"])),spacingM,spacingXl);var KeywordsList$1=_styled.dl.withConfig({displayName:"KeywordsInfo__KeywordsList",componentId:"sc-woteiy-1"})(templateObject_2$1s||(templateObject_2$1s=__makeTemplateObject(["\n width: 100%;\n margin: 0;\n\n + dl {\n margin-top: 5px;\n }\n"],["\n width: 100%;\n margin: 0;\n\n + dl {\n margin-top: 5px;\n }\n"])));var KeywordsListTitle=_styled.dt.withConfig({displayName:"KeywordsInfo__KeywordsListTitle",componentId:"sc-woteiy-2"})(templateObject_3$_||(templateObject_3$_=__makeTemplateObject(["\n display: inline-block;\n padding-right: 5px;\n word-break: normal;\n"],["\n display: inline-block;\n padding-right: 5px;\n word-break: normal;\n"])));var KeywordsListItem=_styled.dd.withConfig({displayName:"KeywordsInfo__KeywordsListItem",componentId:"sc-woteiy-3"})(templateObject_4$J||(templateObject_4$J=__makeTemplateObject(["\n display: inline-block;\n margin: 0;\n\n text-decoration: underline;\n\n &:not(:last-child) span::after {\n content: ',';\n padding-right: 5px;\n }\n"],["\n display: inline-block;\n margin: 0;\n\n text-decoration: underline;\n\n &:not(:last-child) span::after {\n content: ',';\n padding-right: 5px;\n }\n"])));var FlatKeywords=function FlatKeywords(_a){var keywords=_a.item.keywords,filterBaseUrl=_a.filterBaseUrl,className=_a.className,useGridKeywordTitle=_a.useGridKeywordTitle,onClick=_a.onClick,showAllKeywordsInCallout=_a.showAllKeywordsInCallout;var location=useLocation$1();var currentParamsObject=queryString.parse(location.search);var selectedKeywordGroups=useContext(LazySubscriptionContext).selectedKeywordGroups;if(selectedKeywordGroups==null){return null;}var availableKeywordGroups=selectedKeywordGroups===null||selectedKeywordGroups===void 0?void 0:selectedKeywordGroups.reduce(function(result,next){var _a;return __assign(__assign({},result),(_a={},_a[next.id]=next,_a));},{});var keywordsGroupsIds=Object.keys(keywords||[]);var flatKeywords=keywordsGroupsIds.filter(function(id){return availableKeywordGroups[id];}).flatMap(function(groupId){return keywords[groupId].map(function(keyword){return keyword;});});var flatKeywordsList=getFlatKeywordsList();if(showAllKeywordsInCallout){return jsx$1(Tooltip// Give the user more time to interact with the tooltip before it closes
122212
+ var addToUnscopables=addToUnscopables$2;addToUnscopables('flatMap');var KeywordsInfo=function KeywordsInfo(_a){var keywords=_a.keywords,language=_a.language,className=_a.className,filterBaseUrl=_a.filterBaseUrl;var selectedKeywordGroups=useContext(LazySubscriptionContext).selectedKeywordGroups;if(selectedKeywordGroups==null){return null;}var availableKeywordGroups=selectedKeywordGroups===null||selectedKeywordGroups===void 0?void 0:selectedKeywordGroups.reduce(function(result,next){var _a;return __assign(__assign({},result),(_a={},_a[next.id]=next,_a));},{});var flatKeywords=getFlatKeywordList(keywords);var hasKeywords=flatKeywords&&flatKeywords.length>0;if(!hasKeywords){return null;}return jsx$1(Host$S,__assign({"data-keywords":true},{children:renderKeywords()}),void 0);function renderKeywords(){var keywordsGroupsIds=Object.keys(keywords||[]);return keywordsGroupsIds.filter(function(id){return availableKeywordGroups[id];}).map(function(groupId){return keywords[groupId].length>0&&jsx$1(KeywordsGroup,{groupId:groupId,groupName:availableKeywordGroups[groupId].name,language:language,keywords:keywords,className:className,filterBaseUrl:filterBaseUrl},groupId);});}};var KeywordsGroup=function KeywordsGroup(_a){var groupId=_a.groupId,groupName=_a.groupName,keywords=_a.keywords,language=_a.language,className=_a.className,filterBaseUrl=_a.filterBaseUrl;return jsxs(KeywordsList$1,__assign({className:classNames('ms-fontColor-neutralSecondaryAlt',className)},{children:[jsxs(KeywordsListTitle,{children:[jsx$1(KeywordTitle,{groupName:groupName,language:language},void 0),":"]},void 0),keywords[groupId].map(function(k){var Title=jsx$1(KeywordTitle,{groupName:groupName,keywordName:k.name,language:language},void 0);return jsx$1(KeywordsListItem,{children:filterBaseUrl?jsx$1(NavLink,__assign({"data-keyword":true,className:"ms-fontColor-neutralSecondaryAlt",to:filterBaseUrl+"?"+queryString.stringify({keywords:k.id})},{children:Title}),void 0):jsxs(Fragment,{children:[" ",Title," "]},void 0)},groupName+k.name);})]}),void 0);};var Host$S=_styled.div.withConfig({displayName:"KeywordsInfo__Host",componentId:"sc-woteiy-0"})(templateObject_1$2i||(templateObject_1$2i=__makeTemplateObject(["\n padding-right: ","px;\n flex: 1; /* IE fix */\n @media (min-width: 700px) {\n padding-right: ","px;\n }\n"],["\n padding-right: ","px;\n flex: 1; /* IE fix */\n @media (min-width: 700px) {\n padding-right: ","px;\n }\n"])),spacingM,spacingXl);var KeywordsList$1=_styled.dl.withConfig({displayName:"KeywordsInfo__KeywordsList",componentId:"sc-woteiy-1"})(templateObject_2$1u||(templateObject_2$1u=__makeTemplateObject(["\n width: 100%;\n margin: 0;\n\n + dl {\n margin-top: 5px;\n }\n"],["\n width: 100%;\n margin: 0;\n\n + dl {\n margin-top: 5px;\n }\n"])));var KeywordsListTitle=_styled.dt.withConfig({displayName:"KeywordsInfo__KeywordsListTitle",componentId:"sc-woteiy-2"})(templateObject_3$10||(templateObject_3$10=__makeTemplateObject(["\n display: inline-block;\n padding-right: 5px;\n word-break: normal;\n"],["\n display: inline-block;\n padding-right: 5px;\n word-break: normal;\n"])));var KeywordsListItem=_styled.dd.withConfig({displayName:"KeywordsInfo__KeywordsListItem",componentId:"sc-woteiy-3"})(templateObject_4$J||(templateObject_4$J=__makeTemplateObject(["\n display: inline-block;\n margin: 0;\n\n text-decoration: underline;\n\n &:not(:last-child) span::after {\n content: ',';\n padding-right: 5px;\n }\n"],["\n display: inline-block;\n margin: 0;\n\n text-decoration: underline;\n\n &:not(:last-child) span::after {\n content: ',';\n padding-right: 5px;\n }\n"])));var FlatKeywords=function FlatKeywords(_a){var keywords=_a.item.keywords,filterBaseUrl=_a.filterBaseUrl,className=_a.className,useGridKeywordTitle=_a.useGridKeywordTitle,onClick=_a.onClick,showAllKeywordsInCallout=_a.showAllKeywordsInCallout;var location=useLocation$1();var currentParamsObject=queryString.parse(location.search);var selectedKeywordGroups=useContext(LazySubscriptionContext).selectedKeywordGroups;if(selectedKeywordGroups==null){return null;}var availableKeywordGroups=selectedKeywordGroups===null||selectedKeywordGroups===void 0?void 0:selectedKeywordGroups.reduce(function(result,next){var _a;return __assign(__assign({},result),(_a={},_a[next.id]=next,_a));},{});var keywordsGroupsIds=Object.keys(keywords||[]);var flatKeywords=keywordsGroupsIds.filter(function(id){return availableKeywordGroups[id];}).flatMap(function(groupId){return keywords[groupId].map(function(keyword){return keyword;});});var flatKeywordsList=getFlatKeywordsList();if(showAllKeywordsInCallout){return jsx$1(Tooltip// Give the user more time to interact with the tooltip before it closes
122216
122213
  ,__assign({// Give the user more time to interact with the tooltip before it closes
122217
- closeDelay:500,tooltipProps:{onRenderContent:function(){return jsx$1(TooltipList,{children:flatKeywords.map(function(k){return jsx$1("li",{children:jsx$1(KeywordTitle,{keywordName:k.name,keywordId:k.id,groupId:k.groupId,onClick:onClick},void 0)},k.groupId+k.id);})},void 0);}}},{children:flatKeywordsList}),void 0);}return jsx$1(Fragment,{children:flatKeywordsList},void 0);function getFlatKeywordsList(){return jsx$1(FlatKeywordsList,__assign({className:className,shouldApplyEllipsis:showAllKeywordsInCallout,tabIndex:showAllKeywordsInCallout?0:undefined},{children:flatKeywords.map(function(keyword){currentParamsObject.keywords=keyword.id;if(filterBaseUrl){return jsx$1(KeywordItem$1,{children:jsx$1(NavLink,__assign({"data-keyword":true,to:filterBaseUrl+"?"+queryString.stringify(currentParamsObject)},{children:useGridKeywordTitle?jsx$1(GridKeywordTitle,{keywordName:keyword.name,groupId:keyword.groupId},void 0):jsx$1(KeywordTitle,{keywordName:keyword.name,groupId:keyword.groupId,underlined:true},void 0)}),void 0)},keyword.groupId+keyword.id);}return jsx$1(KeywordItem$1,{children:useGridKeywordTitle?jsx$1(GridKeywordTitle,{keywordName:keyword.name,groupId:keyword.groupId},void 0):jsx$1(KeywordTitle,{keywordName:keyword.name,keywordId:keyword.id,groupId:keyword.groupId,onClick:onClick,tabIndex:showAllKeywordsInCallout?-1:0},void 0)},keyword.groupId+keyword.id);})}),void 0);}};var FlatKeywordsList=_styled.ul.withConfig({displayName:"KeywordsInfo__FlatKeywordsList",componentId:"sc-woteiy-4"})(templateObject_6$r||(templateObject_6$r=__makeTemplateObject(["\n margin: 0;\n padding: 0;\n list-style: none;\n color: ",";\n display: inline-block;\n max-width: 100%;\n\n ","\n"],["\n margin: 0;\n padding: 0;\n list-style: none;\n color: ",";\n display: inline-block;\n max-width: 100%;\n\n ","\n"])),function(p){return p.theme.palette.neutralSecondaryAlt;},function(p){return p.shouldApplyEllipsis&&css$2(templateObject_5$C||(templateObject_5$C=__makeTemplateObject(["\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n position: relative;\n z-index: 1;\n "],["\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n position: relative;\n z-index: 1;\n "])));});var KeywordItem$1=_styled.li.withConfig({displayName:"KeywordsInfo__KeywordItem",componentId:"sc-woteiy-5"})(templateObject_7$l||(templateObject_7$l=__makeTemplateObject(["\n display: inline;\n\n &:not(:last-child) {\n &::after {\n content: ', ';\n }\n }\n\n > a,\n > a:link,\n > a:visited,\n > span {\n color: ",";\n }\n\n a {\n position: relative;\n z-index: 1;\n }\n"],["\n display: inline;\n\n &:not(:last-child) {\n &::after {\n content: ', ';\n }\n }\n\n > a,\n > a:link,\n > a:visited,\n > span {\n color: ",";\n }\n\n a {\n position: relative;\n z-index: 1;\n }\n"])),function(p){return p.theme.palette.neutralSecondaryAlt;});var TooltipList=_styled.ul.withConfig({displayName:"KeywordsInfo__TooltipList",componentId:"sc-woteiy-6"})(templateObject_8$j||(templateObject_8$j=__makeTemplateObject(["\n margin: 0;\n padding: 0;\n list-style: none;\n\n > li {\n padding: ","px;\n color: ",";\n font-size: ","px;\n }\n"],["\n margin: 0;\n padding: 0;\n list-style: none;\n\n > li {\n padding: ","px;\n color: ",";\n font-size: ","px;\n }\n"])),spacingXxs,function(p){return p.theme.palette.neutralSecondaryAlt;},fontSizeSmall);var templateObject_1$2g,templateObject_2$1s,templateObject_3$_,templateObject_4$J,templateObject_5$C,templateObject_6$r,templateObject_7$l,templateObject_8$j;var NewsService=/** @class */function(){function NewsService(){}NewsService.getNewsRouteWithRedirect=function(baseRoute,newsId,newsTitle,isExternalContent){var route=!isExternalContent?baseRoute:baseRoute.replace('/news','/redirect/news');return this.getNewsRoute(route,newsId,newsTitle,isExternalContent);};NewsService.getNewsRoute=function(baseRoute,newsId,newsTitle,isExternalContent){var route=baseRoute+"/"+encodeURIComponent(newsId);if(newsTitle){route=route+"/"+slugify(newsTitle,{remove:/[%.#?]/g});}return isExternalContent?route+"?"+queryString.stringify({noRedirect:true}):route;};NewsService.getItemContentLanguages=function(item,languages){if(!item){return [];}return NewsService.getContentLanguages(item.contents,languages);};NewsService.getContentLanguages=function(contents,languages,contentValidator){if(!contents){return [];}var allLanguages=Object.keys(contents);if(!allLanguages.length){return [];}var activeLanguages=allLanguages.filter(function(l){return contents[l].active&&languages.find(function(sl){return sl.code===l;})&&(!contentValidator||contentValidator(contents[l]));});if(contentValidator){return activeLanguages;}return activeLanguages.length?activeLanguages:[allLanguages[0]];};NewsService.getLanguageForPublishableItem=function(item,user,contentValidator){if(!user||!item||!item.contents||!user.subscription){return null;}return NewsService.getLanguageForContent(item.contents,user,contentValidator);};NewsService.getLanguageForContent=function(contents,user,contentValidator){if(!contents){return null;}var activeLanguages=NewsService.getContentLanguages(contents,user.subscription.languages,contentValidator);return NewsService.getUserPreferredLanguage(activeLanguages,user);};NewsService.getUserPreferredLanguage=function(languages,user){if(!languages){return null;}var preferredLanguage=getPreferredContentLanguage(user);var subscription=user.subscription;if(languages.find(function(l){return l===preferredLanguage;})){return preferredLanguage;}if(languages.find(function(l){return l===subscription.defaultLanguage;})){return subscription.defaultLanguage;}return languages[0];};return NewsService;}();var ClickableOverlay=function ClickableOverlay(_a){var title=_a.title,itemId=_a.itemId,itemType=_a.itemType,baseRoute=_a.baseRoute,ariaLabelResourceKey=_a.ariaLabelResourceKey,onClick=_a.onClick,openTargetInNewWindow=_a.openTargetInNewWindow,isExternalContent=_a.isExternalContent;var formatMessage=useIntl().formatMessage;var targetRoute=itemType===ItemResourceTypes.Posts||itemType===ItemResourceTypes.Comments?baseRoute:NewsService.getNewsRoute(baseRoute,itemId,title,isExternalContent);if(openTargetInNewWindow){return jsx$1(ExternalLink$1,{href:targetRoute,target:"_blank",rel:"noopener noreferrer",onClick:onClick,"aria-label":ariaLabelResourceKey?formatMessage({id:ariaLabelResourceKey}):formatMessage({id:'AriaLabel.readMoreAbout'},{title:title}),"data-clickable-overlay":true},void 0);}return jsx$1(StyledLink$1,{to:targetRoute,onClick:onClick,"aria-label":ariaLabelResourceKey?formatMessage({id:ariaLabelResourceKey}):formatMessage({id:'AriaLabel.readMoreAbout'},{title:title}),"data-clickable-overlay":true},void 0);};var Style=css$2(templateObject_1$2f||(templateObject_1$2f=__makeTemplateObject(["\n width: 0;\n height: 0;\n\n &::before {\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n z-index: 1;\n }\n"],["\n width: 0;\n height: 0;\n\n &::before {\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n z-index: 1;\n }\n"])));var StyledLink$1=_styled(Link$4).withConfig({displayName:"ClickableOverlay__StyledLink",componentId:"sc-yfxl9c-0"})(templateObject_2$1r||(templateObject_2$1r=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),Style);var ExternalLink$1=_styled.a.withConfig({displayName:"ClickableOverlay__ExternalLink",componentId:"sc-yfxl9c-1"})(templateObject_3$Z||(templateObject_3$Z=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),Style);var templateObject_1$2f,templateObject_2$1r,templateObject_3$Z;var PostItemTile=function PostItemTile(_a){var post=_a.post,readOnly=_a.readOnly,backgroundColor=_a.backgroundColor,className=_a.className;var features=useFeatures();var buildPath=useSubscriptionHandlePathBuilder().buildPath;return jsxs(PostHost,__assign({className:className,backgroundColor:backgroundColor},{children:[!readOnly&&jsx$1(ClickableOverlay,{baseRoute:buildPath("/posts/"+post.id),itemId:post.id,itemType:ItemResourceTypes.Posts,ariaLabelResourceKey:"AriaLabel.itemLink"},void 0),jsxs(Header$3,{children:[jsx$1(StyledPersonaCard$3,__assign({upn:post.author.userPrincipalName,domIdentifier:"avatar"},{children:jsx$1(Avatar,{upn:post.author.userPrincipalName,text:post.author.displayName,size:PersonaSize.size40,hidePersonaDetails:true},void 0)}),void 0),jsxs(HeaderMetadata$2,{children:[jsx$1(PostDisplayName$1,__assign({"data-author":true},{children:post.author.displayName}),void 0),jsx$1(PostDateTime$1,{className:"ms-fontColor-neutralTertiary",value:post.publishingDate},void 0),jsx$1(Modified,{modified:post.modified},void 0)]},void 0)]},void 0),jsx$1(Content$8,{children:jsx$1(ContentDisplay,{content:post.content,handlers:[ContentDisplayHandler.LineBreak,ContentDisplayHandler.Link,ContentDisplayHandler.Mention,ContentDisplayHandler.Hashtag]},void 0)},void 0),features.keywords&&features.postKeywords&&post.keywords&&jsx$1(StyledKeywordsInfo$1,{keywords:post.keywords},void 0)]}),void 0);};var PostHost=_styled.div.withConfig({displayName:"PostItemTile__PostHost",componentId:"sc-yu434m-0"})(templateObject_3$Y||(templateObject_3$Y=__makeTemplateObject(["\n ","\n\n display: flex;\n flex-direction: column;\n\n font-size: ","px;\n padding: ","px;\n\n position: relative;\n"],["\n ","\n\n display: flex;\n flex-direction: column;\n\n font-size: ","px;\n padding: ","px;\n\n position: relative;\n"])),function(p){return p.backgroundColor?css$2(templateObject_1$2e||(templateObject_1$2e=__makeTemplateObject(["\n background-color: ",";\n "],["\n background-color: ",";\n "])),p.backgroundColor):css$2(templateObject_2$1q||(templateObject_2$1q=__makeTemplateObject(["\n background-color: ",";\n "],["\n background-color: ",";\n "])),p.theme.palette.white);},fontSizeSmall,spacingM);var Header$3=_styled.div.withConfig({displayName:"PostItemTile__Header",componentId:"sc-yu434m-1"})(templateObject_4$I||(templateObject_4$I=__makeTemplateObject(["\n display: flex;\n align-items: center;\n"],["\n display: flex;\n align-items: center;\n"])));var StyledPersonaCard$3=_styled(PersonaCard).withConfig({displayName:"PostItemTile__StyledPersonaCard",componentId:"sc-yu434m-2"})(templateObject_5$B||(templateObject_5$B=__makeTemplateObject(["\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"],["\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"])));var HeaderMetadata$2=_styled.div.withConfig({displayName:"PostItemTile__HeaderMetadata",componentId:"sc-yu434m-3"})(templateObject_6$q||(templateObject_6$q=__makeTemplateObject(["\n flex: 1;\n font-size: ","px;\n padding-left: ","px;\n white-space: nowrap;\n"],["\n flex: 1;\n font-size: ","px;\n padding-left: ","px;\n white-space: nowrap;\n"])),fontSizeSmall,spacingS);var PostDisplayName$1=_styled.div.withConfig({displayName:"PostItemTile__PostDisplayName",componentId:"sc-yu434m-4"})(templateObject_7$k||(templateObject_7$k=__makeTemplateObject(["\n font-weight: bold;\n"],["\n font-weight: bold;\n"])));var PostDateTime$1=_styled(DateTime).withConfig({displayName:"PostItemTile__PostDateTime",componentId:"sc-yu434m-5"})(templateObject_8$i||(templateObject_8$i=__makeTemplateObject(["\n font-size: ","px;\n"],["\n font-size: ","px;\n"])),fontSizeSmaller);var Content$8=_styled.div.withConfig({displayName:"PostItemTile__Content",componentId:"sc-yu434m-6"})(templateObject_9$e||(templateObject_9$e=__makeTemplateObject(["\n padding-top: 15px;\n a {\n text-decoration: underline;\n }\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"],["\n padding-top: 15px;\n a {\n text-decoration: underline;\n }\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"])));var StyledKeywordsInfo$1=_styled(KeywordsInfo).withConfig({displayName:"PostItemTile__StyledKeywordsInfo",componentId:"sc-yu434m-7"})(templateObject_10$c||(templateObject_10$c=__makeTemplateObject(["\n margin-top: ","px;\n\n dd {\n text-decoration: none;\n }\n"],["\n margin-top: ","px;\n\n dd {\n text-decoration: none;\n }\n"])),spacingM);var templateObject_1$2e,templateObject_2$1q,templateObject_3$Y,templateObject_4$I,templateObject_5$B,templateObject_6$q,templateObject_7$k,templateObject_8$i,templateObject_9$e,templateObject_10$c;var EventLocationLink=function EventLocationLink(_a){var location=_a.location,alternativeCaption=_a.alternativeCaption,className=_a.className;var locationLink=location.url||getGoogleMapsSearchLink(location.locationOnMap);return jsx$1(Fragment,{children:locationLink?jsx$1(TextLink,__assign({url:locationLink,ariaLabel:alternativeCaption||location.name},{children:alternativeCaption||location.name}),void 0):jsx$1("span",__assign({className:className},{children:alternativeCaption||location.name}),void 0)},void 0);};var EventLocationInfo=function EventLocationInfo(_a){var locations=_a.locations,className=_a.className;if(!locations||locations.length===0){return null;}var isMultiLine=locations.length>1;return jsx$1(Host$Q,__assign({className:className},{children:jsxs(ListWrapper,__assign({"data-event-locations":true,isMultiLine:isMultiLine},{children:[jsx$1(Label,{resourceKey:"Events.locationsLabel",count:locations.length},void 0),jsx$1(List$2,__assign({isMultiLine:isMultiLine},{children:locations.map(function(l){return jsx$1("li",{children:jsx$1(EventLocationLink,{location:l},void 0)},l.locationId);})}),void 0)]}),void 0)}),void 0);};var EventPeopleInfo=function EventPeopleInfo(_a){var item=_a.item,className=_a.className,hideAnnouncer=_a.hideAnnouncer;var author=item.owner||item.author;var contactsCount=item.contacts&&item.contacts.length;if(hideAnnouncer&&contactsCount===0){return null;}var isMultiLine=contactsCount>1;return jsxs(Host$Q,__assign({className:className},{children:[contactsCount>0&&jsxs(Contacts$1,__assign({"data-event-people":"contacts",isMultiLine:isMultiLine,hideAnnouncer:hideAnnouncer},{children:[jsx$1(Label,{resourceKey:"Events.contactsLabel",count:contactsCount},void 0),jsx$1(List$2,__assign({isMultiLine:isMultiLine},{children:item.contacts.map(function(c){return jsx$1("li",{children:jsx$1(EventUser,{user:c,className:"ms-fontColor-accent"},void 0)},c.userPrincipalName);})}),void 0)]}),void 0),!hideAnnouncer&&author&&jsxs(ListWrapper,__assign({"data-event-people":"author",isMultiLine:false},{children:[jsx$1(Label,{resourceKey:"Events.authorLabel"},void 0),jsx$1(EventUser,{user:author,className:"ms-fontColor-accent"},void 0)]}),void 0)]}),void 0);};var EventUser=function EventUser(_a){var user=_a.user,className=_a.className;return jsx$1("div",__assign({className:className},{children:jsx$1(StyledPersonaCard$2,__assign({upn:user.userPrincipalName},{children:user.displayName}),void 0)}),void 0);};var Label=function Label(_a){var resourceKey=_a.resourceKey,count=_a.count;return jsxs("div",{children:[jsx$1(FormattedMessage$1,{id:resourceKey,values:{count:count||1}},void 0),":\u00A0"]},void 0);};var EventChannelsDisplay=function EventChannelsDisplay(_a){var _b;var item=_a.item,language=_a.language,className=_a.className,allowFilterByChannels=_a.allowFilterByChannels,channelBackgroundColor=_a.channelBackgroundColor;var buildPath=useSubscriptionHandlePathBuilder().buildPath;if(!((_b=item===null||item===void 0?void 0:item.channels)===null||_b===void 0?void 0:_b.length)){return null;}return jsx$1(Channels$2,{channels:item.channels.map(function(c){return c.name;}),language:language,buildChannelFilterUrl:allowFilterByChannels?function(c){return buildPath("/events?"+queryString.stringify({channels:c}));}:null,channelBackgroundColor:channelBackgroundColor,className:className},void 0);};var Host$Q=_styled.div.withConfig({displayName:"EventMetaInfo__Host",componentId:"sc-l9y854-0"})(templateObject_1$2d||(templateObject_1$2d=__makeTemplateObject(["\n display: flex;\n flex-wrap: wrap;\n font-size: ","px;\n"],["\n display: flex;\n flex-wrap: wrap;\n font-size: ","px;\n"])),fontSizeSmall);var ListWrapper=_styled.div.withConfig({displayName:"EventMetaInfo__ListWrapper",componentId:"sc-l9y854-1"})(templateObject_2$1p||(templateObject_2$1p=__makeTemplateObject(["\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n text-align: left;\n\n flex-direction: ",";\n\n ","\n"],["\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n text-align: left;\n\n flex-direction: ",";\n\n ","\n"])),function(_a){var isMultiLine=_a.isMultiLine;return isMultiLine?'column':'row';},function(_a){var isMultiLine=_a.isMultiLine;return isMultiLine&&'> div:first-child { padding-bottom: 3px }';});var Contacts$1=_styled(ListWrapper).withConfig({displayName:"EventMetaInfo__Contacts",componentId:"sc-l9y854-2"})(templateObject_3$X||(templateObject_3$X=__makeTemplateObject(["\n margin-bottom: ","px;\n"],["\n margin-bottom: ","px;\n"])),function(p){return !p.hideAnnouncer?spacingXs:0;});var StyledPersonaCard$2=_styled(PersonaCard).withConfig({displayName:"EventMetaInfo__StyledPersonaCard",componentId:"sc-l9y854-3"})(templateObject_4$H||(templateObject_4$H=__makeTemplateObject(["\n text-decoration: underline;\n"],["\n text-decoration: underline;\n"])));var List$2=_styled.ul.withConfig({displayName:"EventMetaInfo__List",componentId:"sc-l9y854-4"})(templateObject_6$p||(templateObject_6$p=__makeTemplateObject(["\n ",";\n\n &&& {\n padding: 0;\n margin: 0;\n list-style: none;\n }\n\n > li {\n margin-top: ","px;\n }\n"],["\n ",";\n\n &&& {\n padding: 0;\n margin: 0;\n list-style: none;\n }\n\n > li {\n margin-top: ","px;\n }\n"])),function(_a){var isMultiLine=_a.isMultiLine;return !isMultiLine&&css$2(templateObject_5$A||(templateObject_5$A=__makeTemplateObject(["\n display: flex;\n flex-wrap: wrap;\n flex-direction: row;\n align-items: center;\n "],["\n display: flex;\n flex-wrap: wrap;\n flex-direction: row;\n align-items: center;\n "])));},function(_a){var isMultiLine=_a.isMultiLine;return isMultiLine?3:0;});var Channels$2=_styled(ClickableChannelTitles).withConfig({displayName:"EventMetaInfo__Channels",componentId:"sc-l9y854-5"})(templateObject_7$j||(templateObject_7$j=__makeTemplateObject(["\n &&& li {\n margin-top: ","px;\n }\n"],["\n &&& li {\n margin-top: ","px;\n }\n"])),spacingS);var templateObject_1$2d,templateObject_2$1p,templateObject_3$X,templateObject_4$H,templateObject_5$A,templateObject_6$p,templateObject_7$j;var BannerImage=function BannerImage(_a){var imageUrl=_a.imageUrl,children=_a.children,className=_a.className,openImageUrl=_a.openImageUrl;return jsxs(Host$P,__assign({onClick:function(){return openImageUrl&&showPhoto();},className:classNames('bannerImage',className)},{children:[jsx$1(Image$1,{src:imageUrl,imageFit:ImageFit.cover,maximizeFrame:true,alt:""},void 0),children]}),void 0);};var Host$P=_styled.div.withConfig({displayName:"BannerImage__Host",componentId:"sc-1wfmp37-0"})(templateObject_1$2c||(templateObject_1$2c=__makeTemplateObject(["\n position: relative;\n height: inherit;\n\n /*\n The UI Fabric image component has a bug that it shows 1px on the left/ top\n or right side of the background when applying their cross browser image-fit: cover.\n This result in 1px gray/white \"border\".\n We just add 1px to the image width & height to cover this gap\n */\n .ms-Image {\n img {\n width: calc(100% + 1px);\n height: calc(100% + 1px);\n }\n }\n"],["\n position: relative;\n height: inherit;\n\n /*\n The UI Fabric image component has a bug that it shows 1px on the left/ top\n or right side of the background when applying their cross browser image-fit: cover.\n This result in 1px gray/white \"border\".\n We just add 1px to the image width & height to cover this gap\n */\n .ms-Image {\n img {\n width: calc(100% + 1px);\n height: calc(100% + 1px);\n }\n }\n"])));var templateObject_1$2c;function useImageEditorApi(){var api=useApi();var _a=useApiFactory(),createApiUrl=_a.createApiUrl,fetchFromApi=_a.fetchFromApi;var onRequestToken=useContext(AuthenticationContext).onRequestToken;return useMemo(function(){return {getImageInfo:getImageInfo,getImageEditorUrl:getImageEditorUrl,getOriginalImageEditorUrlWithToken:getOriginalImageEditorUrlWithToken,getImageEditorUrlWithToken:getImageEditorUrlWithToken,uploadImage:uploadImage};/**
122214
+ closeDelay:500,tooltipProps:{onRenderContent:function(){return jsx$1(TooltipList,{children:flatKeywords.map(function(k){return jsx$1("li",{children:jsx$1(KeywordTitle,{keywordName:k.name,keywordId:k.id,groupId:k.groupId,onClick:onClick},void 0)},k.groupId+k.id);})},void 0);}}},{children:flatKeywordsList}),void 0);}return jsx$1(Fragment,{children:flatKeywordsList},void 0);function getFlatKeywordsList(){return jsx$1(FlatKeywordsList,__assign({className:className,shouldApplyEllipsis:showAllKeywordsInCallout,tabIndex:showAllKeywordsInCallout?0:undefined},{children:flatKeywords.map(function(keyword){currentParamsObject.keywords=keyword.id;if(filterBaseUrl){return jsx$1(KeywordItem$2,{children:jsx$1(NavLink,__assign({"data-keyword":true,to:filterBaseUrl+"?"+queryString.stringify(currentParamsObject)},{children:useGridKeywordTitle?jsx$1(GridKeywordTitle,{keywordName:keyword.name,groupId:keyword.groupId},void 0):jsx$1(KeywordTitle,{keywordName:keyword.name,groupId:keyword.groupId,underlined:true},void 0)}),void 0)},keyword.groupId+keyword.id);}return jsx$1(KeywordItem$2,{children:useGridKeywordTitle?jsx$1(GridKeywordTitle,{keywordName:keyword.name,groupId:keyword.groupId},void 0):jsx$1(KeywordTitle,{keywordName:keyword.name,keywordId:keyword.id,groupId:keyword.groupId,onClick:onClick,tabIndex:showAllKeywordsInCallout?-1:0},void 0)},keyword.groupId+keyword.id);})}),void 0);}};var FlatKeywordsList=_styled.ul.withConfig({displayName:"KeywordsInfo__FlatKeywordsList",componentId:"sc-woteiy-4"})(templateObject_6$r||(templateObject_6$r=__makeTemplateObject(["\n margin: 0;\n padding: 0;\n list-style: none;\n color: ",";\n display: inline-block;\n max-width: 100%;\n\n ","\n"],["\n margin: 0;\n padding: 0;\n list-style: none;\n color: ",";\n display: inline-block;\n max-width: 100%;\n\n ","\n"])),function(p){return p.theme.palette.neutralSecondaryAlt;},function(p){return p.shouldApplyEllipsis&&css$2(templateObject_5$C||(templateObject_5$C=__makeTemplateObject(["\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n position: relative;\n z-index: 1;\n "],["\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n position: relative;\n z-index: 1;\n "])));});var KeywordItem$2=_styled.li.withConfig({displayName:"KeywordsInfo__KeywordItem",componentId:"sc-woteiy-5"})(templateObject_7$l||(templateObject_7$l=__makeTemplateObject(["\n display: inline;\n\n &:not(:last-child) {\n &::after {\n content: ', ';\n }\n }\n\n > a,\n > a:link,\n > a:visited,\n > span {\n color: ",";\n }\n\n a {\n position: relative;\n z-index: 1;\n }\n"],["\n display: inline;\n\n &:not(:last-child) {\n &::after {\n content: ', ';\n }\n }\n\n > a,\n > a:link,\n > a:visited,\n > span {\n color: ",";\n }\n\n a {\n position: relative;\n z-index: 1;\n }\n"])),function(p){return p.theme.palette.neutralSecondaryAlt;});var TooltipList=_styled.ul.withConfig({displayName:"KeywordsInfo__TooltipList",componentId:"sc-woteiy-6"})(templateObject_8$j||(templateObject_8$j=__makeTemplateObject(["\n margin: 0;\n padding: 0;\n list-style: none;\n\n > li {\n padding: ","px;\n color: ",";\n font-size: ","px;\n }\n"],["\n margin: 0;\n padding: 0;\n list-style: none;\n\n > li {\n padding: ","px;\n color: ",";\n font-size: ","px;\n }\n"])),spacingXxs,function(p){return p.theme.palette.neutralSecondaryAlt;},fontSizeSmall);var templateObject_1$2i,templateObject_2$1u,templateObject_3$10,templateObject_4$J,templateObject_5$C,templateObject_6$r,templateObject_7$l,templateObject_8$j;var NewsService=/** @class */function(){function NewsService(){}NewsService.getNewsRouteWithRedirect=function(baseRoute,newsId,newsTitle,isExternalContent){var route=!isExternalContent?baseRoute:baseRoute.replace('/news','/redirect/news');return this.getNewsRoute(route,newsId,newsTitle,isExternalContent);};NewsService.getNewsRoute=function(baseRoute,newsId,newsTitle,isExternalContent){var route=baseRoute+"/"+encodeURIComponent(newsId);if(newsTitle){route=route+"/"+slugify(newsTitle,{remove:/[%.#?]/g});}return isExternalContent?route+"?"+queryString.stringify({noRedirect:true}):route;};NewsService.getItemContentLanguages=function(item,languages){if(!item){return [];}return NewsService.getContentLanguages(item.contents,languages);};NewsService.getContentLanguages=function(contents,languages,contentValidator){if(!contents){return [];}var allLanguages=Object.keys(contents);if(!allLanguages.length){return [];}var activeLanguages=allLanguages.filter(function(l){return contents[l].active&&languages.find(function(sl){return sl.code===l;})&&(!contentValidator||contentValidator(contents[l]));});if(contentValidator){return activeLanguages;}return activeLanguages.length?activeLanguages:[allLanguages[0]];};NewsService.getLanguageForPublishableItem=function(item,user,contentValidator){if(!user||!item||!item.contents||!user.subscription){return null;}return NewsService.getLanguageForContent(item.contents,user,contentValidator);};NewsService.getLanguageForContent=function(contents,user,contentValidator){if(!contents){return null;}var activeLanguages=NewsService.getContentLanguages(contents,user.subscription.languages,contentValidator);return NewsService.getUserPreferredLanguage(activeLanguages,user);};NewsService.getUserPreferredLanguage=function(languages,user){if(!languages){return null;}var preferredLanguage=getPreferredContentLanguage(user);var subscription=user.subscription;if(languages.find(function(l){return l===preferredLanguage;})){return preferredLanguage;}if(languages.find(function(l){return l===subscription.defaultLanguage;})){return subscription.defaultLanguage;}return languages[0];};return NewsService;}();var ClickableOverlay=function ClickableOverlay(_a){var title=_a.title,itemId=_a.itemId,itemType=_a.itemType,baseRoute=_a.baseRoute,ariaLabelResourceKey=_a.ariaLabelResourceKey,onClick=_a.onClick,openTargetInNewWindow=_a.openTargetInNewWindow,isExternalContent=_a.isExternalContent;var formatMessage=useIntl().formatMessage;var targetRoute=itemType===ItemResourceTypes.Posts||itemType===ItemResourceTypes.Comments?baseRoute:NewsService.getNewsRoute(baseRoute,itemId,title,isExternalContent);if(openTargetInNewWindow){return jsx$1(ExternalLink$1,{href:targetRoute,target:"_blank",rel:"noopener noreferrer",onClick:onClick,"aria-label":ariaLabelResourceKey?formatMessage({id:ariaLabelResourceKey}):formatMessage({id:'AriaLabel.readMoreAbout'},{title:title}),"data-clickable-overlay":true},void 0);}return jsx$1(StyledLink$1,{to:targetRoute,onClick:onClick,"aria-label":ariaLabelResourceKey?formatMessage({id:ariaLabelResourceKey}):formatMessage({id:'AriaLabel.readMoreAbout'},{title:title}),"data-clickable-overlay":true},void 0);};var Style=css$2(templateObject_1$2h||(templateObject_1$2h=__makeTemplateObject(["\n width: 0;\n height: 0;\n\n &::before {\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n z-index: 1;\n }\n"],["\n width: 0;\n height: 0;\n\n &::before {\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n z-index: 1;\n }\n"])));var StyledLink$1=_styled(Link$4).withConfig({displayName:"ClickableOverlay__StyledLink",componentId:"sc-yfxl9c-0"})(templateObject_2$1t||(templateObject_2$1t=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),Style);var ExternalLink$1=_styled.a.withConfig({displayName:"ClickableOverlay__ExternalLink",componentId:"sc-yfxl9c-1"})(templateObject_3$$||(templateObject_3$$=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),Style);var templateObject_1$2h,templateObject_2$1t,templateObject_3$$;var PostItemTile=function PostItemTile(_a){var post=_a.post,readOnly=_a.readOnly,backgroundColor=_a.backgroundColor,className=_a.className;var features=useFeatures();var buildPath=useSubscriptionHandlePathBuilder().buildPath;return jsxs(PostHost,__assign({className:className,backgroundColor:backgroundColor},{children:[!readOnly&&jsx$1(ClickableOverlay,{baseRoute:buildPath("/posts/"+post.id),itemId:post.id,itemType:ItemResourceTypes.Posts,ariaLabelResourceKey:"AriaLabel.itemLink"},void 0),jsxs(Header$3,{children:[jsx$1(StyledPersonaCard$3,__assign({upn:post.author.userPrincipalName,domIdentifier:"avatar"},{children:jsx$1(Avatar,{upn:post.author.userPrincipalName,text:post.author.displayName,size:PersonaSize.size40,hidePersonaDetails:true},void 0)}),void 0),jsxs(HeaderMetadata$2,{children:[jsx$1(PostDisplayName$1,__assign({"data-author":true},{children:post.author.displayName}),void 0),jsx$1(PostDateTime$1,{className:"ms-fontColor-neutralTertiary",value:post.publishingDate},void 0),jsx$1(Modified,{modified:post.modified},void 0)]},void 0)]},void 0),jsx$1(Content$8,{children:jsx$1(ContentDisplay,{content:post.content,handlers:[ContentDisplayHandler.LineBreak,ContentDisplayHandler.Link,ContentDisplayHandler.Mention,ContentDisplayHandler.Hashtag]},void 0)},void 0),features.keywords&&features.postKeywords&&post.keywords&&jsx$1(StyledKeywordsInfo$1,{keywords:post.keywords},void 0)]}),void 0);};var PostHost=_styled.div.withConfig({displayName:"PostItemTile__PostHost",componentId:"sc-yu434m-0"})(templateObject_3$_||(templateObject_3$_=__makeTemplateObject(["\n ","\n\n display: flex;\n flex-direction: column;\n\n font-size: ","px;\n padding: ","px;\n\n position: relative;\n"],["\n ","\n\n display: flex;\n flex-direction: column;\n\n font-size: ","px;\n padding: ","px;\n\n position: relative;\n"])),function(p){return p.backgroundColor?css$2(templateObject_1$2g||(templateObject_1$2g=__makeTemplateObject(["\n background-color: ",";\n "],["\n background-color: ",";\n "])),p.backgroundColor):css$2(templateObject_2$1s||(templateObject_2$1s=__makeTemplateObject(["\n background-color: ",";\n "],["\n background-color: ",";\n "])),p.theme.palette.white);},fontSizeSmall,spacingM);var Header$3=_styled.div.withConfig({displayName:"PostItemTile__Header",componentId:"sc-yu434m-1"})(templateObject_4$I||(templateObject_4$I=__makeTemplateObject(["\n display: flex;\n align-items: center;\n"],["\n display: flex;\n align-items: center;\n"])));var StyledPersonaCard$3=_styled(PersonaCard).withConfig({displayName:"PostItemTile__StyledPersonaCard",componentId:"sc-yu434m-2"})(templateObject_5$B||(templateObject_5$B=__makeTemplateObject(["\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"],["\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"])));var HeaderMetadata$2=_styled.div.withConfig({displayName:"PostItemTile__HeaderMetadata",componentId:"sc-yu434m-3"})(templateObject_6$q||(templateObject_6$q=__makeTemplateObject(["\n flex: 1;\n font-size: ","px;\n padding-left: ","px;\n white-space: nowrap;\n"],["\n flex: 1;\n font-size: ","px;\n padding-left: ","px;\n white-space: nowrap;\n"])),fontSizeSmall,spacingS);var PostDisplayName$1=_styled.div.withConfig({displayName:"PostItemTile__PostDisplayName",componentId:"sc-yu434m-4"})(templateObject_7$k||(templateObject_7$k=__makeTemplateObject(["\n font-weight: bold;\n"],["\n font-weight: bold;\n"])));var PostDateTime$1=_styled(DateTime).withConfig({displayName:"PostItemTile__PostDateTime",componentId:"sc-yu434m-5"})(templateObject_8$i||(templateObject_8$i=__makeTemplateObject(["\n font-size: ","px;\n"],["\n font-size: ","px;\n"])),fontSizeSmaller);var Content$8=_styled.div.withConfig({displayName:"PostItemTile__Content",componentId:"sc-yu434m-6"})(templateObject_9$e||(templateObject_9$e=__makeTemplateObject(["\n padding-top: 15px;\n a {\n text-decoration: underline;\n }\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"],["\n padding-top: 15px;\n a {\n text-decoration: underline;\n }\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"])));var StyledKeywordsInfo$1=_styled(KeywordsInfo).withConfig({displayName:"PostItemTile__StyledKeywordsInfo",componentId:"sc-yu434m-7"})(templateObject_10$c||(templateObject_10$c=__makeTemplateObject(["\n margin-top: ","px;\n\n dd {\n text-decoration: none;\n }\n"],["\n margin-top: ","px;\n\n dd {\n text-decoration: none;\n }\n"])),spacingM);var templateObject_1$2g,templateObject_2$1s,templateObject_3$_,templateObject_4$I,templateObject_5$B,templateObject_6$q,templateObject_7$k,templateObject_8$i,templateObject_9$e,templateObject_10$c;var EventLocationLink=function EventLocationLink(_a){var location=_a.location,alternativeCaption=_a.alternativeCaption,className=_a.className;var locationLink=location.url||getGoogleMapsSearchLink(location.locationOnMap);return jsx$1(Fragment,{children:locationLink?jsx$1(TextLink,__assign({url:locationLink,ariaLabel:alternativeCaption||location.name},{children:alternativeCaption||location.name}),void 0):jsx$1("span",__assign({className:className},{children:alternativeCaption||location.name}),void 0)},void 0);};var EventLocationInfo=function EventLocationInfo(_a){var locations=_a.locations,className=_a.className;if(!locations||locations.length===0){return null;}var isMultiLine=locations.length>1;return jsx$1(Host$R,__assign({className:className},{children:jsxs(ListWrapper,__assign({"data-event-locations":true,isMultiLine:isMultiLine},{children:[jsx$1(Label,{resourceKey:"Events.locationsLabel",count:locations.length},void 0),jsx$1(List$2,__assign({isMultiLine:isMultiLine},{children:locations.map(function(l){return jsx$1("li",{children:jsx$1(EventLocationLink,{location:l},void 0)},l.locationId);})}),void 0)]}),void 0)}),void 0);};var EventPeopleInfo=function EventPeopleInfo(_a){var item=_a.item,className=_a.className,hideAnnouncer=_a.hideAnnouncer;var author=item.owner||item.author;var contactsCount=item.contacts&&item.contacts.length;if(hideAnnouncer&&contactsCount===0){return null;}var isMultiLine=contactsCount>1;return jsxs(Host$R,__assign({className:className},{children:[contactsCount>0&&jsxs(Contacts$1,__assign({"data-event-people":"contacts",isMultiLine:isMultiLine,hideAnnouncer:hideAnnouncer},{children:[jsx$1(Label,{resourceKey:"Events.contactsLabel",count:contactsCount},void 0),jsx$1(List$2,__assign({isMultiLine:isMultiLine},{children:item.contacts.map(function(c){return jsx$1("li",{children:jsx$1(EventUser,{user:c,className:"ms-fontColor-accent"},void 0)},c.userPrincipalName);})}),void 0)]}),void 0),!hideAnnouncer&&author&&jsxs(ListWrapper,__assign({"data-event-people":"author",isMultiLine:false},{children:[jsx$1(Label,{resourceKey:"Events.authorLabel"},void 0),jsx$1(EventUser,{user:author,className:"ms-fontColor-accent"},void 0)]}),void 0)]}),void 0);};var EventUser=function EventUser(_a){var user=_a.user,className=_a.className;return jsx$1("div",__assign({className:className},{children:jsx$1(StyledPersonaCard$2,__assign({upn:user.userPrincipalName},{children:user.displayName}),void 0)}),void 0);};var Label=function Label(_a){var resourceKey=_a.resourceKey,count=_a.count;return jsxs("div",{children:[jsx$1(FormattedMessage$1,{id:resourceKey,values:{count:count||1}},void 0),":\u00A0"]},void 0);};var EventChannelsDisplay=function EventChannelsDisplay(_a){var _b;var item=_a.item,language=_a.language,className=_a.className,allowFilterByChannels=_a.allowFilterByChannels,channelBackgroundColor=_a.channelBackgroundColor;var buildPath=useSubscriptionHandlePathBuilder().buildPath;if(!((_b=item===null||item===void 0?void 0:item.channels)===null||_b===void 0?void 0:_b.length)){return null;}return jsx$1(Channels$2,{channels:item.channels.map(function(c){return c.name;}),language:language,buildChannelFilterUrl:allowFilterByChannels?function(c){return buildPath("/events?"+queryString.stringify({channels:c}));}:null,channelBackgroundColor:channelBackgroundColor,className:className},void 0);};var Host$R=_styled.div.withConfig({displayName:"EventMetaInfo__Host",componentId:"sc-l9y854-0"})(templateObject_1$2f||(templateObject_1$2f=__makeTemplateObject(["\n display: flex;\n flex-wrap: wrap;\n font-size: ","px;\n"],["\n display: flex;\n flex-wrap: wrap;\n font-size: ","px;\n"])),fontSizeSmall);var ListWrapper=_styled.div.withConfig({displayName:"EventMetaInfo__ListWrapper",componentId:"sc-l9y854-1"})(templateObject_2$1r||(templateObject_2$1r=__makeTemplateObject(["\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n text-align: left;\n\n flex-direction: ",";\n\n ","\n"],["\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n text-align: left;\n\n flex-direction: ",";\n\n ","\n"])),function(_a){var isMultiLine=_a.isMultiLine;return isMultiLine?'column':'row';},function(_a){var isMultiLine=_a.isMultiLine;return isMultiLine&&'> div:first-child { padding-bottom: 3px }';});var Contacts$1=_styled(ListWrapper).withConfig({displayName:"EventMetaInfo__Contacts",componentId:"sc-l9y854-2"})(templateObject_3$Z||(templateObject_3$Z=__makeTemplateObject(["\n margin-bottom: ","px;\n"],["\n margin-bottom: ","px;\n"])),function(p){return !p.hideAnnouncer?spacingXs:0;});var StyledPersonaCard$2=_styled(PersonaCard).withConfig({displayName:"EventMetaInfo__StyledPersonaCard",componentId:"sc-l9y854-3"})(templateObject_4$H||(templateObject_4$H=__makeTemplateObject(["\n text-decoration: underline;\n"],["\n text-decoration: underline;\n"])));var List$2=_styled.ul.withConfig({displayName:"EventMetaInfo__List",componentId:"sc-l9y854-4"})(templateObject_6$p||(templateObject_6$p=__makeTemplateObject(["\n ",";\n\n &&& {\n padding: 0;\n margin: 0;\n list-style: none;\n }\n\n > li {\n margin-top: ","px;\n }\n"],["\n ",";\n\n &&& {\n padding: 0;\n margin: 0;\n list-style: none;\n }\n\n > li {\n margin-top: ","px;\n }\n"])),function(_a){var isMultiLine=_a.isMultiLine;return !isMultiLine&&css$2(templateObject_5$A||(templateObject_5$A=__makeTemplateObject(["\n display: flex;\n flex-wrap: wrap;\n flex-direction: row;\n align-items: center;\n "],["\n display: flex;\n flex-wrap: wrap;\n flex-direction: row;\n align-items: center;\n "])));},function(_a){var isMultiLine=_a.isMultiLine;return isMultiLine?3:0;});var Channels$2=_styled(ClickableChannelTitles).withConfig({displayName:"EventMetaInfo__Channels",componentId:"sc-l9y854-5"})(templateObject_7$j||(templateObject_7$j=__makeTemplateObject(["\n &&& li {\n margin-top: ","px;\n }\n"],["\n &&& li {\n margin-top: ","px;\n }\n"])),spacingS);var templateObject_1$2f,templateObject_2$1r,templateObject_3$Z,templateObject_4$H,templateObject_5$A,templateObject_6$p,templateObject_7$j;var BannerImage=function BannerImage(_a){var imageUrl=_a.imageUrl,children=_a.children,className=_a.className,openImageUrl=_a.openImageUrl;return jsxs(Host$Q,__assign({onClick:function(){return openImageUrl&&showPhoto();},className:classNames('bannerImage',className)},{children:[jsx$1(Image$1,{src:imageUrl,imageFit:ImageFit.cover,maximizeFrame:true,alt:""},void 0),children]}),void 0);};var Host$Q=_styled.div.withConfig({displayName:"BannerImage__Host",componentId:"sc-1wfmp37-0"})(templateObject_1$2e||(templateObject_1$2e=__makeTemplateObject(["\n position: relative;\n height: inherit;\n\n /*\n The UI Fabric image component has a bug that it shows 1px on the left/ top\n or right side of the background when applying their cross browser image-fit: cover.\n This result in 1px gray/white \"border\".\n We just add 1px to the image width & height to cover this gap\n */\n .ms-Image {\n img {\n width: calc(100% + 1px);\n height: calc(100% + 1px);\n }\n }\n"],["\n position: relative;\n height: inherit;\n\n /*\n The UI Fabric image component has a bug that it shows 1px on the left/ top\n or right side of the background when applying their cross browser image-fit: cover.\n This result in 1px gray/white \"border\".\n We just add 1px to the image width & height to cover this gap\n */\n .ms-Image {\n img {\n width: calc(100% + 1px);\n height: calc(100% + 1px);\n }\n }\n"])));var templateObject_1$2e;function useImageEditorApi(){var api=useApi();var _a=useApiFactory(),createApiUrl=_a.createApiUrl,fetchFromApi=_a.fetchFromApi;var onRequestToken=useContext(AuthenticationContext).onRequestToken;return useMemo(function(){return {getImageInfo:getImageInfo,getImageEditorUrl:getImageEditorUrl,getOriginalImageEditorUrlWithToken:getOriginalImageEditorUrlWithToken,getImageEditorUrlWithToken:getImageEditorUrlWithToken,uploadImage:uploadImage};/**
122218
122215
  * Retrieve information on a given image. Does not return the actual image.
122219
122216
  */function getImageInfo(itemId,identifier,resourceType){var path="editor/"+resourceType+"/"+itemId+"/images/"+identifier;return api.custom(path+"/info").get().then(function(res){return res.body().data();});}function getImageEditorUrl(itemId,subscriptionId,identifier,resourceType){return __awaiter(this,void 0,void 0,function(){var token;return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,onRequestToken()];case 1:token=_a.sent();return [2/*return*/,getImageEditorUrlWithToken(token,itemId,subscriptionId,identifier,resourceType)];}});});}function getImageEditorUrlWithToken(token,itemId,subscriptionId,identifier,resourceType,width,height){var url=width?"/editor/"+resourceType+"/"+itemId+"/images/"+identifier+"/"+width+"/"+(height||''):"/editor/"+resourceType+"/"+itemId+"/images/"+identifier;return createApiUrl(url,{access_token:token,subscriptionId:subscriptionId});}function getOriginalImageEditorUrlWithToken(token,itemId,subscriptionId,identifier,resourceType){return createApiUrl("/editor/"+resourceType+"/"+itemId+"/images/"+identifier+"/original",{access_token:token,subscriptionId:subscriptionId});}function uploadImage(subscriptionId,resourceType,newImage){return __awaiter(this,void 0,void 0,function(){var fd,token,config;return __generator(this,function(_a){switch(_a.label){case 0:// validate or set defaults
122220
122217
  if(!newImage.identifier){// identifer defaults to 'banner'
@@ -122222,11 +122219,11 @@ newImage.identifier='banner';}fd=new FormData();fd.append('image',newImage.image
122222
122219
  // any promise failures are expected be handled from the code consuming the observable
122223
122220
  return [4/*yield*/,fetchFromApi("/editor/"+resourceType+"/"+newImage.itemId+"/images/"+newImage.identifier+"/"+newImage.variant,config)];case 2:// error handling is not done here
122224
122221
  // any promise failures are expected be handled from the code consuming the observable
122225
- _a.sent();return [2/*return*/,{itemId:newImage.itemId,identifier:newImage.identifier,mimeType:newImage.image.type,extension:newImage.image.name.split('.').pop()}];}});});}},[api,createApiUrl,fetchFromApi,onRequestToken]);}var PublishableItemBanner=function PublishableItemBanner(props){var getImageUrlWithToken=useNewsApi().getImageUrlWithToken;var _a=useVideosApi(),getBannerVideoThumbnailUrl=_a.getBannerVideoThumbnailUrl,getVideoThumbnailUrl=_a.getVideoThumbnailUrl;var getImageEditorUrlWithToken=useImageEditorApi().getImageEditorUrlWithToken;var _b=useState$2(false),showPlayer=_b[0],setShowPlayer=_b[1];var user=useCurrentUser();var features=useFeatures();var onOpenExternalLink=useContext(LinkContext).onOpenExternalLink;var formatMessage=useIntl().formatMessage;useEffect$1(function(){if(props.hidePlayerIfActive){setShowPlayer(false);}},[props.hidePlayerIfActive]);if(!props.token||!props.bannerInfo){return null;}var isImage=props.bannerInfo.type==='image';var imageUrl=getImageUrl(props.useEditorRoutes,isImage,props.width,props.height);var isStreamVideo=props.bannerInfo.videoSource===VideoSource.MicrosoftStream;var streamVideoUrl=isStreamVideo&&getMicrosoftStreamVideoUrl(props.bannerInfo.videoId);var isPlayableVideo=!isImage&&!(isStreamVideo&&env.isNativeMobileApp);if(isPlayableVideo&&showPlayer){return jsx$1(StyledVideoView,{videoInfo:{id:props.bannerInfo.videoId,source:props.bannerInfo.videoSource,url:props.bannerInfo.videoUrl,isDirectUrl:props.bannerInfo.isDirectVideoUrl},autoplay:true,className:props.className},void 0);}return jsxs(StyledBannerImage,__assign({isVideo:!isImage,imageUrl:imageUrl,openImageUrl:props.canOpenImage&&env.isNativeMobileApp?getImageUrl(props.useEditorRoutes,true,'default'):null,className:props.className},{children:[isPlayableVideo&&jsx$1(VideoButtonOverlay,{onClick:handlePlayClick,iconProps:{iconName:'MSNVideosSolid',className:'video-icon'},ariaLabel:formatMessage({id:'Generic.watchVideo'})},void 0),isStreamVideo&&env.isNativeMobileApp&&(features.inAppBrowser?jsx$1(VideoLinkOverlay,__assign({url:streamVideoUrl,onClick:function(e){return __awaiter(void 0,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:e.stopPropagation();e.preventDefault();return [4/*yield*/,onOpenExternalLink(streamVideoUrl)];case 1:_a.sent();return [2/*return*/];}});});},ariaLabel:formatMessage({id:'Generic.watchMicrosoftStream'})},{children:jsx$1(VideoIcon,{iconName:"MSNVideosSolid",className:"video-icon"},void 0)}),void 0):jsx$1(VideoLinkOverlay,__assign({url:streamVideoUrl,ariaLabel:formatMessage({id:'Generic.watchMicrosoftStream'})},{children:jsx$1(VideoIcon,{iconName:"MSNVideosSolid",className:"video-icon"},void 0)}),void 0))]}),void 0);function getImageUrl(useEditorRoutes,isImage,width,height){var _a;if(isImage){return useEditorRoutes?getImageEditorUrlWithToken(props.token,props.itemId,user.subscription.id,props.bannerInfo.imageId,props.resourceType):getImageUrlWithToken(props.token,props.itemId,user.subscription.id,props.resourceType,props.bannerInfo.imageId,width,height);}else {return (_a=new VideoUrlParser(props.bannerInfo.videoUrl).thumbnailUrl)!==null&&_a!==void 0?_a:useEditorRoutes?getVideoThumbnailUrl(props.token,user.subscription.id,props.bannerInfo.videoSource,props.bannerInfo.videoId):getBannerVideoThumbnailUrl(props.token,props.itemId,user.subscription.id,props.resourceType);}}function handlePlayClick(e){var _a;e.stopPropagation();e.preventDefault();setShowPlayer(true);(_a=props.onPlayButtonClick)===null||_a===void 0?void 0:_a.call(props);}};var StyledBannerImage=_styled(BannerImage).withConfig({displayName:"PublishableItemBanner__StyledBannerImage",componentId:"sc-bjnycc-0"})(templateObject_2$1o||(templateObject_2$1o=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),function(p){return p.isVideo&&css$2(templateObject_1$2b||(templateObject_1$2b=__makeTemplateObject(["\n position: relative;\n "],["\n position: relative;\n "])));});var BannerVideoOverlay=css$2(templateObject_3$W||(templateObject_3$W=__makeTemplateObject(["\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n\n background-color: rgba(0, 0, 0, 0.33);\n\n .video-icon {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n\n &:hover {\n .video-icon {\n color: rgba(255, 255, 255, 0.85);\n }\n }\n"],["\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n\n background-color: rgba(0, 0, 0, 0.33);\n\n .video-icon {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n\n &:hover {\n .video-icon {\n color: rgba(255, 255, 255, 0.85);\n }\n }\n"])));var VideoIconStyle=css$2(templateObject_4$G||(templateObject_4$G=__makeTemplateObject(["\n font-size: 50px;\n color: rgba(255, 255, 255, 0.5);\n"],["\n font-size: 50px;\n color: rgba(255, 255, 255, 0.5);\n"])));var VideoButtonOverlay=_styled(IconButton$1).withConfig({displayName:"PublishableItemBanner__VideoButtonOverlay",componentId:"sc-bjnycc-1"})(templateObject_5$z||(templateObject_5$z=__makeTemplateObject(["\n && {\n width: 100%;\n height: 100%;\n border: 0;\n margin: 0;\n padding: 0;\n z-index: 1;\n border-radius: 0;\n\n ","\n\n i.video-icon {\n ","\n }\n\n &&:hover {\n background-color: rgba(0, 0, 0, 0.33);\n }\n }\n"],["\n && {\n width: 100%;\n height: 100%;\n border: 0;\n margin: 0;\n padding: 0;\n z-index: 1;\n border-radius: 0;\n\n ","\n\n i.video-icon {\n ","\n }\n\n &&:hover {\n background-color: rgba(0, 0, 0, 0.33);\n }\n }\n"])),BannerVideoOverlay,VideoIconStyle);var VideoLinkOverlay=_styled(ExternalLinkHandler).withConfig({displayName:"PublishableItemBanner__VideoLinkOverlay",componentId:"sc-bjnycc-2"})(templateObject_6$o||(templateObject_6$o=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),BannerVideoOverlay);var VideoIcon=_styled(Icon).withConfig({displayName:"PublishableItemBanner__VideoIcon",componentId:"sc-bjnycc-3"})(templateObject_7$i||(templateObject_7$i=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),VideoIconStyle);var StyledVideoView=_styled(VideoView).withConfig({displayName:"PublishableItemBanner__StyledVideoView",componentId:"sc-bjnycc-4"})(templateObject_8$h||(templateObject_8$h=__makeTemplateObject(["\n height: 100%;\n"],["\n height: 100%;\n"])));var templateObject_1$2b,templateObject_2$1o,templateObject_3$W,templateObject_4$G,templateObject_5$z,templateObject_6$o,templateObject_7$i,templateObject_8$h;var EventCardBanner=function EventCardBanner(_a){var item=_a.item,bannerWidth=_a.bannerWidth,bannerHostDefaultWidth=_a.bannerHostDefaultWidth,showPlaceholder=_a.showPlaceholder;if(!item.bannerInfo&&!showPlaceholder){return null;}return jsx$1("div",{children:jsx$1(LeftBannerWrapper,__assign({defaultWidth:bannerHostDefaultWidth,showPlaceholder:showPlaceholder},{children:jsx$1(PublishableItemBanner,{itemId:item.id,bannerInfo:item.bannerInfo,width:bannerWidth,token:item.fileAccessToken,resourceType:ItemResourceTypes.Events},void 0)}),void 0)},void 0);};var FeedbackCountButton=function FeedbackCountButton(_a){var isActive=_a.isActive,count=_a.count,iconName=_a.iconName,activeIconName=_a.activeIconName,tooltipResourceKey=_a.tooltipResourceKey,tooltipResourceKeyValues=_a.tooltipResourceKeyValues,activeTooltipResourceKey=_a.activeTooltipResourceKey,activeTooltipResourceKeyValues=_a.activeTooltipResourceKeyValues,feedbackType=_a.feedbackType,hideTooltip=_a.hideTooltip,className=_a.className,props=__rest(_a,["isActive","count","iconName","activeIconName","tooltipResourceKey","tooltipResourceKeyValues","activeTooltipResourceKey","activeTooltipResourceKeyValues","feedbackType","hideTooltip","className"]);var resourceKey=isActive?activeTooltipResourceKey||tooltipResourceKey:tooltipResourceKey;var resourceValues=isActive?activeTooltipResourceKeyValues||tooltipResourceKeyValues:tooltipResourceKeyValues;return jsxs(CountButtonHost,__assign({className:className,"data-feedback":feedbackType,"data-feedback-button-isactive":isActive!==null&&isActive!==void 0?isActive:false,"data-feedback-count":count},{children:[jsx$1(IEMarginFix,{},void 0),jsx$1(PreloadIcons,{icons:[activeIconName,iconName]},void 0),!hideTooltip?jsx$1(TooltipHost,__assign({resourceKey:resourceKey,values:resourceValues},{children:jsx$1(FeedbackCountButtonInternal,__assign({count:count,feedbackType:feedbackType,isActive:isActive,iconName:iconName,activeIconName:activeIconName},props),void 0)}),void 0):jsx$1(FeedbackCountButtonInternal,__assign({count:count,feedbackType:feedbackType,isActive:isActive,iconName:iconName,activeIconName:activeIconName},props),void 0)]}),void 0);};var FeedbackCountButtonInternal=function FeedbackCountButtonInternal(_a){var count=_a.count,iconName=_a.iconName,activeIconName=_a.activeIconName,feedbackType=_a.feedbackType,isActive=_a.isActive,onClick=_a.onClick,readOnly=_a.readOnly,ariaLabel=_a.ariaLabel,highlight=_a.highlight,hideZeroCount=_a.hideZeroCount,doNotRenderZeroCount=_a.doNotRenderZeroCount;if(onClick){return jsx$1(StyledIconButton$6,__assign({onClick:onClick,iconProps:{iconName:isActive?activeIconName:iconName},"data-feedback-button":feedbackType,disabled:readOnly,highlight:highlight,"data-unread-comment-highlight":highlight,ariaLabel:ariaLabel},{children:jsx$1(CountDisplay,{count:count,doNotRenderZeroCount:doNotRenderZeroCount,hideZeroCount:hideZeroCount},void 0)}),void 0);}return jsxs(Fragment,{children:[jsx$1(StyledIcon$7,{iconName:isActive?activeIconName:iconName,highlight:highlight,"data-unread-comment-highlight":highlight},void 0),jsx$1(CountDisplay,{count:count,doNotRenderZeroCount:doNotRenderZeroCount,hideZeroCount:hideZeroCount,ariaLabel:ariaLabel},void 0)]},void 0);};var CountDisplay=function CountDisplay(_a){var count=_a.count,hideZeroCount=_a.hideZeroCount,doNotRenderZeroCount=_a.doNotRenderZeroCount,ariaLabel=_a.ariaLabel;var shouldNotRenderZeroCount=doNotRenderZeroCount&&!count;if(shouldNotRenderZeroCount){return null;}var shouldHideZeroCount=hideZeroCount&&!count;return jsx$1(CountLabel,__assign({isHidden:shouldHideZeroCount,"aria-label":ariaLabel},{children:count}),void 0);};var TooltipHost=_styled(Tooltip).withConfig({displayName:"FeedbackCountButton__TooltipHost",componentId:"sc-vg1ry1-0"})(templateObject_1$2a||(templateObject_1$2a=__makeTemplateObject(["\n && {\n display: flex;\n height: 100%;\n align-items: center;\n }\n"],["\n && {\n display: flex;\n height: 100%;\n align-items: center;\n }\n"])));var CountButtonHost=_styled.div.withConfig({displayName:"FeedbackCountButton__CountButtonHost",componentId:"sc-vg1ry1-1"})(templateObject_2$1n||(templateObject_2$1n=__makeTemplateObject(["\n display: flex;\n align-items: center;\n min-width: 60px;\n height: ","px; // ensure same height for feedback buttons\n\n margin-right: 9px;\n"],["\n display: flex;\n align-items: center;\n min-width: 60px;\n height: ","px; // ensure same height for feedback buttons\n\n margin-right: 9px;\n"])),feedbackButtonHeight);var IEMarginFix=createGlobalStyle(templateObject_3$V||(templateObject_3$V=__makeTemplateObject(["\n .browser-name-ie {\n "," {\n margin-right: 20px;\n }\n }\n"],["\n .browser-name-ie {\n "," {\n margin-right: 20px;\n }\n }\n"])),CountButtonHost);var StyledIconButton$6=_styled(IconButton).withConfig({displayName:"FeedbackCountButton__StyledIconButton",componentId:"sc-vg1ry1-2"})(templateObject_4$F||(templateObject_4$F=__makeTemplateObject(["\n && {\n margin: 0;\n padding: 0;\n width: 100%;\n font-size: inherit;\n\n &[disabled] {\n background: transparent;\n }\n }\n\n i {\n font-size: 22px;\n margin: 0;\n ","\n }\n\n user-select: none;\n"],["\n && {\n margin: 0;\n padding: 0;\n width: 100%;\n font-size: inherit;\n\n &[disabled] {\n background: transparent;\n }\n }\n\n i {\n font-size: 22px;\n margin: 0;\n ","\n }\n\n user-select: none;\n"])),function(p){return p.highlight&&unreadCommentHighlight;});var StyledIcon$7=_styled(Icon).withConfig({displayName:"FeedbackCountButton__StyledIcon",componentId:"sc-vg1ry1-3"})(templateObject_5$y||(templateObject_5$y=__makeTemplateObject(["\n font-size: 22px;\n user-select: none;\n\n ","\n"],["\n font-size: 22px;\n user-select: none;\n\n ","\n"])),function(p){return p.highlight&&unreadCommentHighlight;});var CountLabel=_styled.span.withConfig({displayName:"FeedbackCountButton__CountLabel",componentId:"sc-vg1ry1-4"})(templateObject_8$g||(templateObject_8$g=__makeTemplateObject(["\n margin-left: 7px;\n word-break: normal;\n align-self: center;\n ","\n ","\n"],["\n margin-left: 7px;\n word-break: normal;\n align-self: center;\n ","\n ","\n"])),function(p){return p.isHidden&&css$2(templateObject_6$n||(templateObject_6$n=__makeTemplateObject(["\n visibility: hidden;\n "],["\n visibility: hidden;\n "])));},function(p){return p.isDisabled&&css$2(templateObject_7$h||(templateObject_7$h=__makeTemplateObject(["\n color: ",";\n "],["\n color: ",";\n "])),p.theme.palette.neutralQuaternary);});var PreloadIcons=function PreloadIcons(_a){var icons=_a.icons;return jsx$1(Fragment,{children:icons.filter(function(i){return i;}).map(function(i){return jsx$1(PreloadIcon,{iconName:i},i);})},void 0);};var PreloadIcon=_styled(Icon).withConfig({displayName:"FeedbackCountButton__PreloadIcon",componentId:"sc-vg1ry1-5"})(templateObject_9$d||(templateObject_9$d=__makeTemplateObject(["\n position: fixed;\n left: -500px;\n"],["\n position: fixed;\n left: -500px;\n"])));var templateObject_1$2a,templateObject_2$1n,templateObject_3$V,templateObject_4$F,templateObject_5$y,templateObject_6$n,templateObject_7$h,templateObject_8$g,templateObject_9$d;var EventCardCommentCount=function EventCardCommentCount(_a){var item=_a.item;var formatMessage=useIntl().formatMessage;return jsxs(Fragment,{children:[jsx$1(IEFix$1,{},void 0),jsx$1(StyledFeedbackCountButton,{tooltipResourceKey:"Events.numberOfComments",tooltipResourceKeyValues:{count:item.statistics.commentCount},ariaLabel:formatMessage({id:'AriaLabel.commentsButton'}),iconName:"Chat",count:item.statistics.commentCount,feedbackType:"comment",highlight:item.hasNewComments,className:"event-card-comments"},void 0)]},void 0);};var StyledFeedbackCountButton=_styled(FeedbackCountButton).withConfig({displayName:"EventCardCommentCount__StyledFeedbackCountButton",componentId:"sc-3prmx8-0"})(templateObject_1$29||(templateObject_1$29=__makeTemplateObject(["\n && {\n min-width: 0;\n margin-right: 0;\n }\n"],["\n && {\n min-width: 0;\n margin-right: 0;\n }\n"])));var IEFix$1=createGlobalStyle(templateObject_2$1m||(templateObject_2$1m=__makeTemplateObject(["\n .browser-name-ie {\n .event-card-comments {\n margin-right: 0 !important;\n }\n }\n"],["\n .browser-name-ie {\n .event-card-comments {\n margin-right: 0 !important;\n }\n }\n"])));var templateObject_1$29,templateObject_2$1m;var EventCancelInformation=function EventCancelInformation(_a){var _b;var item=_a.item,language=_a.language,className=_a.className;var user=useCurrentUser();if(!((_b=item.cancelInformation)===null||_b===void 0?void 0:_b.isCancelled)){return null;}var contents=item.cancelInformation.reasons||{};var reason=contents[language]||contents[NewsService.getUserPreferredLanguage(Object.keys(contents),user)]||Object.values(contents)[0];return jsxs(Host$O,__assign({className:className,"data-event-cancelled-info":true},{children:[jsxs(TitleContainer,{children:[jsx$1(CancelIcon,{iconName:"RemoveEvent"},void 0),jsx$1(Title$9,{id:"Events.cancel.cancelled"},void 0)]},void 0),reason]}),void 0);};var Host$O=_styled.div.withConfig({displayName:"EventCancelInformation__Host",componentId:"sc-rh6578-0"})(templateObject_1$28||(templateObject_1$28=__makeTemplateObject(["\n position: relative;\n padding: ","px;\n margin-top: ","px;\n\n font-size: ","px;\n\n :after {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: ",";\n opacity: 0.1;\n }\n"],["\n position: relative;\n padding: ","px;\n margin-top: ","px;\n\n font-size: ","px;\n\n :after {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: ",";\n opacity: 0.1;\n }\n"])),spacingM,spacingS,fontSizeSmall,function(p){return p.theme.palette.red;});var TitleContainer=_styled.div.withConfig({displayName:"EventCancelInformation__TitleContainer",componentId:"sc-rh6578-1"})(templateObject_2$1l||(templateObject_2$1l=__makeTemplateObject(["\n display: flex;\n align-items: center;\n padding-bottom: ","px;\n\n color: ",";\n\n *:not(:first-child) {\n padding-left: ","px;\n }\n"],["\n display: flex;\n align-items: center;\n padding-bottom: ","px;\n\n color: ",";\n\n *:not(:first-child) {\n padding-left: ","px;\n }\n"])),spacingXs,function(p){return p.theme.palette.redDark;},spacingXs);var CancelIcon=_styled(Icon).withConfig({displayName:"EventCancelInformation__CancelIcon",componentId:"sc-rh6578-2"})(templateObject_3$U||(templateObject_3$U=__makeTemplateObject(["\n font-size: 20px;\n"],["\n font-size: 20px;\n"])));var Title$9=_styled(FormattedMessageWithStyle).withConfig({displayName:"EventCancelInformation__Title",componentId:"sc-rh6578-3"})(templateObject_4$E||(templateObject_4$E=__makeTemplateObject(["\n font-weight: bold;\n"],["\n font-weight: bold;\n"])));var templateObject_1$28,templateObject_2$1l,templateObject_3$U,templateObject_4$E;var EventUserRegistrationContext=/*#__PURE__*/createContext(null);function getDeadlineInfos(item){var hasDeadline=item.registrationSettings.deadline!=null;var isPastDeadline=hasDeadline&&moment(item.registrationSettings.deadline).isBefore(moment());return {hasDeadline:hasDeadline,isPastDeadline:isPastDeadline};}var EventRegistrationButton=function EventRegistrationButton(_a){var isRegistered=_a.isRegistered,className=_a.className,disabled=_a.disabled,onClick=_a.onClick,showInfoMessage=_a.showInfoMessage,infoMessageResourceKey=_a.infoMessageResourceKey;var formatMessage=useIntl().formatMessage;return jsxs(Host$N,__assign({className:className,"aria-label":formatMessage({id:'Events.registration.sectionLabel'})},{children:[jsx$1(RegisterButton,{text:formatMessage({id:isRegistered?'Events.registration.deregisterButtonCaption':'Events.registration.registerButtonCaption'}),disabled:disabled,"data-event-register-button":!!isRegistered,onClick:function(e){e.preventDefault();onClick();},isRegistered:isRegistered},void 0),showInfoMessage&&jsxs(InfoMessage,__assign({"data-event-register-info":true},{children:[jsx$1(Icon,{iconName:"Info"},void 0),jsx$1(FormattedMessage$1,{id:infoMessageResourceKey},void 0)]}),void 0)]}),void 0);};var Host$N=_styled.div.withConfig({displayName:"EventRegistrationButton__Host",componentId:"sc-rvaf0t-0"})(templateObject_1$27||(templateObject_1$27=__makeTemplateObject(["\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n"],["\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n"])));var RegisterButton=_styled(PrimaryButton).withConfig({displayName:"EventRegistrationButton__RegisterButton",componentId:"sc-rvaf0t-1"})(templateObject_4$D||(templateObject_4$D=__makeTemplateObject(["\n && {\n min-width: 200px;\n border: 0;\n &:hover {\n border: 0;\n }\n ","\n ","\n }\n"],["\n && {\n min-width: 200px;\n border: 0;\n &:hover {\n border: 0;\n }\n ","\n ","\n }\n"])),function(p){return p.disabled&&css$2(templateObject_2$1k||(templateObject_2$1k=__makeTemplateObject(["\n background-color: ",";\n "],["\n background-color: ",";\n "])),p.theme.palette.neutralQuaternaryAlt);},function(p){return p.isRegistered&&css$2(templateObject_3$T||(templateObject_3$T=__makeTemplateObject(["\n &:not([disabled]) {\n background-color: ",";\n color: #fff;\n\n &:hover {\n background-color: ",";\n }\n }\n "],["\n &:not([disabled]) {\n background-color: ",";\n color: #fff;\n\n &:hover {\n background-color: ",";\n }\n }\n "])),p.theme.palette.red,p.theme.palette.redDark);});var InfoMessage=_styled.span.withConfig({displayName:"EventRegistrationButton__InfoMessage",componentId:"sc-rvaf0t-2"})(templateObject_5$x||(templateObject_5$x=__makeTemplateObject(["\n display: flex;\n align-items: center;\n font-style: italic;\n margin-top: ","px;\n font-size: ","px;\n\n i {\n padding-right: ","px;\n }\n"],["\n display: flex;\n align-items: center;\n font-style: italic;\n margin-top: ","px;\n font-size: ","px;\n\n i {\n padding-right: ","px;\n }\n"])),spacingXs,fontSizeSmall,spacingXs);var templateObject_1$27,templateObject_2$1k,templateObject_3$T,templateObject_4$D,templateObject_5$x;var $$3=_export;var DESCRIPTORS=descriptors;var global$2=global$m;var has=has$c;var isObject=isObject$c;var defineProperty=objectDefineProperty.f;var copyConstructorProperties=copyConstructorProperties$2;var NativeSymbol=global$2.Symbol;if(DESCRIPTORS&&typeof NativeSymbol=='function'&&(!('description'in NativeSymbol.prototype)||// Safari 12 bug
122222
+ _a.sent();return [2/*return*/,{itemId:newImage.itemId,identifier:newImage.identifier,mimeType:newImage.image.type,extension:newImage.image.name.split('.').pop()}];}});});}},[api,createApiUrl,fetchFromApi,onRequestToken]);}var PublishableItemBanner=function PublishableItemBanner(props){var getImageUrlWithToken=useNewsApi().getImageUrlWithToken;var _a=useVideosApi(),getBannerVideoThumbnailUrl=_a.getBannerVideoThumbnailUrl,getVideoThumbnailUrl=_a.getVideoThumbnailUrl;var getImageEditorUrlWithToken=useImageEditorApi().getImageEditorUrlWithToken;var _b=useState$2(false),showPlayer=_b[0],setShowPlayer=_b[1];var user=useCurrentUser();var features=useFeatures();var onOpenExternalLink=useContext(LinkContext).onOpenExternalLink;var formatMessage=useIntl().formatMessage;useEffect$1(function(){if(props.hidePlayerIfActive){setShowPlayer(false);}},[props.hidePlayerIfActive]);if(!props.token||!props.bannerInfo){return null;}var isImage=props.bannerInfo.type==='image';var imageUrl=getImageUrl(props.useEditorRoutes,isImage,props.width,props.height);var isStreamVideo=props.bannerInfo.videoSource===VideoSource.MicrosoftStream;var streamVideoUrl=isStreamVideo&&getMicrosoftStreamVideoUrl(props.bannerInfo.videoId);var isPlayableVideo=!isImage&&!(isStreamVideo&&env.isNativeMobileApp);if(isPlayableVideo&&showPlayer){return jsx$1(StyledVideoView,{videoInfo:{id:props.bannerInfo.videoId,source:props.bannerInfo.videoSource,url:props.bannerInfo.videoUrl,isDirectUrl:props.bannerInfo.isDirectVideoUrl},autoplay:true,className:props.className},void 0);}return jsxs(StyledBannerImage,__assign({isVideo:!isImage,imageUrl:imageUrl,openImageUrl:props.canOpenImage&&env.isNativeMobileApp?getImageUrl(props.useEditorRoutes,true,'default'):null,className:props.className},{children:[isPlayableVideo&&jsx$1(VideoButtonOverlay,{onClick:handlePlayClick,iconProps:{iconName:'MSNVideosSolid',className:'video-icon'},ariaLabel:formatMessage({id:'Generic.watchVideo'})},void 0),isStreamVideo&&env.isNativeMobileApp&&(features.inAppBrowser?jsx$1(VideoLinkOverlay,__assign({url:streamVideoUrl,onClick:function(e){return __awaiter(void 0,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:e.stopPropagation();e.preventDefault();return [4/*yield*/,onOpenExternalLink(streamVideoUrl)];case 1:_a.sent();return [2/*return*/];}});});},ariaLabel:formatMessage({id:'Generic.watchMicrosoftStream'})},{children:jsx$1(VideoIcon,{iconName:"MSNVideosSolid",className:"video-icon"},void 0)}),void 0):jsx$1(VideoLinkOverlay,__assign({url:streamVideoUrl,ariaLabel:formatMessage({id:'Generic.watchMicrosoftStream'})},{children:jsx$1(VideoIcon,{iconName:"MSNVideosSolid",className:"video-icon"},void 0)}),void 0))]}),void 0);function getImageUrl(useEditorRoutes,isImage,width,height){var _a;if(isImage){return useEditorRoutes?getImageEditorUrlWithToken(props.token,props.itemId,user.subscription.id,props.bannerInfo.imageId,props.resourceType):getImageUrlWithToken(props.token,props.itemId,user.subscription.id,props.resourceType,props.bannerInfo.imageId,width,height);}else {return (_a=new VideoUrlParser(props.bannerInfo.videoUrl).thumbnailUrl)!==null&&_a!==void 0?_a:useEditorRoutes?getVideoThumbnailUrl(props.token,user.subscription.id,props.bannerInfo.videoSource,props.bannerInfo.videoId):getBannerVideoThumbnailUrl(props.token,props.itemId,user.subscription.id,props.resourceType);}}function handlePlayClick(e){var _a;e.stopPropagation();e.preventDefault();setShowPlayer(true);(_a=props.onPlayButtonClick)===null||_a===void 0?void 0:_a.call(props);}};var StyledBannerImage=_styled(BannerImage).withConfig({displayName:"PublishableItemBanner__StyledBannerImage",componentId:"sc-bjnycc-0"})(templateObject_2$1q||(templateObject_2$1q=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),function(p){return p.isVideo&&css$2(templateObject_1$2d||(templateObject_1$2d=__makeTemplateObject(["\n position: relative;\n "],["\n position: relative;\n "])));});var BannerVideoOverlay=css$2(templateObject_3$Y||(templateObject_3$Y=__makeTemplateObject(["\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n\n background-color: rgba(0, 0, 0, 0.33);\n\n .video-icon {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n\n &:hover {\n .video-icon {\n color: rgba(255, 255, 255, 0.85);\n }\n }\n"],["\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n\n background-color: rgba(0, 0, 0, 0.33);\n\n .video-icon {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n\n &:hover {\n .video-icon {\n color: rgba(255, 255, 255, 0.85);\n }\n }\n"])));var VideoIconStyle=css$2(templateObject_4$G||(templateObject_4$G=__makeTemplateObject(["\n font-size: 50px;\n color: rgba(255, 255, 255, 0.5);\n"],["\n font-size: 50px;\n color: rgba(255, 255, 255, 0.5);\n"])));var VideoButtonOverlay=_styled(IconButton$1).withConfig({displayName:"PublishableItemBanner__VideoButtonOverlay",componentId:"sc-bjnycc-1"})(templateObject_5$z||(templateObject_5$z=__makeTemplateObject(["\n && {\n width: 100%;\n height: 100%;\n border: 0;\n margin: 0;\n padding: 0;\n z-index: 1;\n border-radius: 0;\n\n ","\n\n i.video-icon {\n ","\n }\n\n &&:hover {\n background-color: rgba(0, 0, 0, 0.33);\n }\n }\n"],["\n && {\n width: 100%;\n height: 100%;\n border: 0;\n margin: 0;\n padding: 0;\n z-index: 1;\n border-radius: 0;\n\n ","\n\n i.video-icon {\n ","\n }\n\n &&:hover {\n background-color: rgba(0, 0, 0, 0.33);\n }\n }\n"])),BannerVideoOverlay,VideoIconStyle);var VideoLinkOverlay=_styled(ExternalLinkHandler).withConfig({displayName:"PublishableItemBanner__VideoLinkOverlay",componentId:"sc-bjnycc-2"})(templateObject_6$o||(templateObject_6$o=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),BannerVideoOverlay);var VideoIcon=_styled(Icon).withConfig({displayName:"PublishableItemBanner__VideoIcon",componentId:"sc-bjnycc-3"})(templateObject_7$i||(templateObject_7$i=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),VideoIconStyle);var StyledVideoView=_styled(VideoView).withConfig({displayName:"PublishableItemBanner__StyledVideoView",componentId:"sc-bjnycc-4"})(templateObject_8$h||(templateObject_8$h=__makeTemplateObject(["\n height: 100%;\n"],["\n height: 100%;\n"])));var templateObject_1$2d,templateObject_2$1q,templateObject_3$Y,templateObject_4$G,templateObject_5$z,templateObject_6$o,templateObject_7$i,templateObject_8$h;var EventCardBanner=function EventCardBanner(_a){var item=_a.item,bannerWidth=_a.bannerWidth,bannerHostDefaultWidth=_a.bannerHostDefaultWidth,showPlaceholder=_a.showPlaceholder;if(!item.bannerInfo&&!showPlaceholder){return null;}return jsx$1("div",{children:jsx$1(LeftBannerWrapper,__assign({defaultWidth:bannerHostDefaultWidth,showPlaceholder:showPlaceholder},{children:jsx$1(PublishableItemBanner,{itemId:item.id,bannerInfo:item.bannerInfo,width:bannerWidth,token:item.fileAccessToken,resourceType:ItemResourceTypes.Events},void 0)}),void 0)},void 0);};var FeedbackCountButton=function FeedbackCountButton(_a){var isActive=_a.isActive,count=_a.count,iconName=_a.iconName,activeIconName=_a.activeIconName,tooltipResourceKey=_a.tooltipResourceKey,tooltipResourceKeyValues=_a.tooltipResourceKeyValues,activeTooltipResourceKey=_a.activeTooltipResourceKey,activeTooltipResourceKeyValues=_a.activeTooltipResourceKeyValues,feedbackType=_a.feedbackType,hideTooltip=_a.hideTooltip,className=_a.className,props=__rest(_a,["isActive","count","iconName","activeIconName","tooltipResourceKey","tooltipResourceKeyValues","activeTooltipResourceKey","activeTooltipResourceKeyValues","feedbackType","hideTooltip","className"]);var resourceKey=isActive?activeTooltipResourceKey||tooltipResourceKey:tooltipResourceKey;var resourceValues=isActive?activeTooltipResourceKeyValues||tooltipResourceKeyValues:tooltipResourceKeyValues;return jsxs(CountButtonHost,__assign({className:className,"data-feedback":feedbackType,"data-feedback-button-isactive":isActive!==null&&isActive!==void 0?isActive:false,"data-feedback-count":count},{children:[jsx$1(IEMarginFix,{},void 0),jsx$1(PreloadIcons,{icons:[activeIconName,iconName]},void 0),!hideTooltip?jsx$1(TooltipHost,__assign({resourceKey:resourceKey,values:resourceValues},{children:jsx$1(FeedbackCountButtonInternal,__assign({count:count,feedbackType:feedbackType,isActive:isActive,iconName:iconName,activeIconName:activeIconName},props),void 0)}),void 0):jsx$1(FeedbackCountButtonInternal,__assign({count:count,feedbackType:feedbackType,isActive:isActive,iconName:iconName,activeIconName:activeIconName},props),void 0)]}),void 0);};var FeedbackCountButtonInternal=function FeedbackCountButtonInternal(_a){var count=_a.count,iconName=_a.iconName,activeIconName=_a.activeIconName,feedbackType=_a.feedbackType,isActive=_a.isActive,onClick=_a.onClick,readOnly=_a.readOnly,ariaLabel=_a.ariaLabel,highlight=_a.highlight,hideZeroCount=_a.hideZeroCount,doNotRenderZeroCount=_a.doNotRenderZeroCount;if(onClick){return jsx$1(StyledIconButton$6,__assign({onClick:onClick,iconProps:{iconName:isActive?activeIconName:iconName},"data-feedback-button":feedbackType,disabled:readOnly,highlight:highlight,"data-unread-comment-highlight":highlight,ariaLabel:ariaLabel},{children:jsx$1(CountDisplay,{count:count,doNotRenderZeroCount:doNotRenderZeroCount,hideZeroCount:hideZeroCount},void 0)}),void 0);}return jsxs(Fragment,{children:[jsx$1(StyledIcon$7,{iconName:isActive?activeIconName:iconName,highlight:highlight,"data-unread-comment-highlight":highlight},void 0),jsx$1(CountDisplay,{count:count,doNotRenderZeroCount:doNotRenderZeroCount,hideZeroCount:hideZeroCount,ariaLabel:ariaLabel},void 0)]},void 0);};var CountDisplay=function CountDisplay(_a){var count=_a.count,hideZeroCount=_a.hideZeroCount,doNotRenderZeroCount=_a.doNotRenderZeroCount,ariaLabel=_a.ariaLabel;var shouldNotRenderZeroCount=doNotRenderZeroCount&&!count;if(shouldNotRenderZeroCount){return null;}var shouldHideZeroCount=hideZeroCount&&!count;return jsx$1(CountLabel,__assign({isHidden:shouldHideZeroCount,"aria-label":ariaLabel},{children:count}),void 0);};var TooltipHost=_styled(Tooltip).withConfig({displayName:"FeedbackCountButton__TooltipHost",componentId:"sc-vg1ry1-0"})(templateObject_1$2c||(templateObject_1$2c=__makeTemplateObject(["\n && {\n display: flex;\n height: 100%;\n align-items: center;\n }\n"],["\n && {\n display: flex;\n height: 100%;\n align-items: center;\n }\n"])));var CountButtonHost=_styled.div.withConfig({displayName:"FeedbackCountButton__CountButtonHost",componentId:"sc-vg1ry1-1"})(templateObject_2$1p||(templateObject_2$1p=__makeTemplateObject(["\n display: flex;\n align-items: center;\n min-width: 60px;\n height: ","px; // ensure same height for feedback buttons\n\n margin-right: 9px;\n"],["\n display: flex;\n align-items: center;\n min-width: 60px;\n height: ","px; // ensure same height for feedback buttons\n\n margin-right: 9px;\n"])),feedbackButtonHeight);var IEMarginFix=createGlobalStyle(templateObject_3$X||(templateObject_3$X=__makeTemplateObject(["\n .browser-name-ie {\n "," {\n margin-right: 20px;\n }\n }\n"],["\n .browser-name-ie {\n "," {\n margin-right: 20px;\n }\n }\n"])),CountButtonHost);var StyledIconButton$6=_styled(IconButton).withConfig({displayName:"FeedbackCountButton__StyledIconButton",componentId:"sc-vg1ry1-2"})(templateObject_4$F||(templateObject_4$F=__makeTemplateObject(["\n && {\n margin: 0;\n padding: 0;\n width: 100%;\n font-size: inherit;\n\n &[disabled] {\n background: transparent;\n }\n }\n\n i {\n font-size: 22px;\n margin: 0;\n ","\n }\n\n user-select: none;\n"],["\n && {\n margin: 0;\n padding: 0;\n width: 100%;\n font-size: inherit;\n\n &[disabled] {\n background: transparent;\n }\n }\n\n i {\n font-size: 22px;\n margin: 0;\n ","\n }\n\n user-select: none;\n"])),function(p){return p.highlight&&unreadCommentHighlight;});var StyledIcon$7=_styled(Icon).withConfig({displayName:"FeedbackCountButton__StyledIcon",componentId:"sc-vg1ry1-3"})(templateObject_5$y||(templateObject_5$y=__makeTemplateObject(["\n font-size: 22px;\n user-select: none;\n\n ","\n"],["\n font-size: 22px;\n user-select: none;\n\n ","\n"])),function(p){return p.highlight&&unreadCommentHighlight;});var CountLabel=_styled.span.withConfig({displayName:"FeedbackCountButton__CountLabel",componentId:"sc-vg1ry1-4"})(templateObject_8$g||(templateObject_8$g=__makeTemplateObject(["\n margin-left: 7px;\n word-break: normal;\n align-self: center;\n ","\n ","\n"],["\n margin-left: 7px;\n word-break: normal;\n align-self: center;\n ","\n ","\n"])),function(p){return p.isHidden&&css$2(templateObject_6$n||(templateObject_6$n=__makeTemplateObject(["\n visibility: hidden;\n "],["\n visibility: hidden;\n "])));},function(p){return p.isDisabled&&css$2(templateObject_7$h||(templateObject_7$h=__makeTemplateObject(["\n color: ",";\n "],["\n color: ",";\n "])),p.theme.palette.neutralQuaternary);});var PreloadIcons=function PreloadIcons(_a){var icons=_a.icons;return jsx$1(Fragment,{children:icons.filter(function(i){return i;}).map(function(i){return jsx$1(PreloadIcon,{iconName:i},i);})},void 0);};var PreloadIcon=_styled(Icon).withConfig({displayName:"FeedbackCountButton__PreloadIcon",componentId:"sc-vg1ry1-5"})(templateObject_9$d||(templateObject_9$d=__makeTemplateObject(["\n position: fixed;\n left: -500px;\n"],["\n position: fixed;\n left: -500px;\n"])));var templateObject_1$2c,templateObject_2$1p,templateObject_3$X,templateObject_4$F,templateObject_5$y,templateObject_6$n,templateObject_7$h,templateObject_8$g,templateObject_9$d;var EventCardCommentCount=function EventCardCommentCount(_a){var item=_a.item;var formatMessage=useIntl().formatMessage;return jsxs(Fragment,{children:[jsx$1(IEFix$1,{},void 0),jsx$1(StyledFeedbackCountButton,{tooltipResourceKey:"Events.numberOfComments",tooltipResourceKeyValues:{count:item.statistics.commentCount},ariaLabel:formatMessage({id:'AriaLabel.commentsButton'}),iconName:"Chat",count:item.statistics.commentCount,feedbackType:"comment",highlight:item.hasNewComments,className:"event-card-comments"},void 0)]},void 0);};var StyledFeedbackCountButton=_styled(FeedbackCountButton).withConfig({displayName:"EventCardCommentCount__StyledFeedbackCountButton",componentId:"sc-3prmx8-0"})(templateObject_1$2b||(templateObject_1$2b=__makeTemplateObject(["\n && {\n min-width: 0;\n margin-right: 0;\n }\n"],["\n && {\n min-width: 0;\n margin-right: 0;\n }\n"])));var IEFix$1=createGlobalStyle(templateObject_2$1o||(templateObject_2$1o=__makeTemplateObject(["\n .browser-name-ie {\n .event-card-comments {\n margin-right: 0 !important;\n }\n }\n"],["\n .browser-name-ie {\n .event-card-comments {\n margin-right: 0 !important;\n }\n }\n"])));var templateObject_1$2b,templateObject_2$1o;var EventCancelInformation=function EventCancelInformation(_a){var _b;var item=_a.item,language=_a.language,className=_a.className;var user=useCurrentUser();if(!((_b=item.cancelInformation)===null||_b===void 0?void 0:_b.isCancelled)){return null;}var contents=item.cancelInformation.reasons||{};var reason=contents[language]||contents[NewsService.getUserPreferredLanguage(Object.keys(contents),user)]||Object.values(contents)[0];return jsxs(Host$P,__assign({className:className,"data-event-cancelled-info":true},{children:[jsxs(TitleContainer,{children:[jsx$1(CancelIcon,{iconName:"RemoveEvent"},void 0),jsx$1(Title$a,{id:"Events.cancel.cancelled"},void 0)]},void 0),reason]}),void 0);};var Host$P=_styled.div.withConfig({displayName:"EventCancelInformation__Host",componentId:"sc-rh6578-0"})(templateObject_1$2a||(templateObject_1$2a=__makeTemplateObject(["\n position: relative;\n padding: ","px;\n margin-top: ","px;\n\n font-size: ","px;\n\n :after {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: ",";\n opacity: 0.1;\n }\n"],["\n position: relative;\n padding: ","px;\n margin-top: ","px;\n\n font-size: ","px;\n\n :after {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: ",";\n opacity: 0.1;\n }\n"])),spacingM,spacingS,fontSizeSmall,function(p){return p.theme.palette.red;});var TitleContainer=_styled.div.withConfig({displayName:"EventCancelInformation__TitleContainer",componentId:"sc-rh6578-1"})(templateObject_2$1n||(templateObject_2$1n=__makeTemplateObject(["\n display: flex;\n align-items: center;\n padding-bottom: ","px;\n\n color: ",";\n\n *:not(:first-child) {\n padding-left: ","px;\n }\n"],["\n display: flex;\n align-items: center;\n padding-bottom: ","px;\n\n color: ",";\n\n *:not(:first-child) {\n padding-left: ","px;\n }\n"])),spacingXs,function(p){return p.theme.palette.redDark;},spacingXs);var CancelIcon=_styled(Icon).withConfig({displayName:"EventCancelInformation__CancelIcon",componentId:"sc-rh6578-2"})(templateObject_3$W||(templateObject_3$W=__makeTemplateObject(["\n font-size: 20px;\n"],["\n font-size: 20px;\n"])));var Title$a=_styled(FormattedMessageWithStyle).withConfig({displayName:"EventCancelInformation__Title",componentId:"sc-rh6578-3"})(templateObject_4$E||(templateObject_4$E=__makeTemplateObject(["\n font-weight: bold;\n"],["\n font-weight: bold;\n"])));var templateObject_1$2a,templateObject_2$1n,templateObject_3$W,templateObject_4$E;var EventUserRegistrationContext=/*#__PURE__*/createContext(null);function getDeadlineInfos(item){var hasDeadline=item.registrationSettings.deadline!=null;var isPastDeadline=hasDeadline&&moment(item.registrationSettings.deadline).isBefore(moment());return {hasDeadline:hasDeadline,isPastDeadline:isPastDeadline};}var EventRegistrationButton=function EventRegistrationButton(_a){var isRegistered=_a.isRegistered,className=_a.className,disabled=_a.disabled,onClick=_a.onClick,showInfoMessage=_a.showInfoMessage,infoMessageResourceKey=_a.infoMessageResourceKey;var formatMessage=useIntl().formatMessage;return jsxs(Host$O,__assign({className:className,"aria-label":formatMessage({id:'Events.registration.sectionLabel'})},{children:[jsx$1(RegisterButton,{text:formatMessage({id:isRegistered?'Events.registration.deregisterButtonCaption':'Events.registration.registerButtonCaption'}),disabled:disabled,"data-event-register-button":!!isRegistered,onClick:function(e){e.preventDefault();onClick();},isRegistered:isRegistered},void 0),showInfoMessage&&jsxs(InfoMessage,__assign({"data-event-register-info":true},{children:[jsx$1(Icon,{iconName:"Info"},void 0),jsx$1(FormattedMessage$1,{id:infoMessageResourceKey},void 0)]}),void 0)]}),void 0);};var Host$O=_styled.div.withConfig({displayName:"EventRegistrationButton__Host",componentId:"sc-rvaf0t-0"})(templateObject_1$29||(templateObject_1$29=__makeTemplateObject(["\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n"],["\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n"])));var RegisterButton=_styled(PrimaryButton).withConfig({displayName:"EventRegistrationButton__RegisterButton",componentId:"sc-rvaf0t-1"})(templateObject_4$D||(templateObject_4$D=__makeTemplateObject(["\n && {\n min-width: 200px;\n border: 0;\n &:hover {\n border: 0;\n }\n ","\n ","\n }\n"],["\n && {\n min-width: 200px;\n border: 0;\n &:hover {\n border: 0;\n }\n ","\n ","\n }\n"])),function(p){return p.disabled&&css$2(templateObject_2$1m||(templateObject_2$1m=__makeTemplateObject(["\n background-color: ",";\n "],["\n background-color: ",";\n "])),p.theme.palette.neutralQuaternaryAlt);},function(p){return p.isRegistered&&css$2(templateObject_3$V||(templateObject_3$V=__makeTemplateObject(["\n &:not([disabled]) {\n background-color: ",";\n color: #fff;\n\n &:hover {\n background-color: ",";\n }\n }\n "],["\n &:not([disabled]) {\n background-color: ",";\n color: #fff;\n\n &:hover {\n background-color: ",";\n }\n }\n "])),p.theme.palette.red,p.theme.palette.redDark);});var InfoMessage=_styled.span.withConfig({displayName:"EventRegistrationButton__InfoMessage",componentId:"sc-rvaf0t-2"})(templateObject_5$x||(templateObject_5$x=__makeTemplateObject(["\n display: flex;\n align-items: center;\n font-style: italic;\n margin-top: ","px;\n font-size: ","px;\n\n i {\n padding-right: ","px;\n }\n"],["\n display: flex;\n align-items: center;\n font-style: italic;\n margin-top: ","px;\n font-size: ","px;\n\n i {\n padding-right: ","px;\n }\n"])),spacingXs,fontSizeSmall,spacingXs);var templateObject_1$29,templateObject_2$1m,templateObject_3$V,templateObject_4$D,templateObject_5$x;var $$3=_export;var DESCRIPTORS=descriptors;var global$2=global$m;var has=has$c;var isObject=isObject$c;var defineProperty=objectDefineProperty.f;var copyConstructorProperties=copyConstructorProperties$2;var NativeSymbol=global$2.Symbol;if(DESCRIPTORS&&typeof NativeSymbol=='function'&&(!('description'in NativeSymbol.prototype)||// Safari 12 bug
122226
122223
  NativeSymbol().description!==undefined)){var EmptyStringDescriptionStore={};// wrap Symbol constructor for correct work with undefined description
122227
122224
  var SymbolWrapper=function Symbol(){var description=arguments.length<1||arguments[0]===undefined?undefined:String(arguments[0]);var result=this instanceof SymbolWrapper?new NativeSymbol(description)// in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)'
122228
122225
  :description===undefined?NativeSymbol():NativeSymbol(description);if(description==='')EmptyStringDescriptionStore[result]=true;return result;};copyConstructorProperties(SymbolWrapper,NativeSymbol);var symbolPrototype=SymbolWrapper.prototype=NativeSymbol.prototype;symbolPrototype.constructor=SymbolWrapper;var symbolToString=symbolPrototype.toString;var native=String(NativeSymbol('test'))=='Symbol(test)';var regexp=/^Symbol\((.*)\)[^)]+$/;defineProperty(symbolPrototype,'description',{configurable:true,get:function description(){var symbol=isObject(this)?this.valueOf():this;var string=symbolToString.call(symbol);if(has(EmptyStringDescriptionStore,symbol))return '';var desc=native?string.slice(7,-1):string.replace(regexp,'$1');return desc===''?undefined:desc;}});$$3({global:true,forced:true},{Symbol:SymbolWrapper});}function getLocationQuestionId(item){return "location_id_"+item.id;}function getLocationPollDefinitions(item,formatMessage,result,isOnBehalfOf){if(!item.locations||item.locations.length<2){return {};}var locationQuestionId=getLocationQuestionId(item);return {translations:__spreadArray([{language:'en',id:locationQuestionId,text:formatMessage({id:!isOnBehalfOf?'Events.registration.locations.questionTitle':'Events.registration.locations.onBehalfOfQuestionTitle'})}],item.locations.map(function(l){return {language:'en',id:l.locationId,text:l.name};})),question:{questionId:locationQuestionId,isMultiChoice:false,choices:item.locations.map(function(l){return getLocationChoice(locationQuestionId,l,result,formatMessage,isOnBehalfOf);})}};}function getLocationChoice(locationQuestionId,location,result,formatMessage,isOnBehalfOf){var _a,_b,_c,_d,_e;var choice={choiceId:location.locationId};if(!location.maxNumberOfSeats){return choice;}var takenSeats=(_e=(_d=(_c=(_b=(_a=result===null||result===void 0?void 0:result.answers)===null||_a===void 0?void 0:_a.find(function(a){return a.questionId===locationQuestionId;}))===null||_b===void 0?void 0:_b.choices)===null||_c===void 0?void 0:_c.find(function(c){return c.choiceId===location.locationId;}))===null||_d===void 0?void 0:_d.count)!==null&&_e!==void 0?_e:0;var availableSeats=Math.max(location.maxNumberOfSeats-takenSeats,0);choice.description=formatMessage({id:'Events.registration.locations.leftSeats'},{total:location.maxNumberOfSeats,available:availableSeats,b:function(text){return jsx$1("strong",{children:text},void 0);}});if(availableSeats===0){choice.disabled=!isOnBehalfOf;}return choice;}var EventRegistrationLocationSeatsInfo=function EventRegistrationLocationSeatsInfo(_a){var hasAnySeatsLeft=_a.hasAnySeatsLeft,locations=_a.locations,className=_a.className;if(!(locations===null||locations===void 0?void 0:locations.length)){return null;}if(locations.length>1){if(hasAnySeatsLeft){// in this case we don't want to render anything, because it's already rendered by the poll anyway
122229
- return null;}return jsx$1(MessageContainer,__assign({domIdentifier:"multi-location-no-seats-left",className:className},{children:jsx$1(NoSeatsMessage,{id:"Events.registration.locations.noSeatsLeft"},void 0)}),void 0);}var location=locations[0];if(hasAnySeatsLeft){return jsx$1(MessageContainer,__assign({domIdentifier:"one-location-number-of-seats-left",className:className},{children:jsx$1(SeatsInfoMessage,{id:"Events.registration.locations.seatsLeftInLocation",values:{available:location.seatsLeft,b:function(text){return jsx$1("span",{children:text},void 0);}}},void 0)}),void 0);}return jsx$1(MessageContainer,__assign({domIdentifier:"one-location-no-seats-left",className:className},{children:jsx$1(NoSeatsMessage,{id:"Events.registration.locations.leftSeats",values:{total:location.maxNumberOfSeats,available:location.seatsLeft,b:function(text){return jsx$1("span",{children:text},void 0);}}},void 0)}),void 0);};var SeatsInfoMessage=_styled(FormattedMessageWithStyle)(templateObject_1$26||(templateObject_1$26=__makeTemplateObject(["\n font-size: ","px;\n\n span {\n font-weight: bold;\n }\n"],["\n font-size: ","px;\n\n span {\n font-weight: bold;\n }\n"])),fontSizeSmall);var NoSeatsMessage=_styled(FormattedMessageWithStyle)(templateObject_2$1j||(templateObject_2$1j=__makeTemplateObject(["\n color: ",";\n font-size: ","px;\n\n span {\n font-weight: bold;\n }\n"],["\n color: ",";\n font-size: ","px;\n\n span {\n font-weight: bold;\n }\n"])),function(p){return p.theme.palette.neutralSecondaryAlt;},fontSizeSmall);var MessageContainer=function MessageContainer(_a){var domIdentifier=_a.domIdentifier,className=_a.className,children=_a.children;return jsx$1("div",__assign({"data-seats-info":domIdentifier,className:className},{children:children}),void 0);};var templateObject_1$26,templateObject_2$1j;var EventRegistrationInfoDescription=_styled(FormattedMessageWithStyle).withConfig({displayName:"EventRegistrationInfoDescription",componentId:"sc-1shfbk2-0"})(templateObject_1$25||(templateObject_1$25=__makeTemplateObject(["\n font-size: ","px;\n\n time {\n font-weight: bold;\n }\n"],["\n font-size: ","px;\n\n time {\n font-weight: bold;\n }\n"])),fontSizeSmall);var templateObject_1$25;var EventRegistrationRegisterStatusInfo=function EventRegistrationRegisterStatusInfo(_a){var isRegistered=_a.isRegistered,onBehalfOfUpn=_a.onBehalfOfUpn,className=_a.className;if(!isRegistered){return null;}return jsx$1(EventRegistrationInfoDescription,{className:className,id:onBehalfOfUpn?'Events.registration.onBehalfOfIsRegistered':'Events.registration.userIsRegistered'},void 0);};var EventRegistrationDeadlineInfo=function EventRegistrationDeadlineInfo(_a){var item=_a.item,isRegistered=_a.isRegistered,className=_a.className;var _b=getDeadlineInfos(item),isPastDeadline=_b.isPastDeadline,hasDeadline=_b.hasDeadline;if(isRegistered||!hasDeadline){return null;}return jsx$1(EventRegistrationInfoDescription,{className:className,id:"Events.registration.deadline.title",values:{isPast:isPastDeadline,deadlineRelative:hasDeadline&&jsx$1(DateTime,{value:item.registrationSettings.deadline,showAsRelative:true},void 0)}},void 0);};var EventUserRegistrationFullSeriesDialog=function EventUserRegistrationFullSeriesDialog(_a){var item=_a.item,visible=_a.visible,isRegistered=_a.isRegistered,onClick=_a.onClick,onDismiss=_a.onDismiss;var formatMessage=useIntl().formatMessage;var recurrenceSettingsEndDate=item.recurrenceSettings.endDate;return jsxs(Dialog,__assign({hidden:!visible,modalProps:{isBlocking:false},dialogContentProps:{type:DialogType.normal,title:formatMessage({id:isRegistered?'Events.registration.recurringEvent.deregister':'Events.registration.recurringEvent.register'})},onDismiss:onDismiss},{children:[jsxs(DialogContent$1,__assign({"data-registration-full-series":true},{children:[recurrenceSettingsEndDate&&jsx$1(FormattedMessage$1,{id:"Events.registration.lastOccurrence",values:{date:moment(recurrenceSettingsEndDate).format('L')},tagName:"p"},void 0),jsx$1(FormattedMessage$1,{id:isRegistered?'Events.registration.fullSeriesDeregistered':'Events.registration.fullSeriesRegistered',tagName:"p"},void 0)]}),void 0),jsxs(DialogFooter,{children:[jsx$1(DefaultButton,__assign({onClick:onDismiss,"data-button":"cancel"},{children:jsx$1(FormattedMessage$1,{id:"Generic.Cancel"},void 0)}),void 0),jsx$1(PrimaryButton,__assign({onClick:function(){return onClick(!isRegistered);},"data-button":"save"},{children:jsx$1(FormattedMessage$1,{id:isRegistered?'Events.registration.deregisterButtonCaption':'Events.registration.registerButtonCaption'},void 0)}),void 0)]},void 0)]}),void 0);};var DialogContent$1=_styled.div.withConfig({displayName:"EventUserRegistrationFullSeriesDialog__DialogContent",componentId:"sc-8ec3oi-0"})(templateObject_1$24||(templateObject_1$24=__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n\n > p {\n margin-top: 0;\n }\n"],["\n display: flex;\n flex-direction: column;\n\n > p {\n margin-top: 0;\n }\n"])));var templateObject_1$24;var feedbackCache={};function useFeedbackApi(){var api=useApi();return useMemo(function(){return {getFeedback:getFeedback,setFeedback:setFeedback,unsetFeedback:unsetFeedback,updatePollAnswers:updatePollAnswers,getPollResult:getPollResult,getLikers:getLikers};function getFeedback(type,itemId,onBehalfOfUpn){var cacheKey=itemId+(onBehalfOfUpn||'');if(feedbackCache[cacheKey]!=null){return feedbackCache[cacheKey];}return feedbackCache[cacheKey]=api.custom(type+"/"+itemId+"/feedback?"+queryString.stringify({onBehalfOfUpn:onBehalfOfUpn})).get().then(function(result){return result.body().data();});}function setFeedback(type,itemId,feedbackType){delete feedbackCache[itemId];return api.custom(type+"/"+itemId+"/feedback/"+feedbackType).put({}).then(function(){return null;});}function unsetFeedback(type,itemId,feedbackType){delete feedbackCache[itemId];return api.custom(type+"/"+itemId+"/feedback/"+feedbackType).delete().then(function(){return null;});}function updatePollAnswers(type,itemId,answers){delete feedbackCache[itemId];return api.custom(type+"/"+itemId+"/feedback/poll/answers").put(answers).then(function(){return null;});}function getPollResult(type,itemId){return api.custom(type+"/"+itemId+"/feedback/poll/result").get().then(function(result){return result.body().data();});}function getLikers(type,itemId,filter){return api.custom(type+"/"+itemId+"/feedback/likes").get(filter).then(function(result){return result.body().data();});}},[api]);}function useEventRegistrationApi(){var api=useApi();return useMemo(function(){return {setEventRegistration:setEventRegistration,getEventRegistrationResults:getEventRegistrationResults,getParticipants:getParticipants};function setEventRegistration(itemId,response,pollAnswers,locationId,onBehalfOfUpn){var cacheKey=itemId+(onBehalfOfUpn||'');delete feedbackCache[cacheKey];return api.custom("events/"+itemId+"/feedback/registration").put({response:response,pollAnswers:pollAnswers,locationId:locationId,onBehalfOfUpn:onBehalfOfUpn}).then(function(){return null;});}function getEventRegistrationResults(itemId){return api.custom("events/"+itemId+"/feedback/registration/result").get().then(function(result){return result.body().data();});}function getParticipants(eventId){return api.custom("events/"+eventId+"/feedback/registration/participants").get().then(function(result){return result.body().data();}).then(function(r){return r.participants;});}},[api]);}var EventUserRegistration=function EventUserRegistration(_a){var _b,_c;var disabled=_a.disabled,hideInfoMessage=_a.hideInfoMessage,className=_a.className;var history=useHistory();var user=useCurrentUserContext().user;var refreshUserDetails=useRefreshUserDetails();var _d=useState$2(false),isSaving=_d[0],setIsSaving=_d[1];var _e=useState$2(false),showRegisterFullSeriesDialog=_e[0],setShowRegisterFullSeriesDialog=_e[1];var toastHandleRef=useRef$1(null);var buildPath=useSubscriptionHandlePathBuilder().buildPath;var followPublicPublishableItemComments=useManageCurrentUserApi().followPublicPublishableItemComments;var setEventRegistration=useEventRegistrationApi().setEventRegistration;var _f=useContext(EventUserRegistrationContext),hasPollContext=_f.hasPollContext,submitPoll=_f.submitPoll,answers=_f.answers,hasMissingAnswers=_f.hasMissingAnswers,reset=_f.reset,isLoading=_f.isLoading,onBehalfOfUpn=_f.onBehalfOfUpn,item=_f.item,eventResponse=_f.eventResponse,setEventResponse=_f.setEventResponse,seatsInfo=_f.seatsInfo;var _g=useNotificationContext(),dismissToast=_g.dismissToast,showToast=_g.showToast,showError=_g.showError;useListener(RegisterFullSeriesTriggerAction.type,function(action){if(action.recurrenceSeriesId===item.recurrenceSeriesId){setEventResponse(action.response);}return false;},[]);if(isLoading||!item.registrationSettings||!item.registrationSettings.enabled||((_b=item.cancelInformation)===null||_b===void 0?void 0:_b.isCancelled)){return null;}var isRegistered=eventResponse===EventResponse.Registered;var isFullSeriesRegistrationModeEnabled=((_c=item.registrationSettings)===null||_c===void 0?void 0:_c.seriesMode)===SeriesRegistrationMode.FullSeries;var hasPoll=item.poll&&item.poll.questions&&item.poll.questions.length>0||item.locations&&item.locations.length>1;var showInfoMessage=!hideInfoMessage&&isFullSeriesRegistrationModeEnabled&&hasPollContext;return jsxs("div",__assign({className:className},{children:[jsx$1(DeadlineInfo,{item:item,isRegistered:isRegistered},void 0),jsx$1(SeatsInfo,{hasAnySeatsLeft:seatsInfo.hasAnySeatsLeft,locations:seatsInfo.locations},void 0),jsx$1(StatusInfo,{isRegistered:isRegistered,onBehalfOfUpn:onBehalfOfUpn},void 0),jsx$1(EventRegistrationButton,{isRegistered:isRegistered,disabled:isButtonDisabled(),onClick:function(){return handleClick(!isRegistered);},showInfoMessage:showInfoMessage,infoMessageResourceKey:isRegistered?'Events.registration.fullSeriesDeregistered':'Events.registration.fullSeriesRegistered'},void 0),showRegisterFullSeriesDialog&&jsx$1(EventUserRegistrationFullSeriesDialog,{item:item,visible:showRegisterFullSeriesDialog,onClick:handleRegisterFullSeriesClick,onDismiss:function(){return setShowRegisterFullSeriesDialog(false);},isRegistered:isRegistered},void 0)]}),void 0);function isButtonDisabled(){if(disabled||isLoading||isSaving){return true;}var isPastDeadline=getDeadlineInfos(item).isPastDeadline;if(isRegistered){return !onBehalfOfUpn&&isPastDeadline;}if(hasMissingAnswers){return true;}if(onBehalfOfUpn){return false;}return !seatsInfo.hasAnySeatsLeft||isPastDeadline;}function handleClick(doRegister){return __awaiter(this,void 0,void 0,function(){var language,contents,targetRoute;return __generator(this,function(_a){switch(_a.label){case 0:if(!doRegister){if(isFullSeriesRegistrationModeEnabled&&!hasPollContext){setShowRegisterFullSeriesDialog(true);return [2/*return*/];}deregister();return [2/*return*/];}if(isFullSeriesRegistrationModeEnabled&&!hasPoll&&!hasPollContext){setShowRegisterFullSeriesDialog(true);return [2/*return*/];}if(hasPoll&&!hasPollContext){language=NewsService.getLanguageForPublishableItem(item,user);contents=item.contents[language];targetRoute=NewsService.getNewsRoute('events',item.id,contents.title);history.push(buildPath(targetRoute));return [2/*return*/];}return [4/*yield*/,register()];case 1:_a.sent();return [2/*return*/];}});});}function handleRegisterFullSeriesClick(doRegister){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_b){switch(_b.label){case 0:setShowRegisterFullSeriesDialog(false);if(!doRegister)return [3/*break*/,2];return [4/*yield*/,register()];case 1:_b.sent();return [3/*break*/,4];case 2:return [4/*yield*/,deregister()];case 3:_b.sent();_b.label=4;case 4:triggerEvent(RegisterFullSeriesTriggerAction.create(item.recurrenceSeriesId,doRegister?EventResponse.Registered:EventResponse.NotSet));return [2/*return*/];}});});}function register(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,submitPoll(function(){return toggleRegistration(true,answers,onBehalfOfUpn);})];case 1:_a.sent();return [2/*return*/];}});});}function deregister(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,toggleRegistration(false,null,onBehalfOfUpn)];case 1:_a.sent();return [4/*yield*/,reset()];case 2:_a.sent();return [2/*return*/];}});});}function toggleRegistration(doRegister,answersToSet,onBehalfOfUpn){return __awaiter(this,void 0,void 0,function(){var newResponse,locationQuestionId_1,locationId,registerOnBehalfOfUserStringResource,error_1;return __generator(this,function(_a){switch(_a.label){case 0:if(isSaving){return [2/*return*/];}setIsSaving(true);_a.label=1;case 1:_a.trys.push([1,3,4,5]);newResponse=doRegister?EventResponse.Registered:EventResponse.NotSet;setEventResponse(newResponse);if(!answersToSet){answersToSet=[];}locationQuestionId_1=getLocationQuestionId(item);locationId=answersToSet.filter(function(a){return a.questionId===locationQuestionId_1;}).map(function(a){return a.choiceIds[0];})[0];answersToSet=answersToSet.filter(function(a){return a.questionId!==locationQuestionId_1;});return [4/*yield*/,setEventRegistration(item.id,newResponse,answersToSet,locationId,onBehalfOfUpn)];case 2:_a.sent();refreshUserDetails();triggerEvent(EventResponseTriggerAction.create(item.id,newResponse,locationId,onBehalfOfUpn));if(doRegister&&!onBehalfOfUpn){followPublicPublishableItemComments(item.id,ItemResourceTypes.Events);triggerEvent(FollowCommentsTriggerAction.create(item.id,true));}dismissToast(toastHandleRef.current);registerOnBehalfOfUserStringResource=isHiddenMail(onBehalfOfUpn)?'Events.registration.onBehalfOfRegistrationSuccess.hiddenMail':'Events.registration.onBehalfOfRegistrationSuccess';toastHandleRef.current=showToast(doRegister?onBehalfOfUpn?registerOnBehalfOfUserStringResource:'Events.registration.registrationSuccess':onBehalfOfUpn?'Events.registration.onBehalfOfDeregistrationSuccess':'Events.registration.deregistrationSuccess',{mail:onBehalfOfUpn});return [3/*break*/,5];case 3:error_1=_a.sent();logger.error(error_1);showError('Generic.error');setEventResponse(eventResponse);return [3/*break*/,5];case 4:setIsSaving(false);return [7/*endfinally*/];case 5:return [2/*return*/];}});});}};var DeadlineInfo=_styled(EventRegistrationDeadlineInfo).withConfig({displayName:"EventUserRegistration__DeadlineInfo",componentId:"sc-1mvozes-0"})(templateObject_1$23||(templateObject_1$23=__makeTemplateObject(["\n margin-bottom: ","px;\n"],["\n margin-bottom: ","px;\n"])),spacingS);var SeatsInfo=_styled(EventRegistrationLocationSeatsInfo).withConfig({displayName:"EventUserRegistration__SeatsInfo",componentId:"sc-1mvozes-1"})(templateObject_2$1i||(templateObject_2$1i=__makeTemplateObject(["\n margin-bottom: ","px;\n"],["\n margin-bottom: ","px;\n"])),spacingS);var StatusInfo=_styled(EventRegistrationRegisterStatusInfo).withConfig({displayName:"EventUserRegistration__StatusInfo",componentId:"sc-1mvozes-2"})(templateObject_3$S||(templateObject_3$S=__makeTemplateObject(["\n margin-bottom: ","px;\n"],["\n margin-bottom: ","px;\n"])),spacingS);var templateObject_1$23,templateObject_2$1i,templateObject_3$S;var EventCardUserRegistration=function EventCardUserRegistration(_a){var item=_a.item,disabled=_a.disabled,className=_a.className;var _b=useState$2(item.userResponse),eventResponse=_b[0],setEventResponse=_b[1];var isRegistered=eventResponse===EventResponse.Registered;// eslint-disable-next-line react-hooks/exhaustive-deps
122226
+ return null;}return jsx$1(MessageContainer,__assign({domIdentifier:"multi-location-no-seats-left",className:className},{children:jsx$1(NoSeatsMessage,{id:"Events.registration.locations.noSeatsLeft"},void 0)}),void 0);}var location=locations[0];if(hasAnySeatsLeft){return jsx$1(MessageContainer,__assign({domIdentifier:"one-location-number-of-seats-left",className:className},{children:jsx$1(SeatsInfoMessage,{id:"Events.registration.locations.seatsLeftInLocation",values:{available:location.seatsLeft,b:function(text){return jsx$1("span",{children:text},void 0);}}},void 0)}),void 0);}return jsx$1(MessageContainer,__assign({domIdentifier:"one-location-no-seats-left",className:className},{children:jsx$1(NoSeatsMessage,{id:"Events.registration.locations.leftSeats",values:{total:location.maxNumberOfSeats,available:location.seatsLeft,b:function(text){return jsx$1("span",{children:text},void 0);}}},void 0)}),void 0);};var SeatsInfoMessage=_styled(FormattedMessageWithStyle)(templateObject_1$28||(templateObject_1$28=__makeTemplateObject(["\n font-size: ","px;\n\n span {\n font-weight: bold;\n }\n"],["\n font-size: ","px;\n\n span {\n font-weight: bold;\n }\n"])),fontSizeSmall);var NoSeatsMessage=_styled(FormattedMessageWithStyle)(templateObject_2$1l||(templateObject_2$1l=__makeTemplateObject(["\n color: ",";\n font-size: ","px;\n\n span {\n font-weight: bold;\n }\n"],["\n color: ",";\n font-size: ","px;\n\n span {\n font-weight: bold;\n }\n"])),function(p){return p.theme.palette.neutralSecondaryAlt;},fontSizeSmall);var MessageContainer=function MessageContainer(_a){var domIdentifier=_a.domIdentifier,className=_a.className,children=_a.children;return jsx$1("div",__assign({"data-seats-info":domIdentifier,className:className},{children:children}),void 0);};var templateObject_1$28,templateObject_2$1l;var EventRegistrationInfoDescription=_styled(FormattedMessageWithStyle).withConfig({displayName:"EventRegistrationInfoDescription",componentId:"sc-1shfbk2-0"})(templateObject_1$27||(templateObject_1$27=__makeTemplateObject(["\n font-size: ","px;\n\n time {\n font-weight: bold;\n }\n"],["\n font-size: ","px;\n\n time {\n font-weight: bold;\n }\n"])),fontSizeSmall);var templateObject_1$27;var EventRegistrationRegisterStatusInfo=function EventRegistrationRegisterStatusInfo(_a){var isRegistered=_a.isRegistered,onBehalfOfUpn=_a.onBehalfOfUpn,className=_a.className;if(!isRegistered){return null;}return jsx$1(EventRegistrationInfoDescription,{className:className,id:onBehalfOfUpn?'Events.registration.onBehalfOfIsRegistered':'Events.registration.userIsRegistered'},void 0);};var EventRegistrationDeadlineInfo=function EventRegistrationDeadlineInfo(_a){var item=_a.item,isRegistered=_a.isRegistered,className=_a.className;var _b=getDeadlineInfos(item),isPastDeadline=_b.isPastDeadline,hasDeadline=_b.hasDeadline;if(isRegistered||!hasDeadline){return null;}return jsx$1(EventRegistrationInfoDescription,{className:className,id:"Events.registration.deadline.title",values:{isPast:isPastDeadline,deadlineRelative:hasDeadline&&jsx$1(DateTime,{value:item.registrationSettings.deadline,showAsRelative:true},void 0)}},void 0);};var EventUserRegistrationFullSeriesDialog=function EventUserRegistrationFullSeriesDialog(_a){var item=_a.item,visible=_a.visible,isRegistered=_a.isRegistered,onClick=_a.onClick,onDismiss=_a.onDismiss;var formatMessage=useIntl().formatMessage;var recurrenceSettingsEndDate=item.recurrenceSettings.endDate;return jsxs(Dialog,__assign({hidden:!visible,modalProps:{isBlocking:false},dialogContentProps:{type:DialogType.normal,title:formatMessage({id:isRegistered?'Events.registration.recurringEvent.deregister':'Events.registration.recurringEvent.register'})},onDismiss:onDismiss},{children:[jsxs(DialogContent$1,__assign({"data-registration-full-series":true},{children:[recurrenceSettingsEndDate&&jsx$1(FormattedMessage$1,{id:"Events.registration.lastOccurrence",values:{date:moment(recurrenceSettingsEndDate).format('L')},tagName:"p"},void 0),jsx$1(FormattedMessage$1,{id:isRegistered?'Events.registration.fullSeriesDeregistered':'Events.registration.fullSeriesRegistered',tagName:"p"},void 0)]}),void 0),jsxs(DialogFooter,{children:[jsx$1(DefaultButton,__assign({onClick:onDismiss,"data-button":"cancel"},{children:jsx$1(FormattedMessage$1,{id:"Generic.Cancel"},void 0)}),void 0),jsx$1(PrimaryButton,__assign({onClick:function(){return onClick(!isRegistered);},"data-button":"save"},{children:jsx$1(FormattedMessage$1,{id:isRegistered?'Events.registration.deregisterButtonCaption':'Events.registration.registerButtonCaption'},void 0)}),void 0)]},void 0)]}),void 0);};var DialogContent$1=_styled.div.withConfig({displayName:"EventUserRegistrationFullSeriesDialog__DialogContent",componentId:"sc-8ec3oi-0"})(templateObject_1$26||(templateObject_1$26=__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n\n > p {\n margin-top: 0;\n }\n"],["\n display: flex;\n flex-direction: column;\n\n > p {\n margin-top: 0;\n }\n"])));var templateObject_1$26;var feedbackCache={};function useFeedbackApi(){var api=useApi();return useMemo(function(){return {getFeedback:getFeedback,setFeedback:setFeedback,unsetFeedback:unsetFeedback,updatePollAnswers:updatePollAnswers,getPollResult:getPollResult,getLikers:getLikers};function getFeedback(type,itemId,onBehalfOfUpn){var cacheKey=itemId+(onBehalfOfUpn||'');if(feedbackCache[cacheKey]!=null){return feedbackCache[cacheKey];}return feedbackCache[cacheKey]=api.custom(type+"/"+itemId+"/feedback?"+queryString.stringify({onBehalfOfUpn:onBehalfOfUpn})).get().then(function(result){return result.body().data();});}function setFeedback(type,itemId,feedbackType){delete feedbackCache[itemId];return api.custom(type+"/"+itemId+"/feedback/"+feedbackType).put({}).then(function(){return null;});}function unsetFeedback(type,itemId,feedbackType){delete feedbackCache[itemId];return api.custom(type+"/"+itemId+"/feedback/"+feedbackType).delete().then(function(){return null;});}function updatePollAnswers(type,itemId,answers){delete feedbackCache[itemId];return api.custom(type+"/"+itemId+"/feedback/poll/answers").put(answers).then(function(){return null;});}function getPollResult(type,itemId){return api.custom(type+"/"+itemId+"/feedback/poll/result").get().then(function(result){return result.body().data();});}function getLikers(type,itemId,filter){return api.custom(type+"/"+itemId+"/feedback/likes").get(filter).then(function(result){return result.body().data();});}},[api]);}function useEventRegistrationApi(){var api=useApi();return useMemo(function(){return {setEventRegistration:setEventRegistration,getEventRegistrationResults:getEventRegistrationResults,getParticipants:getParticipants};function setEventRegistration(itemId,response,pollAnswers,locationId,onBehalfOfUpn){var cacheKey=itemId+(onBehalfOfUpn||'');delete feedbackCache[cacheKey];return api.custom("events/"+itemId+"/feedback/registration").put({response:response,pollAnswers:pollAnswers,locationId:locationId,onBehalfOfUpn:onBehalfOfUpn}).then(function(){return null;});}function getEventRegistrationResults(itemId){return api.custom("events/"+itemId+"/feedback/registration/result").get().then(function(result){return result.body().data();});}function getParticipants(eventId){return api.custom("events/"+eventId+"/feedback/registration/participants").get().then(function(result){return result.body().data();}).then(function(r){return r.participants;});}},[api]);}var EventUserRegistration=function EventUserRegistration(_a){var _b,_c;var disabled=_a.disabled,hideInfoMessage=_a.hideInfoMessage,className=_a.className;var history=useHistory();var user=useCurrentUserContext().user;var refreshUserDetails=useRefreshUserDetails();var _d=useState$2(false),isSaving=_d[0],setIsSaving=_d[1];var _e=useState$2(false),showRegisterFullSeriesDialog=_e[0],setShowRegisterFullSeriesDialog=_e[1];var toastHandleRef=useRef$1(null);var buildPath=useSubscriptionHandlePathBuilder().buildPath;var followPublicPublishableItemComments=useManageCurrentUserApi().followPublicPublishableItemComments;var setEventRegistration=useEventRegistrationApi().setEventRegistration;var _f=useContext(EventUserRegistrationContext),hasPollContext=_f.hasPollContext,submitPoll=_f.submitPoll,answers=_f.answers,hasMissingAnswers=_f.hasMissingAnswers,reset=_f.reset,isLoading=_f.isLoading,onBehalfOfUpn=_f.onBehalfOfUpn,item=_f.item,eventResponse=_f.eventResponse,setEventResponse=_f.setEventResponse,seatsInfo=_f.seatsInfo;var _g=useNotificationContext(),dismissToast=_g.dismissToast,showToast=_g.showToast,showError=_g.showError;useListener(RegisterFullSeriesTriggerAction.type,function(action){if(action.recurrenceSeriesId===item.recurrenceSeriesId){setEventResponse(action.response);}return false;},[]);if(isLoading||!item.registrationSettings||!item.registrationSettings.enabled||((_b=item.cancelInformation)===null||_b===void 0?void 0:_b.isCancelled)){return null;}var isRegistered=eventResponse===EventResponse.Registered;var isFullSeriesRegistrationModeEnabled=((_c=item.registrationSettings)===null||_c===void 0?void 0:_c.seriesMode)===SeriesRegistrationMode.FullSeries;var hasPoll=item.poll&&item.poll.questions&&item.poll.questions.length>0||item.locations&&item.locations.length>1;var showInfoMessage=!hideInfoMessage&&isFullSeriesRegistrationModeEnabled&&hasPollContext;return jsxs("div",__assign({className:className},{children:[jsx$1(DeadlineInfo,{item:item,isRegistered:isRegistered},void 0),jsx$1(SeatsInfo,{hasAnySeatsLeft:seatsInfo.hasAnySeatsLeft,locations:seatsInfo.locations},void 0),jsx$1(StatusInfo,{isRegistered:isRegistered,onBehalfOfUpn:onBehalfOfUpn},void 0),jsx$1(EventRegistrationButton,{isRegistered:isRegistered,disabled:isButtonDisabled(),onClick:function(){return handleClick(!isRegistered);},showInfoMessage:showInfoMessage,infoMessageResourceKey:isRegistered?'Events.registration.fullSeriesDeregistered':'Events.registration.fullSeriesRegistered'},void 0),showRegisterFullSeriesDialog&&jsx$1(EventUserRegistrationFullSeriesDialog,{item:item,visible:showRegisterFullSeriesDialog,onClick:handleRegisterFullSeriesClick,onDismiss:function(){return setShowRegisterFullSeriesDialog(false);},isRegistered:isRegistered},void 0)]}),void 0);function isButtonDisabled(){if(disabled||isLoading||isSaving){return true;}var isPastDeadline=getDeadlineInfos(item).isPastDeadline;if(isRegistered){return !onBehalfOfUpn&&isPastDeadline;}if(hasMissingAnswers){return true;}if(onBehalfOfUpn){return false;}return !seatsInfo.hasAnySeatsLeft||isPastDeadline;}function handleClick(doRegister){return __awaiter(this,void 0,void 0,function(){var language,contents,targetRoute;return __generator(this,function(_a){switch(_a.label){case 0:if(!doRegister){if(isFullSeriesRegistrationModeEnabled&&!hasPollContext){setShowRegisterFullSeriesDialog(true);return [2/*return*/];}deregister();return [2/*return*/];}if(isFullSeriesRegistrationModeEnabled&&!hasPoll&&!hasPollContext){setShowRegisterFullSeriesDialog(true);return [2/*return*/];}if(hasPoll&&!hasPollContext){language=NewsService.getLanguageForPublishableItem(item,user);contents=item.contents[language];targetRoute=NewsService.getNewsRoute('events',item.id,contents.title);history.push(buildPath(targetRoute));return [2/*return*/];}return [4/*yield*/,register()];case 1:_a.sent();return [2/*return*/];}});});}function handleRegisterFullSeriesClick(doRegister){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_b){switch(_b.label){case 0:setShowRegisterFullSeriesDialog(false);if(!doRegister)return [3/*break*/,2];return [4/*yield*/,register()];case 1:_b.sent();return [3/*break*/,4];case 2:return [4/*yield*/,deregister()];case 3:_b.sent();_b.label=4;case 4:triggerEvent(RegisterFullSeriesTriggerAction.create(item.recurrenceSeriesId,doRegister?EventResponse.Registered:EventResponse.NotSet));return [2/*return*/];}});});}function register(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,submitPoll(function(){return toggleRegistration(true,answers,onBehalfOfUpn);})];case 1:_a.sent();return [2/*return*/];}});});}function deregister(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,toggleRegistration(false,null,onBehalfOfUpn)];case 1:_a.sent();return [4/*yield*/,reset()];case 2:_a.sent();return [2/*return*/];}});});}function toggleRegistration(doRegister,answersToSet,onBehalfOfUpn){return __awaiter(this,void 0,void 0,function(){var newResponse,locationQuestionId_1,locationId,registerOnBehalfOfUserStringResource,error_1;return __generator(this,function(_a){switch(_a.label){case 0:if(isSaving){return [2/*return*/];}setIsSaving(true);_a.label=1;case 1:_a.trys.push([1,3,4,5]);newResponse=doRegister?EventResponse.Registered:EventResponse.NotSet;setEventResponse(newResponse);if(!answersToSet){answersToSet=[];}locationQuestionId_1=getLocationQuestionId(item);locationId=answersToSet.filter(function(a){return a.questionId===locationQuestionId_1;}).map(function(a){return a.choiceIds[0];})[0];answersToSet=answersToSet.filter(function(a){return a.questionId!==locationQuestionId_1;});return [4/*yield*/,setEventRegistration(item.id,newResponse,answersToSet,locationId,onBehalfOfUpn)];case 2:_a.sent();refreshUserDetails();triggerEvent(EventResponseTriggerAction.create(item.id,newResponse,locationId,onBehalfOfUpn));if(doRegister&&!onBehalfOfUpn){followPublicPublishableItemComments(item.id,ItemResourceTypes.Events);triggerEvent(FollowCommentsTriggerAction.create(item.id,true));}dismissToast(toastHandleRef.current);registerOnBehalfOfUserStringResource=isHiddenMail(onBehalfOfUpn)?'Events.registration.onBehalfOfRegistrationSuccess.hiddenMail':'Events.registration.onBehalfOfRegistrationSuccess';toastHandleRef.current=showToast(doRegister?onBehalfOfUpn?registerOnBehalfOfUserStringResource:'Events.registration.registrationSuccess':onBehalfOfUpn?'Events.registration.onBehalfOfDeregistrationSuccess':'Events.registration.deregistrationSuccess',{mail:onBehalfOfUpn});return [3/*break*/,5];case 3:error_1=_a.sent();logger.error(error_1);showError('Generic.error');setEventResponse(eventResponse);return [3/*break*/,5];case 4:setIsSaving(false);return [7/*endfinally*/];case 5:return [2/*return*/];}});});}};var DeadlineInfo=_styled(EventRegistrationDeadlineInfo).withConfig({displayName:"EventUserRegistration__DeadlineInfo",componentId:"sc-1mvozes-0"})(templateObject_1$25||(templateObject_1$25=__makeTemplateObject(["\n margin-bottom: ","px;\n"],["\n margin-bottom: ","px;\n"])),spacingS);var SeatsInfo=_styled(EventRegistrationLocationSeatsInfo).withConfig({displayName:"EventUserRegistration__SeatsInfo",componentId:"sc-1mvozes-1"})(templateObject_2$1k||(templateObject_2$1k=__makeTemplateObject(["\n margin-bottom: ","px;\n"],["\n margin-bottom: ","px;\n"])),spacingS);var StatusInfo=_styled(EventRegistrationRegisterStatusInfo).withConfig({displayName:"EventUserRegistration__StatusInfo",componentId:"sc-1mvozes-2"})(templateObject_3$U||(templateObject_3$U=__makeTemplateObject(["\n margin-bottom: ","px;\n"],["\n margin-bottom: ","px;\n"])),spacingS);var templateObject_1$25,templateObject_2$1k,templateObject_3$U;var EventCardUserRegistration=function EventCardUserRegistration(_a){var item=_a.item,disabled=_a.disabled,className=_a.className;var _b=useState$2(item.userResponse),eventResponse=_b[0],setEventResponse=_b[1];var isRegistered=eventResponse===EventResponse.Registered;// eslint-disable-next-line react-hooks/exhaustive-deps
122230
122227
  var seatsInfo=useMemo(getSeatsInfo,[isRegistered,item.id]);return jsx$1(EventUserRegistrationContext.Provider,__assign({value:{hasPollContext:false,item:item,submitPoll:function(savePollAnswers){return savePollAnswers();},reset:function(){return Promise.resolve();},answers:null,hasMissingAnswers:false,onBehalfOfUpn:null,isLoading:false,eventResponse:eventResponse,setEventResponse:setEventResponse,seatsInfo:seatsInfo}},{children:jsx$1(EventUserRegistration,{disabled:disabled,className:className},void 0)}),void 0);function getSeatsInfo(){var _a;if(!item.registrationSettings||!item.registrationSettings.enabled||((_a=item.cancelInformation)===null||_a===void 0?void 0:_a.isCancelled)||isRegistered){return {hasAnySeatsLeft:true};}var locationsWithSeats=item.locations.filter(function(l){return l.maxNumberOfSeats>0;});var hasLocationsWithoutSeats=locationsWithSeats.length!==item.locations.length;if(!locationsWithSeats.length||hasLocationsWithoutSeats){return {hasAnySeatsLeft:true};}var participantsCount=getTotalParticipants();if(locationsWithSeats.length===1){var location_1=locationsWithSeats[0];var seatsLeft=Math.max(location_1.maxNumberOfSeats-participantsCount,0);return {hasAnySeatsLeft:seatsLeft>0,locations:[__assign(__assign({},location_1),{seatsLeft:seatsLeft})]};}// in this case we don't really know if we have any left seats or not
122231
122228
  // since to get this information we need to load all results of all items
122232
122229
  // we don't want to do this, so we just return "true"
@@ -122234,7 +122231,7 @@ var seatsInfo=useMemo(getSeatsInfo,[isRegistered,item.id]);return jsx$1(EventUse
122234
122231
  return {hasAnySeatsLeft:true,locations:undefined};}function getTotalParticipants(){if(item.userResponse!==eventResponse){return (item.statistics.participantsCount||0)+(eventResponse===EventResponse.Registered?1:-1);}return item.statistics.participantsCount||0;}};var pageSize=50;var defaultShimmerCount=7;var LikersList=function LikersList(_a){var itemId=_a.itemId,itemType=_a.itemType,likersCount=_a.likersCount,className=_a.className;var getLikers=useFeedbackApi().getLikers;var initialPageSize=Math.min(likersCount,pageSize);var _b=usePromise$2(loadLikers,null,[itemId]),likersInfo=_b[0],isLoading=_b[1],loadNextPage=_b[5];var isInitialLoading=!(likersInfo===null||likersInfo===void 0?void 0:likersInfo.likers)&&isLoading;var isLoadingNextPage=(likersInfo===null||likersInfo===void 0?void 0:likersInfo.likers)&&isLoading;var scrollContainer=useRef$1(null);return jsxs(Fragment,{children:[jsx$1(LikersListShimmer,__assign({count:Math.min(likersCount,defaultShimmerCount),isLoading:isInitialLoading&&likersCount>0},{children:jsxs(List$1,__assign({className:className,"data-likers-list":true,ref:scrollContainer,onScroll:handleScroll},{children:[likersInfo===null||likersInfo===void 0?void 0:likersInfo.likers.map(function(i){return jsx$1("li",{children:jsx$1(PersonaCard,__assign({upn:i.userPrincipalName},{children:jsx$1(StyledAvatar$2,{"data-liker":i.userPrincipalName,upn:i.userPrincipalName,text:i.displayName},void 0)}),void 0)},i.id);}),isLoadingNextPage&&jsx$1(StyledSpinner$3,{},void 0),likersInfo&&!likersInfo.token&&likersInfo.likers.length>defaultShimmerCount&&jsx$1(UsersLoadedIndicator,{children:jsx$1(FormattedMessage$1,{id:"Generic.finishedLoadingLikers"},void 0)},void 0)]}),void 0)}),void 0),(likersInfo===null||likersInfo===void 0?void 0:likersInfo.likers)&&!likersInfo.likers.length&&jsx$1(FormattedMessage$1,{id:"Generic.nobodyLikesThis"},void 0)]},void 0);function loadLikers(likersInfo){if(likersInfo===void 0){likersInfo={likers:[],token:null};}return __awaiter(this,void 0,void 0,function(){var result;return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,getLikers(itemType,itemId,{pageSize:!likersInfo.token?initialPageSize:pageSize,token:likersInfo.token})];case 1:result=_a.sent();return [2/*return*/,{likers:likersInfo.likers.concat(result.items),token:result.paginationToken}];}});});}function handleScroll(){return __awaiter(this,void 0,void 0,function(){var container,err_1;return __generator(this,function(_a){switch(_a.label){case 0:container=scrollContainer.current;if(!container){return [2/*return*/];}// check if we reached the end of the pagination
122235
122232
  // or we are already loading the next page
122236
122233
  if(likersInfo.token==null||isLoading){return [2/*return*/];}// check if user scrolled enough
122237
- if(container.scrollHeight-container.scrollTop>container.clientHeight+300){return [2/*return*/];}_a.label=1;case 1:_a.trys.push([1,3,,4]);return [4/*yield*/,loadNextPage(likersInfo)];case 2:_a.sent();return [3/*break*/,4];case 3:err_1=_a.sent();logger.error(err_1);return [3/*break*/,4];case 4:return [2/*return*/];}});});}};var StyledAvatar$2=_styled(Avatar).withConfig({displayName:"LikersList__StyledAvatar",componentId:"sc-a990fb-0"})(templateObject_1$22||(templateObject_1$22=__makeTemplateObject(["\n .ms-Persona-primaryText {\n white-space: initial;\n }\n"],["\n .ms-Persona-primaryText {\n white-space: initial;\n }\n"])));var List$1=_styled.ul.withConfig({displayName:"LikersList__List",componentId:"sc-a990fb-1"})(templateObject_2$1h||(templateObject_2$1h=__makeTemplateObject(["\n list-style: none;\n margin: 0;\n padding: 4px;\n\n max-height: ","px;\n overflow-y: auto;\n\n display: flex;\n flex-direction: column;\n\n li {\n display: flex;\n flex: 1 1 auto;\n margin-top: ","px;\n }\n"],["\n list-style: none;\n margin: 0;\n padding: 4px;\n\n max-height: ","px;\n overflow-y: auto;\n\n display: flex;\n flex-direction: column;\n\n li {\n display: flex;\n flex: 1 1 auto;\n margin-top: ","px;\n }\n"])),defaultShimmerCount*58,spacingS);var StyledSpinner$3=_styled(Spinner).withConfig({displayName:"LikersList__StyledSpinner",componentId:"sc-a990fb-2"})(templateObject_3$R||(templateObject_3$R=__makeTemplateObject(["\n margin: ","px 0;\n\n & > .ms-Spinner {\n height: 38px;\n }\n"],["\n margin: ","px 0;\n\n & > .ms-Spinner {\n height: 38px;\n }\n"])),spacingS);var LikersListShimmer=function LikersListShimmer(_a){var count=_a.count,isLoading=_a.isLoading,children=_a.children;return jsx$1(Shimmer,__assign({isDataLoaded:!isLoading,customElementsGroup:Array.from(Array(count)).map(function(_,i){return jsx$1(UserShimmer$1,{},i);})},{children:children}),void 0);};var UserShimmer$1=function UserShimmer(){return jsxs(Fragment,{children:[jsx$1(ShimmerElementsGroup,{shimmerElements:[{type:ShimmerElementType.gap,height:10,width:'100%'}]},void 0),jsx$1(ShimmerElementsGroup,{shimmerElements:[{type:ShimmerElementType.circle,height:48,verticalAlign:'bottom'},{type:ShimmerElementType.gap,height:15},{type:ShimmerElementType.gap,height:15},{type:ShimmerElementType.line,height:18}]},void 0)]},void 0);};var UsersLoadedIndicator=_styled.div.withConfig({displayName:"LikersList__UsersLoadedIndicator",componentId:"sc-a990fb-3"})(templateObject_4$C||(templateObject_4$C=__makeTemplateObject(["\n margin-top: ","px;\n font-style: italic;\n display: flex;\n justify-content: center;\n"],["\n margin-top: ","px;\n font-style: italic;\n display: flex;\n justify-content: center;\n"])),spacingM);var templateObject_1$22,templateObject_2$1h,templateObject_3$R,templateObject_4$C;_styled.div.withConfig({displayName:"LongPressLikeButton__ButtonHost",componentId:"sc-1n5c9rg-0"})(templateObject_1$21||(templateObject_1$21=__makeTemplateObject(["\n * {\n // try to fix ios behavior\n -webkit-touch-callout: none !important;\n -webkit-user-select: none !important;\n -khtml-user-select: none !important;\n -moz-user-select: none !important;\n -ms-user-select: none !important;\n user-select: none !important;\n -webkit-text-size-adjust: none;\n }\n"],["\n * {\n // try to fix ios behavior\n -webkit-touch-callout: none !important;\n -webkit-user-select: none !important;\n -khtml-user-select: none !important;\n -moz-user-select: none !important;\n -ms-user-select: none !important;\n user-select: none !important;\n -webkit-text-size-adjust: none;\n }\n"])));createGlobalStyle(templateObject_2$1g||(templateObject_2$1g=__makeTemplateObject(["\n .dialog-likers-list {\n .ms-Dialog-main {\n @media (max-width: ","px) {\n width: 100% !important;\n }\n }\n }\n"],["\n .dialog-likers-list {\n .ms-Dialog-main {\n @media (max-width: ","px) {\n width: 100% !important;\n }\n }\n }\n"])),maxScreenSize.small);var templateObject_1$21,templateObject_2$1g;var HoverLikeButton=function HoverLikeButton(_a){var itemId=_a.itemId,itemType=_a.itemType,likersCount=_a.likersCount,children=_a.children;var _b=useState$2(false),showCallout=_b[0],setshowCallout=_b[1];var buttonRef=useRef$1(null);var timeout=useRef$1(null);useEffect$1(function(){return function(){return window.clearTimeout(timeout.current);};},[]);return jsxs("div",__assign({ref:buttonRef,onMouseEnter:startOpenCalloutTimer,onMouseLeave:cancelOpenCalloutTimer,onFocus:startOpenCalloutTimer,onBlur:cancelOpenCalloutTimer},{children:[jsx$1("div",{children:children},void 0),showCallout&&jsx$1(LikersCallout,{itemId:itemId,itemType:itemType,target:buttonRef.current,likersCount:likersCount,onDismiss:function(){return setshowCallout(false);}},void 0)]}),void 0);function startOpenCalloutTimer(){if(!likersCount){return;}window.clearTimeout(timeout.current);timeout.current=window.setTimeout(function(){setshowCallout(true);},1000);}function cancelOpenCalloutTimer(){window.clearTimeout(timeout.current);}};var LikersCallout=function LikersCallout(_a){var itemId=_a.itemId,itemType=_a.itemType,onDismiss=_a.onDismiss,target=_a.target,likersCount=_a.likersCount;return jsxs(StyledCallout$2,__assign({target:target,onDismiss:onDismiss,directionalHint:DirectionalHint$1.leftCenter},{children:[jsxs(LikedBy,{children:[jsx$1(FormattedMessage$1,{id:"Generic.likers"},void 0),":"]},void 0),jsx$1(LikersList,{itemId:itemId,itemType:itemType,likersCount:likersCount},void 0)]}),void 0);};var StyledCallout$2=_styled(Callout).withConfig({displayName:"HoverLikeButton__StyledCallout",componentId:"sc-1f0a2ni-0"})(templateObject_1$20||(templateObject_1$20=__makeTemplateObject(["\n padding: ","px;\n .ms-Callout-main {\n min-height: ","px;\n overflow-y: hidden;\n width: 225px;\n\n .ms-TooltipHost {\n white-space: initial;\n }\n }\n"],["\n padding: ","px;\n .ms-Callout-main {\n min-height: ","px;\n overflow-y: hidden;\n width: 225px;\n\n .ms-TooltipHost {\n white-space: initial;\n }\n }\n"])),spacingM,spacingXl);var LikedBy=_styled.span.withConfig({displayName:"HoverLikeButton__LikedBy",componentId:"sc-1f0a2ni-1"})(templateObject_2$1f||(templateObject_2$1f=__makeTemplateObject(["\n font-weight: bold;\n"],["\n font-weight: bold;\n"])));var templateObject_1$20,templateObject_2$1f;var LikeButton=function LikeButton(_a){var itemId=_a.itemId,itemType=_a.itemType,isActive=_a.isActive,count=_a.count,onClick=_a.onClick,isDemoContent=_a.isDemoContent,doNotRenderZeroCount=_a.doNotRenderZeroCount,readOnly=_a.readOnly,className=_a.className;var features=useFeatures();var formatMessage=useIntl().formatMessage;var user=useCurrentUser();var canShowLikers=features.showLikers&&!isDemoContent&&!user.isPublicUser;var likeButton=jsx$1(FeedbackCountButton,{className:className,tooltipResourceKey:"Generic.like",activeTooltipResourceKey:"Generic.unlike",ariaLabel:formatMessage({id:isActive?'AriaLabel.unlikeItemButton':'AriaLabel.likeItemButton'}),iconName:"Like",activeIconName:"LikeSolid",isActive:isActive,onClick:onClick,count:count,feedbackType:"like",doNotRenderZeroCount:doNotRenderZeroCount,readOnly:readOnly,hideTooltip:canShowLikers},void 0);if(!canShowLikers){return likeButton;}return jsx$1(HoverLikeButton,__assign({itemId:itemId,itemType:itemType,likersCount:count},{children:likeButton}),void 0);};function hasFeedbackType(feedbackSettings,feedbackType){return feedbackSettings&&feedbackSettings.feedbackOptions&&feedbackSettings.feedbackOptions.findIndex(function(f){return f===feedbackType;})>-1;}var CardLikeButton=function CardLikeButton(_a){var _b,_c,_d;var item=_a.item,itemResourceType=_a.itemResourceType,className=_a.className;var _e=useState$2(item.isLiked),isLiked=_e[0],setIsLiked=_e[1];var _f=useState$2((_c=(_b=item.statistics)===null||_b===void 0?void 0:_b.likeCount)!==null&&_c!==void 0?_c:0),likeCount=_f[0],setLikeCount=_f[1];var _g=useState$2(false),isSaving=_g[0],setIsSaving=_g[1];var features=useFeatures();var _h=useFeedbackApi(),setFeedback=_h.setFeedback,unsetFeedback=_h.unsetFeedback;var metadata=(_d=item.metadata)!==null&&_d!==void 0?_d:{};var hasLikesEnabled=hasFeedbackType(metadata.feedbackSettings,'like');var showError=useNotificationContext().showError;if(!features.likes||!hasLikesEnabled){return null;}return jsx$1(StyledLikeButton$2,{itemId:item.id,itemType:itemResourceType,isActive:isLiked,count:likeCount,onClick:handleClick,doNotRenderZeroCount:true,className:className,isDemoContent:item.isDemoContent},void 0);function handleClick(){return __awaiter(this,void 0,void 0,function(){var isNowLiked,oldCount;return __generator(this,function(_b){switch(_b.label){case 0:if(isSaving){return [2/*return*/];}isNowLiked=!isLiked;oldCount=likeCount;_b.label=1;case 1:_b.trys.push([1,6,7,8]);setIsSaving(true);setIsLiked(isNowLiked);setLikeCount(isNowLiked?oldCount+1:oldCount-1);if(!isNowLiked)return [3/*break*/,3];return [4/*yield*/,setFeedback(itemResourceType,item.id,'like')];case 2:_b.sent();return [3/*break*/,5];case 3:return [4/*yield*/,unsetFeedback(itemResourceType,item.id,'like')];case 4:_b.sent();_b.label=5;case 5:return [3/*break*/,8];case 6:_b.sent();setIsLiked(!isNowLiked);showError('NewsArticle.setFeedback_error');setLikeCount(oldCount);return [3/*break*/,8];case 7:setIsSaving(false);return [7/*endfinally*/];case 8:return [2/*return*/];}});});}};var StyledLikeButton$2=_styled(LikeButton).withConfig({displayName:"CardLikeButton__StyledLikeButton",componentId:"sc-10mlzn4-0"})(templateObject_1$1$||(templateObject_1$1$=__makeTemplateObject(["\n min-width: 1px;\n margin: 0 4px;\n font-size: 0.9rem;\n font-weight: normal;\n\n i {\n font-size: 22px;\n font-weight: 400;\n }\n"],["\n min-width: 1px;\n margin: 0 4px;\n font-size: 0.9rem;\n font-weight: normal;\n\n i {\n font-size: 22px;\n font-weight: 400;\n }\n"])));var templateObject_1$1$;var EventRecurrenceSeriesInfo=function EventRecurrenceSeriesInfo(_a){var _b;var eventItem=_a.eventItem,className=_a.className;if(!(eventItem===null||eventItem===void 0?void 0:eventItem.recurrenceSeriesId)){return null;}var endDate=(_b=eventItem.recurrenceSettings)===null||_b===void 0?void 0:_b.endDate;return jsx$1(Host$M,__assign({className:className},{children:jsx$1(StyledTooltip$3,__assign({resourceKey:"Events.editor.recurrence.iconTooltip",values:{endDate:moment(endDate).format('LL')},hidden:!endDate},{children:jsxs(Container$2,{children:[jsx$1(StyledIcon$6,{iconName:"RecurringEvent"},void 0),jsx$1(FormattedMessage$1,{id:"Events.editor.recurrence.series"},void 0)]},void 0)}),void 0)}),void 0);};var Host$M=_styled.div.withConfig({displayName:"EventRecurrenceSeriesInfo__Host",componentId:"sc-12fly5n-0"})(templateObject_1$1_||(templateObject_1$1_=__makeTemplateObject(["\n display: flex;\n font-size: ","px;\n"],["\n display: flex;\n font-size: ","px;\n"])),fontSizeSmall);var StyledTooltip$3=_styled(Tooltip).withConfig({displayName:"EventRecurrenceSeriesInfo__StyledTooltip",componentId:"sc-12fly5n-1"})(templateObject_2$1e||(templateObject_2$1e=__makeTemplateObject(["\n z-index: 1;\n"],["\n z-index: 1;\n"])));var Container$2=_styled.div.withConfig({displayName:"EventRecurrenceSeriesInfo__Container",componentId:"sc-12fly5n-2"})(templateObject_3$Q||(templateObject_3$Q=__makeTemplateObject(["\n display: flex;\n align-items: center;\n"],["\n display: flex;\n align-items: center;\n"])));var StyledIcon$6=_styled(Icon).withConfig({displayName:"EventRecurrenceSeriesInfo__StyledIcon",componentId:"sc-12fly5n-3"})(templateObject_4$B||(templateObject_4$B=__makeTemplateObject(["\n font-size: ","px;\n padding-right: ","px;\n"],["\n font-size: ","px;\n padding-right: ","px;\n"])),fontSizeMedium,spacingXs);var templateObject_1$1_,templateObject_2$1e,templateObject_3$Q,templateObject_4$B;var EventRecurrenceSeriesInfoNavLink=function EventRecurrenceSeriesInfoNavLink(_a){var recurrenceSeriesId=_a.recurrenceSeriesId,title=_a.title,children=_a.children,className=_a.className;var buildPath=useSubscriptionHandlePathBuilder().buildPath;if(!recurrenceSeriesId){return null;}return jsx$1(StyledNavLink$2,__assign({to:buildPath("/events/upcoming?"+queryString.stringify({seriesId:recurrenceSeriesId,seriesTitle:title})),className:className},{children:children}),void 0);};var StyledNavLink$2=_styled(NavLink).withConfig({displayName:"EventRecurrenceSeriesInfoNavLink__StyledNavLink",componentId:"sc-1szm15-0"})(templateObject_1$1Z||(templateObject_1$1Z=__makeTemplateObject(["\n &&& {\n color: ",";\n text-decoration: none;\n }\n"],["\n &&& {\n color: ",";\n text-decoration: none;\n }\n"])),function(p){return p.theme.textColors.default;});var templateObject_1$1Z;var EventCard=function EventCard(_a){var _b,_c,_d,_e,_f;var item=_a.item,language=_a.language,styleDefinition=_a.styleDefinition,allowFilterByChannels=_a.allowFilterByChannels,showFeedbackButtons=_a.showFeedbackButtons,readOnly=_a.readOnly,className=_a.className;var user=useCurrentUser();var buildPath=useSubscriptionHandlePathBuilder().buildPath;var windowSize=useWindowSize$2();var highlight=!!user.unreadEvents.find(function(e){return e.itemId===item.id||e.itemId===item.recurrenceSeriesId;});var userLanguage=getPreferredContentLanguage(user);var contents=item.contents[language];var targetRoute=NewsService.getNewsRoute(buildPath('/events'),item.id,contents.title);var isCancelled=(_b=item.cancelInformation)===null||_b===void 0?void 0:_b.isCancelled;var hasNoRegistration=!isCancelled&&!((_c=item.registrationSettings)===null||_c===void 0?void 0:_c.enabled);var hasManyLocationsAndContacts=((_d=item.locations)===null||_d===void 0?void 0:_d.length)+((_e=item.contacts)===null||_e===void 0?void 0:_e.length)>=6;var bannerOnTheLeft=windowSize.width>767;var bannerWidth=bannerOnTheLeft&&hasManyLocationsAndContacts?750:450;return jsxs(Host$L,__assign({className:className,highlight:highlight,styleDefinition:styleDefinition,"data-item-id":item.id,"data-card-highlight":highlight,"data-no-registration":hasNoRegistration,"data-banner":(_f=item.bannerInfo)===null||_f===void 0?void 0:_f.type},{children:[jsx$1(IEFix,{},void 0),!readOnly&&jsx$1(ClickableOverlay,{baseRoute:buildPath('/events'),title:contents.title,itemId:item.id,itemType:ItemResourceTypes.Events},void 0),jsx$1(EventCardBanner,{item:item,bannerWidth:bannerWidth,bannerHostDefaultWidth:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.bannerHostWidth,showPlaceholder:!item.bannerInfo&&(styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.showPlaceholderIfNoBannerInfo)},void 0),jsxs(Content$7,{children:[jsxs(Header$2,__assign({"data-card-header":true},{children:[jsx$1(Dates,{startDate:item.startDate,endDate:item.endDate,isCancelled:isCancelled,className:"event-card-dates"},void 0),showFeedbackButtons&&jsx$1(Feedback,{item:item,type:"header",targetRoute:targetRoute},void 0)]}),void 0),readOnly?jsx$1(RecurrenceSeriesInfo$1,{eventItem:item},void 0):jsx$1(EventRecurrenceSeriesInfoNavLink,{recurrenceSeriesId:item.recurrenceSeriesId,title:contents.title,children:jsx$1(RecurrenceSeriesInfo$1,{eventItem:item},void 0)},void 0),jsx$1(Title$8,{children:readOnly?contents.title:jsx$1(StyledLink,__assign({to:targetRoute},{children:contents.title}),void 0)},void 0),jsxs(Footer$1,{children:[jsxs(FooterStart,{children:[jsx$1(Locations,{locations:item.locations},void 0),jsx$1(Contacts,{item:item,hideAnnouncer:true},void 0),jsx$1(EventChannelsDisplay,{item:item,language:userLanguage,allowFilterByChannels:allowFilterByChannels,channelBackgroundColor:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.channelsBackgroundColor},void 0)]},void 0),jsxs(FooterEnd,{children:[jsx$1(Registration,{item:item,disabled:readOnly},void 0),jsx$1(CancelInfo,{item:item},void 0),showFeedbackButtons&&jsx$1(Feedback,{item:item,type:"footer",targetRoute:targetRoute},void 0)]},void 0)]},void 0)]},void 0)]}),void 0);};var Host$L=_styled.article.withConfig({displayName:"EventCard__Host",componentId:"sc-19skrau-0"})(templateObject_4$A||(templateObject_4$A=__makeTemplateObject(["\n ","\n\n display: flex;\n width: 100%;\n position: relative;\n\n @media (max-width: ","px) {\n flex-direction: column;\n }\n\n ","\n\n color: ",";\n"],["\n ","\n\n display: flex;\n width: 100%;\n position: relative;\n\n @media (max-width: ","px) {\n flex-direction: column;\n }\n\n ","\n\n color: ",";\n"])),function(p){return p.styleDefinition?css$2(templateObject_1$1Y||(templateObject_1$1Y=__makeTemplateObject(["\n background-color: ",";\n ",";\n "],["\n background-color: ",";\n ",";\n "])),p.styleDefinition.backgroundColor||p.theme.palette.white,!p.styleDefinition.noShadow&&CardBorderInline(2,2)):css$2(templateObject_2$1d||(templateObject_2$1d=__makeTemplateObject(["\n ",";\n background-color: ",";\n "],["\n ",";\n background-color: ",";\n "])),CardBorderInline(2,2),p.theme.palette.white);},maxScreenSize.medium,function(p){return p.highlight&&css$2(templateObject_3$P||(templateObject_3$P=__makeTemplateObject(["\n position: relative;\n\n &::after {\n ",";\n }\n "],["\n position: relative;\n\n &::after {\n ",";\n }\n "])),BannerHighlightStyle$1);},function(p){return p.theme.textColors.default;});var BannerHighlightStyle$1=css$2(templateObject_5$w||(templateObject_5$w=__makeTemplateObject(["\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n width: ","px;\n display: block;\n background-color: ",";\n"],["\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n width: ","px;\n display: block;\n background-color: ",";\n"])),spacingXs,function(p){return p.theme.palette.accent;});var StyledLink=_styled(Link$4).withConfig({displayName:"EventCard__StyledLink",componentId:"sc-19skrau-1"})(templateObject_6$m||(templateObject_6$m=__makeTemplateObject(["\n &&& {\n &,\n :link,\n :visited {\n color: ",";\n text-decoration: none;\n }\n }\n"],["\n &&& {\n &,\n :link,\n :visited {\n color: ",";\n text-decoration: none;\n }\n }\n"])),function(p){return p.theme.textColors.default;});var Title$8=_styled.h3.withConfig({displayName:"EventCard__Title",componentId:"sc-19skrau-2"})(templateObject_7$g||(templateObject_7$g=__makeTemplateObject(["\n font-size: ","px;\n"],["\n font-size: ","px;\n"])),fontSizeMedium);var Header$2=_styled.div.withConfig({displayName:"EventCard__Header",componentId:"sc-19skrau-3"})(templateObject_8$f||(templateObject_8$f=__makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n\n @media (max-width: ","px) {\n flex-direction: column;\n align-items: flex-start;\n > *:not(:first-child) {\n padding-top: ","px;\n }\n }\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"],["\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n\n @media (max-width: ","px) {\n flex-direction: column;\n align-items: flex-start;\n > *:not(:first-child) {\n padding-top: ","px;\n }\n }\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"])),maxScreenSize.medium,spacingXs);var RecurrenceSeriesInfo$1=_styled(EventRecurrenceSeriesInfo).withConfig({displayName:"EventCard__RecurrenceSeriesInfo",componentId:"sc-19skrau-4"})(templateObject_9$c||(templateObject_9$c=__makeTemplateObject(["\n margin-top: ","px;\n"],["\n margin-top: ","px;\n"])),spacingS);var Content$7=_styled.div.withConfig({displayName:"EventCard__Content",componentId:"sc-19skrau-5"})(templateObject_10$b||(templateObject_10$b=__makeTemplateObject(["\n padding: ","px;\n flex-grow: 1;\n\n color: ",";\n"],["\n padding: ","px;\n flex-grow: 1;\n\n color: ",";\n"])),spacingM,function(p){return p.theme.textColors.default;});var Footer$1=_styled.div.withConfig({displayName:"EventCard__Footer",componentId:"sc-19skrau-6"})(templateObject_11$7||(templateObject_11$7=__makeTemplateObject(["\n margin-top: ","px;\n\n display: flex;\n justify-content: space-between;\n align-items: flex-end;\n\n @media (max-width: ","px) {\n flex-direction: column;\n align-items: stretch;\n }\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"],["\n margin-top: ","px;\n\n display: flex;\n justify-content: space-between;\n align-items: flex-end;\n\n @media (max-width: ","px) {\n flex-direction: column;\n align-items: stretch;\n }\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"])),spacingM,maxScreenSize.medium);var FooterStart=_styled.div.withConfig({displayName:"EventCard__FooterStart",componentId:"sc-19skrau-7"})(templateObject_12$6||(templateObject_12$6=__makeTemplateObject(["\n flex: 1 1 100%;\n\n margin-right: ","px;\n\n > *:first-child:not(:only-child) {\n margin-bottom: ","px;\n }\n\n @media (max-width: ","px) {\n flex: 1 1 auto;\n }\n"],["\n flex: 1 1 100%;\n\n margin-right: ","px;\n\n > *:first-child:not(:only-child) {\n margin-bottom: ","px;\n }\n\n @media (max-width: ","px) {\n flex: 1 1 auto;\n }\n"])),spacingXs,spacingS,maxScreenSize.medium);var FooterEnd=_styled.div.withConfig({displayName:"EventCard__FooterEnd",componentId:"sc-19skrau-8"})(templateObject_13$5||(templateObject_13$5=__makeTemplateObject(["\n flex: 0 0 200px;\n\n @media (max-width: ","px) {\n margin-top: ","px;\n flex: 1 1 auto;\n }\n"],["\n flex: 0 0 200px;\n\n @media (max-width: ","px) {\n margin-top: ","px;\n flex: 1 1 auto;\n }\n"])),maxScreenSize.medium,spacingS);var HeaderFeedback=css$2(templateObject_14$5||(templateObject_14$5=__makeTemplateObject(["\n display: none;\n @media (min-width: ","px) {\n display: flex;\n align-items: center;\n }\n"],["\n display: none;\n @media (min-width: ","px) {\n display: flex;\n align-items: center;\n }\n"])),minScreenSize.medium);var FooterFeedback=css$2(templateObject_15$5||(templateObject_15$5=__makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: flex-end;\n margin-top: ","px;\n\n @media (min-width: ","px) {\n display: none;\n }\n"],["\n display: flex;\n align-items: center;\n justify-content: flex-end;\n margin-top: ","px;\n\n @media (min-width: ","px) {\n display: none;\n }\n"])),spacingS,minScreenSize.medium);var FeedbackHost=_styled.div.withConfig({displayName:"EventCard__FeedbackHost",componentId:"sc-19skrau-9"})(templateObject_16$5||(templateObject_16$5=__makeTemplateObject(["\n ",";\n"],["\n ",";\n"])),function(_a){var isHeader=_a.isHeader;return isHeader?HeaderFeedback:FooterFeedback;});var Feedback=function Feedback(_a){var item=_a.item,type=_a.type,targetRoute=_a.targetRoute;var user=useCurrentUser();var showCommentCount=item.statistics&&item.statistics.commentCount>0&&hasFeedbackType(item.metadata.feedbackSettings,'comment')&&!user.isPublicUser;return jsxs(FeedbackHost,__assign({isHeader:type==='header'},{children:[jsx$1(EventCardLikeButton,{item:item,itemResourceType:ItemResourceTypes.Events},void 0),showCommentCount&&jsx$1(StyledLink,__assign({to:targetRoute+"#comments","aria-hidden":"true"},{children:jsx$1(EventCardCommentCount,{item:item},void 0)}),void 0)]}),void 0);};var EventCardLikeButton=_styled(CardLikeButton).withConfig({displayName:"EventCard__EventCardLikeButton",componentId:"sc-19skrau-10"})(templateObject_17$4||(templateObject_17$4=__makeTemplateObject(["\n && {\n button {\n min-height: 23px;\n display: flex;\n margin-right: 9px;\n font-size: 1rem;\n }\n }\n"],["\n && {\n button {\n min-height: 23px;\n display: flex;\n margin-right: 9px;\n font-size: 1rem;\n }\n }\n"])));var Registration=_styled(EventCardUserRegistration).withConfig({displayName:"EventCard__Registration",componentId:"sc-19skrau-11"})(templateObject_18$3||(templateObject_18$3=__makeTemplateObject(["\n && {\n margin-top: ","px;\n button {\n width: 100%;\n }\n\n @media (min-width: ","px) {\n text-align: right;\n button {\n width: initial;\n }\n }\n }\n"],["\n && {\n margin-top: ","px;\n button {\n width: 100%;\n }\n\n @media (min-width: ","px) {\n text-align: right;\n button {\n width: initial;\n }\n }\n }\n"])),spacingS,minScreenSize.medium);var Dates=_styled(DateTimeRange).withConfig({displayName:"EventCard__Dates",componentId:"sc-19skrau-12"})(templateObject_19$3||(templateObject_19$3=__makeTemplateObject(["\n flex: 1;\n font-size: ","px;\n font-weight: 500;\n opacity: ",";\n padding-right: ","px;\n"],["\n flex: 1;\n font-size: ","px;\n font-weight: 500;\n opacity: ",";\n padding-right: ","px;\n"])),fontSizeSmall,function(_a){var isCancelled=_a.isCancelled;return isCancelled?0.4:1;},spacingS);var Locations=_styled(EventLocationInfo).withConfig({displayName:"EventCard__Locations",componentId:"sc-19skrau-13"})(templateObject_20$2||(templateObject_20$2=__makeTemplateObject([""],[""])));var Contacts=_styled(EventPeopleInfo).withConfig({displayName:"EventCard__Contacts",componentId:"sc-19skrau-14"})(templateObject_21$1||(templateObject_21$1=__makeTemplateObject(["\n flex-direction: column;\n"],["\n flex-direction: column;\n"])));var CancelInfo=_styled(EventCancelInformation).withConfig({displayName:"EventCard__CancelInfo",componentId:"sc-19skrau-15"})(templateObject_22$1||(templateObject_22$1=__makeTemplateObject(["\n margin: 0 -","px;\n @media (min-width: ","px) {\n margin: 0;\n }\n"],["\n margin: 0 -","px;\n @media (min-width: ","px) {\n margin: 0;\n }\n"])),spacingM,minScreenSize.medium);var IEFix=createGlobalStyle(templateObject_23$1||(templateObject_23$1=__makeTemplateObject(["\n .browser-name-ie {\n .event-card-dates {\n flex: 1 1 0%;\n flex-basis: 0%;\n }\n }\n"],["\n .browser-name-ie {\n .event-card-dates {\n flex: 1 1 0%;\n flex-basis: 0%;\n }\n }\n"])));var templateObject_1$1Y,templateObject_2$1d,templateObject_3$P,templateObject_4$A,templateObject_5$w,templateObject_6$m,templateObject_7$g,templateObject_8$f,templateObject_9$c,templateObject_10$b,templateObject_11$7,templateObject_12$6,templateObject_13$5,templateObject_14$5,templateObject_15$5,templateObject_16$5,templateObject_17$4,templateObject_18$3,templateObject_19$3,templateObject_20$2,templateObject_21$1,templateObject_22$1,templateObject_23$1;function useExternalContentHandler(){var _this=this;var history=useHistory();var onRequestToken=useContext(AuthenticationContext).onRequestToken;var trackExternalItem=useNewsApi().trackExternalItem;var createApiUrl=useApiFactory().createApiUrl;var currentUser=useCurrentUser();var webAppUrls=useSubscriptionWebAppUrls();var _a=useContext(LinkContext),onOpenExternalLink=_a.onOpenExternalLink,tryGetInternalLink=_a.tryGetInternalLink;var refreshUserDetails=useRefreshUserDetails();return function(item,itemType,openInNewTab){return __awaiter(_this,void 0,void 0,function(){var language,externalContentUrl,internalLink,token;return __generator(this,function(_a){switch(_a.label){case 0:if(!(item===null||item===void 0?void 0:item.useExternalContent)){return [2/*return*/,null];}language=getPreferredContentLanguage(currentUser);externalContentUrl=getExternalContentUrl(item,language);if(!externalContentUrl){return [2/*return*/,null];}internalLink=tryGetInternalLink(externalContentUrl,webAppUrls);if(internalLink){// no API redirect; only the unread & page views tracking
122234
+ if(container.scrollHeight-container.scrollTop>container.clientHeight+300){return [2/*return*/];}_a.label=1;case 1:_a.trys.push([1,3,,4]);return [4/*yield*/,loadNextPage(likersInfo)];case 2:_a.sent();return [3/*break*/,4];case 3:err_1=_a.sent();logger.error(err_1);return [3/*break*/,4];case 4:return [2/*return*/];}});});}};var StyledAvatar$2=_styled(Avatar).withConfig({displayName:"LikersList__StyledAvatar",componentId:"sc-a990fb-0"})(templateObject_1$24||(templateObject_1$24=__makeTemplateObject(["\n .ms-Persona-primaryText {\n white-space: initial;\n }\n"],["\n .ms-Persona-primaryText {\n white-space: initial;\n }\n"])));var List$1=_styled.ul.withConfig({displayName:"LikersList__List",componentId:"sc-a990fb-1"})(templateObject_2$1j||(templateObject_2$1j=__makeTemplateObject(["\n list-style: none;\n margin: 0;\n padding: 4px;\n\n max-height: ","px;\n overflow-y: auto;\n\n display: flex;\n flex-direction: column;\n\n li {\n display: flex;\n flex: 1 1 auto;\n margin-top: ","px;\n }\n"],["\n list-style: none;\n margin: 0;\n padding: 4px;\n\n max-height: ","px;\n overflow-y: auto;\n\n display: flex;\n flex-direction: column;\n\n li {\n display: flex;\n flex: 1 1 auto;\n margin-top: ","px;\n }\n"])),defaultShimmerCount*58,spacingS);var StyledSpinner$3=_styled(Spinner).withConfig({displayName:"LikersList__StyledSpinner",componentId:"sc-a990fb-2"})(templateObject_3$T||(templateObject_3$T=__makeTemplateObject(["\n margin: ","px 0;\n\n & > .ms-Spinner {\n height: 38px;\n }\n"],["\n margin: ","px 0;\n\n & > .ms-Spinner {\n height: 38px;\n }\n"])),spacingS);var LikersListShimmer=function LikersListShimmer(_a){var count=_a.count,isLoading=_a.isLoading,children=_a.children;return jsx$1(Shimmer,__assign({isDataLoaded:!isLoading,customElementsGroup:Array.from(Array(count)).map(function(_,i){return jsx$1(UserShimmer$1,{},i);})},{children:children}),void 0);};var UserShimmer$1=function UserShimmer(){return jsxs(Fragment,{children:[jsx$1(ShimmerElementsGroup,{shimmerElements:[{type:ShimmerElementType.gap,height:10,width:'100%'}]},void 0),jsx$1(ShimmerElementsGroup,{shimmerElements:[{type:ShimmerElementType.circle,height:48,verticalAlign:'bottom'},{type:ShimmerElementType.gap,height:15},{type:ShimmerElementType.gap,height:15},{type:ShimmerElementType.line,height:18}]},void 0)]},void 0);};var UsersLoadedIndicator=_styled.div.withConfig({displayName:"LikersList__UsersLoadedIndicator",componentId:"sc-a990fb-3"})(templateObject_4$C||(templateObject_4$C=__makeTemplateObject(["\n margin-top: ","px;\n font-style: italic;\n display: flex;\n justify-content: center;\n"],["\n margin-top: ","px;\n font-style: italic;\n display: flex;\n justify-content: center;\n"])),spacingM);var templateObject_1$24,templateObject_2$1j,templateObject_3$T,templateObject_4$C;_styled.div.withConfig({displayName:"LongPressLikeButton__ButtonHost",componentId:"sc-1n5c9rg-0"})(templateObject_1$23||(templateObject_1$23=__makeTemplateObject(["\n * {\n // try to fix ios behavior\n -webkit-touch-callout: none !important;\n -webkit-user-select: none !important;\n -khtml-user-select: none !important;\n -moz-user-select: none !important;\n -ms-user-select: none !important;\n user-select: none !important;\n -webkit-text-size-adjust: none;\n }\n"],["\n * {\n // try to fix ios behavior\n -webkit-touch-callout: none !important;\n -webkit-user-select: none !important;\n -khtml-user-select: none !important;\n -moz-user-select: none !important;\n -ms-user-select: none !important;\n user-select: none !important;\n -webkit-text-size-adjust: none;\n }\n"])));createGlobalStyle(templateObject_2$1i||(templateObject_2$1i=__makeTemplateObject(["\n .dialog-likers-list {\n .ms-Dialog-main {\n @media (max-width: ","px) {\n width: 100% !important;\n }\n }\n }\n"],["\n .dialog-likers-list {\n .ms-Dialog-main {\n @media (max-width: ","px) {\n width: 100% !important;\n }\n }\n }\n"])),maxScreenSize.small);var templateObject_1$23,templateObject_2$1i;var HoverLikeButton=function HoverLikeButton(_a){var itemId=_a.itemId,itemType=_a.itemType,likersCount=_a.likersCount,children=_a.children;var _b=useState$2(false),showCallout=_b[0],setshowCallout=_b[1];var buttonRef=useRef$1(null);var timeout=useRef$1(null);useEffect$1(function(){return function(){return window.clearTimeout(timeout.current);};},[]);return jsxs("div",__assign({ref:buttonRef,onMouseEnter:startOpenCalloutTimer,onMouseLeave:cancelOpenCalloutTimer,onFocus:startOpenCalloutTimer,onBlur:cancelOpenCalloutTimer},{children:[jsx$1("div",{children:children},void 0),showCallout&&jsx$1(LikersCallout,{itemId:itemId,itemType:itemType,target:buttonRef.current,likersCount:likersCount,onDismiss:function(){return setshowCallout(false);}},void 0)]}),void 0);function startOpenCalloutTimer(){if(!likersCount){return;}window.clearTimeout(timeout.current);timeout.current=window.setTimeout(function(){setshowCallout(true);},1000);}function cancelOpenCalloutTimer(){window.clearTimeout(timeout.current);}};var LikersCallout=function LikersCallout(_a){var itemId=_a.itemId,itemType=_a.itemType,onDismiss=_a.onDismiss,target=_a.target,likersCount=_a.likersCount;return jsxs(StyledCallout$1,__assign({target:target,onDismiss:onDismiss,directionalHint:DirectionalHint$1.leftCenter},{children:[jsxs(LikedBy,{children:[jsx$1(FormattedMessage$1,{id:"Generic.likers"},void 0),":"]},void 0),jsx$1(LikersList,{itemId:itemId,itemType:itemType,likersCount:likersCount},void 0)]}),void 0);};var StyledCallout$1=_styled(Callout).withConfig({displayName:"HoverLikeButton__StyledCallout",componentId:"sc-1f0a2ni-0"})(templateObject_1$22||(templateObject_1$22=__makeTemplateObject(["\n padding: ","px;\n .ms-Callout-main {\n min-height: ","px;\n overflow-y: hidden;\n width: 225px;\n\n .ms-TooltipHost {\n white-space: initial;\n }\n }\n"],["\n padding: ","px;\n .ms-Callout-main {\n min-height: ","px;\n overflow-y: hidden;\n width: 225px;\n\n .ms-TooltipHost {\n white-space: initial;\n }\n }\n"])),spacingM,spacingXl);var LikedBy=_styled.span.withConfig({displayName:"HoverLikeButton__LikedBy",componentId:"sc-1f0a2ni-1"})(templateObject_2$1h||(templateObject_2$1h=__makeTemplateObject(["\n font-weight: bold;\n"],["\n font-weight: bold;\n"])));var templateObject_1$22,templateObject_2$1h;var LikeButton=function LikeButton(_a){var itemId=_a.itemId,itemType=_a.itemType,isActive=_a.isActive,count=_a.count,onClick=_a.onClick,isDemoContent=_a.isDemoContent,doNotRenderZeroCount=_a.doNotRenderZeroCount,readOnly=_a.readOnly,className=_a.className;var features=useFeatures();var formatMessage=useIntl().formatMessage;var user=useCurrentUser();var canShowLikers=features.showLikers&&!isDemoContent&&!user.isPublicUser;var likeButton=jsx$1(FeedbackCountButton,{className:className,tooltipResourceKey:"Generic.like",activeTooltipResourceKey:"Generic.unlike",ariaLabel:formatMessage({id:isActive?'AriaLabel.unlikeItemButton':'AriaLabel.likeItemButton'}),iconName:"Like",activeIconName:"LikeSolid",isActive:isActive,onClick:onClick,count:count,feedbackType:"like",doNotRenderZeroCount:doNotRenderZeroCount,readOnly:readOnly,hideTooltip:canShowLikers},void 0);if(!canShowLikers){return likeButton;}return jsx$1(HoverLikeButton,__assign({itemId:itemId,itemType:itemType,likersCount:count},{children:likeButton}),void 0);};function hasFeedbackType(feedbackSettings,feedbackType){return feedbackSettings&&feedbackSettings.feedbackOptions&&feedbackSettings.feedbackOptions.findIndex(function(f){return f===feedbackType;})>-1;}var CardLikeButton=function CardLikeButton(_a){var _b,_c,_d;var item=_a.item,itemResourceType=_a.itemResourceType,className=_a.className;var _e=useState$2(item.isLiked),isLiked=_e[0],setIsLiked=_e[1];var _f=useState$2((_c=(_b=item.statistics)===null||_b===void 0?void 0:_b.likeCount)!==null&&_c!==void 0?_c:0),likeCount=_f[0],setLikeCount=_f[1];var _g=useState$2(false),isSaving=_g[0],setIsSaving=_g[1];var features=useFeatures();var _h=useFeedbackApi(),setFeedback=_h.setFeedback,unsetFeedback=_h.unsetFeedback;var metadata=(_d=item.metadata)!==null&&_d!==void 0?_d:{};var hasLikesEnabled=hasFeedbackType(metadata.feedbackSettings,'like');var showError=useNotificationContext().showError;if(!features.likes||!hasLikesEnabled){return null;}return jsx$1(StyledLikeButton$2,{itemId:item.id,itemType:itemResourceType,isActive:isLiked,count:likeCount,onClick:handleClick,doNotRenderZeroCount:true,className:className,isDemoContent:item.isDemoContent},void 0);function handleClick(){return __awaiter(this,void 0,void 0,function(){var isNowLiked,oldCount;return __generator(this,function(_b){switch(_b.label){case 0:if(isSaving){return [2/*return*/];}isNowLiked=!isLiked;oldCount=likeCount;_b.label=1;case 1:_b.trys.push([1,6,7,8]);setIsSaving(true);setIsLiked(isNowLiked);setLikeCount(isNowLiked?oldCount+1:oldCount-1);if(!isNowLiked)return [3/*break*/,3];return [4/*yield*/,setFeedback(itemResourceType,item.id,'like')];case 2:_b.sent();return [3/*break*/,5];case 3:return [4/*yield*/,unsetFeedback(itemResourceType,item.id,'like')];case 4:_b.sent();_b.label=5;case 5:return [3/*break*/,8];case 6:_b.sent();setIsLiked(!isNowLiked);showError('NewsArticle.setFeedback_error');setLikeCount(oldCount);return [3/*break*/,8];case 7:setIsSaving(false);return [7/*endfinally*/];case 8:return [2/*return*/];}});});}};var StyledLikeButton$2=_styled(LikeButton).withConfig({displayName:"CardLikeButton__StyledLikeButton",componentId:"sc-10mlzn4-0"})(templateObject_1$21||(templateObject_1$21=__makeTemplateObject(["\n min-width: 1px;\n margin: 0 4px;\n font-size: 0.9rem;\n font-weight: normal;\n\n i {\n font-size: 22px;\n font-weight: 400;\n }\n"],["\n min-width: 1px;\n margin: 0 4px;\n font-size: 0.9rem;\n font-weight: normal;\n\n i {\n font-size: 22px;\n font-weight: 400;\n }\n"])));var templateObject_1$21;var EventRecurrenceSeriesInfo=function EventRecurrenceSeriesInfo(_a){var _b;var eventItem=_a.eventItem,className=_a.className;if(!(eventItem===null||eventItem===void 0?void 0:eventItem.recurrenceSeriesId)){return null;}var endDate=(_b=eventItem.recurrenceSettings)===null||_b===void 0?void 0:_b.endDate;return jsx$1(Host$N,__assign({className:className},{children:jsx$1(StyledTooltip$3,__assign({resourceKey:"Events.editor.recurrence.iconTooltip",values:{endDate:moment(endDate).format('LL')},hidden:!endDate},{children:jsxs(Container$2,{children:[jsx$1(StyledIcon$6,{iconName:"RecurringEvent"},void 0),jsx$1(FormattedMessage$1,{id:"Events.editor.recurrence.series"},void 0)]},void 0)}),void 0)}),void 0);};var Host$N=_styled.div.withConfig({displayName:"EventRecurrenceSeriesInfo__Host",componentId:"sc-12fly5n-0"})(templateObject_1$20||(templateObject_1$20=__makeTemplateObject(["\n display: flex;\n font-size: ","px;\n"],["\n display: flex;\n font-size: ","px;\n"])),fontSizeSmall);var StyledTooltip$3=_styled(Tooltip).withConfig({displayName:"EventRecurrenceSeriesInfo__StyledTooltip",componentId:"sc-12fly5n-1"})(templateObject_2$1g||(templateObject_2$1g=__makeTemplateObject(["\n z-index: 1;\n"],["\n z-index: 1;\n"])));var Container$2=_styled.div.withConfig({displayName:"EventRecurrenceSeriesInfo__Container",componentId:"sc-12fly5n-2"})(templateObject_3$S||(templateObject_3$S=__makeTemplateObject(["\n display: flex;\n align-items: center;\n"],["\n display: flex;\n align-items: center;\n"])));var StyledIcon$6=_styled(Icon).withConfig({displayName:"EventRecurrenceSeriesInfo__StyledIcon",componentId:"sc-12fly5n-3"})(templateObject_4$B||(templateObject_4$B=__makeTemplateObject(["\n font-size: ","px;\n padding-right: ","px;\n"],["\n font-size: ","px;\n padding-right: ","px;\n"])),fontSizeMedium,spacingXs);var templateObject_1$20,templateObject_2$1g,templateObject_3$S,templateObject_4$B;var EventRecurrenceSeriesInfoNavLink=function EventRecurrenceSeriesInfoNavLink(_a){var recurrenceSeriesId=_a.recurrenceSeriesId,title=_a.title,children=_a.children,className=_a.className;var buildPath=useSubscriptionHandlePathBuilder().buildPath;if(!recurrenceSeriesId){return null;}return jsx$1(StyledNavLink$2,__assign({to:buildPath("/events/upcoming?"+queryString.stringify({seriesId:recurrenceSeriesId,seriesTitle:title})),className:className},{children:children}),void 0);};var StyledNavLink$2=_styled(NavLink).withConfig({displayName:"EventRecurrenceSeriesInfoNavLink__StyledNavLink",componentId:"sc-1szm15-0"})(templateObject_1$1$||(templateObject_1$1$=__makeTemplateObject(["\n &&& {\n color: ",";\n text-decoration: none;\n }\n"],["\n &&& {\n color: ",";\n text-decoration: none;\n }\n"])),function(p){return p.theme.textColors.default;});var templateObject_1$1$;var EventCard=function EventCard(_a){var _b,_c,_d,_e,_f;var item=_a.item,language=_a.language,styleDefinition=_a.styleDefinition,allowFilterByChannels=_a.allowFilterByChannels,showFeedbackButtons=_a.showFeedbackButtons,readOnly=_a.readOnly,className=_a.className;var user=useCurrentUser();var buildPath=useSubscriptionHandlePathBuilder().buildPath;var windowSize=useWindowSize$2();var highlight=!!user.unreadEvents.find(function(e){return e.itemId===item.id||e.itemId===item.recurrenceSeriesId;});var userLanguage=getPreferredContentLanguage(user);var contents=item.contents[language];var targetRoute=NewsService.getNewsRoute(buildPath('/events'),item.id,contents.title);var isCancelled=(_b=item.cancelInformation)===null||_b===void 0?void 0:_b.isCancelled;var hasNoRegistration=!isCancelled&&!((_c=item.registrationSettings)===null||_c===void 0?void 0:_c.enabled);var hasManyLocationsAndContacts=((_d=item.locations)===null||_d===void 0?void 0:_d.length)+((_e=item.contacts)===null||_e===void 0?void 0:_e.length)>=6;var bannerOnTheLeft=windowSize.width>767;var bannerWidth=bannerOnTheLeft&&hasManyLocationsAndContacts?750:450;return jsxs(Host$M,__assign({className:className,highlight:highlight,styleDefinition:styleDefinition,"data-item-id":item.id,"data-card-highlight":highlight,"data-no-registration":hasNoRegistration,"data-banner":(_f=item.bannerInfo)===null||_f===void 0?void 0:_f.type},{children:[jsx$1(IEFix,{},void 0),!readOnly&&jsx$1(ClickableOverlay,{baseRoute:buildPath('/events'),title:contents.title,itemId:item.id,itemType:ItemResourceTypes.Events},void 0),jsx$1(EventCardBanner,{item:item,bannerWidth:bannerWidth,bannerHostDefaultWidth:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.bannerHostWidth,showPlaceholder:!item.bannerInfo&&(styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.showPlaceholderIfNoBannerInfo)},void 0),jsxs(Content$7,{children:[jsxs(Header$2,__assign({"data-card-header":true},{children:[jsx$1(Dates,{startDate:item.startDate,endDate:item.endDate,isCancelled:isCancelled,className:"event-card-dates"},void 0),showFeedbackButtons&&jsx$1(Feedback,{item:item,type:"header",targetRoute:targetRoute},void 0)]}),void 0),readOnly?jsx$1(RecurrenceSeriesInfo$1,{eventItem:item},void 0):jsx$1(EventRecurrenceSeriesInfoNavLink,{recurrenceSeriesId:item.recurrenceSeriesId,title:contents.title,children:jsx$1(RecurrenceSeriesInfo$1,{eventItem:item},void 0)},void 0),jsx$1(Title$9,{children:readOnly?contents.title:jsx$1(StyledLink,__assign({to:targetRoute},{children:contents.title}),void 0)},void 0),jsxs(Footer$1,{children:[jsxs(FooterStart,{children:[jsx$1(Locations,{locations:item.locations},void 0),jsx$1(Contacts,{item:item,hideAnnouncer:true},void 0),jsx$1(EventChannelsDisplay,{item:item,language:userLanguage,allowFilterByChannels:allowFilterByChannels,channelBackgroundColor:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.channelsBackgroundColor},void 0)]},void 0),jsxs(FooterEnd,{children:[jsx$1(Registration,{item:item,disabled:readOnly},void 0),jsx$1(CancelInfo,{item:item},void 0),showFeedbackButtons&&jsx$1(Feedback,{item:item,type:"footer",targetRoute:targetRoute},void 0)]},void 0)]},void 0)]},void 0)]}),void 0);};var Host$M=_styled.article.withConfig({displayName:"EventCard__Host",componentId:"sc-19skrau-0"})(templateObject_4$A||(templateObject_4$A=__makeTemplateObject(["\n ","\n\n display: flex;\n width: 100%;\n position: relative;\n\n @media (max-width: ","px) {\n flex-direction: column;\n }\n\n ","\n\n color: ",";\n"],["\n ","\n\n display: flex;\n width: 100%;\n position: relative;\n\n @media (max-width: ","px) {\n flex-direction: column;\n }\n\n ","\n\n color: ",";\n"])),function(p){return p.styleDefinition?css$2(templateObject_1$1_||(templateObject_1$1_=__makeTemplateObject(["\n background-color: ",";\n ",";\n "],["\n background-color: ",";\n ",";\n "])),p.styleDefinition.backgroundColor||p.theme.palette.white,!p.styleDefinition.noShadow&&CardBorderInline(2,2)):css$2(templateObject_2$1f||(templateObject_2$1f=__makeTemplateObject(["\n ",";\n background-color: ",";\n "],["\n ",";\n background-color: ",";\n "])),CardBorderInline(2,2),p.theme.palette.white);},maxScreenSize.medium,function(p){return p.highlight&&css$2(templateObject_3$R||(templateObject_3$R=__makeTemplateObject(["\n position: relative;\n\n &::after {\n ",";\n }\n "],["\n position: relative;\n\n &::after {\n ",";\n }\n "])),BannerHighlightStyle$1);},function(p){return p.theme.textColors.default;});var BannerHighlightStyle$1=css$2(templateObject_5$w||(templateObject_5$w=__makeTemplateObject(["\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n width: ","px;\n display: block;\n background-color: ",";\n"],["\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n width: ","px;\n display: block;\n background-color: ",";\n"])),spacingXs,function(p){return p.theme.palette.accent;});var StyledLink=_styled(Link$4).withConfig({displayName:"EventCard__StyledLink",componentId:"sc-19skrau-1"})(templateObject_6$m||(templateObject_6$m=__makeTemplateObject(["\n &&& {\n &,\n :link,\n :visited {\n color: ",";\n text-decoration: none;\n }\n }\n"],["\n &&& {\n &,\n :link,\n :visited {\n color: ",";\n text-decoration: none;\n }\n }\n"])),function(p){return p.theme.textColors.default;});var Title$9=_styled.h3.withConfig({displayName:"EventCard__Title",componentId:"sc-19skrau-2"})(templateObject_7$g||(templateObject_7$g=__makeTemplateObject(["\n font-size: ","px;\n"],["\n font-size: ","px;\n"])),fontSizeMedium);var Header$2=_styled.div.withConfig({displayName:"EventCard__Header",componentId:"sc-19skrau-3"})(templateObject_8$f||(templateObject_8$f=__makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n\n @media (max-width: ","px) {\n flex-direction: column;\n align-items: flex-start;\n > *:not(:first-child) {\n padding-top: ","px;\n }\n }\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"],["\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n\n @media (max-width: ","px) {\n flex-direction: column;\n align-items: flex-start;\n > *:not(:first-child) {\n padding-top: ","px;\n }\n }\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"])),maxScreenSize.medium,spacingXs);var RecurrenceSeriesInfo$1=_styled(EventRecurrenceSeriesInfo).withConfig({displayName:"EventCard__RecurrenceSeriesInfo",componentId:"sc-19skrau-4"})(templateObject_9$c||(templateObject_9$c=__makeTemplateObject(["\n margin-top: ","px;\n"],["\n margin-top: ","px;\n"])),spacingS);var Content$7=_styled.div.withConfig({displayName:"EventCard__Content",componentId:"sc-19skrau-5"})(templateObject_10$b||(templateObject_10$b=__makeTemplateObject(["\n padding: ","px;\n flex-grow: 1;\n\n color: ",";\n"],["\n padding: ","px;\n flex-grow: 1;\n\n color: ",";\n"])),spacingM,function(p){return p.theme.textColors.default;});var Footer$1=_styled.div.withConfig({displayName:"EventCard__Footer",componentId:"sc-19skrau-6"})(templateObject_11$7||(templateObject_11$7=__makeTemplateObject(["\n margin-top: ","px;\n\n display: flex;\n justify-content: space-between;\n align-items: flex-end;\n\n @media (max-width: ","px) {\n flex-direction: column;\n align-items: stretch;\n }\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"],["\n margin-top: ","px;\n\n display: flex;\n justify-content: space-between;\n align-items: flex-end;\n\n @media (max-width: ","px) {\n flex-direction: column;\n align-items: stretch;\n }\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"])),spacingM,maxScreenSize.medium);var FooterStart=_styled.div.withConfig({displayName:"EventCard__FooterStart",componentId:"sc-19skrau-7"})(templateObject_12$6||(templateObject_12$6=__makeTemplateObject(["\n flex: 1 1 100%;\n\n margin-right: ","px;\n\n > *:first-child:not(:only-child) {\n margin-bottom: ","px;\n }\n\n @media (max-width: ","px) {\n flex: 1 1 auto;\n }\n"],["\n flex: 1 1 100%;\n\n margin-right: ","px;\n\n > *:first-child:not(:only-child) {\n margin-bottom: ","px;\n }\n\n @media (max-width: ","px) {\n flex: 1 1 auto;\n }\n"])),spacingXs,spacingS,maxScreenSize.medium);var FooterEnd=_styled.div.withConfig({displayName:"EventCard__FooterEnd",componentId:"sc-19skrau-8"})(templateObject_13$5||(templateObject_13$5=__makeTemplateObject(["\n flex: 0 0 200px;\n\n @media (max-width: ","px) {\n margin-top: ","px;\n flex: 1 1 auto;\n }\n"],["\n flex: 0 0 200px;\n\n @media (max-width: ","px) {\n margin-top: ","px;\n flex: 1 1 auto;\n }\n"])),maxScreenSize.medium,spacingS);var HeaderFeedback=css$2(templateObject_14$5||(templateObject_14$5=__makeTemplateObject(["\n display: none;\n @media (min-width: ","px) {\n display: flex;\n align-items: center;\n }\n"],["\n display: none;\n @media (min-width: ","px) {\n display: flex;\n align-items: center;\n }\n"])),minScreenSize.medium);var FooterFeedback=css$2(templateObject_15$5||(templateObject_15$5=__makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: flex-end;\n margin-top: ","px;\n\n @media (min-width: ","px) {\n display: none;\n }\n"],["\n display: flex;\n align-items: center;\n justify-content: flex-end;\n margin-top: ","px;\n\n @media (min-width: ","px) {\n display: none;\n }\n"])),spacingS,minScreenSize.medium);var FeedbackHost=_styled.div.withConfig({displayName:"EventCard__FeedbackHost",componentId:"sc-19skrau-9"})(templateObject_16$5||(templateObject_16$5=__makeTemplateObject(["\n ",";\n"],["\n ",";\n"])),function(_a){var isHeader=_a.isHeader;return isHeader?HeaderFeedback:FooterFeedback;});var Feedback=function Feedback(_a){var item=_a.item,type=_a.type,targetRoute=_a.targetRoute;var user=useCurrentUser();var showCommentCount=item.statistics&&item.statistics.commentCount>0&&hasFeedbackType(item.metadata.feedbackSettings,'comment')&&!user.isPublicUser;return jsxs(FeedbackHost,__assign({isHeader:type==='header'},{children:[jsx$1(EventCardLikeButton,{item:item,itemResourceType:ItemResourceTypes.Events},void 0),showCommentCount&&jsx$1(StyledLink,__assign({to:targetRoute+"#comments","aria-hidden":"true"},{children:jsx$1(EventCardCommentCount,{item:item},void 0)}),void 0)]}),void 0);};var EventCardLikeButton=_styled(CardLikeButton).withConfig({displayName:"EventCard__EventCardLikeButton",componentId:"sc-19skrau-10"})(templateObject_17$4||(templateObject_17$4=__makeTemplateObject(["\n && {\n button {\n min-height: 23px;\n display: flex;\n margin-right: 9px;\n font-size: 1rem;\n }\n }\n"],["\n && {\n button {\n min-height: 23px;\n display: flex;\n margin-right: 9px;\n font-size: 1rem;\n }\n }\n"])));var Registration=_styled(EventCardUserRegistration).withConfig({displayName:"EventCard__Registration",componentId:"sc-19skrau-11"})(templateObject_18$3||(templateObject_18$3=__makeTemplateObject(["\n && {\n margin-top: ","px;\n button {\n width: 100%;\n }\n\n @media (min-width: ","px) {\n text-align: right;\n button {\n width: initial;\n }\n }\n }\n"],["\n && {\n margin-top: ","px;\n button {\n width: 100%;\n }\n\n @media (min-width: ","px) {\n text-align: right;\n button {\n width: initial;\n }\n }\n }\n"])),spacingS,minScreenSize.medium);var Dates=_styled(DateTimeRange).withConfig({displayName:"EventCard__Dates",componentId:"sc-19skrau-12"})(templateObject_19$3||(templateObject_19$3=__makeTemplateObject(["\n flex: 1;\n font-size: ","px;\n font-weight: 500;\n opacity: ",";\n padding-right: ","px;\n"],["\n flex: 1;\n font-size: ","px;\n font-weight: 500;\n opacity: ",";\n padding-right: ","px;\n"])),fontSizeSmall,function(_a){var isCancelled=_a.isCancelled;return isCancelled?0.4:1;},spacingS);var Locations=_styled(EventLocationInfo).withConfig({displayName:"EventCard__Locations",componentId:"sc-19skrau-13"})(templateObject_20$2||(templateObject_20$2=__makeTemplateObject([""],[""])));var Contacts=_styled(EventPeopleInfo).withConfig({displayName:"EventCard__Contacts",componentId:"sc-19skrau-14"})(templateObject_21$1||(templateObject_21$1=__makeTemplateObject(["\n flex-direction: column;\n"],["\n flex-direction: column;\n"])));var CancelInfo=_styled(EventCancelInformation).withConfig({displayName:"EventCard__CancelInfo",componentId:"sc-19skrau-15"})(templateObject_22$1||(templateObject_22$1=__makeTemplateObject(["\n margin: 0 -","px;\n @media (min-width: ","px) {\n margin: 0;\n }\n"],["\n margin: 0 -","px;\n @media (min-width: ","px) {\n margin: 0;\n }\n"])),spacingM,minScreenSize.medium);var IEFix=createGlobalStyle(templateObject_23$1||(templateObject_23$1=__makeTemplateObject(["\n .browser-name-ie {\n .event-card-dates {\n flex: 1 1 0%;\n flex-basis: 0%;\n }\n }\n"],["\n .browser-name-ie {\n .event-card-dates {\n flex: 1 1 0%;\n flex-basis: 0%;\n }\n }\n"])));var templateObject_1$1_,templateObject_2$1f,templateObject_3$R,templateObject_4$A,templateObject_5$w,templateObject_6$m,templateObject_7$g,templateObject_8$f,templateObject_9$c,templateObject_10$b,templateObject_11$7,templateObject_12$6,templateObject_13$5,templateObject_14$5,templateObject_15$5,templateObject_16$5,templateObject_17$4,templateObject_18$3,templateObject_19$3,templateObject_20$2,templateObject_21$1,templateObject_22$1,templateObject_23$1;function useExternalContentHandler(){var _this=this;var history=useHistory();var onRequestToken=useContext(AuthenticationContext).onRequestToken;var trackExternalItem=useNewsApi().trackExternalItem;var createApiUrl=useApiFactory().createApiUrl;var currentUser=useCurrentUser();var webAppUrls=useSubscriptionWebAppUrls();var _a=useContext(LinkContext),onOpenExternalLink=_a.onOpenExternalLink,tryGetInternalLink=_a.tryGetInternalLink;var refreshUserDetails=useRefreshUserDetails();return function(item,itemType,openInNewTab){return __awaiter(_this,void 0,void 0,function(){var language,externalContentUrl,internalLink,token;return __generator(this,function(_a){switch(_a.label){case 0:if(!(item===null||item===void 0?void 0:item.useExternalContent)){return [2/*return*/,null];}language=getPreferredContentLanguage(currentUser);externalContentUrl=getExternalContentUrl(item,language);if(!externalContentUrl){return [2/*return*/,null];}internalLink=tryGetInternalLink(externalContentUrl,webAppUrls);if(internalLink){// no API redirect; only the unread & page views tracking
122238
122235
  trackExternalItem(item.id,itemType).then(function(){return refreshUserDetails();},logger.error);history.push(internalLink);return [2/*return*/,true];}return [4/*yield*/,onRequestToken()];case 1:token=_a.sent();if(!token){return [2/*return*/,false];}return [4/*yield*/,redirectToExternalContent(item.id,itemType,token,openInNewTab)];case 2:_a.sent();refreshUserDetails();return [2/*return*/,true];}});});};function redirectToExternalContent(itemId,itemType,token,openNewTab){return __awaiter(this,void 0,void 0,function(){var apiExternalContentRedirectRoute;return __generator(this,function(_a){switch(_a.label){case 0:apiExternalContentRedirectRoute=createApiUrl("/"+itemType+"/"+encodeURIComponent(itemId)+"/external_url",{access_token:token});return [4/*yield*/,onOpenExternalLink(apiExternalContentRedirectRoute,openNewTab)];case 1:_a.sent();return [2/*return*/];}});});}}function useExternalContentClickHandler(){var _this=this;var handleExternalContent=useExternalContentHandler();return function(e,item,itemType){return __awaiter(_this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:if(!item.useExternalContent){return [2/*return*/];}e.stopPropagation();e.preventDefault();return [4/*yield*/,handleExternalContent(item,itemType,true)];case 1:_a.sent();return [2/*return*/];}});});};}function useExternalContentRedirectHandler(item,resourceType,noRedirect){var _this=this;var handleExternalContent=useExternalContentHandler();useEffect$1(function(){if(noRedirect){return;}(function(){return __awaiter(_this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,handleExternalContent(item,resourceType)];case 1:return [2/*return*/,_a.sent()];}});});})();// eslint-disable-next-line react-hooks/exhaustive-deps
122239
122236
  },[item===null||item===void 0?void 0:item.id]);}function usePagesClickHandler(){var user=useCurrentUser();var userToken=useCurrentToken();var onOpenExternalLink=useContext(LinkContext).onOpenExternalLink;var getDocumentFileUrl=usePagesApi().getDocumentFileUrl;var createApiUrl=useApiFactory().createApiUrl;var handleExternalContent=useExternalContentHandler();var _a=useFileAccessTokenApi(),exchangeShortLivedToken=_a.exchangeShortLivedToken,getPublishableItemShortLivedToken=_a.getPublishableItemShortLivedToken,createDownloadClickHandler=_a.createDownloadClickHandler;return useMemo(function(){return {createPageClickHandler:createPageClickHandler,createDocumentClickHandler:createDocumentClickHandler};// eslint-disable-next-line react-hooks/exhaustive-deps
122240
122237
  },[user.subscription.id,userToken,getDocumentFileUrl,handleExternalContent]);function createPageClickHandler(page,basePath,additionalOnClick,ignoreExternalContent){var _this=this;if(!page.useExternalContent||// we don't want the editor view to open the external page
@@ -122249,18 +122246,18 @@ return nodes.slice().sort(function(a,b){return compareRootPages(groupPositions,a
122249
122246
  // we just use the id for that, because this one is always different
122250
122247
  var fallbackCompare=function fallbackCompare(){var _a;return ((_a=a.id)===null||_a===void 0?void 0:_a.localeCompare(b===null||b===void 0?void 0:b.id))||0;};if(firstGroupIdOfA===firstGroupIdOfB){return a.position-b.position||fallbackCompare();}return groupPositions[firstGroupIdOfA]-groupPositions[firstGroupIdOfB]||fallbackCompare();}function useInlinePageDocument(documentData,page,basePath){if(basePath===void 0){basePath='pages';}var extension=documentData.extension,fileId=documentData.fileId,originalFileName=documentData.fileName,pageId=documentData.pageId,originalTitle=documentData.title;var user=useCurrentUser();var formatMessage=useIntl().formatMessage;var buildPath=useSubscriptionHandlePathBuilder().buildPath;var createDocumentClickHandler=usePagesClickHandler().createDocumentClickHandler;var _a=useMemo(function(){var iconName=getFileIconByExtension(extension);var fileUrl=NewsService.getNewsRoute(buildPath(basePath),pageId,null);return {iconName:iconName,fileUrl:fileUrl};// eslint-disable-next-line react-hooks/exhaustive-deps
122251
122248
  },[extension,pageId]),fileUrl=_a.fileUrl,iconName=_a.iconName;var _b=useMemo(function(){if(!(page===null||page===void 0?void 0:page.id)){return {title:originalTitle,fileName:originalFileName};}var _a=getFileInfo(page,user),fileInfo=_a.fileInfo,language=_a.language;var onPageDocumentDownloadClick=createDocumentClickHandler(pageId,fileId,language,fileInfo.shouldOpenInBrowser,page.fileAccessToken,basePath);return {title:getTitle(page,user,formatMessage,language),fileName:fileInfo.fileName,onPageDocumentDownloadClick:onPageDocumentDownloadClick};// eslint-disable-next-line react-hooks/exhaustive-deps
122252
- },[page===null||page===void 0?void 0:page.id,createDocumentClickHandler]),fileName=_b.fileName,title=_b.title,onPageDocumentDownloadClick=_b.onPageDocumentDownloadClick;return {fileUrl:fileUrl,iconName:iconName,fileName:fileName,title:title,onPageDocumentDownloadClick:onPageDocumentDownloadClick};}function getFileInfo(page,user){var _a=getContentForPage(page,user),content=_a.content,language=_a.language;return {fileInfo:content===null||content===void 0?void 0:content.fileInfo,language:language};}function getContentForPage(page,user){var language=getLanguageForPage(page,user);return {content:page.contents[language],language:language};}function getLanguageForPage(page,user){if(!user||!page||!page.contents||!user.subscription){return null;}var language=NewsService.getLanguageForContent(page.contents,user,function(c){var _a;return page.pageType!==PageType.Document||((_a=c.fileInfo)===null||_a===void 0?void 0:_a.fileId)!=null;});if(language){return language;}return NewsService.getLanguageForContent(page.contents,user);}function convertToNavigationNode(page){var _a,_b,_c,_d;var parent=(_b=(_a=page===null||page===void 0?void 0:page.navigationContext)===null||_a===void 0?void 0:_a.parent)!==null&&_b!==void 0?_b:{id:page.parentId,contents:{}};return {id:page.id,pageType:page.pageType,parent:parent,position:page.position,status:page.status,groupIds:page.groupIds,hasHiddenAncestor:page.hasHiddenAncestor,isUnlinked:page.isUnlinked,hasPublishedVersion:page.isCurrentPublishedVersion||!!page.publishedVersionId,contents:Object.values(page.contents||{}).filter(function(c){return c.active;}).reduce(function(acc,next){acc[next.language]=next;return acc;},{}),firstChildId:page.firstChildId||((_d=(_c=page.navigationContext)===null||_c===void 0?void 0:_c.children)===null||_d===void 0?void 0:_d[0].id),children:undefined,isSearchMatch:undefined,hasAnyPageChild:undefined,useExternalContent:page.useExternalContent,topLevelFolderName:undefined,uploadToken:undefined};}var HostBaseStyle=function HostBaseStyle(backgroundColor){return css$2(templateObject_3$O||(templateObject_3$O=__makeTemplateObject(["\n ","\n\n display: flex;\n width: 100%;\n "],["\n ","\n\n display: flex;\n width: 100%;\n "])),function(p){return backgroundColor?css$2(templateObject_1$1X||(templateObject_1$1X=__makeTemplateObject(["\n background-color: ",";\n "],["\n background-color: ",";\n "])),backgroundColor||p.theme.palette.white):css$2(templateObject_2$1c||(templateObject_2$1c=__makeTemplateObject(["\n ",";\n background-color: ",";\n "],["\n ",";\n background-color: ",";\n "])),CardBorderInline(2,2),p.theme.palette.white);});};var ContentStyle=css$2(templateObject_4$z||(templateObject_4$z=__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n font-size: ","px;\n"],["\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n font-size: ","px;\n"])),fontSizeMedium);var MetaInfoStyle=function MetaInfoStyle(marginBottomOnEmpty){return css$2(templateObject_5$v||(templateObject_5$v=__makeTemplateObject(["\n font-size: ","px;\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n\n &:empty {\n margin-bottom: ","px;\n }\n"],["\n font-size: ","px;\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n\n &:empty {\n margin-bottom: ","px;\n }\n"])),fontSizeSmall,marginBottomOnEmpty||spacingM);};var BorderRadiusStyle=function BorderRadiusStyle(roundedCornerSize,rightSideOnly){var radius=roundedCornerSize||inlinePageBannerRoundedCornerSize;return css$2(templateObject_8$e||(templateObject_8$e=__makeTemplateObject(["\n ","\n "],["\n ","\n "])),rightSideOnly?css$2(templateObject_6$l||(templateObject_6$l=__makeTemplateObject(["\n border-top-right-radius: ","px;\n border-bottom-right-radius: ","px;\n "],["\n border-top-right-radius: ","px;\n border-bottom-right-radius: ","px;\n "])),radius,radius):css$2(templateObject_7$f||(templateObject_7$f=__makeTemplateObject(["\n border-radius: ","px;\n "],["\n border-radius: ","px;\n "])),radius));};var templateObject_1$1X,templateObject_2$1c,templateObject_3$O,templateObject_4$z,templateObject_5$v,templateObject_6$l,templateObject_7$f,templateObject_8$e;var ExternalContentIcon=function ExternalContentIcon(_a){var tooltipResourceKey=_a.tooltipResourceKey,tooltipResourceValues=_a.tooltipResourceValues,className=_a.className;return jsx$1(StyledTooltip$2,__assign({className:className,resourceKey:tooltipResourceKey,values:{url:tooltipResourceValues},width:400},{children:jsx$1(StyledIcon$5,{iconName:"NavigateExternalInline","data-external-content":true},void 0)}),void 0);};var StyledTooltip$2=_styled(Tooltip).withConfig({displayName:"ExternalContentIcon__StyledTooltip",componentId:"sc-8h84ua-0"})(templateObject_1$1W||(templateObject_1$1W=__makeTemplateObject(["\n display: inline-flex;\n z-index: 1;\n"],["\n display: inline-flex;\n z-index: 1;\n"])));var StyledIcon$5=_styled(Icon).withConfig({displayName:"ExternalContentIcon__StyledIcon",componentId:"sc-8h84ua-1"})(templateObject_2$1b||(templateObject_2$1b=__makeTemplateObject(["\n margin-left: ","px;\n"],["\n margin-left: ","px;\n"])),spacingXs);var templateObject_1$1W,templateObject_2$1b;var Title$7=function Title(_a){var title=_a.title,targetRoute=_a.targetRoute,readOnly=_a.readOnly,openTargetInNewWindow=_a.openTargetInNewWindow,isDownloadLink=_a.isDownloadLink,isExternalContent=_a.isExternalContent,onClick=_a.onClick,resourceKey=_a.resourceKey,resourceValues=_a.resourceValues,className=_a.className;return jsx$1(TitleHost,__assign({className:className,"data-title":true},{children:readOnly?jsx$1("span",{children:title},void 0):isDownloadLink?jsx$1("a",__assign({href:targetRoute,rel:"noopener noreferrer",onClick:onClick},{children:jsx$1("span",{children:title},void 0)}),void 0):openTargetInNewWindow?jsxs("a",__assign({href:targetRoute,target:"_blank",rel:"noopener noreferrer",onClick:onClick},{children:[jsx$1("span",{children:title},void 0),isExternalContent&&jsx$1(ExternalContentIcon,{tooltipResourceKey:resourceKey,tooltipResourceValues:resourceValues},void 0)]}),void 0):jsxs(Link$4,__assign({to:targetRoute,onClick:onClick},{children:[jsx$1("span",{children:title},void 0),isExternalContent&&jsx$1(ExternalContentIcon,{tooltipResourceKey:resourceKey,tooltipResourceValues:resourceValues},void 0)]}),void 0)}),void 0);};var TitleHost=_styled.h3.withConfig({displayName:"Title__TitleHost",componentId:"sc-1wpb7iz-0"})(templateObject_1$1V||(templateObject_1$1V=__makeTemplateObject(["\n font-size: ","px;\n\n &&& {\n margin: 0 0 ","px 0;\n\n a {\n &,\n :link,\n :visited {\n color: ",";\n text-decoration: none;\n z-index: 1;\n }\n\n > span {\n z-index: 1;\n }\n }\n }\n"],["\n font-size: ","px;\n\n &&& {\n margin: 0 0 ","px 0;\n\n a {\n &,\n :link,\n :visited {\n color: ",";\n text-decoration: none;\n z-index: 1;\n }\n\n > span {\n z-index: 1;\n }\n }\n }\n"])),fontSizeMedium,spacingS,function(p){return p.theme.textColors.default;});var templateObject_1$1V;function getBreadcrumbsItems(page,target,handleOnClick,getTitle,formatMessage,hideCurrentPageNode,hideHomeNode){var ancestors=[];var parent=page.navigationContext.parent;while(parent!=null&&parent.id!=null){ancestors.unshift({title:getTitle(parent),id:parent.id});parent=parent.parent;}var parentNode=ancestors.find(function(a){return a.id===page.parentId;});var items=hideHomeNode?[]:[{key:'home',text:formatMessage({id:'Generic.home'}),href:target}];var ancestorItems=ancestors.map(function(node){return {key:node.id,text:node.title,href:NewsService.getNewsRoute(target,node.id,node.title),onClick:handleOnClick};});if(hideCurrentPageNode){return {breadcrumbItems:__spreadArray(__spreadArray([],items),ancestorItems),ancestors:ancestors,parentNode:parentNode};}var currentItem={key:'current',text:getTitle(page),isCurrentItem:true};return {breadcrumbItems:__spreadArray(__spreadArray(__spreadArray([],items),ancestorItems),[currentItem]),ancestors:ancestors,parentNode:parentNode};}var ListItemBreadcrumb=function ListItemBreadcrumb(_a){var page=_a.page,languageOverride=_a.language,className=_a.className;var user=useCurrentUser();var formatMessage=useIntl().formatMessage;if(!page||!page.navigationContext){return null;}var breadcrumbItems=getBreadcrumbsItems(page,null,function(){},function(page){return getTitle(page,user,formatMessage,languageOverride);},formatMessage,true,true).breadcrumbItems;return jsx$1(Host$K,__assign({className:className},{children:breadcrumbItems.map(function(b,i){return jsxs(Fragment$1,{children:[i!==0&&jsx$1(RightChevronIcon,{iconName:"ChevronRight"},void 0),jsx$1("span",{children:b.text},void 0)]},b.key);})}),void 0);};var Host$K=_styled.p.withConfig({displayName:"ListItemBreadcrumb__Host",componentId:"sc-c9uoz1-0"})(templateObject_1$1U||(templateObject_1$1U=__makeTemplateObject(["\n padding: 0;\n margin: ","px 0 0;\n font-size: ","px;\n\n color: ",";\n text-align: start;\n\n > span,\n i {\n vertical-align: middle;\n line-height: 1;\n }\n"],["\n padding: 0;\n margin: ","px 0 0;\n font-size: ","px;\n\n color: ",";\n text-align: start;\n\n > span,\n i {\n vertical-align: middle;\n line-height: 1;\n }\n"])),spacingXxs,fontSizeSmall,function(p){return p.theme.palette.neutralTertiary;});var RightChevronIcon=_styled(Icon).withConfig({displayName:"ListItemBreadcrumb__RightChevronIcon",componentId:"sc-c9uoz1-1"})(templateObject_2$1a||(templateObject_2$1a=__makeTemplateObject(["\n &&& {\n font-weight: bold;\n margin: 0 ","px;\n font-size: ","px;\n }\n"],["\n &&& {\n font-weight: bold;\n margin: 0 ","px;\n font-size: ","px;\n }\n"])),spacingXxs,fontSizeSmaller-2);var templateObject_1$1U,templateObject_2$1a;var PageItemTile=function PageItemTile(_a){var _b,_c;var item=_a.item,baseRoute=_a.baseRoute,filterBaseUrl=_a.filterBaseUrl,styleDefinition=_a.styleDefinition,readOnly=_a.readOnly,additionalMetadata=_a.additionalMetadata,buttons=_a.buttons,additionalContent=_a.additionalContent,showBannerPlaceholder=_a.showBannerPlaceholder,showBreadcrumb=_a.showBreadcrumb,showIntro=_a.showIntro,className=_a.className;var user=useCurrentUserContext().user;var intl=useIntl();var createPageClickHandler=usePagesClickHandler().createPageClickHandler;var title=getTitle(item,user,intl.formatMessage);var language=getLanguageForPage(item,user);var content=item.contents[language];var hasKeywords=Object.keys((_b=item.keywords)!==null&&_b!==void 0?_b:[]).length>0;var targetRoute=NewsService.getNewsRoute(baseRoute,item.id,title);var clickHandler=createPageClickHandler(item);var isDocument=item.pageType===PageType.Document;var isEditor=baseRoute.includes('/editor');var preferredContentLanguage=getPreferredContentLanguage(user);var url=item.useExternalContent&&getExternalContentUrl(item,preferredContentLanguage);return jsxs(Host$J,__assign({"data-item-id":item.id,className:className},{children:[!readOnly&&jsx$1(ClickableOverlay,{itemId:item.id,itemType:ItemResourceTypes.Pages,baseRoute:baseRoute,title:title,isExternalContent:item.useExternalContent},void 0),jsxs(Inner$3$1,__assign({styleDefinition:styleDefinition,hasBanner:item.bannerInfo!=null||showBannerPlaceholder||isDocument},{children:[jsx$1(Banner$2,{item:item,language:language,bannerDefaultWidth:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.bannerDefaultWidth,applyRoundedCorners:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.applyRoundedCorners,showBannerPlaceholder:showBannerPlaceholder,isEditor:isEditor,bannerFontSize:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.bannerFontSize},void 0),jsxs(Content$6,__assign({padding:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.contentPadding,"data-page-tile-content":true},{children:[jsxs(MetaInfo$3,__assign({paddingRight:showBreadcrumb&&!isDocument&&readOnly?spacingM:0},{children:[showBreadcrumb&&jsx$1(StyledListItemBreadcrumb,{page:item},void 0),!showBreadcrumb&&item.modified&&jsx$1(DateTime,{value:item.modified},void 0),additionalMetadata]}),void 0),jsxs(MainContent,{children:[jsxs(TitleAndIntro,__assign({addDownloadButtonSafetySpace:isDocument},{children:[jsx$1(StyledTitle$1,{title:title,targetRoute:targetRoute,readOnly:readOnly,onClick:clickHandler,fontSize:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.titleFontSize,margin:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.titleMargin,isExternalContent:item.useExternalContent,resourceKey:item.useExternalContent?'ExternalLinkButton.pages.navigateTo':undefined,resourceValues:url!==null&&url!==void 0?url:undefined},void 0),showIntro&&((_c=content.intro)===null||_c===void 0?void 0:_c.length)>0&&jsx$1(Intro$2,{children:content.intro},void 0)]}),void 0),additionalContent]},void 0),hasKeywords&&jsx$1(Keywords$2,{children:jsx$1(FlatKeywords,{item:item,filterBaseUrl:filterBaseUrl},void 0)},void 0),buttons&&jsx$1(Buttons$2,{children:buttons},void 0)]}),void 0)]}),void 0)]}),void 0);};var StyledTitle$1=_styled(Title$7).withConfig({displayName:"PageItemTile__StyledTitle",componentId:"sc-lcm8k6-0"})(templateObject_5$u||(templateObject_5$u=__makeTemplateObject(["\n // for embedded pages we do not pass in a custom font size and we want to truncate the title to 2 lines\n ","\n\n ",";\n\n ",";\n\n display: inline-block;\n max-width: 100%;\n\n a:focus {\n outline-offset: 0 !important;\n }\n"],["\n // for embedded pages we do not pass in a custom font size and we want to truncate the title to 2 lines\n ","\n\n ",";\n\n ",";\n\n display: inline-block;\n max-width: 100%;\n\n a:focus {\n outline-offset: 0 !important;\n }\n"])),function(p){return !p.fontSize&&css$2(templateObject_1$1T||(templateObject_1$1T=__makeTemplateObject(["\n a {\n display: inline-flex;\n }\n\n span {\n ","\n }\n "],["\n a {\n display: inline-flex;\n }\n\n span {\n ","\n }\n "])),LineClamp(2,fontSizeMedium,1.4));},function(p){return p.fontSize&&css$2(templateObject_2$19||(templateObject_2$19=__makeTemplateObject(["\n &&& {\n font-size: ","px;\n line-height: 20px;\n\n i[data-external-content] {\n font-size: ","px;\n line-height: ","px;\n }\n }\n\n a {\n display: inline-flex;\n max-width: 100%;\n }\n\n span {\n // we pass a custom font size (smaller) for inline page lists and here we want to keep the title to single line\n display: block;\n max-width: 100%;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n "],["\n &&& {\n font-size: ","px;\n line-height: 20px;\n\n i[data-external-content] {\n font-size: ","px;\n line-height: ","px;\n }\n }\n\n a {\n display: inline-flex;\n max-width: 100%;\n }\n\n span {\n // we pass a custom font size (smaller) for inline page lists and here we want to keep the title to single line\n display: block;\n max-width: 100%;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n "])),p.fontSize,fontSizeNormal,fontSizeNormal);},function(p){return p.margin?css$2(templateObject_3$N||(templateObject_3$N=__makeTemplateObject(["\n margin: "," !important;\n "],["\n margin: "," !important;\n "])),p.margin):css$2(templateObject_4$y||(templateObject_4$y=__makeTemplateObject(["\n margin: 0 !important;\n "],["\n margin: 0 !important;\n "])));});var Intro$2=_styled.div.withConfig({displayName:"PageItemTile__Intro",componentId:"sc-lcm8k6-1"})(templateObject_6$k||(templateObject_6$k=__makeTemplateObject(["\n margin: ","px 0 ","px;\n ","\n"],["\n margin: ","px 0 ","px;\n ","\n"])),spacingXs-1,spacingS+5,LineClamp(10,fontSizeSmall,1.4));var Host$J=_styled.article.withConfig({displayName:"PageItemTile__Host",componentId:"sc-lcm8k6-2"})(templateObject_7$e||(templateObject_7$e=__makeTemplateObject(["\n position: relative;\n"],["\n position: relative;\n"])));var Inner$3$1=_styled.div.withConfig({displayName:"PageItemTile__Inner",componentId:"sc-lcm8k6-3"})(templateObject_11$6||(templateObject_11$6=__makeTemplateObject(["\n ","\n ","\n ","\n ","\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"],["\n ","\n ","\n ","\n ","\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"])),function(p){var _a;return HostBaseStyle((_a=p.styleDefinition)===null||_a===void 0?void 0:_a.backgroundColor);},function(p){var _a;return ((_a=p.styleDefinition)===null||_a===void 0?void 0:_a.applyRoundedCorners)&&BorderRadiusStyle();},function(p){var _a;return ((_a=p.styleDefinition)===null||_a===void 0?void 0:_a.height)?css$2(templateObject_8$d||(templateObject_8$d=__makeTemplateObject(["\n height: ","px;\n "],["\n height: ","px;\n "])),p.styleDefinition.height):css$2(templateObject_9$b||(templateObject_9$b=__makeTemplateObject(["\n height: auto;\n min-height: 138px;\n "],["\n height: auto;\n min-height: 138px;\n "])));},function(p){var _a;return p.hasBanner&&css$2(templateObject_10$a||(templateObject_10$a=__makeTemplateObject(["\n [data-page-tile-content] {\n max-width: calc(100% - ","px)};\n }\n "],["\n [data-page-tile-content] {\n max-width: calc(100% - ","px)};\n }\n "])),(_a=p.styleDefinition)===null||_a===void 0?void 0:_a.bannerDefaultWidth);});var Content$6=_styled.div.withConfig({displayName:"PageItemTile__Content",componentId:"sc-lcm8k6-4"})(templateObject_14$4||(templateObject_14$4=__makeTemplateObject(["\n ","\n ","\n\n box-sizing: border-box;\n max-width: 100%;\n"],["\n ","\n ","\n\n box-sizing: border-box;\n max-width: 100%;\n"])),ContentStyle,function(p){return p.padding?css$2(templateObject_12$5||(templateObject_12$5=__makeTemplateObject(["\n padding: ",";\n "],["\n padding: ",";\n "])),p.padding):css$2(templateObject_13$4||(templateObject_13$4=__makeTemplateObject(["\n padding: ","px;\n "],["\n padding: ","px;\n "])),spacingM);});var MetaInfo$3=_styled.div.withConfig({displayName:"PageItemTile__MetaInfo",componentId:"sc-lcm8k6-5"})(templateObject_15$4||(templateObject_15$4=__makeTemplateObject(["\n "," /* font-size of date */\n display: inline-flex;\n align-items: center;\n flex-wrap: nowrap;\n color: ",";\n\n padding-left: 2px;\n padding-right: ","px;\n"],["\n "," /* font-size of date */\n display: inline-flex;\n align-items: center;\n flex-wrap: nowrap;\n color: ",";\n\n padding-left: 2px;\n padding-right: ","px;\n"])),MetaInfoStyle(17),function(p){return p.theme.textColors.default;},function(p){return p.paddingRight;});var MainContent=_styled.div.withConfig({displayName:"PageItemTile__MainContent",componentId:"sc-lcm8k6-6"})(templateObject_16$4||(templateObject_16$4=__makeTemplateObject(["\n display: flex;\n align-items: center;\n padding-left: 2px;\n"],["\n display: flex;\n align-items: center;\n padding-left: 2px;\n"])));var DownloadButtonWidth=32;var TitleAndIntro=_styled.div.withConfig({displayName:"PageItemTile__TitleAndIntro",componentId:"sc-lcm8k6-7"})(templateObject_17$3||(templateObject_17$3=__makeTemplateObject(["\n width: calc(\n 100% -\n ","px\n );\n"],["\n width: calc(\n 100% -\n ","px\n );\n"])),function(p){return p.addDownloadButtonSafetySpace?DownloadButtonWidth:0;});var StyledListItemBreadcrumb=_styled(ListItemBreadcrumb).withConfig({displayName:"PageItemTile__StyledListItemBreadcrumb",componentId:"sc-lcm8k6-8"})(templateObject_18$2||(templateObject_18$2=__makeTemplateObject(["\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n &&& {\n // this is needed because draft.js adds a 1rem margin bottom here somehow (because the breadcrumb is a <p> maybe) and it breaks the view\n margin-bottom: 0;\n }\n"],["\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n &&& {\n // this is needed because draft.js adds a 1rem margin bottom here somehow (because the breadcrumb is a <p> maybe) and it breaks the view\n margin-bottom: 0;\n }\n"])));var Keywords$2=_styled.div.withConfig({displayName:"PageItemTile__Keywords",componentId:"sc-lcm8k6-9"})(templateObject_19$2||(templateObject_19$2=__makeTemplateObject(["\n margin-top: auto;\n\n > ul {\n font-size: ","px;\n line-height: 20px;\n height: 20px;\n padding: 0 2px !important;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n && {\n a:link,\n a:visited {\n color: "," !important;\n\n &:focus {\n outline-offset: 0 !important;\n }\n }\n }\n"],["\n margin-top: auto;\n\n > ul {\n font-size: ","px;\n line-height: 20px;\n height: 20px;\n padding: 0 2px !important;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n && {\n a:link,\n a:visited {\n color: "," !important;\n\n &:focus {\n outline-offset: 0 !important;\n }\n }\n }\n"])),fontSizeSmall,function(p){return p.theme.palette.neutralSecondaryAlt;});var Buttons$2=_styled.div.withConfig({displayName:"PageItemTile__Buttons",componentId:"sc-lcm8k6-10"})(templateObject_20$1||(templateObject_20$1=__makeTemplateObject(["\n display: flex;\n align-items: center;\n padding-top: ","px;\n margin-top: auto;\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"],["\n display: flex;\n align-items: center;\n padding-top: ","px;\n margin-top: auto;\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"])),spacingS);var Banner$2=function Banner(_a){var _b,_c;var item=_a.item,language=_a.language,bannerDefaultWidth=_a.bannerDefaultWidth,bannerFontSize=_a.bannerFontSize,applyRoundedCorners=_a.applyRoundedCorners,showBannerPlaceholder=_a.showBannerPlaceholder,isEditor=_a.isEditor;var bannerInfo=item.bannerInfo;var isDocument=item.pageType===PageType.Document;var fileIcon=getFileIconByExtension(((_c=(_b=item.contents[language])===null||_b===void 0?void 0:_b.fileInfo)===null||_c===void 0?void 0:_c.extension)||'');if(isDocument){return jsx$1(BannerHost$1,__assign({defaultWidth:bannerDefaultWidth,applyRoundedCorners:applyRoundedCorners},{children:jsx$1(FileIcon$1,{iconName:fileIcon,fontSize:bannerFontSize,color:getIconColor(fileIcon)},void 0)}),void 0);}if(!bannerInfo&&!showBannerPlaceholder){return null;}if(bannerDefaultWidth<100){return jsx$1(SmallBannerWrapper,__assign({defaultWidth:bannerDefaultWidth,applyRoundedCorners:applyRoundedCorners},{children:jsx$1(PublishableItemBanner,{itemId:item.id,bannerInfo:bannerInfo,useEditorRoutes:isEditor,width:200,token:item.fileAccessToken,resourceType:ItemResourceTypes.Pages},void 0)}),void 0);}return jsx$1("div",{children:jsx$1(LargeBannerWrapper,__assign({defaultWidth:bannerDefaultWidth,applyRoundedCorners:applyRoundedCorners},{children:jsx$1(PublishableItemBanner,{itemId:item.id,bannerInfo:bannerInfo,useEditorRoutes:isEditor,width:450,token:item.fileAccessToken,resourceType:ItemResourceTypes.Pages},void 0)}),void 0)},void 0);};var BannerHost$1=_styled.div.withConfig({displayName:"PageItemTile__BannerHost",componentId:"sc-lcm8k6-11"})(templateObject_23$2||(templateObject_23$2=__makeTemplateObject(["\n display: flex;\n width: ","px;\n justify-content: center;\n align-items: center;\n background-color: ",";\n\n ","\n\n @media (max-width: ","px) {\n ","\n }\n"],["\n display: flex;\n width: ","px;\n justify-content: center;\n align-items: center;\n background-color: ",";\n\n ","\n\n @media (max-width: ","px) {\n ","\n }\n"])),function(p){return p.defaultWidth;},function(p){return p.theme.palette.neutralQuaternaryAlt;},function(p){return p.applyRoundedCorners&&css$2(templateObject_21$2||(templateObject_21$2=__makeTemplateObject(["\n ","\n overflow: hidden;\n /* fix for iOS and Safari: overflow: hidden with border-radius */\n transform: translateZ(0);\n "],["\n ","\n overflow: hidden;\n /* fix for iOS and Safari: overflow: hidden with border-radius */\n transform: translateZ(0);\n "])),BorderRadiusStyle(5));},maxScreenSize.medium,function(p){return p.defaultWidth>100&&css$2(templateObject_22$2||(templateObject_22$2=__makeTemplateObject(["\n width: auto;\n height: 100px;\n "],["\n width: auto;\n height: 100px;\n "])));});var FileIcon$1=_styled(Icon).withConfig({displayName:"PageItemTile__FileIcon",componentId:"sc-lcm8k6-12"})(templateObject_24$1||(templateObject_24$1=__makeTemplateObject(["\n font-size: ","px;\n color: ",";\n"],["\n font-size: ","px;\n color: ",";\n"])),function(p){return p.fontSize||30;},function(p){return p.color||p.theme.textColors.default;});var SmallBannerWrapper=_styled.div.withConfig({displayName:"PageItemTile__SmallBannerWrapper",componentId:"sc-lcm8k6-13"})(templateObject_26$1||(templateObject_26$1=__makeTemplateObject(["\n background-color: ",";\n\n width: ","px;\n height: 100%;\n\n .video-view-container {\n height: 100%;\n }\n\n &&& .video-icon {\n font-size: 35px;\n margin: 0;\n }\n\n ","\n"],["\n background-color: ",";\n\n width: ","px;\n height: 100%;\n\n .video-view-container {\n height: 100%;\n }\n\n &&& .video-icon {\n font-size: 35px;\n margin: 0;\n }\n\n ","\n"])),function(p){return p.theme.palette.accent;},function(p){return p.defaultWidth;},function(p){return p.applyRoundedCorners&&css$2(templateObject_25$1||(templateObject_25$1=__makeTemplateObject(["\n ","\n overflow: hidden;\n /* fix for iOS and Safari: overflow: hidden with border-radius */\n transform: translateZ(0);\n "],["\n ","\n overflow: hidden;\n /* fix for iOS and Safari: overflow: hidden with border-radius */\n transform: translateZ(0);\n "])),BorderRadiusStyle(5));});var LargeBannerWrapper=_styled(LeftBannerWrapper).withConfig({displayName:"PageItemTile__LargeBannerWrapper",componentId:"sc-lcm8k6-14"})(templateObject_28$1||(templateObject_28$1=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),function(p){return p.applyRoundedCorners&&css$2(templateObject_27$1||(templateObject_27$1=__makeTemplateObject(["\n ","\n overflow: hidden;\n /* fix for iOS and Safari: overflow: hidden with border-radius */\n transform: translateZ(0);\n "],["\n ","\n overflow: hidden;\n /* fix for iOS and Safari: overflow: hidden with border-radius */\n transform: translateZ(0);\n "])),BorderRadiusStyle(5,true));});var templateObject_1$1T,templateObject_2$19,templateObject_3$N,templateObject_4$y,templateObject_5$u,templateObject_6$k,templateObject_7$e,templateObject_8$d,templateObject_9$b,templateObject_10$a,templateObject_11$6,templateObject_12$5,templateObject_13$4,templateObject_14$4,templateObject_15$4,templateObject_16$4,templateObject_17$3,templateObject_18$2,templateObject_19$2,templateObject_20$1,templateObject_21$2,templateObject_22$2,templateObject_23$2,templateObject_24$1,templateObject_25$1,templateObject_26$1,templateObject_27$1,templateObject_28$1;var global$1=global$m;var trim=stringTrim$1.trim;var whitespaces$4=whitespaces$3;var $parseInt=global$1.parseInt;var hex=/^[+-]?0[Xx]/;var FORCED=$parseInt(whitespaces$4+'08')!==8||$parseInt(whitespaces$4+'0x16')!==22;// `parseInt` method
122249
+ },[page===null||page===void 0?void 0:page.id,createDocumentClickHandler]),fileName=_b.fileName,title=_b.title,onPageDocumentDownloadClick=_b.onPageDocumentDownloadClick;return {fileUrl:fileUrl,iconName:iconName,fileName:fileName,title:title,onPageDocumentDownloadClick:onPageDocumentDownloadClick};}function getFileInfo(page,user){var _a=getContentForPage(page,user),content=_a.content,language=_a.language;return {fileInfo:content===null||content===void 0?void 0:content.fileInfo,language:language};}function getContentForPage(page,user){var language=getLanguageForPage(page,user);return {content:page.contents[language],language:language};}function getLanguageForPage(page,user){if(!user||!page||!page.contents||!user.subscription){return null;}var language=NewsService.getLanguageForContent(page.contents,user,function(c){var _a;return page.pageType!==PageType.Document||((_a=c.fileInfo)===null||_a===void 0?void 0:_a.fileId)!=null;});if(language){return language;}return NewsService.getLanguageForContent(page.contents,user);}function convertToNavigationNode(page){var _a,_b,_c,_d;var parent=(_b=(_a=page===null||page===void 0?void 0:page.navigationContext)===null||_a===void 0?void 0:_a.parent)!==null&&_b!==void 0?_b:{id:page.parentId,contents:{}};return {id:page.id,pageType:page.pageType,parent:parent,position:page.position,status:page.status,groupIds:page.groupIds,hasHiddenAncestor:page.hasHiddenAncestor,isUnlinked:page.isUnlinked,hasPublishedVersion:page.isCurrentPublishedVersion||!!page.publishedVersionId,contents:Object.values(page.contents||{}).filter(function(c){return c.active;}).reduce(function(acc,next){acc[next.language]=next;return acc;},{}),firstChildId:page.firstChildId||((_d=(_c=page.navigationContext)===null||_c===void 0?void 0:_c.children)===null||_d===void 0?void 0:_d[0].id),children:undefined,isSearchMatch:undefined,hasAnyPageChild:undefined,useExternalContent:page.useExternalContent,topLevelFolderName:undefined,uploadToken:undefined};}var HostBaseStyle=function HostBaseStyle(backgroundColor){return css$2(templateObject_3$Q||(templateObject_3$Q=__makeTemplateObject(["\n ","\n\n display: flex;\n width: 100%;\n "],["\n ","\n\n display: flex;\n width: 100%;\n "])),function(p){return backgroundColor?css$2(templateObject_1$1Z||(templateObject_1$1Z=__makeTemplateObject(["\n background-color: ",";\n "],["\n background-color: ",";\n "])),backgroundColor||p.theme.palette.white):css$2(templateObject_2$1e||(templateObject_2$1e=__makeTemplateObject(["\n ",";\n background-color: ",";\n "],["\n ",";\n background-color: ",";\n "])),CardBorderInline(2,2),p.theme.palette.white);});};var ContentStyle=css$2(templateObject_4$z||(templateObject_4$z=__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n font-size: ","px;\n"],["\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n font-size: ","px;\n"])),fontSizeMedium);var MetaInfoStyle=function MetaInfoStyle(marginBottomOnEmpty){return css$2(templateObject_5$v||(templateObject_5$v=__makeTemplateObject(["\n font-size: ","px;\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n\n &:empty {\n margin-bottom: ","px;\n }\n"],["\n font-size: ","px;\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n\n &:empty {\n margin-bottom: ","px;\n }\n"])),fontSizeSmall,marginBottomOnEmpty||spacingM);};var BorderRadiusStyle=function BorderRadiusStyle(roundedCornerSize,rightSideOnly){var radius=roundedCornerSize||inlinePageBannerRoundedCornerSize;return css$2(templateObject_8$e||(templateObject_8$e=__makeTemplateObject(["\n ","\n "],["\n ","\n "])),rightSideOnly?css$2(templateObject_6$l||(templateObject_6$l=__makeTemplateObject(["\n border-top-right-radius: ","px;\n border-bottom-right-radius: ","px;\n "],["\n border-top-right-radius: ","px;\n border-bottom-right-radius: ","px;\n "])),radius,radius):css$2(templateObject_7$f||(templateObject_7$f=__makeTemplateObject(["\n border-radius: ","px;\n "],["\n border-radius: ","px;\n "])),radius));};var templateObject_1$1Z,templateObject_2$1e,templateObject_3$Q,templateObject_4$z,templateObject_5$v,templateObject_6$l,templateObject_7$f,templateObject_8$e;var ExternalContentIcon=function ExternalContentIcon(_a){var tooltipResourceKey=_a.tooltipResourceKey,tooltipResourceValues=_a.tooltipResourceValues,className=_a.className;return jsx$1(StyledTooltip$2,__assign({className:className,resourceKey:tooltipResourceKey,values:{url:tooltipResourceValues},width:400},{children:jsx$1(StyledIcon$5,{iconName:"NavigateExternalInline","data-external-content":true},void 0)}),void 0);};var StyledTooltip$2=_styled(Tooltip).withConfig({displayName:"ExternalContentIcon__StyledTooltip",componentId:"sc-8h84ua-0"})(templateObject_1$1Y||(templateObject_1$1Y=__makeTemplateObject(["\n display: inline-flex;\n z-index: 1;\n"],["\n display: inline-flex;\n z-index: 1;\n"])));var StyledIcon$5=_styled(Icon).withConfig({displayName:"ExternalContentIcon__StyledIcon",componentId:"sc-8h84ua-1"})(templateObject_2$1d||(templateObject_2$1d=__makeTemplateObject(["\n margin-left: ","px;\n"],["\n margin-left: ","px;\n"])),spacingXs);var templateObject_1$1Y,templateObject_2$1d;var Title$8=function Title(_a){var title=_a.title,targetRoute=_a.targetRoute,readOnly=_a.readOnly,openTargetInNewWindow=_a.openTargetInNewWindow,isDownloadLink=_a.isDownloadLink,isExternalContent=_a.isExternalContent,onClick=_a.onClick,resourceKey=_a.resourceKey,resourceValues=_a.resourceValues,className=_a.className;return jsx$1(TitleHost,__assign({className:className,"data-title":true},{children:readOnly?jsx$1("span",{children:title},void 0):isDownloadLink?jsx$1("a",__assign({href:targetRoute,rel:"noopener noreferrer",onClick:onClick},{children:jsx$1("span",{children:title},void 0)}),void 0):openTargetInNewWindow?jsxs("a",__assign({href:targetRoute,target:"_blank",rel:"noopener noreferrer",onClick:onClick},{children:[jsx$1("span",{children:title},void 0),isExternalContent&&jsx$1(ExternalContentIcon,{tooltipResourceKey:resourceKey,tooltipResourceValues:resourceValues},void 0)]}),void 0):jsxs(Link$4,__assign({to:targetRoute,onClick:onClick},{children:[jsx$1("span",{children:title},void 0),isExternalContent&&jsx$1(ExternalContentIcon,{tooltipResourceKey:resourceKey,tooltipResourceValues:resourceValues},void 0)]}),void 0)}),void 0);};var TitleHost=_styled.h3.withConfig({displayName:"Title__TitleHost",componentId:"sc-1wpb7iz-0"})(templateObject_1$1X||(templateObject_1$1X=__makeTemplateObject(["\n font-size: ","px;\n\n &&& {\n margin: 0 0 ","px 0;\n\n a {\n &,\n :link,\n :visited {\n color: ",";\n text-decoration: none;\n z-index: 1;\n }\n\n > span {\n z-index: 1;\n }\n }\n }\n"],["\n font-size: ","px;\n\n &&& {\n margin: 0 0 ","px 0;\n\n a {\n &,\n :link,\n :visited {\n color: ",";\n text-decoration: none;\n z-index: 1;\n }\n\n > span {\n z-index: 1;\n }\n }\n }\n"])),fontSizeMedium,spacingS,function(p){return p.theme.textColors.default;});var templateObject_1$1X;function getBreadcrumbsItems(page,target,handleOnClick,getTitle,formatMessage,hideCurrentPageNode,hideHomeNode){var ancestors=[];var parent=page.navigationContext.parent;while(parent!=null&&parent.id!=null){ancestors.unshift({title:getTitle(parent),id:parent.id});parent=parent.parent;}var parentNode=ancestors.find(function(a){return a.id===page.parentId;});var items=hideHomeNode?[]:[{key:'home',text:formatMessage({id:'Generic.home'}),href:target}];var ancestorItems=ancestors.map(function(node){return {key:node.id,text:node.title,href:NewsService.getNewsRoute(target,node.id,node.title),onClick:handleOnClick};});if(hideCurrentPageNode){return {breadcrumbItems:__spreadArray(__spreadArray([],items),ancestorItems),ancestors:ancestors,parentNode:parentNode};}var currentItem={key:'current',text:getTitle(page),isCurrentItem:true};return {breadcrumbItems:__spreadArray(__spreadArray(__spreadArray([],items),ancestorItems),[currentItem]),ancestors:ancestors,parentNode:parentNode};}var ListItemBreadcrumb=function ListItemBreadcrumb(_a){var page=_a.page,languageOverride=_a.language,className=_a.className;var user=useCurrentUser();var formatMessage=useIntl().formatMessage;if(!page||!page.navigationContext){return null;}var breadcrumbItems=getBreadcrumbsItems(page,null,function(){},function(page){return getTitle(page,user,formatMessage,languageOverride);},formatMessage,true,true).breadcrumbItems;return jsx$1(Host$L,__assign({className:className},{children:breadcrumbItems.map(function(b,i){return jsxs(Fragment$1,{children:[i!==0&&jsx$1(RightChevronIcon,{iconName:"ChevronRight"},void 0),jsx$1("span",{children:b.text},void 0)]},b.key);})}),void 0);};var Host$L=_styled.p.withConfig({displayName:"ListItemBreadcrumb__Host",componentId:"sc-c9uoz1-0"})(templateObject_1$1W||(templateObject_1$1W=__makeTemplateObject(["\n padding: 0;\n margin: ","px 0 0;\n font-size: ","px;\n\n color: ",";\n text-align: start;\n\n > span,\n i {\n vertical-align: middle;\n line-height: 1;\n }\n"],["\n padding: 0;\n margin: ","px 0 0;\n font-size: ","px;\n\n color: ",";\n text-align: start;\n\n > span,\n i {\n vertical-align: middle;\n line-height: 1;\n }\n"])),spacingXxs,fontSizeSmall,function(p){return p.theme.palette.neutralTertiary;});var RightChevronIcon=_styled(Icon).withConfig({displayName:"ListItemBreadcrumb__RightChevronIcon",componentId:"sc-c9uoz1-1"})(templateObject_2$1c||(templateObject_2$1c=__makeTemplateObject(["\n &&& {\n font-weight: bold;\n margin: 0 ","px;\n font-size: ","px;\n }\n"],["\n &&& {\n font-weight: bold;\n margin: 0 ","px;\n font-size: ","px;\n }\n"])),spacingXxs,fontSizeSmaller-2);var templateObject_1$1W,templateObject_2$1c;var PageItemTile=function PageItemTile(_a){var _b,_c;var item=_a.item,baseRoute=_a.baseRoute,filterBaseUrl=_a.filterBaseUrl,styleDefinition=_a.styleDefinition,readOnly=_a.readOnly,additionalMetadata=_a.additionalMetadata,buttons=_a.buttons,additionalContent=_a.additionalContent,showBannerPlaceholder=_a.showBannerPlaceholder,showBreadcrumb=_a.showBreadcrumb,showIntro=_a.showIntro,className=_a.className;var user=useCurrentUserContext().user;var intl=useIntl();var createPageClickHandler=usePagesClickHandler().createPageClickHandler;var title=getTitle(item,user,intl.formatMessage);var language=getLanguageForPage(item,user);var content=item.contents[language];var hasKeywords=Object.keys((_b=item.keywords)!==null&&_b!==void 0?_b:[]).length>0;var targetRoute=NewsService.getNewsRoute(baseRoute,item.id,title);var clickHandler=createPageClickHandler(item);var isDocument=item.pageType===PageType.Document;var isEditor=baseRoute.includes('/editor');var preferredContentLanguage=getPreferredContentLanguage(user);var url=item.useExternalContent&&getExternalContentUrl(item,preferredContentLanguage);return jsxs(Host$K,__assign({"data-item-id":item.id,className:className},{children:[!readOnly&&jsx$1(ClickableOverlay,{itemId:item.id,itemType:ItemResourceTypes.Pages,baseRoute:baseRoute,title:title,isExternalContent:item.useExternalContent},void 0),jsxs(Inner$3$1,__assign({styleDefinition:styleDefinition,hasBanner:item.bannerInfo!=null||showBannerPlaceholder||isDocument},{children:[jsx$1(Banner$2,{item:item,language:language,bannerDefaultWidth:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.bannerDefaultWidth,applyRoundedCorners:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.applyRoundedCorners,showBannerPlaceholder:showBannerPlaceholder,isEditor:isEditor,bannerFontSize:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.bannerFontSize},void 0),jsxs(Content$6,__assign({padding:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.contentPadding,"data-page-tile-content":true},{children:[jsxs(MetaInfo$3,__assign({paddingRight:showBreadcrumb&&!isDocument&&readOnly?spacingM:0},{children:[showBreadcrumb&&jsx$1(StyledListItemBreadcrumb,{page:item},void 0),!showBreadcrumb&&item.modified&&jsx$1(DateTime,{value:item.modified},void 0),additionalMetadata]}),void 0),jsxs(MainContent,{children:[jsxs(TitleAndIntro,__assign({addDownloadButtonSafetySpace:isDocument},{children:[jsx$1(StyledTitle$1,{title:title,targetRoute:targetRoute,readOnly:readOnly,onClick:clickHandler,fontSize:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.titleFontSize,margin:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.titleMargin,isExternalContent:item.useExternalContent,resourceKey:item.useExternalContent?'ExternalLinkButton.pages.navigateTo':undefined,resourceValues:url!==null&&url!==void 0?url:undefined},void 0),showIntro&&((_c=content.intro)===null||_c===void 0?void 0:_c.length)>0&&jsx$1(Intro$2,{children:content.intro},void 0)]}),void 0),additionalContent]},void 0),hasKeywords&&jsx$1(Keywords$2,{children:jsx$1(FlatKeywords,{item:item,filterBaseUrl:filterBaseUrl},void 0)},void 0),buttons&&jsx$1(Buttons$3,{children:buttons},void 0)]}),void 0)]}),void 0)]}),void 0);};var StyledTitle$1=_styled(Title$8).withConfig({displayName:"PageItemTile__StyledTitle",componentId:"sc-lcm8k6-0"})(templateObject_5$u||(templateObject_5$u=__makeTemplateObject(["\n // for embedded pages we do not pass in a custom font size and we want to truncate the title to 2 lines\n ","\n\n ",";\n\n ",";\n\n display: inline-block;\n max-width: 100%;\n\n a:focus {\n outline-offset: 0 !important;\n }\n"],["\n // for embedded pages we do not pass in a custom font size and we want to truncate the title to 2 lines\n ","\n\n ",";\n\n ",";\n\n display: inline-block;\n max-width: 100%;\n\n a:focus {\n outline-offset: 0 !important;\n }\n"])),function(p){return !p.fontSize&&css$2(templateObject_1$1V||(templateObject_1$1V=__makeTemplateObject(["\n a {\n display: inline-flex;\n }\n\n span {\n ","\n }\n "],["\n a {\n display: inline-flex;\n }\n\n span {\n ","\n }\n "])),LineClamp(2,fontSizeMedium,1.4));},function(p){return p.fontSize&&css$2(templateObject_2$1b||(templateObject_2$1b=__makeTemplateObject(["\n &&& {\n font-size: ","px;\n line-height: 20px;\n\n i[data-external-content] {\n font-size: ","px;\n line-height: ","px;\n }\n }\n\n a {\n display: inline-flex;\n max-width: 100%;\n }\n\n span {\n // we pass a custom font size (smaller) for inline page lists and here we want to keep the title to single line\n display: block;\n max-width: 100%;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n "],["\n &&& {\n font-size: ","px;\n line-height: 20px;\n\n i[data-external-content] {\n font-size: ","px;\n line-height: ","px;\n }\n }\n\n a {\n display: inline-flex;\n max-width: 100%;\n }\n\n span {\n // we pass a custom font size (smaller) for inline page lists and here we want to keep the title to single line\n display: block;\n max-width: 100%;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n "])),p.fontSize,fontSizeNormal,fontSizeNormal);},function(p){return p.margin?css$2(templateObject_3$P||(templateObject_3$P=__makeTemplateObject(["\n margin: "," !important;\n "],["\n margin: "," !important;\n "])),p.margin):css$2(templateObject_4$y||(templateObject_4$y=__makeTemplateObject(["\n margin: 0 !important;\n "],["\n margin: 0 !important;\n "])));});var Intro$2=_styled.div.withConfig({displayName:"PageItemTile__Intro",componentId:"sc-lcm8k6-1"})(templateObject_6$k||(templateObject_6$k=__makeTemplateObject(["\n margin: ","px 0 ","px;\n ","\n"],["\n margin: ","px 0 ","px;\n ","\n"])),spacingXs-1,spacingS+5,LineClamp(10,fontSizeSmall,1.4));var Host$K=_styled.article.withConfig({displayName:"PageItemTile__Host",componentId:"sc-lcm8k6-2"})(templateObject_7$e||(templateObject_7$e=__makeTemplateObject(["\n position: relative;\n"],["\n position: relative;\n"])));var Inner$3$1=_styled.div.withConfig({displayName:"PageItemTile__Inner",componentId:"sc-lcm8k6-3"})(templateObject_11$6||(templateObject_11$6=__makeTemplateObject(["\n ","\n ","\n ","\n ","\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"],["\n ","\n ","\n ","\n ","\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"])),function(p){var _a;return HostBaseStyle((_a=p.styleDefinition)===null||_a===void 0?void 0:_a.backgroundColor);},function(p){var _a;return ((_a=p.styleDefinition)===null||_a===void 0?void 0:_a.applyRoundedCorners)&&BorderRadiusStyle();},function(p){var _a;return ((_a=p.styleDefinition)===null||_a===void 0?void 0:_a.height)?css$2(templateObject_8$d||(templateObject_8$d=__makeTemplateObject(["\n height: ","px;\n "],["\n height: ","px;\n "])),p.styleDefinition.height):css$2(templateObject_9$b||(templateObject_9$b=__makeTemplateObject(["\n height: auto;\n min-height: 138px;\n "],["\n height: auto;\n min-height: 138px;\n "])));},function(p){var _a;return p.hasBanner&&css$2(templateObject_10$a||(templateObject_10$a=__makeTemplateObject(["\n [data-page-tile-content] {\n max-width: calc(100% - ","px)};\n }\n "],["\n [data-page-tile-content] {\n max-width: calc(100% - ","px)};\n }\n "])),(_a=p.styleDefinition)===null||_a===void 0?void 0:_a.bannerDefaultWidth);});var Content$6=_styled.div.withConfig({displayName:"PageItemTile__Content",componentId:"sc-lcm8k6-4"})(templateObject_14$4||(templateObject_14$4=__makeTemplateObject(["\n ","\n ","\n\n box-sizing: border-box;\n max-width: 100%;\n"],["\n ","\n ","\n\n box-sizing: border-box;\n max-width: 100%;\n"])),ContentStyle,function(p){return p.padding?css$2(templateObject_12$5||(templateObject_12$5=__makeTemplateObject(["\n padding: ",";\n "],["\n padding: ",";\n "])),p.padding):css$2(templateObject_13$4||(templateObject_13$4=__makeTemplateObject(["\n padding: ","px;\n "],["\n padding: ","px;\n "])),spacingM);});var MetaInfo$3=_styled.div.withConfig({displayName:"PageItemTile__MetaInfo",componentId:"sc-lcm8k6-5"})(templateObject_15$4||(templateObject_15$4=__makeTemplateObject(["\n "," /* font-size of date */\n display: inline-flex;\n align-items: center;\n flex-wrap: nowrap;\n color: ",";\n\n padding-left: 2px;\n padding-right: ","px;\n"],["\n "," /* font-size of date */\n display: inline-flex;\n align-items: center;\n flex-wrap: nowrap;\n color: ",";\n\n padding-left: 2px;\n padding-right: ","px;\n"])),MetaInfoStyle(17),function(p){return p.theme.textColors.default;},function(p){return p.paddingRight;});var MainContent=_styled.div.withConfig({displayName:"PageItemTile__MainContent",componentId:"sc-lcm8k6-6"})(templateObject_16$4||(templateObject_16$4=__makeTemplateObject(["\n display: flex;\n align-items: center;\n padding-left: 2px;\n"],["\n display: flex;\n align-items: center;\n padding-left: 2px;\n"])));var DownloadButtonWidth=32;var TitleAndIntro=_styled.div.withConfig({displayName:"PageItemTile__TitleAndIntro",componentId:"sc-lcm8k6-7"})(templateObject_17$3||(templateObject_17$3=__makeTemplateObject(["\n width: calc(\n 100% -\n ","px\n );\n"],["\n width: calc(\n 100% -\n ","px\n );\n"])),function(p){return p.addDownloadButtonSafetySpace?DownloadButtonWidth:0;});var StyledListItemBreadcrumb=_styled(ListItemBreadcrumb).withConfig({displayName:"PageItemTile__StyledListItemBreadcrumb",componentId:"sc-lcm8k6-8"})(templateObject_18$2||(templateObject_18$2=__makeTemplateObject(["\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n &&& {\n // this is needed because draft.js adds a 1rem margin bottom here somehow (because the breadcrumb is a <p> maybe) and it breaks the view\n margin-bottom: 0;\n }\n"],["\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n &&& {\n // this is needed because draft.js adds a 1rem margin bottom here somehow (because the breadcrumb is a <p> maybe) and it breaks the view\n margin-bottom: 0;\n }\n"])));var Keywords$2=_styled.div.withConfig({displayName:"PageItemTile__Keywords",componentId:"sc-lcm8k6-9"})(templateObject_19$2||(templateObject_19$2=__makeTemplateObject(["\n margin-top: auto;\n\n > ul {\n font-size: ","px;\n line-height: 20px;\n height: 20px;\n padding: 0 2px !important;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n && {\n a:link,\n a:visited {\n color: "," !important;\n\n &:focus {\n outline-offset: 0 !important;\n }\n }\n }\n"],["\n margin-top: auto;\n\n > ul {\n font-size: ","px;\n line-height: 20px;\n height: 20px;\n padding: 0 2px !important;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n && {\n a:link,\n a:visited {\n color: "," !important;\n\n &:focus {\n outline-offset: 0 !important;\n }\n }\n }\n"])),fontSizeSmall,function(p){return p.theme.palette.neutralSecondaryAlt;});var Buttons$3=_styled.div.withConfig({displayName:"PageItemTile__Buttons",componentId:"sc-lcm8k6-10"})(templateObject_20$1||(templateObject_20$1=__makeTemplateObject(["\n display: flex;\n align-items: center;\n padding-top: ","px;\n margin-top: auto;\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"],["\n display: flex;\n align-items: center;\n padding-top: ","px;\n margin-top: auto;\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"])),spacingS);var Banner$2=function Banner(_a){var _b,_c;var item=_a.item,language=_a.language,bannerDefaultWidth=_a.bannerDefaultWidth,bannerFontSize=_a.bannerFontSize,applyRoundedCorners=_a.applyRoundedCorners,showBannerPlaceholder=_a.showBannerPlaceholder,isEditor=_a.isEditor;var bannerInfo=item.bannerInfo;var isDocument=item.pageType===PageType.Document;var fileIcon=getFileIconByExtension(((_c=(_b=item.contents[language])===null||_b===void 0?void 0:_b.fileInfo)===null||_c===void 0?void 0:_c.extension)||'');if(isDocument){return jsx$1(BannerHost$1,__assign({defaultWidth:bannerDefaultWidth,applyRoundedCorners:applyRoundedCorners},{children:jsx$1(FileIcon$1,{iconName:fileIcon,fontSize:bannerFontSize,color:getIconColor(fileIcon)},void 0)}),void 0);}if(!bannerInfo&&!showBannerPlaceholder){return null;}if(bannerDefaultWidth<100){return jsx$1(SmallBannerWrapper,__assign({defaultWidth:bannerDefaultWidth,applyRoundedCorners:applyRoundedCorners},{children:jsx$1(PublishableItemBanner,{itemId:item.id,bannerInfo:bannerInfo,useEditorRoutes:isEditor,width:200,token:item.fileAccessToken,resourceType:ItemResourceTypes.Pages},void 0)}),void 0);}return jsx$1("div",{children:jsx$1(LargeBannerWrapper,__assign({defaultWidth:bannerDefaultWidth,applyRoundedCorners:applyRoundedCorners},{children:jsx$1(PublishableItemBanner,{itemId:item.id,bannerInfo:bannerInfo,useEditorRoutes:isEditor,width:450,token:item.fileAccessToken,resourceType:ItemResourceTypes.Pages},void 0)}),void 0)},void 0);};var BannerHost$1=_styled.div.withConfig({displayName:"PageItemTile__BannerHost",componentId:"sc-lcm8k6-11"})(templateObject_23$2||(templateObject_23$2=__makeTemplateObject(["\n display: flex;\n width: ","px;\n justify-content: center;\n align-items: center;\n background-color: ",";\n\n ","\n\n @media (max-width: ","px) {\n ","\n }\n"],["\n display: flex;\n width: ","px;\n justify-content: center;\n align-items: center;\n background-color: ",";\n\n ","\n\n @media (max-width: ","px) {\n ","\n }\n"])),function(p){return p.defaultWidth;},function(p){return p.theme.palette.neutralQuaternaryAlt;},function(p){return p.applyRoundedCorners&&css$2(templateObject_21$2||(templateObject_21$2=__makeTemplateObject(["\n ","\n overflow: hidden;\n /* fix for iOS and Safari: overflow: hidden with border-radius */\n transform: translateZ(0);\n "],["\n ","\n overflow: hidden;\n /* fix for iOS and Safari: overflow: hidden with border-radius */\n transform: translateZ(0);\n "])),BorderRadiusStyle(5));},maxScreenSize.medium,function(p){return p.defaultWidth>100&&css$2(templateObject_22$2||(templateObject_22$2=__makeTemplateObject(["\n width: auto;\n height: 100px;\n "],["\n width: auto;\n height: 100px;\n "])));});var FileIcon$1=_styled(Icon).withConfig({displayName:"PageItemTile__FileIcon",componentId:"sc-lcm8k6-12"})(templateObject_24$1||(templateObject_24$1=__makeTemplateObject(["\n font-size: ","px;\n color: ",";\n"],["\n font-size: ","px;\n color: ",";\n"])),function(p){return p.fontSize||30;},function(p){return p.color||p.theme.textColors.default;});var SmallBannerWrapper=_styled.div.withConfig({displayName:"PageItemTile__SmallBannerWrapper",componentId:"sc-lcm8k6-13"})(templateObject_26$1||(templateObject_26$1=__makeTemplateObject(["\n background-color: ",";\n\n width: ","px;\n height: 100%;\n\n .video-view-container {\n height: 100%;\n }\n\n &&& .video-icon {\n font-size: 35px;\n margin: 0;\n }\n\n ","\n"],["\n background-color: ",";\n\n width: ","px;\n height: 100%;\n\n .video-view-container {\n height: 100%;\n }\n\n &&& .video-icon {\n font-size: 35px;\n margin: 0;\n }\n\n ","\n"])),function(p){return p.theme.palette.accent;},function(p){return p.defaultWidth;},function(p){return p.applyRoundedCorners&&css$2(templateObject_25$1||(templateObject_25$1=__makeTemplateObject(["\n ","\n overflow: hidden;\n /* fix for iOS and Safari: overflow: hidden with border-radius */\n transform: translateZ(0);\n "],["\n ","\n overflow: hidden;\n /* fix for iOS and Safari: overflow: hidden with border-radius */\n transform: translateZ(0);\n "])),BorderRadiusStyle(5));});var LargeBannerWrapper=_styled(LeftBannerWrapper).withConfig({displayName:"PageItemTile__LargeBannerWrapper",componentId:"sc-lcm8k6-14"})(templateObject_28$1||(templateObject_28$1=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),function(p){return p.applyRoundedCorners&&css$2(templateObject_27$1||(templateObject_27$1=__makeTemplateObject(["\n ","\n overflow: hidden;\n /* fix for iOS and Safari: overflow: hidden with border-radius */\n transform: translateZ(0);\n "],["\n ","\n overflow: hidden;\n /* fix for iOS and Safari: overflow: hidden with border-radius */\n transform: translateZ(0);\n "])),BorderRadiusStyle(5,true));});var templateObject_1$1V,templateObject_2$1b,templateObject_3$P,templateObject_4$y,templateObject_5$u,templateObject_6$k,templateObject_7$e,templateObject_8$d,templateObject_9$b,templateObject_10$a,templateObject_11$6,templateObject_12$5,templateObject_13$4,templateObject_14$4,templateObject_15$4,templateObject_16$4,templateObject_17$3,templateObject_18$2,templateObject_19$2,templateObject_20$1,templateObject_21$2,templateObject_22$2,templateObject_23$2,templateObject_24$1,templateObject_25$1,templateObject_26$1,templateObject_27$1,templateObject_28$1;var global$1=global$m;var trim=stringTrim$1.trim;var whitespaces$4=whitespaces$3;var $parseInt=global$1.parseInt;var hex=/^[+-]?0[Xx]/;var FORCED=$parseInt(whitespaces$4+'08')!==8||$parseInt(whitespaces$4+'0x16')!==22;// `parseInt` method
122253
122250
  // https://tc39.github.io/ecma262/#sec-parseint-string-radix
122254
122251
  var numberParseInt=FORCED?function parseInt(string,radix){var S=trim(String(string));return $parseInt(S,radix>>>0||(hex.test(S)?16:10));}:$parseInt;var $$2$1=_export;var parseIntImplementation=numberParseInt;// `parseInt` method
122255
122252
  // https://tc39.github.io/ecma262/#sec-parseint-string-radix
122256
- $$2$1({global:true,forced:parseInt!=parseIntImplementation},{parseInt:parseIntImplementation});function getMaxImageWidth(defaultMaxWidth){return defaultMaxWidth!==null&&defaultMaxWidth!==void 0?defaultMaxWidth:maxContentWidth;}function getImageWidth(image){var width=typeof image==='string'?parseInt(image):image===null||image===void 0?void 0:image.width;if(!width||isNaN(width)){return getMaxImageWidth();}return Math.min(width,getMaxImageWidth());}function getNewsCardIcon(item,intl){if(hasFlag(item.knownState,KnownNewsState.Alert)){return {name:'Warning',backgroundColor:'red',tooltipText:intl.formatMessage({id:'NewsArticle.alert'})};}if(hasFlag(item.knownState,KnownNewsState.Unconfirmed)){return {name:'Completed',backgroundColor:'green',tooltipText:intl.formatMessage({id:'NewsArticle.confirmationRequired'})};}return null;}var ItemTileLayoutMode;(function(ItemTileLayoutMode){ItemTileLayoutMode["BannerTopMode"]="bannerTop";ItemTileLayoutMode["BannerLeftMode"]="bannerLeft";})(ItemTileLayoutMode||(ItemTileLayoutMode={}));var NewsItemTile=function NewsItemTile(_a){var item=_a.item,baseRoute=_a.baseRoute,layoutMode=_a.layoutMode,filterBaseUrl=_a.filterBaseUrl,dateLabelResourceKey=_a.dateLabelResourceKey,buttons=_a.buttons,openTargetInNewWindow=_a.openTargetInNewWindow,onClick=_a.onClick,onChannelClick=_a.onChannelClick,onKeywordClick=_a.onKeywordClick,styleDefinition=_a.styleDefinition,readOnly=_a.readOnly,className=_a.className;var user=useCurrentUserContext().user;var token=useCurrentToken();var intl=useIntl();var features=useFeatures();var title=getTitle(item,user,intl.formatMessage);var headline=getHeadline(item,user);var language=NewsService.getLanguageForPublishableItem(item,user);var handleExternalContentClick=useExternalContentClickHandler();var targetRoute=NewsService.getNewsRouteWithRedirect(baseRoute,item.id,title,item.useExternalContent);var hasKeywords=Object.keys(item.keywords).length>0;var content=item.contents[language];var hasIntro=content.intro&&content.intro.length>0;var icon=getNewsCardIcon(item,intl);var preferredContentLanguage=getPreferredContentLanguage(user);var url=getExternalContentUrl(item,preferredContentLanguage);return jsxs(Host$I,__assign({hasBanner:item.bannerInfo!=null,layoutMode:layoutMode,styleDefinition:styleDefinition,"data-item-id":item.id,className:className},{children:[!readOnly&&jsx$1(ClickableOverlay,{itemId:item.id,itemType:ItemResourceTypes.News,baseRoute:baseRoute,onClick:onClick,title:title,openTargetInNewWindow:openTargetInNewWindow,isExternalContent:item.useExternalContent},void 0),jsx$1(Banner$1$1,{item:item,token:item.fileAccessToken||token,resourceType:ItemResourceTypes.News,layoutMode:layoutMode,bannerDefaultWidth:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.bannerDefaultWidth,showPlaceholderIfNoBannerInfo:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.showPlaceholderIfNoBannerInfo},void 0),jsxs(Content$5,{children:[jsxs(MetaInfoAndIcon,{children:[jsxs(MetaInfo$2,__assign({showChannelsToTheRight:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.showChannelsToTheRight},{children:[dateLabelResourceKey&&jsxs(Fragment,{children:[jsx$1(FormattedMessage$1,{id:dateLabelResourceKey},void 0),":\u00A0"]},void 0),jsx$1(DateTime,{value:item.publishingDate},void 0),jsxs(Fragment,{children:["\u2002",jsx$1(StyledClickableChannelTitles,{channels:item.channels.map(function(c){return c.name;}),language:getPreferredContentLanguage(user),channelBackgroundColor:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.channelsBackgroundColor,onClick:onChannelClick},void 0)]},void 0)]}),void 0),icon&&jsx$1(NewsCardIcon$1,{children:jsx$1(Tooltip,__assign({text:icon.tooltipText},{children:jsx$1(StyledIcon$4$1,{iconName:icon.name,backgroundColor:icon.backgroundColor},void 0)}),item.id+"-"+icon.name)},void 0)]},void 0),features.contentHeadline&&!!headline&&jsx$1(Headline$2,{children:headline},void 0),jsx$1(StyledTitle$2,{title:title,targetRoute:targetRoute,readOnly:readOnly,openTargetInNewWindow:openTargetInNewWindow,onClick:function(e){if(onClick){onClick(e,true);}else {handleExternalContentClick(e,item,ItemResourceTypes.News);}},isExternalContent:item.useExternalContent,resourceKey:"ExternalLinkButton.news.navigateTo",resourceValues:url},void 0),hasIntro&&jsx$1(Intro$1$1,{children:content.intro},void 0),hasKeywords&&jsx$1(StyledKeywords,{item:item,filterBaseUrl:filterBaseUrl,onClick:onKeywordClick},void 0),buttons&&jsx$1(Footer,__assign({alignItemsToTheRight:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.showChannelsToTheRight},{children:buttons}),void 0)]},void 0)]}),void 0);};var Host$I=_styled.article.withConfig({displayName:"NewsItemTile__Host",componentId:"sc-15drgb8-0"})(templateObject_4$x||(templateObject_4$x=__makeTemplateObject(["\n ","\n ",";\n\n ","\n\n ","\n\n ","\n\n position: relative;\n"],["\n ","\n ",";\n\n ","\n\n ","\n\n ","\n\n position: relative;\n"])),function(p){var _a;return HostBaseStyle((_a=p.styleDefinition)===null||_a===void 0?void 0:_a.backgroundColor);},function(p){var _a;return !((_a=p.styleDefinition)===null||_a===void 0?void 0:_a.noShadow)&&CardBorderInline(2,2);},function(p){return p.hasBanner&&css$2(templateObject_1$1S||(templateObject_1$1S=__makeTemplateObject(["\n min-height: 138px;\n "],["\n min-height: 138px;\n "])));},function(p){return (!p.layoutMode||p.layoutMode===ItemTileLayoutMode.BannerLeftMode)&&css$2(templateObject_2$18||(templateObject_2$18=__makeTemplateObject(["\n @media (max-width: ","px) {\n flex-direction: column;\n }\n "],["\n @media (max-width: ","px) {\n flex-direction: column;\n }\n "])),maxScreenSize.medium);},function(p){return p.layoutMode===ItemTileLayoutMode.BannerTopMode&&css$2(templateObject_3$M||(templateObject_3$M=__makeTemplateObject(["\n flex-direction: column;\n "],["\n flex-direction: column;\n "])));});var StyledTitle$2=_styled(Title$7).withConfig({displayName:"NewsItemTile__StyledTitle",componentId:"sc-15drgb8-1"})(templateObject_5$t||(templateObject_5$t=__makeTemplateObject(["\n &&& {\n margin-right: auto;\n display: inline-flex;\n }\n\n i[data-external-content] {\n font-size: ","px;\n line-height: ","px;\n }\n"],["\n &&& {\n margin-right: auto;\n display: inline-flex;\n }\n\n i[data-external-content] {\n font-size: ","px;\n line-height: ","px;\n }\n"])),fontSizeMedium,fontSizeSmall);var Content$5=_styled.div.withConfig({displayName:"NewsItemTile__Content",componentId:"sc-15drgb8-2"})(templateObject_6$j||(templateObject_6$j=__makeTemplateObject(["\n ","\n padding: ","px;\n"],["\n ","\n padding: ","px;\n"])),ContentStyle,spacingM);var Headline$2=_styled.div.withConfig({displayName:"NewsItemTile__Headline",componentId:"sc-15drgb8-3"})(templateObject_7$d||(templateObject_7$d=__makeTemplateObject(["\n font-size: ","px;\n font-weight: bold;\n margin-bottom: ","px;\n"],["\n font-size: ","px;\n font-weight: bold;\n margin-bottom: ","px;\n"])),fontSizeSmall,spacingS);var Intro$1$1=_styled.p.withConfig({displayName:"NewsItemTile__Intro",componentId:"sc-15drgb8-4"})(templateObject_8$c||(templateObject_8$c=__makeTemplateObject(["\n margin: 0;\n font-size: ","px;\n"],["\n margin: 0;\n font-size: ","px;\n"])),fontSizeNormal);var MetaInfoAndIcon=_styled.div.withConfig({displayName:"NewsItemTile__MetaInfoAndIcon",componentId:"sc-15drgb8-5"})(templateObject_9$a||(templateObject_9$a=__makeTemplateObject(["\n display: flex;\n"],["\n display: flex;\n"])));var MetaInfo$2=_styled.div.withConfig({displayName:"NewsItemTile__MetaInfo",componentId:"sc-15drgb8-6"})(templateObject_11$5||(templateObject_11$5=__makeTemplateObject(["\n ","\n color: ",";\n margin-bottom: ","px;\n\n ","\n"],["\n ","\n color: ",";\n margin-bottom: ","px;\n\n ","\n"])),MetaInfoStyle(),function(p){return p.theme.palette.neutralTertiary;},spacingS,function(p){return p.showChannelsToTheRight&&css$2(templateObject_10$9||(templateObject_10$9=__makeTemplateObject(["\n width: 100%;\n\n time {\n margin-right: auto;\n }\n "],["\n width: 100%;\n\n time {\n margin-right: auto;\n }\n "])));});var NewsCardIcon$1=_styled.div.withConfig({displayName:"NewsItemTile__NewsCardIcon",componentId:"sc-15drgb8-7"})(templateObject_12$4||(templateObject_12$4=__makeTemplateObject(["\n display: flex;\n margin-left: auto;\n z-index: 10;\n"],["\n display: flex;\n margin-left: auto;\n z-index: 10;\n"])));var StyledIcon$4$1=_styled(Icon).withConfig({displayName:"NewsItemTile__StyledIcon",componentId:"sc-15drgb8-8"})(templateObject_13$3||(templateObject_13$3=__makeTemplateObject(["\n font-size: ","px;\n width: 24px;\n height: 24px;\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n margin-left: ","px;\n cursor: pointer;\n\n background-color: ",";\n color: ",";\n"],["\n font-size: ","px;\n width: 24px;\n height: 24px;\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n margin-left: ","px;\n cursor: pointer;\n\n background-color: ",";\n color: ",";\n"])),fontSizeSmaller,spacingXs,function(p){return p.backgroundColor;},function(p){return p.theme.palette.white;});var StyledKeywords=_styled(FlatKeywords).withConfig({displayName:"NewsItemTile__StyledKeywords",componentId:"sc-15drgb8-9"})(templateObject_14$3||(templateObject_14$3=__makeTemplateObject(["\n margin-top: ","px;\n font-size: ","px;\n\n && a {\n &,\n :link,\n :visited {\n color: ",";\n }\n }\n"],["\n margin-top: ","px;\n font-size: ","px;\n\n && a {\n &,\n :link,\n :visited {\n color: ",";\n }\n }\n"])),spacingS,fontSizeSmall,function(p){return p.theme.palette.neutralTertiary;});var Footer=_styled.footer.withConfig({displayName:"NewsItemTile__Footer",componentId:"sc-15drgb8-10"})(templateObject_16$3||(templateObject_16$3=__makeTemplateObject(["\n display: flex;\n align-items: center;\n padding-top: ","px;\n margin-top: auto;\n ","\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n\n .ms-TooltipHost {\n display: flex;\n align-items: center;\n margin-right: ","px;\n\n i {\n font-size: 22px;\n }\n }\n"],["\n display: flex;\n align-items: center;\n padding-top: ","px;\n margin-top: auto;\n ","\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n\n .ms-TooltipHost {\n display: flex;\n align-items: center;\n margin-right: ","px;\n\n i {\n font-size: 22px;\n }\n }\n"])),spacingS,function(p){return p.alignItemsToTheRight&&css$2(templateObject_15$3||(templateObject_15$3=__makeTemplateObject(["\n justify-content: flex-end;\n "],["\n justify-content: flex-end;\n "])));},spacingS+5);var Banner$1$1=function Banner(_a){var item=_a.item,token=_a.token,resourceType=_a.resourceType,layoutMode=_a.layoutMode,bannerDefaultWidth=_a.bannerDefaultWidth,showPlaceholderIfNoBannerInfo=_a.showPlaceholderIfNoBannerInfo;var bannerInfo=item.bannerInfo;if(!bannerInfo&&!showPlaceholderIfNoBannerInfo){return null;}var banner=getBanner();return jsx$1("div",{children:banner},void 0);function getBanner(){if(layoutMode===ItemTileLayoutMode.BannerTopMode){return jsx$1(TopBannerWrapper,__assign({showPlaceholder:!bannerInfo&&showPlaceholderIfNoBannerInfo},{children:jsx$1(TopBannerInner,{children:jsx$1(PublishableItemBanner,{itemId:item.id,bannerInfo:bannerInfo,width:getMaxImageWidth(),token:item.fileAccessToken||token,resourceType:resourceType},void 0)},void 0)}),void 0);}return jsx$1(LeftBannerWrapper,__assign({defaultWidth:bannerDefaultWidth!==null&&bannerDefaultWidth!==void 0?bannerDefaultWidth:150,showPlaceholder:!bannerInfo&&showPlaceholderIfNoBannerInfo},{children:jsx$1(PublishableItemBanner,{itemId:item.id,bannerInfo:bannerInfo,width:getMaxImageWidth(450),token:item.fileAccessToken||token,resourceType:resourceType},void 0)}),void 0);}};var TopBannerWrapper=_styled.div.withConfig({displayName:"NewsItemTile__TopBannerWrapper",componentId:"sc-15drgb8-11"})(templateObject_18$1||(templateObject_18$1=__makeTemplateObject(["\n position: relative;\n width: 100%;\n padding-top: calc(100% * (1 / ","));\n ","\n"],["\n position: relative;\n width: 100%;\n padding-top: calc(100% * (1 / ","));\n ","\n"])),bannerAspectRatio,function(p){return p.showPlaceholder&&css$2(templateObject_17$2||(templateObject_17$2=__makeTemplateObject(["\n background-color: ",";\n "],["\n background-color: ",";\n "])),p.theme.palette.accent);});var TopBannerInner=_styled.div.withConfig({displayName:"NewsItemTile__TopBannerInner",componentId:"sc-15drgb8-12"})(templateObject_19$1||(templateObject_19$1=__makeTemplateObject(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"],["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"])));var StyledClickableChannelTitles=_styled(ClickableChannelTitles).withConfig({displayName:"NewsItemTile__StyledClickableChannelTitles",componentId:"sc-15drgb8-13"})(templateObject_20$3||(templateObject_20$3=__makeTemplateObject(["\n z-index: 1;\n"],["\n z-index: 1;\n"])));var templateObject_1$1S,templateObject_2$18,templateObject_3$M,templateObject_4$x,templateObject_5$t,templateObject_6$j,templateObject_7$d,templateObject_8$c,templateObject_9$a,templateObject_10$9,templateObject_11$5,templateObject_12$4,templateObject_13$3,templateObject_14$3,templateObject_15$3,templateObject_16$3,templateObject_17$2,templateObject_18$1,templateObject_19$1,templateObject_20$3;var DocumentDownloadButton=function DocumentDownloadButton(_a){var _b;var page=_a.page,basePath=_a.basePath,onClick=_a.onClick,className=_a.className;var formatMessage=useIntl().formatMessage;var currentUser=useCurrentUser();var createDocumentClickHandler=usePagesClickHandler().createDocumentClickHandler;if(page.pageType!==PageType.Document){return null;}var _c=getContentForPage(page,currentUser),content=_c.content,language=_c.language;var fileInfo=content===null||content===void 0?void 0:content.fileInfo;var title=content===null||content===void 0?void 0:content.title;if(!fileInfo||!language){return null;}return jsx$1(StyledTooltip$1,__assign({resourceKey:'Pages.documents.downloadButton.tooltip',values:{fileName:title||fileInfo.fileName},className:className},{children:jsx$1(IconButton,{iconProps:{iconName:'Download'},onClick:createDocumentClickHandler(page.id,fileInfo.fileId,language,fileInfo.shouldOpenInBrowser,(_b=page)===null||_b===void 0?void 0:_b.fileAccessToken,basePath,onClick),ariaLabel:formatMessage({id:'Pages.documents.downloadButton.tooltip'},{fileName:title||fileInfo.fileName})},void 0)}),void 0);};var StyledTooltip$1=_styled(Tooltip).withConfig({displayName:"DocumentDownloadButton__StyledTooltip",componentId:"sc-1lgs2rp-0"})(templateObject_1$1R||(templateObject_1$1R=__makeTemplateObject(["\n display: inline-flex;\n\n > button {\n border: 0;\n padding: 0;\n height: 28px; // this is needed for the focus indicator\n\n i {\n color: ",";\n }\n }\n"],["\n display: inline-flex;\n\n > button {\n border: 0;\n padding: 0;\n height: 28px; // this is needed for the focus indicator\n\n i {\n color: ",";\n }\n }\n"])),function(p){return p.theme.textColors.default;});var templateObject_1$1R;var EmbeddedObjectTile=function EmbeddedObjectTile(_a){var _b;var id=_a.id,type=_a.type,readOnly=_a.readOnly,previewTheme=_a.previewTheme,buttons=_a.buttons,groupIds=_a.groupIds,className=_a.className;var getPost=usePostsApi().getPost;var getNews=useNewsApi().get;var loadPage=usePagesApi().loadPage;var getEvent=useEventsApi().getEvent;var buildPath=useSubscriptionHandlePathBuilder().buildPath;var _c=usePromise$2(fetchItem),item=_c[0],isLoading=_c[1],error=_c[2];var useDarkTheme=previewTheme==='dark';var palette=useContext(ThemeContext$1).theme.palette;var user=useCurrentUser();var backgroundColor=useDarkTheme?palette.neutralLight:palette.white;if(isLoading){return jsx$1(SpinnerHost,{children:jsx$1(StyledSpinner$2,{size:SpinnerSize.large},void 0)},void 0);}if(((_b=error===null||error===void 0?void 0:error.response)===null||_b===void 0?void 0:_b.statusCode)===403){return jsxs(Host$H,__assign({backgroundColor:backgroundColor,className:className,"data-warning-access-denied":true},{children:[buttons,jsx$1(EmbeddedObjectWarningTile,{iconName:"LockSolid",iconLabel:"Generic.noAccess",messageResourceKey:"Generic.noAccessReason"},void 0)]}),void 0);}if(error||!item){return jsxs(Host$H,__assign({backgroundColor:backgroundColor,className:className,"data-warning-not-found":true},{children:[buttons,jsx$1(EmbeddedObjectWarningTile,{iconName:"AlertSolid",iconLabel:"Generic.itemNotFound",messageResourceKey:"Generic.deletedItemReason"},void 0)]}),void 0);}var itemGroupIds=getItemGroupIds();return jsxs(Fragment,{children:[jsxs(Host$H,__assign({backgroundColor:backgroundColor,className:className,"data-embedded-object-id":id},{children:[buttons,renderEmbeddedObjectTile()]}),void 0),groupIds&&groupIds.every(function(gid){return !itemGroupIds.includes(gid);})&&jsx$1(DifferentGroupWarning,__assign({"data-warning-different-group":true},{children:jsx$1(EmbeddedObjectWarningTile,{messageResourceKey:"Generic.differentGroupWarning"},void 0)}),void 0)]},void 0);function getItemGroupIds(){var _a,_b;var groupIds=(_a=item)===null||_a===void 0?void 0:_a.groupIds;if(groupIds){return groupIds;}var groupId=(_b=item)===null||_b===void 0?void 0:_b.groupId;return groupId?[groupId]:null;}function fetchItem(){return __awaiter(this,void 0,void 0,function(){var _a;return __generator(this,function(_b){switch(_b.label){case 0:_a=type;switch(_a){case AttachmentType.Post:return [3/*break*/,1];case AttachmentType.News:return [3/*break*/,3];case AttachmentType.Page:return [3/*break*/,5];case AttachmentType.Event:return [3/*break*/,7];}return [3/*break*/,9];case 1:return [4/*yield*/,getPost(id)];case 2:return [2/*return*/,_b.sent()];case 3:return [4/*yield*/,getNews(id).toPromise()];case 4:return [2/*return*/,_b.sent()];case 5:return [4/*yield*/,loadPage(id)];case 6:return [2/*return*/,_b.sent()];case 7:return [4/*yield*/,getEvent(id)];case 8:return [2/*return*/,_b.sent()];case 9:throw Error('Invalid type');}});});}function renderEmbeddedObjectTile(){var _a;if(type===AttachmentType.Post){return jsx$1(PostItemTile,{post:item,backgroundColor:backgroundColor,readOnly:readOnly},void 0);}if(type===AttachmentType.News){var newsItem=item;return jsx$1(NewsItemTile,{item:newsItem,baseRoute:buildPath('news'),styleDefinition:{backgroundColor:backgroundColor,noShadow:true,channelsBackgroundColor:useDarkTheme&&palette.white},readOnly:readOnly},void 0);}if(type===AttachmentType.Page){var pageItem=item;return jsx$1(StyledPageItemTile$1,{item:pageItem,baseRoute:buildPath('pages'),styleDefinition:{backgroundColor:backgroundColor,bannerDefaultWidth:150,bannerFontSize:60},readOnly:readOnly,isBannerClickable:((_a=pageItem.bannerInfo)===null||_a===void 0?void 0:_a.type)==='video',additionalMetadata:jsx$1(StyledDocumentDownloadButton$3,{page:item,marginRight:readOnly?spacingM:0},void 0),showBreadcrumb:true,showIntro:true},void 0);}var language=NewsService.getLanguageForPublishableItem(item,user);return jsx$1(EventCard,{item:item,language:language,styleDefinition:{backgroundColor:backgroundColor,noShadow:true,channelsBackgroundColor:useDarkTheme&&palette.white,bannerHostWidth:150},readOnly:readOnly},void 0);}};var Host$H=_styled.div.withConfig({displayName:"EmbeddedObjectTile__Host",componentId:"sc-yfh5nh-0"})(templateObject_3$L||(templateObject_3$L=__makeTemplateObject(["\n width: 100%;\n ","\n"],["\n width: 100%;\n ","\n"])),function(p){return p.backgroundColor?css$2(templateObject_1$1Q||(templateObject_1$1Q=__makeTemplateObject(["\n background-color: ",";\n "],["\n background-color: ",";\n "])),p.backgroundColor):css$2(templateObject_2$17||(templateObject_2$17=__makeTemplateObject(["\n background-color: ",";\n "],["\n background-color: ",";\n "])),function(p){return p.theme.palette.white;});});var DifferentGroupWarning=_styled.div.withConfig({displayName:"EmbeddedObjectTile__DifferentGroupWarning",componentId:"sc-yfh5nh-1"})(templateObject_4$w||(templateObject_4$w=__makeTemplateObject(["\n background-color: ",";\n color: ",";\n font-size: ","px;\n"],["\n background-color: ",";\n color: ",";\n font-size: ","px;\n"])),function(p){return p.theme.semanticColors.errorBackground;},function(p){return p.theme.palette.red;},fontSizeSmall);var EmbeddedObjectWarningTile=function EmbeddedObjectWarningTile(_a){var messageResourceKey=_a.messageResourceKey,iconName=_a.iconName,iconLabel=_a.iconLabel;return jsxs(WarningHost,{children:[(iconName||iconLabel)&&jsxs(Title$6,{children:[iconName&&jsx$1(StyleIcon,{iconName:iconName},void 0),iconLabel&&jsx$1(FormattedMessageWithStyle,{id:iconLabel},void 0)]},void 0),jsx$1(FormattedMessageWithStyle,{id:messageResourceKey},void 0)]},void 0);};var WarningHost=_styled.div.withConfig({displayName:"EmbeddedObjectTile__WarningHost",componentId:"sc-yfh5nh-2"})(templateObject_5$s||(templateObject_5$s=__makeTemplateObject(["\n padding: ","px;\n"],["\n padding: ","px;\n"])),spacingM);var Title$6=_styled.div.withConfig({displayName:"EmbeddedObjectTile__Title",componentId:"sc-yfh5nh-3"})(templateObject_6$i||(templateObject_6$i=__makeTemplateObject(["\n display: flex;\n align-items: center;\n font-weight: bold;\n font-size: ","px;\n margin-bottom: ","px;\n"],["\n display: flex;\n align-items: center;\n font-weight: bold;\n font-size: ","px;\n margin-bottom: ","px;\n"])),fontSizeMedium,spacingS);var SpinnerHost=_styled.div.withConfig({displayName:"EmbeddedObjectTile__SpinnerHost",componentId:"sc-yfh5nh-4"})(templateObject_7$c||(templateObject_7$c=__makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n margin-top: ","px;\n"],["\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n margin-top: ","px;\n"])),spacingL);var StyledSpinner$2=_styled(Spinner).withConfig({displayName:"EmbeddedObjectTile__StyledSpinner",componentId:"sc-yfh5nh-5"})(templateObject_8$b||(templateObject_8$b=__makeTemplateObject(["\n margin-top: 0;\n margin-bottom: ","px;\n"],["\n margin-top: 0;\n margin-bottom: ","px;\n"])),spacingL);var StyleIcon=_styled(Icon).withConfig({displayName:"EmbeddedObjectTile__StyleIcon",componentId:"sc-yfh5nh-6"})(templateObject_9$9||(templateObject_9$9=__makeTemplateObject(["\n padding-right: ","px;\n"],["\n padding-right: ","px;\n"])),spacingS);var StyledPageItemTile$1=_styled(PageItemTile).withConfig({displayName:"EmbeddedObjectTile__StyledPageItemTile",componentId:"sc-yfh5nh-7"})(templateObject_11$4||(templateObject_11$4=__makeTemplateObject(["\n ","\n\n @media (max-width: ","px) {\n > div {\n flex-direction: column;\n }\n\n [data-page-tile-content] {\n max-width: 100%;\n }\n }\n"],["\n ","\n\n @media (max-width: ","px) {\n > div {\n flex-direction: column;\n }\n\n [data-page-tile-content] {\n max-width: 100%;\n }\n }\n"])),function(p){return p.isBannerClickable&&css$2(templateObject_10$8||(templateObject_10$8=__makeTemplateObject(["\n [data-page-tile-content] {\n position: relative;\n }\n "],["\n [data-page-tile-content] {\n position: relative;\n }\n "])));},maxScreenSize.medium);var StyledDocumentDownloadButton$3=_styled(DocumentDownloadButton).withConfig({displayName:"EmbeddedObjectTile__StyledDocumentDownloadButton",componentId:"sc-yfh5nh-8"})(templateObject_12$3||(templateObject_12$3=__makeTemplateObject(["\n margin-left: auto;\n z-index: 1;\n\n > button i {\n margin: 0;\n color: ",";\n }\n\n margin-right: ","px;\n\n @media (max-width: ","px) {\n margin-right: 0;\n }\n"],["\n margin-left: auto;\n z-index: 1;\n\n > button i {\n margin: 0;\n color: ",";\n }\n\n margin-right: ","px;\n\n @media (max-width: ","px) {\n margin-right: 0;\n }\n"])),function(p){return p.theme.textColors.default;},function(p){return p.marginRight;},maxScreenSize.medium);var templateObject_1$1Q,templateObject_2$17,templateObject_3$L,templateObject_4$w,templateObject_5$s,templateObject_6$i,templateObject_7$c,templateObject_8$b,templateObject_9$9,templateObject_10$8,templateObject_11$4,templateObject_12$3;var EmbeddedObjectList=function EmbeddedObjectList(_a){var attachments=_a.attachments,className=_a.className,onDeleteClick=_a.onDeleteClick,previewTheme=_a.previewTheme;var formatMessage=useIntl().formatMessage;var embeddedObjects=attachments.filter(function(f){return f.type===AttachmentType.Post||f.type===AttachmentType.News||f.type===AttachmentType.Page||f.type===AttachmentType.Event;});if(embeddedObjects.length===0){return null;}if(onDeleteClick){return jsx$1(Host$G,__assign({className:className,"data-embedded-object-attachment-list":true},{children:embeddedObjects.map(function(o){return jsx$1(AttachmentHost,__assign({domIdentifier:"embedded-object",deleteButton:jsx$1(DeleteAttachmentButton,{"data-remove-attachment-button":o.id,iconProps:{iconName:'ChromeClose'},onClick:function(){onDeleteClick(o);},ariaLabel:formatMessage({id:'AriaLabel.removeAttachmentButton'})},void 0)},{children:jsx$1(EmbeddedObjectTile,{id:o.id,type:o.type,previewTheme:previewTheme,readOnly:true},o.id)}),o.id);})}),void 0);}return jsx$1(PreviewHost,__assign({className:className,domIdentifier:"embedded-object-preview-"+embeddedObjects[0].id},{children:jsx$1(EmbeddedObjectTile,{id:embeddedObjects[0].id,type:embeddedObjects[0].type,previewTheme:previewTheme},void 0)}),void 0);};var Host$G=_styled.div.withConfig({displayName:"EmbeddedObjectList__Host",componentId:"sc-axja9n-0"})(templateObject_1$1P||(templateObject_1$1P=__makeTemplateObject(["\n display: inline-flex;\n flex-wrap: wrap;\n width: 100%;\n padding-bottom: ","px;\n\n > div {\n margin-top: ","px;\n }\n"],["\n display: inline-flex;\n flex-wrap: wrap;\n width: 100%;\n padding-bottom: ","px;\n\n > div {\n margin-top: ","px;\n }\n"])),spacingM,spacingM);var PreviewHost=_styled(AttachmentHost).withConfig({displayName:"EmbeddedObjectList__PreviewHost",componentId:"sc-axja9n-1"})(templateObject_2$16||(templateObject_2$16=__makeTemplateObject(["\n margin: ","px 0 0 0;\n\n /* ensure VFI is still visible for Embedded objects */\n [data-embedded-object-id] {\n a[data-clickable-overlay]:focus {\n &::before {\n outline-offset: -5px !important;\n border-radius: ","px;\n }\n }\n }\n"],["\n margin: ","px 0 0 0;\n\n /* ensure VFI is still visible for Embedded objects */\n [data-embedded-object-id] {\n a[data-clickable-overlay]:focus {\n &::before {\n outline-offset: -5px !important;\n border-radius: ","px;\n }\n }\n }\n"])),spacingM,attachmentRoundedCornerSize);var templateObject_1$1P,templateObject_2$16;var ImageAttachmentList=function ImageAttachmentList(_a){var images=_a.images,onDeleteClick=_a.onDeleteClick,disabled=_a.disabled,imageBackgroundColor=_a.imageBackgroundColor,className=_a.className;if(!images||images.length===0){return null;}return jsx$1(List,__assign({className:className},{children:images.map(function(i){return jsx$1(ListItem$1,{children:jsx$1(ImageAttachmentPreview,{attachment:i,disabled:disabled,onDeleteClick:function(){return onDeleteClick(i);},backgroundColor:imageBackgroundColor},void 0)},i.id);})}),void 0);};var List=_styled.ul.withConfig({displayName:"ImageAttachmentList__List",componentId:"sc-7el1kj-0"})(templateObject_1$1O||(templateObject_1$1O=__makeTemplateObject(["\n display: flex;\n flex-wrap: wrap;\n justify-content: space-between;\n margin: 0;\n padding: 0;\n list-style: none;\n"],["\n display: flex;\n flex-wrap: wrap;\n justify-content: space-between;\n margin: 0;\n padding: 0;\n list-style: none;\n"])));var ListItem$1=_styled.li.withConfig({displayName:"ImageAttachmentList__ListItem",componentId:"sc-7el1kj-1"})(templateObject_2$15||(templateObject_2$15=__makeTemplateObject(["\n width: calc(100% - ","px);\n\n @media (min-width: ","px) {\n width: calc(50% - ","px);\n }\n"],["\n width: calc(100% - ","px);\n\n @media (min-width: ","px) {\n width: calc(50% - ","px);\n }\n"])),spacingS-5,minScreenSize.medium,spacingS-5);var ImageAttachmentPreview=function ImageAttachmentPreview(_a){var attachment=_a.attachment,onDeleteClick=_a.onDeleteClick,disabled=_a.disabled,backgroundColor=_a.backgroundColor;var formatMessage=useIntl().formatMessage;return jsxs(AttachmentHost,__assign({domIdentifier:"image",backgroundColor:backgroundColor,deleteButton:!disabled&&jsx$1(StyledDeleteAttachmentButton,{iconProps:{iconName:'Delete'},onClick:onDeleteClick,disabled:attachment.isUploadInProgress,ariaLabel:formatMessage({id:'AriaLabel.removeAttachmentButton'})},void 0)},{children:[attachment.hasError&&jsx$1(AttachmentOverlay,{children:jsx$1("div",{children:jsx$1(WarningIcon,{iconName:"Warning"},void 0)},void 0)},void 0),attachment.isUploadInProgress&&jsx$1(AttachmentOverlay,{children:jsx$1(CenteredSpinner,{size:SpinnerSize.large},void 0)},void 0),jsx$1(Image$1,{src:attachment.previewUrl,height:225,imageFit:ImageFit.centerCover,title:attachment.filename},void 0)]}),void 0);};var AttachmentOverlay=_styled.div.withConfig({displayName:"ImageAttachmentList__AttachmentOverlay",componentId:"sc-7el1kj-2"})(templateObject_3$K||(templateObject_3$K=__makeTemplateObject(["\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n z-index: 2;\n\n background-color: rgba(146, 146, 146, 0.33);\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n border-radius: ","px;\n overflow: hidden;\n /* fix for iOS and Safari: overflow: hidden with border-radius */\n transform: translateZ(0);\n"],["\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n z-index: 2;\n\n background-color: rgba(146, 146, 146, 0.33);\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n border-radius: ","px;\n overflow: hidden;\n /* fix for iOS and Safari: overflow: hidden with border-radius */\n transform: translateZ(0);\n"])),attachmentRoundedCornerSize);var CenteredSpinner=_styled(Spinner).withConfig({displayName:"ImageAttachmentList__CenteredSpinner",componentId:"sc-7el1kj-3"})(templateObject_4$v||(templateObject_4$v=__makeTemplateObject(["\n margin-top: auto;\n height: 100%;\n"],["\n margin-top: auto;\n height: 100%;\n"])));var WarningIcon=_styled(Icon).withConfig({displayName:"ImageAttachmentList__WarningIcon",componentId:"sc-7el1kj-4"})(templateObject_5$r||(templateObject_5$r=__makeTemplateObject(["\n font-size: 100px;\n color: ",";\n"],["\n font-size: 100px;\n color: ",";\n"])),function(p){return p.theme.palette.redDark;});var StyledDeleteAttachmentButton=_styled(DeleteAttachmentButton).withConfig({displayName:"ImageAttachmentList__StyledDeleteAttachmentButton",componentId:"sc-7el1kj-5"})(templateObject_6$h||(templateObject_6$h=__makeTemplateObject(["\n && {\n i {\n font-size: ","px;\n margin: 0;\n }\n }\n"],["\n && {\n i {\n font-size: ","px;\n margin: 0;\n }\n }\n"])),fontSizeMedium);var templateObject_1$1O,templateObject_2$15,templateObject_3$K,templateObject_4$v,templateObject_5$r,templateObject_6$h;var AttachmentList=function AttachmentList(_a){var className=_a.className,files=_a.files,onDeleteAttachmentClick=_a.onDeleteAttachmentClick,disabled=_a.disabled,previewTheme=_a.previewTheme,disableVideoPreview=_a.disableVideoPreview,disableEmbeddedObjectPreview=_a.disableEmbeddedObjectPreview;var attachedImages=files.filter(function(f){return f.type===AttachmentType.Image;});var attachedFiles=files.filter(function(f){return f.type===AttachmentType.File;});var palette=useContext(ThemeContext$1).theme.palette;return jsxs(Host$F,__assign({className:className,hasItems:files.length>0,"data-attachment-list":true},{children:[jsx$1(GifEditList,{attachments:files,onDeleteClick:function(v){return onDeleteAttachmentClick(v);},previewTheme:previewTheme},void 0),jsx$1(ImageAttachmentList,{images:attachedImages,disabled:disabled,onDeleteClick:function(i){return onDeleteAttachmentClick(i);},imageBackgroundColor:previewTheme==='dark'?palette.neutralLight:palette.white},void 0),!disableVideoPreview&&jsx$1(VideoList,{attachments:files,onDeleteClick:function(v){return onDeleteAttachmentClick(v);}},void 0),!disableEmbeddedObjectPreview&&jsx$1(EmbeddedObjectList,{attachments:files,onDeleteClick:function(v){return onDeleteAttachmentClick(v);},previewTheme:previewTheme},void 0),jsx$1(FilesList$1,{files:attachedFiles,onDeleteClick:function(f){return onDeleteAttachmentClick(f);},disabled:disabled},void 0),jsx$1("div",{style:{clear:'both'}},void 0)]}),void 0);};var FilesList$1=_styled(FileAttachmentList).withConfig({displayName:"AttachmentList__FilesList",componentId:"sc-1s0cqp9-0"})(templateObject_1$1N||(templateObject_1$1N=__makeTemplateObject(["\n margin-top: ","px;\n"],["\n margin-top: ","px;\n"])),spacingM);var Host$F=_styled.div.withConfig({displayName:"AttachmentList__Host",componentId:"sc-1s0cqp9-1"})(templateObject_2$14||(templateObject_2$14=__makeTemplateObject(["\n margin-top: ",";\n"],["\n margin-top: ",";\n"])),function(_a){var hasItems=_a.hasItems;return hasItems?'8px':'0';});var templateObject_1$1N,templateObject_2$14;var RichCommentInputWithAttachmentList=/*#__PURE__*/forwardRef(function(props,ref){var _a;return jsxs(Fragment,{children:[jsx$1(RichCommentInput,__assign({},props,{ref:ref}),void 0),jsx$1(AttachmentList,{files:props.attachments,disabled:props.disabled,onDeleteAttachmentClick:props.onDeleteAttachment,previewTheme:(_a=props.inputTheme)!==null&&_a!==void 0?_a:props.attachmentPreviewTheme,disableVideoPreview:props.disableVideoPreview,disableEmbeddedObjectPreview:props.disableEmbeddedObjectPreview},void 0)]},void 0);});var CreateComment=function CreateComment(_a){var className=_a.className,onPost=_a.onPost,autoFocus=_a.autoFocus,readOnly=_a.readOnly,initialContent=_a.content,allowAttachments=_a.allowAttachments,mentionSearchHandler=_a.mentionSearchHandler,useLargeDropTarget=_a.useLargeDropTarget,placeHolderStringResourceKey=_a.placeHolderStringResourceKey,placeHolderStringResourceValues=_a.placeHolderStringResourceValues,_b=_a.focusAfterPost,focusAfterPost=_b===void 0?true:_b,onAttachmentsChanged=_a.onAttachmentsChanged,_c=_a.attachments,attachments=_c===void 0?[]:_c,deletedAttachmentUrls=_a.deletedAttachmentUrls,onDeleteAttachment=_a.onDeleteAttachment,disableDragAndDrop=_a.disableDragAndDrop,allowKeywords=_a.allowKeywords,allowSaveWithoutContent=_a.allowSaveWithoutContent,saveOnEnter=_a.saveOnEnter,saveOnCtrlEnter=_a.saveOnCtrlEnter,keywordSettings=_a.keywordSettings;var availableKeywords=(keywordSettings===null||keywordSettings===void 0?void 0:keywordSettings.availableKeywords)||[];var defaultKeywords=(keywordSettings===null||keywordSettings===void 0?void 0:keywordSettings.defaultKeywords)||[];var mandatoryKeywords=(keywordSettings===null||keywordSettings===void 0?void 0:keywordSettings.mandatoryKeywords)||[];var _d=useState$2(false),isSaving=_d[0],setIsSaving=_d[1];var _e=useState$2(initialContent||''),content=_e[0],setContent=_e[1];var _f=useState$2(null),selectedKeywords=_f[0],setSelectedKeywords=_f[1];var _g=useState$2(false),showKeywordsPicker=_g[0],setShowKeywordsPicker=_g[1];var inputRef=useRef$1(null);var formatMessage=useIntl().formatMessage;var isReadOnly=readOnly||isSaving;var ignoreRef=useRef$1(false);useEffect$1(function(){return function(){ignoreRef.current=true;};},[]);var initialSelectedKeywords=defaultKeywords.concat(mandatoryKeywords);var initialSelectedKeywordIds=initialSelectedKeywords.map(function(k){return k.id;}).join('-');useEffect$1(function(){setSelectedKeywords(initialSelectedKeywords);if(initialSelectedKeywords.length===0){setShowKeywordsPicker(false);}// eslint-disable-next-line react-hooks/exhaustive-deps
122257
- },[initialSelectedKeywordIds]);return jsx$1("div",__assign({className:className},{children:jsx$1(RichCommentInputWithAttachmentList,{defaultKeywords:getGroupedKeywords(selectedKeywords!==null&&selectedKeywords!==void 0?selectedKeywords:defaultKeywords),ref:inputRef,content:content,attachments:attachments,deletedAttachmentUrls:deletedAttachmentUrls,onAttachmentsChange:onAttachmentsChanged,onDeleteAttachment:onDeleteAttachment,onEnter:saveOnEnter&&handleSave,onCtrlEnter:saveOnCtrlEnter&&handleSave,onChange:function(value){return setContent(value);},onFocus:function(){if(initialSelectedKeywords.length>0){setShowKeywordsPicker(true);}},disabled:isReadOnly,autoFocus:autoFocus,mentionSearchHandler:mentionSearchHandler,allowAttachments:allowAttachments,allowKeywords:allowKeywords,availableKeywords:availableKeywords,mandatoryKeywords:mandatoryKeywords,onKeywordsChange:function(keywords){return setSelectedKeywords(keywords);},showKeywordsPicker:showKeywordsPicker,disableDragAndDrop:disableDragAndDrop,useLargeDropTarget:useLargeDropTarget,placeHolderStringResourceKey:placeHolderStringResourceKey,placeHolderStringResourceValues:placeHolderStringResourceValues,buttons:jsxs(Fragment,{children:[allowKeywords&&jsx$1(IconButton,{iconProps:{iconName:'Tag'},onClick:function(){setShowKeywordsPicker(!showKeywordsPicker);},disabled:isReadOnly,"data-button-type":"keywords",ariaLabel:formatMessage({id:'AriaLabel.keywordsButton'})},void 0),jsx$1(IconButton,{iconProps:{iconName:'Send'},disabled:isSaveDisabled(),onClick:handleSave,"data-button-type":"save",ariaLabel:formatMessage({id:'AriaLabel.sendButton'})},'saveButton'+isSaveDisabled())]},void 0)},void 0)}),void 0);function handleSave(){return __awaiter(this,void 0,void 0,function(){var groupedKeywords;return __generator(this,function(_a){switch(_a.label){case 0:if(isSaveDisabled()){return [2/*return*/];}setIsSaving(true);groupedKeywords=getGroupedKeywords(selectedKeywords);return [4/*yield*/,onPost({content:content.trim()},groupedKeywords)];case 1:_a.sent();setShowKeywordsPicker(false);setSelectedKeywords(defaultKeywords||[]);if(!ignoreRef.current){setIsSaving(false);setContent('');if(focusAfterPost){inputRef.current.focus();}}return [2/*return*/];}});});}function isSaveDisabled(){return isReadOnly||!canSaveInput(allowSaveWithoutContent,attachments,content);}};var gutter=2;_styled.div.withConfig({displayName:"LegacyPostPhotoGallery__Gallery",componentId:"sc-ir1n2k-0"})(templateObject_1$1M||(templateObject_1$1M=__makeTemplateObject(["\n overflow: hidden;\n\n margin-left: -","px;\n margin-right: -","px;\n"],["\n overflow: hidden;\n\n margin-left: -","px;\n margin-right: -","px;\n"])),gutter,gutter);_styled.a.withConfig({displayName:"LegacyPostPhotoGallery__ImageItem",componentId:"sc-ir1n2k-1"})(templateObject_2$13||(templateObject_2$13=__makeTemplateObject(["\n background-color: #eee;\n box-sizing: border-box;\n float: left;\n margin: ","px;\n overflow: hidden;\n position: relative;\n width: 100%;\n height: 200px;\n cursor: pointer;\n\n :hover {\n opacity: 0.9;\n }\n\n > * {\n height: 100%;\n }\n\n @media (min-width: ","px) {\n width: calc(50% - ","px);\n height: 200px;\n }\n\n @media (min-width: ","px) {\n width: calc(25% - ","px);\n height: 150px;\n }\n"],["\n background-color: #eee;\n box-sizing: border-box;\n float: left;\n margin: ","px;\n overflow: hidden;\n position: relative;\n width: 100%;\n height: 200px;\n cursor: pointer;\n\n :hover {\n opacity: 0.9;\n }\n\n > * {\n height: 100%;\n }\n\n @media (min-width: ","px) {\n width: calc(50% - ","px);\n height: 200px;\n }\n\n @media (min-width: ","px) {\n width: calc(25% - ","px);\n height: 150px;\n }\n"])),gutter,minScreenSize.small,gutter*2,minScreenSize.medium,gutter*2);var templateObject_1$1M,templateObject_2$13;var ImagesAndFilesList=function ImagesAndFilesList(_a){var item=_a.item,basePath=_a.basePath,imagesGridBackgroundColor=_a.imagesGridBackgroundColor,className=_a.className;var user=useCurrentUser();var _b=useAttachmentsApi(),getImageUrl=_b.getImageUrl,getFileUrl=_b.getFileUrl;var subscriptionId=user.subscription.id;var files=item.attachments.filter(function(a){return a.type===AttachmentType.File;});var images=item.attachments.filter(function(a){return a.type===AttachmentType.Image;});var maxImageWidth=images.length>=4?minScreenSize.medium-spacingX:minScreenSize.large;var galleryDetails=useMemo(function(){var galleryImages=images.map(function(a){var _a;return {previewUrl:(_a=a.previewUrl)!==null&&_a!==void 0?_a:getImageUrl(basePath,subscriptionId,item,a.id,maxImageWidth),imageId:a.id,width:a.width,height:a.height};});return {galleryId:createId(),images:galleryImages};// eslint-disable-next-line react-hooks/exhaustive-deps
122258
- },[item.attachments,item.fileAccessToken,item.attachmentContainerId]);if(images.length===0&&files.length===0){return null;}return jsxs("div",__assign({className:className},{children:[jsx$1(PhotoGrid,{images:galleryDetails.images,imageUrlResolver:function(imageId,width,height){return getImageUrl(basePath,subscriptionId,item,imageId,width,height);},gridBackgroundColor:imagesGridBackgroundColor},void 0),jsx$1(FilesList,{files:files,getFileUrl:function(attachmentId,token){return getFileUrl(basePath,subscriptionId,item,attachmentId,token);},fileAccessToken:item.fileAccessToken},void 0)]}),void 0);};var FilesList=_styled(FileAttachmentList).withConfig({displayName:"ImagesAndFilesList__FilesList",componentId:"sc-1wjy8l6-0"})(templateObject_1$1L||(templateObject_1$1L=__makeTemplateObject(["\n :not(:first-child) {\n margin-top: ","px;\n }\n"],["\n :not(:first-child) {\n margin-top: ","px;\n }\n"])),spacingM);var templateObject_1$1L;var EditComment=function EditComment(_a){var content=_a.content,files=_a.files,deletedFileUrls=_a.deletedFileUrls,onSave=_a.onSave,onCancel=_a.onCancel,className=_a.className,mentionSearchHandler=_a.mentionSearchHandler,allowAttachments=_a.allowAttachments,inputTheme=_a.inputTheme,onAttachmentAdded=_a.onAttachmentAdded,onDeleteAttachment=_a.onDeleteAttachment,allowKeywords=_a.allowKeywords,availableKeywords=_a.availableKeywords,mandatoryKeywords=_a.mandatoryKeywords,keywords=_a.keywords,allowSaveWithoutContent=_a.allowSaveWithoutContent,saveOnEnter=_a.saveOnEnter,saveOnCtrlEnter=_a.saveOnCtrlEnter;var formatMessage=useIntl().formatMessage;var _b=useState$2(content||''),newContent=_b[0],setContent=_b[1];var _c=useState$2(false),showKeywordsPicker=_c[0],setShowKeywordsPicker=_c[1];var _d=useState$2(getFlatKeywordList(keywords)||[]),selectedKeywords=_d[0],setSelectedKeywords=_d[1];var hasMandatoryKeywords=(mandatoryKeywords===null||mandatoryKeywords===void 0?void 0:mandatoryKeywords.length)>0;var automaticallyShowKeywordsPicker=allowKeywords&&(hasMandatoryKeywords||selectedKeywords.length!==0);return jsx$1(RichCommentInputWithAttachmentList,{className:className,content:newContent,attachments:files,deletedAttachmentUrls:deletedFileUrls,autoFocus:true,mentionSearchHandler:mentionSearchHandler,onChange:function(value){return setContent(value);},onEnter:saveOnEnter&&handleSave,onCtrlEnter:saveOnCtrlEnter&&handleSave,onAttachmentsChange:onAttachmentAdded,onDeleteAttachment:onDeleteAttachment,allowAttachments:allowAttachments,allowKeywords:allowKeywords,availableKeywords:availableKeywords,mandatoryKeywords:mandatoryKeywords,defaultKeywords:keywords,onKeywordsChange:function(keywords){return setSelectedKeywords(keywords);},showKeywordsPicker:showKeywordsPicker||automaticallyShowKeywordsPicker,inputTheme:inputTheme,buttons:jsxs(Fragment,{children:[allowKeywords&&jsx$1(IconButton,{iconProps:{iconName:'Tag'},onClick:function(){setShowKeywordsPicker(!showKeywordsPicker);},"data-button-type":"keywords","aria-label":formatMessage({id:'AriaLabel.keywordsButton'})},void 0),jsx$1(IconButton,{iconProps:{iconName:'CheckMark'},disabled:!canSaveInput(allowSaveWithoutContent,files,newContent),onClick:handleSave,"data-button":"save",ariaLabel:formatMessage({id:'AriaLabel.sendButton'})},void 0),jsx$1(IconButton,{iconProps:{iconName:'Cancel'},onClick:onCancel,"data-button":"cancel",ariaLabel:formatMessage({id:'AriaLabel.cancelButton'})},void 0)]},void 0)},void 0);function handleSave(){var groupedKeywords=getGroupedKeywords(selectedKeywords);onSave(newContent.trim(),groupedKeywords);setShowKeywordsPicker(false);}};function useAttachmentUploader(initialAttachments,containerId,basePath){var ignoreRef=useRef$1(false);var warningToastHandle=useRef$1();var _a=useAttachmentsApi(),uploadFile=_a.uploadFile,uploadImage=_a.uploadImage;var showToastWarning=useNotificationContext().showToastWarning;useEffect$1(function(){return function(){ignoreRef.current=true;};},[]);var user=useCurrentUser();var _b=useState$2(initialAttachments),attachments=_b[0],setAttachments=_b[1];var _c=useState$2([]),deletedAttachmentUrls=_c[0],setDeletedAttachmentUrls=_c[1];// eslint-disable-next-line react-hooks/exhaustive-deps
122253
+ $$2$1({global:true,forced:parseInt!=parseIntImplementation},{parseInt:parseIntImplementation});function getMaxImageWidth(defaultMaxWidth){return defaultMaxWidth!==null&&defaultMaxWidth!==void 0?defaultMaxWidth:maxContentWidth;}function getImageWidth(image){var width=typeof image==='string'?parseInt(image):image===null||image===void 0?void 0:image.width;if(!width||isNaN(width)){return getMaxImageWidth();}return Math.min(width,getMaxImageWidth());}function getNewsCardIcon(item,intl){if(hasFlag(item.knownState,KnownNewsState.Alert)){return {name:'Warning',backgroundColor:'red',tooltipText:intl.formatMessage({id:'NewsArticle.alert'})};}if(hasFlag(item.knownState,KnownNewsState.Unconfirmed)){return {name:'Completed',backgroundColor:'green',tooltipText:intl.formatMessage({id:'NewsArticle.confirmationRequired'})};}return null;}var ItemTileLayoutMode;(function(ItemTileLayoutMode){ItemTileLayoutMode["BannerTopMode"]="bannerTop";ItemTileLayoutMode["BannerLeftMode"]="bannerLeft";})(ItemTileLayoutMode||(ItemTileLayoutMode={}));var NewsItemTile=function NewsItemTile(_a){var item=_a.item,baseRoute=_a.baseRoute,layoutMode=_a.layoutMode,filterBaseUrl=_a.filterBaseUrl,dateLabelResourceKey=_a.dateLabelResourceKey,buttons=_a.buttons,openTargetInNewWindow=_a.openTargetInNewWindow,onClick=_a.onClick,onChannelClick=_a.onChannelClick,onKeywordClick=_a.onKeywordClick,styleDefinition=_a.styleDefinition,readOnly=_a.readOnly,className=_a.className;var user=useCurrentUserContext().user;var token=useCurrentToken();var intl=useIntl();var features=useFeatures();var title=getTitle(item,user,intl.formatMessage);var headline=getHeadline(item,user);var language=NewsService.getLanguageForPublishableItem(item,user);var handleExternalContentClick=useExternalContentClickHandler();var targetRoute=NewsService.getNewsRouteWithRedirect(baseRoute,item.id,title,item.useExternalContent);var hasKeywords=Object.keys(item.keywords).length>0;var content=item.contents[language];var hasIntro=content.intro&&content.intro.length>0;var icon=getNewsCardIcon(item,intl);var preferredContentLanguage=getPreferredContentLanguage(user);var url=getExternalContentUrl(item,preferredContentLanguage);return jsxs(Host$J,__assign({hasBanner:item.bannerInfo!=null,layoutMode:layoutMode,styleDefinition:styleDefinition,"data-item-id":item.id,className:className},{children:[!readOnly&&jsx$1(ClickableOverlay,{itemId:item.id,itemType:ItemResourceTypes.News,baseRoute:baseRoute,onClick:onClick,title:title,openTargetInNewWindow:openTargetInNewWindow,isExternalContent:item.useExternalContent},void 0),jsx$1(Banner$1$1,{item:item,token:item.fileAccessToken||token,resourceType:ItemResourceTypes.News,layoutMode:layoutMode,bannerDefaultWidth:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.bannerDefaultWidth,showPlaceholderIfNoBannerInfo:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.showPlaceholderIfNoBannerInfo},void 0),jsxs(Content$5,{children:[jsxs(MetaInfoAndIcon,{children:[jsxs(MetaInfo$2,__assign({showChannelsToTheRight:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.showChannelsToTheRight},{children:[dateLabelResourceKey&&jsxs(Fragment,{children:[jsx$1(FormattedMessage$1,{id:dateLabelResourceKey},void 0),":\u00A0"]},void 0),jsx$1(DateTime,{value:item.publishingDate},void 0),jsxs(Fragment,{children:["\u2002",jsx$1(StyledClickableChannelTitles,{channels:item.channels.map(function(c){return c.name;}),language:getPreferredContentLanguage(user),channelBackgroundColor:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.channelsBackgroundColor,onClick:onChannelClick},void 0)]},void 0)]}),void 0),icon&&jsx$1(NewsCardIcon$1,{children:jsx$1(Tooltip,__assign({text:icon.tooltipText},{children:jsx$1(StyledIcon$4$1,{iconName:icon.name,backgroundColor:icon.backgroundColor},void 0)}),item.id+"-"+icon.name)},void 0)]},void 0),features.contentHeadline&&!!headline&&jsx$1(Headline$2,{children:headline},void 0),jsx$1(StyledTitle$2,{title:title,targetRoute:targetRoute,readOnly:readOnly,openTargetInNewWindow:openTargetInNewWindow,onClick:function(e){if(onClick){onClick(e,true);}else {handleExternalContentClick(e,item,ItemResourceTypes.News);}},isExternalContent:item.useExternalContent,resourceKey:"ExternalLinkButton.news.navigateTo",resourceValues:url},void 0),hasIntro&&jsx$1(Intro$1$1,{children:content.intro},void 0),hasKeywords&&jsx$1(StyledKeywords,{item:item,filterBaseUrl:filterBaseUrl,onClick:onKeywordClick},void 0),buttons&&jsx$1(Footer,__assign({alignItemsToTheRight:styleDefinition===null||styleDefinition===void 0?void 0:styleDefinition.showChannelsToTheRight},{children:buttons}),void 0)]},void 0)]}),void 0);};var Host$J=_styled.article.withConfig({displayName:"NewsItemTile__Host",componentId:"sc-15drgb8-0"})(templateObject_4$x||(templateObject_4$x=__makeTemplateObject(["\n ","\n ",";\n\n ","\n\n ","\n\n ","\n\n position: relative;\n"],["\n ","\n ",";\n\n ","\n\n ","\n\n ","\n\n position: relative;\n"])),function(p){var _a;return HostBaseStyle((_a=p.styleDefinition)===null||_a===void 0?void 0:_a.backgroundColor);},function(p){var _a;return !((_a=p.styleDefinition)===null||_a===void 0?void 0:_a.noShadow)&&CardBorderInline(2,2);},function(p){return p.hasBanner&&css$2(templateObject_1$1U||(templateObject_1$1U=__makeTemplateObject(["\n min-height: 138px;\n "],["\n min-height: 138px;\n "])));},function(p){return (!p.layoutMode||p.layoutMode===ItemTileLayoutMode.BannerLeftMode)&&css$2(templateObject_2$1a||(templateObject_2$1a=__makeTemplateObject(["\n @media (max-width: ","px) {\n flex-direction: column;\n }\n "],["\n @media (max-width: ","px) {\n flex-direction: column;\n }\n "])),maxScreenSize.medium);},function(p){return p.layoutMode===ItemTileLayoutMode.BannerTopMode&&css$2(templateObject_3$O||(templateObject_3$O=__makeTemplateObject(["\n flex-direction: column;\n "],["\n flex-direction: column;\n "])));});var StyledTitle$2=_styled(Title$8).withConfig({displayName:"NewsItemTile__StyledTitle",componentId:"sc-15drgb8-1"})(templateObject_5$t||(templateObject_5$t=__makeTemplateObject(["\n &&& {\n margin-right: auto;\n display: inline-flex;\n }\n\n i[data-external-content] {\n font-size: ","px;\n line-height: ","px;\n }\n"],["\n &&& {\n margin-right: auto;\n display: inline-flex;\n }\n\n i[data-external-content] {\n font-size: ","px;\n line-height: ","px;\n }\n"])),fontSizeMedium,fontSizeSmall);var Content$5=_styled.div.withConfig({displayName:"NewsItemTile__Content",componentId:"sc-15drgb8-2"})(templateObject_6$j||(templateObject_6$j=__makeTemplateObject(["\n ","\n padding: ","px;\n"],["\n ","\n padding: ","px;\n"])),ContentStyle,spacingM);var Headline$2=_styled.div.withConfig({displayName:"NewsItemTile__Headline",componentId:"sc-15drgb8-3"})(templateObject_7$d||(templateObject_7$d=__makeTemplateObject(["\n font-size: ","px;\n font-weight: bold;\n margin-bottom: ","px;\n"],["\n font-size: ","px;\n font-weight: bold;\n margin-bottom: ","px;\n"])),fontSizeSmall,spacingS);var Intro$1$1=_styled.p.withConfig({displayName:"NewsItemTile__Intro",componentId:"sc-15drgb8-4"})(templateObject_8$c||(templateObject_8$c=__makeTemplateObject(["\n margin: 0;\n font-size: ","px;\n"],["\n margin: 0;\n font-size: ","px;\n"])),fontSizeNormal);var MetaInfoAndIcon=_styled.div.withConfig({displayName:"NewsItemTile__MetaInfoAndIcon",componentId:"sc-15drgb8-5"})(templateObject_9$a||(templateObject_9$a=__makeTemplateObject(["\n display: flex;\n"],["\n display: flex;\n"])));var MetaInfo$2=_styled.div.withConfig({displayName:"NewsItemTile__MetaInfo",componentId:"sc-15drgb8-6"})(templateObject_11$5||(templateObject_11$5=__makeTemplateObject(["\n ","\n color: ",";\n margin-bottom: ","px;\n\n ","\n"],["\n ","\n color: ",";\n margin-bottom: ","px;\n\n ","\n"])),MetaInfoStyle(),function(p){return p.theme.palette.neutralTertiary;},spacingS,function(p){return p.showChannelsToTheRight&&css$2(templateObject_10$9||(templateObject_10$9=__makeTemplateObject(["\n width: 100%;\n\n time {\n margin-right: auto;\n }\n "],["\n width: 100%;\n\n time {\n margin-right: auto;\n }\n "])));});var NewsCardIcon$1=_styled.div.withConfig({displayName:"NewsItemTile__NewsCardIcon",componentId:"sc-15drgb8-7"})(templateObject_12$4||(templateObject_12$4=__makeTemplateObject(["\n display: flex;\n margin-left: auto;\n z-index: 10;\n"],["\n display: flex;\n margin-left: auto;\n z-index: 10;\n"])));var StyledIcon$4$1=_styled(Icon).withConfig({displayName:"NewsItemTile__StyledIcon",componentId:"sc-15drgb8-8"})(templateObject_13$3||(templateObject_13$3=__makeTemplateObject(["\n font-size: ","px;\n width: 24px;\n height: 24px;\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n margin-left: ","px;\n cursor: pointer;\n\n background-color: ",";\n color: ",";\n"],["\n font-size: ","px;\n width: 24px;\n height: 24px;\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n margin-left: ","px;\n cursor: pointer;\n\n background-color: ",";\n color: ",";\n"])),fontSizeSmaller,spacingXs,function(p){return p.backgroundColor;},function(p){return p.theme.palette.white;});var StyledKeywords=_styled(FlatKeywords).withConfig({displayName:"NewsItemTile__StyledKeywords",componentId:"sc-15drgb8-9"})(templateObject_14$3||(templateObject_14$3=__makeTemplateObject(["\n margin-top: ","px;\n font-size: ","px;\n\n && a {\n &,\n :link,\n :visited {\n color: ",";\n }\n }\n"],["\n margin-top: ","px;\n font-size: ","px;\n\n && a {\n &,\n :link,\n :visited {\n color: ",";\n }\n }\n"])),spacingS,fontSizeSmall,function(p){return p.theme.palette.neutralTertiary;});var Footer=_styled.footer.withConfig({displayName:"NewsItemTile__Footer",componentId:"sc-15drgb8-10"})(templateObject_16$3||(templateObject_16$3=__makeTemplateObject(["\n display: flex;\n align-items: center;\n padding-top: ","px;\n margin-top: auto;\n ","\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n\n .ms-TooltipHost {\n display: flex;\n align-items: center;\n margin-right: ","px;\n\n i {\n font-size: 22px;\n }\n }\n"],["\n display: flex;\n align-items: center;\n padding-top: ","px;\n margin-top: auto;\n ","\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n\n .ms-TooltipHost {\n display: flex;\n align-items: center;\n margin-right: ","px;\n\n i {\n font-size: 22px;\n }\n }\n"])),spacingS,function(p){return p.alignItemsToTheRight&&css$2(templateObject_15$3||(templateObject_15$3=__makeTemplateObject(["\n justify-content: flex-end;\n "],["\n justify-content: flex-end;\n "])));},spacingS+5);var Banner$1$1=function Banner(_a){var item=_a.item,token=_a.token,resourceType=_a.resourceType,layoutMode=_a.layoutMode,bannerDefaultWidth=_a.bannerDefaultWidth,showPlaceholderIfNoBannerInfo=_a.showPlaceholderIfNoBannerInfo;var bannerInfo=item.bannerInfo;if(!bannerInfo&&!showPlaceholderIfNoBannerInfo){return null;}var banner=getBanner();return jsx$1("div",{children:banner},void 0);function getBanner(){if(layoutMode===ItemTileLayoutMode.BannerTopMode){return jsx$1(TopBannerWrapper,__assign({showPlaceholder:!bannerInfo&&showPlaceholderIfNoBannerInfo},{children:jsx$1(TopBannerInner,{children:jsx$1(PublishableItemBanner,{itemId:item.id,bannerInfo:bannerInfo,width:getMaxImageWidth(),token:item.fileAccessToken||token,resourceType:resourceType},void 0)},void 0)}),void 0);}return jsx$1(LeftBannerWrapper,__assign({defaultWidth:bannerDefaultWidth!==null&&bannerDefaultWidth!==void 0?bannerDefaultWidth:150,showPlaceholder:!bannerInfo&&showPlaceholderIfNoBannerInfo},{children:jsx$1(PublishableItemBanner,{itemId:item.id,bannerInfo:bannerInfo,width:getMaxImageWidth(450),token:item.fileAccessToken||token,resourceType:resourceType},void 0)}),void 0);}};var TopBannerWrapper=_styled.div.withConfig({displayName:"NewsItemTile__TopBannerWrapper",componentId:"sc-15drgb8-11"})(templateObject_18$1||(templateObject_18$1=__makeTemplateObject(["\n position: relative;\n width: 100%;\n padding-top: calc(100% * (1 / ","));\n ","\n"],["\n position: relative;\n width: 100%;\n padding-top: calc(100% * (1 / ","));\n ","\n"])),bannerAspectRatio,function(p){return p.showPlaceholder&&css$2(templateObject_17$2||(templateObject_17$2=__makeTemplateObject(["\n background-color: ",";\n "],["\n background-color: ",";\n "])),p.theme.palette.accent);});var TopBannerInner=_styled.div.withConfig({displayName:"NewsItemTile__TopBannerInner",componentId:"sc-15drgb8-12"})(templateObject_19$1||(templateObject_19$1=__makeTemplateObject(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"],["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"])));var StyledClickableChannelTitles=_styled(ClickableChannelTitles).withConfig({displayName:"NewsItemTile__StyledClickableChannelTitles",componentId:"sc-15drgb8-13"})(templateObject_20$3||(templateObject_20$3=__makeTemplateObject(["\n z-index: 1;\n"],["\n z-index: 1;\n"])));var templateObject_1$1U,templateObject_2$1a,templateObject_3$O,templateObject_4$x,templateObject_5$t,templateObject_6$j,templateObject_7$d,templateObject_8$c,templateObject_9$a,templateObject_10$9,templateObject_11$5,templateObject_12$4,templateObject_13$3,templateObject_14$3,templateObject_15$3,templateObject_16$3,templateObject_17$2,templateObject_18$1,templateObject_19$1,templateObject_20$3;var DocumentDownloadButton=function DocumentDownloadButton(_a){var _b;var page=_a.page,basePath=_a.basePath,onClick=_a.onClick,className=_a.className;var formatMessage=useIntl().formatMessage;var currentUser=useCurrentUser();var createDocumentClickHandler=usePagesClickHandler().createDocumentClickHandler;if(page.pageType!==PageType.Document){return null;}var _c=getContentForPage(page,currentUser),content=_c.content,language=_c.language;var fileInfo=content===null||content===void 0?void 0:content.fileInfo;var title=content===null||content===void 0?void 0:content.title;if(!fileInfo||!language){return null;}return jsx$1(StyledTooltip$1,__assign({resourceKey:'Pages.documents.downloadButton.tooltip',values:{fileName:title||fileInfo.fileName},className:className},{children:jsx$1(IconButton,{iconProps:{iconName:'Download'},onClick:createDocumentClickHandler(page.id,fileInfo.fileId,language,fileInfo.shouldOpenInBrowser,(_b=page)===null||_b===void 0?void 0:_b.fileAccessToken,basePath,onClick),ariaLabel:formatMessage({id:'Pages.documents.downloadButton.tooltip'},{fileName:title||fileInfo.fileName})},void 0)}),void 0);};var StyledTooltip$1=_styled(Tooltip).withConfig({displayName:"DocumentDownloadButton__StyledTooltip",componentId:"sc-1lgs2rp-0"})(templateObject_1$1T||(templateObject_1$1T=__makeTemplateObject(["\n display: inline-flex;\n\n > button {\n border: 0;\n padding: 0;\n height: 28px; // this is needed for the focus indicator\n\n i {\n color: ",";\n }\n }\n"],["\n display: inline-flex;\n\n > button {\n border: 0;\n padding: 0;\n height: 28px; // this is needed for the focus indicator\n\n i {\n color: ",";\n }\n }\n"])),function(p){return p.theme.textColors.default;});var templateObject_1$1T;var EmbeddedObjectTile=function EmbeddedObjectTile(_a){var _b;var id=_a.id,type=_a.type,readOnly=_a.readOnly,previewTheme=_a.previewTheme,buttons=_a.buttons,groupIds=_a.groupIds,className=_a.className;var getPost=usePostsApi().getPost;var getNews=useNewsApi().get;var loadPage=usePagesApi().loadPage;var getEvent=useEventsApi().getEvent;var buildPath=useSubscriptionHandlePathBuilder().buildPath;var _c=usePromise$2(fetchItem),item=_c[0],isLoading=_c[1],error=_c[2];var useDarkTheme=previewTheme==='dark';var palette=useContext(ThemeContext$1).theme.palette;var user=useCurrentUser();var backgroundColor=useDarkTheme?palette.neutralLight:palette.white;if(isLoading){return jsx$1(SpinnerHost,{children:jsx$1(StyledSpinner$2,{size:SpinnerSize.large},void 0)},void 0);}if(((_b=error===null||error===void 0?void 0:error.response)===null||_b===void 0?void 0:_b.statusCode)===403){return jsxs(Host$I,__assign({backgroundColor:backgroundColor,className:className,"data-warning-access-denied":true},{children:[buttons,jsx$1(EmbeddedObjectWarningTile,{iconName:"LockSolid",iconLabel:"Generic.noAccess",messageResourceKey:"Generic.noAccessReason"},void 0)]}),void 0);}if(error||!item){return jsxs(Host$I,__assign({backgroundColor:backgroundColor,className:className,"data-warning-not-found":true},{children:[buttons,jsx$1(EmbeddedObjectWarningTile,{iconName:"AlertSolid",iconLabel:"Generic.itemNotFound",messageResourceKey:"Generic.deletedItemReason"},void 0)]}),void 0);}var itemGroupIds=getItemGroupIds();return jsxs(Fragment,{children:[jsxs(Host$I,__assign({backgroundColor:backgroundColor,className:className,"data-embedded-object-id":id},{children:[buttons,renderEmbeddedObjectTile()]}),void 0),groupIds&&groupIds.every(function(gid){return !itemGroupIds.includes(gid);})&&jsx$1(DifferentGroupWarning,__assign({"data-warning-different-group":true},{children:jsx$1(EmbeddedObjectWarningTile,{messageResourceKey:"Generic.differentGroupWarning"},void 0)}),void 0)]},void 0);function getItemGroupIds(){var _a,_b;var groupIds=(_a=item)===null||_a===void 0?void 0:_a.groupIds;if(groupIds){return groupIds;}var groupId=(_b=item)===null||_b===void 0?void 0:_b.groupId;return groupId?[groupId]:null;}function fetchItem(){return __awaiter(this,void 0,void 0,function(){var _a;return __generator(this,function(_b){switch(_b.label){case 0:_a=type;switch(_a){case AttachmentType.Post:return [3/*break*/,1];case AttachmentType.News:return [3/*break*/,3];case AttachmentType.Page:return [3/*break*/,5];case AttachmentType.Event:return [3/*break*/,7];}return [3/*break*/,9];case 1:return [4/*yield*/,getPost(id)];case 2:return [2/*return*/,_b.sent()];case 3:return [4/*yield*/,getNews(id).toPromise()];case 4:return [2/*return*/,_b.sent()];case 5:return [4/*yield*/,loadPage(id)];case 6:return [2/*return*/,_b.sent()];case 7:return [4/*yield*/,getEvent(id)];case 8:return [2/*return*/,_b.sent()];case 9:throw Error('Invalid type');}});});}function renderEmbeddedObjectTile(){var _a;if(type===AttachmentType.Post){return jsx$1(PostItemTile,{post:item,backgroundColor:backgroundColor,readOnly:readOnly},void 0);}if(type===AttachmentType.News){var newsItem=item;return jsx$1(NewsItemTile,{item:newsItem,baseRoute:buildPath('news'),styleDefinition:{backgroundColor:backgroundColor,noShadow:true,channelsBackgroundColor:useDarkTheme&&palette.white},readOnly:readOnly},void 0);}if(type===AttachmentType.Page){var pageItem=item;return jsx$1(StyledPageItemTile$1,{item:pageItem,baseRoute:buildPath('pages'),styleDefinition:{backgroundColor:backgroundColor,bannerDefaultWidth:150,bannerFontSize:60},readOnly:readOnly,isBannerClickable:((_a=pageItem.bannerInfo)===null||_a===void 0?void 0:_a.type)==='video',additionalMetadata:jsx$1(StyledDocumentDownloadButton$3,{page:item,marginRight:readOnly?spacingM:0},void 0),showBreadcrumb:true,showIntro:true},void 0);}var language=NewsService.getLanguageForPublishableItem(item,user);return jsx$1(EventCard,{item:item,language:language,styleDefinition:{backgroundColor:backgroundColor,noShadow:true,channelsBackgroundColor:useDarkTheme&&palette.white,bannerHostWidth:150},readOnly:readOnly},void 0);}};var Host$I=_styled.div.withConfig({displayName:"EmbeddedObjectTile__Host",componentId:"sc-yfh5nh-0"})(templateObject_3$N||(templateObject_3$N=__makeTemplateObject(["\n width: 100%;\n ","\n"],["\n width: 100%;\n ","\n"])),function(p){return p.backgroundColor?css$2(templateObject_1$1S||(templateObject_1$1S=__makeTemplateObject(["\n background-color: ",";\n "],["\n background-color: ",";\n "])),p.backgroundColor):css$2(templateObject_2$19||(templateObject_2$19=__makeTemplateObject(["\n background-color: ",";\n "],["\n background-color: ",";\n "])),function(p){return p.theme.palette.white;});});var DifferentGroupWarning=_styled.div.withConfig({displayName:"EmbeddedObjectTile__DifferentGroupWarning",componentId:"sc-yfh5nh-1"})(templateObject_4$w||(templateObject_4$w=__makeTemplateObject(["\n background-color: ",";\n color: ",";\n font-size: ","px;\n"],["\n background-color: ",";\n color: ",";\n font-size: ","px;\n"])),function(p){return p.theme.semanticColors.errorBackground;},function(p){return p.theme.palette.red;},fontSizeSmall);var EmbeddedObjectWarningTile=function EmbeddedObjectWarningTile(_a){var messageResourceKey=_a.messageResourceKey,iconName=_a.iconName,iconLabel=_a.iconLabel;return jsxs(WarningHost,{children:[(iconName||iconLabel)&&jsxs(Title$7,{children:[iconName&&jsx$1(StyleIcon,{iconName:iconName},void 0),iconLabel&&jsx$1(FormattedMessageWithStyle,{id:iconLabel},void 0)]},void 0),jsx$1(FormattedMessageWithStyle,{id:messageResourceKey},void 0)]},void 0);};var WarningHost=_styled.div.withConfig({displayName:"EmbeddedObjectTile__WarningHost",componentId:"sc-yfh5nh-2"})(templateObject_5$s||(templateObject_5$s=__makeTemplateObject(["\n padding: ","px;\n"],["\n padding: ","px;\n"])),spacingM);var Title$7=_styled.div.withConfig({displayName:"EmbeddedObjectTile__Title",componentId:"sc-yfh5nh-3"})(templateObject_6$i||(templateObject_6$i=__makeTemplateObject(["\n display: flex;\n align-items: center;\n font-weight: bold;\n font-size: ","px;\n margin-bottom: ","px;\n"],["\n display: flex;\n align-items: center;\n font-weight: bold;\n font-size: ","px;\n margin-bottom: ","px;\n"])),fontSizeMedium,spacingS);var SpinnerHost=_styled.div.withConfig({displayName:"EmbeddedObjectTile__SpinnerHost",componentId:"sc-yfh5nh-4"})(templateObject_7$c||(templateObject_7$c=__makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n margin-top: ","px;\n"],["\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n margin-top: ","px;\n"])),spacingL);var StyledSpinner$2=_styled(Spinner).withConfig({displayName:"EmbeddedObjectTile__StyledSpinner",componentId:"sc-yfh5nh-5"})(templateObject_8$b||(templateObject_8$b=__makeTemplateObject(["\n margin-top: 0;\n margin-bottom: ","px;\n"],["\n margin-top: 0;\n margin-bottom: ","px;\n"])),spacingL);var StyleIcon=_styled(Icon).withConfig({displayName:"EmbeddedObjectTile__StyleIcon",componentId:"sc-yfh5nh-6"})(templateObject_9$9||(templateObject_9$9=__makeTemplateObject(["\n padding-right: ","px;\n"],["\n padding-right: ","px;\n"])),spacingS);var StyledPageItemTile$1=_styled(PageItemTile).withConfig({displayName:"EmbeddedObjectTile__StyledPageItemTile",componentId:"sc-yfh5nh-7"})(templateObject_11$4||(templateObject_11$4=__makeTemplateObject(["\n ","\n\n @media (max-width: ","px) {\n > div {\n flex-direction: column;\n }\n\n [data-page-tile-content] {\n max-width: 100%;\n }\n }\n"],["\n ","\n\n @media (max-width: ","px) {\n > div {\n flex-direction: column;\n }\n\n [data-page-tile-content] {\n max-width: 100%;\n }\n }\n"])),function(p){return p.isBannerClickable&&css$2(templateObject_10$8||(templateObject_10$8=__makeTemplateObject(["\n [data-page-tile-content] {\n position: relative;\n }\n "],["\n [data-page-tile-content] {\n position: relative;\n }\n "])));},maxScreenSize.medium);var StyledDocumentDownloadButton$3=_styled(DocumentDownloadButton).withConfig({displayName:"EmbeddedObjectTile__StyledDocumentDownloadButton",componentId:"sc-yfh5nh-8"})(templateObject_12$3||(templateObject_12$3=__makeTemplateObject(["\n margin-left: auto;\n z-index: 1;\n\n > button i {\n margin: 0;\n color: ",";\n }\n\n margin-right: ","px;\n\n @media (max-width: ","px) {\n margin-right: 0;\n }\n"],["\n margin-left: auto;\n z-index: 1;\n\n > button i {\n margin: 0;\n color: ",";\n }\n\n margin-right: ","px;\n\n @media (max-width: ","px) {\n margin-right: 0;\n }\n"])),function(p){return p.theme.textColors.default;},function(p){return p.marginRight;},maxScreenSize.medium);var templateObject_1$1S,templateObject_2$19,templateObject_3$N,templateObject_4$w,templateObject_5$s,templateObject_6$i,templateObject_7$c,templateObject_8$b,templateObject_9$9,templateObject_10$8,templateObject_11$4,templateObject_12$3;var EmbeddedObjectList=function EmbeddedObjectList(_a){var attachments=_a.attachments,className=_a.className,onDeleteClick=_a.onDeleteClick,previewTheme=_a.previewTheme;var formatMessage=useIntl().formatMessage;var embeddedObjects=attachments.filter(function(f){return f.type===AttachmentType.Post||f.type===AttachmentType.News||f.type===AttachmentType.Page||f.type===AttachmentType.Event;});if(embeddedObjects.length===0){return null;}if(onDeleteClick){return jsx$1(Host$H,__assign({className:className,"data-embedded-object-attachment-list":true},{children:embeddedObjects.map(function(o){return jsx$1(AttachmentHost,__assign({domIdentifier:"embedded-object",deleteButton:jsx$1(DeleteAttachmentButton,{"data-remove-attachment-button":o.id,iconProps:{iconName:'ChromeClose'},onClick:function(){onDeleteClick(o);},ariaLabel:formatMessage({id:'AriaLabel.removeAttachmentButton'})},void 0)},{children:jsx$1(EmbeddedObjectTile,{id:o.id,type:o.type,previewTheme:previewTheme,readOnly:true},o.id)}),o.id);})}),void 0);}return jsx$1(PreviewHost,__assign({className:className,domIdentifier:"embedded-object-preview-"+embeddedObjects[0].id},{children:jsx$1(EmbeddedObjectTile,{id:embeddedObjects[0].id,type:embeddedObjects[0].type,previewTheme:previewTheme},void 0)}),void 0);};var Host$H=_styled.div.withConfig({displayName:"EmbeddedObjectList__Host",componentId:"sc-axja9n-0"})(templateObject_1$1R||(templateObject_1$1R=__makeTemplateObject(["\n display: inline-flex;\n flex-wrap: wrap;\n width: 100%;\n\n > div {\n margin-top: ","px;\n }\n"],["\n display: inline-flex;\n flex-wrap: wrap;\n width: 100%;\n\n > div {\n margin-top: ","px;\n }\n"])),spacingM);var PreviewHost=_styled(AttachmentHost).withConfig({displayName:"EmbeddedObjectList__PreviewHost",componentId:"sc-axja9n-1"})(templateObject_2$18||(templateObject_2$18=__makeTemplateObject(["\n margin: ","px 0 0 0;\n\n /* ensure VFI is still visible for Embedded objects */\n [data-embedded-object-id] {\n a[data-clickable-overlay]:focus {\n &::before {\n outline-offset: -5px !important;\n border-radius: ","px;\n }\n }\n }\n"],["\n margin: ","px 0 0 0;\n\n /* ensure VFI is still visible for Embedded objects */\n [data-embedded-object-id] {\n a[data-clickable-overlay]:focus {\n &::before {\n outline-offset: -5px !important;\n border-radius: ","px;\n }\n }\n }\n"])),spacingM,attachmentRoundedCornerSize);var templateObject_1$1R,templateObject_2$18;var ImageAttachmentList=function ImageAttachmentList(_a){var images=_a.images,onDeleteClick=_a.onDeleteClick,disabled=_a.disabled,imageBackgroundColor=_a.imageBackgroundColor,className=_a.className;if(!images||images.length===0){return null;}return jsx$1(List,__assign({className:className},{children:images.map(function(i){return jsx$1(ListItem$1,{children:jsx$1(ImageAttachmentPreview,{attachment:i,disabled:disabled,onDeleteClick:function(){return onDeleteClick(i);},backgroundColor:imageBackgroundColor},void 0)},i.id);})}),void 0);};var List=_styled.ul.withConfig({displayName:"ImageAttachmentList__List",componentId:"sc-7el1kj-0"})(templateObject_1$1Q||(templateObject_1$1Q=__makeTemplateObject(["\n display: flex;\n flex-wrap: wrap;\n justify-content: space-between;\n margin: 0;\n padding: 0;\n list-style: none;\n"],["\n display: flex;\n flex-wrap: wrap;\n justify-content: space-between;\n margin: 0;\n padding: 0;\n list-style: none;\n"])));var ListItem$1=_styled.li.withConfig({displayName:"ImageAttachmentList__ListItem",componentId:"sc-7el1kj-1"})(templateObject_2$17||(templateObject_2$17=__makeTemplateObject(["\n width: calc(100% - ","px);\n\n @media (min-width: ","px) {\n width: calc(50% - ","px);\n }\n"],["\n width: calc(100% - ","px);\n\n @media (min-width: ","px) {\n width: calc(50% - ","px);\n }\n"])),spacingS-5,minScreenSize.medium,spacingS-5);var ImageAttachmentPreview=function ImageAttachmentPreview(_a){var attachment=_a.attachment,onDeleteClick=_a.onDeleteClick,disabled=_a.disabled,backgroundColor=_a.backgroundColor;var formatMessage=useIntl().formatMessage;return jsxs(AttachmentHost,__assign({domIdentifier:"image",backgroundColor:backgroundColor,deleteButton:!disabled&&jsx$1(StyledDeleteAttachmentButton,{iconProps:{iconName:'Delete'},onClick:onDeleteClick,disabled:attachment.isUploadInProgress,ariaLabel:formatMessage({id:'AriaLabel.removeAttachmentButton'})},void 0)},{children:[attachment.hasError&&jsx$1(AttachmentOverlay,{children:jsx$1("div",{children:jsx$1(WarningIcon,{iconName:"Warning"},void 0)},void 0)},void 0),attachment.isUploadInProgress&&jsx$1(AttachmentOverlay,{children:jsx$1(CenteredSpinner,{size:SpinnerSize.large},void 0)},void 0),jsx$1(Image$1,{src:attachment.previewUrl,height:225,imageFit:ImageFit.centerCover,title:attachment.filename},void 0)]}),void 0);};var AttachmentOverlay=_styled.div.withConfig({displayName:"ImageAttachmentList__AttachmentOverlay",componentId:"sc-7el1kj-2"})(templateObject_3$M||(templateObject_3$M=__makeTemplateObject(["\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n z-index: 2;\n\n background-color: rgba(146, 146, 146, 0.33);\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n border-radius: ","px;\n overflow: hidden;\n /* fix for iOS and Safari: overflow: hidden with border-radius */\n transform: translateZ(0);\n"],["\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n z-index: 2;\n\n background-color: rgba(146, 146, 146, 0.33);\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n border-radius: ","px;\n overflow: hidden;\n /* fix for iOS and Safari: overflow: hidden with border-radius */\n transform: translateZ(0);\n"])),attachmentRoundedCornerSize);var CenteredSpinner=_styled(Spinner).withConfig({displayName:"ImageAttachmentList__CenteredSpinner",componentId:"sc-7el1kj-3"})(templateObject_4$v||(templateObject_4$v=__makeTemplateObject(["\n margin-top: auto;\n height: 100%;\n"],["\n margin-top: auto;\n height: 100%;\n"])));var WarningIcon=_styled(Icon).withConfig({displayName:"ImageAttachmentList__WarningIcon",componentId:"sc-7el1kj-4"})(templateObject_5$r||(templateObject_5$r=__makeTemplateObject(["\n font-size: 100px;\n color: ",";\n"],["\n font-size: 100px;\n color: ",";\n"])),function(p){return p.theme.palette.redDark;});var StyledDeleteAttachmentButton=_styled(DeleteAttachmentButton).withConfig({displayName:"ImageAttachmentList__StyledDeleteAttachmentButton",componentId:"sc-7el1kj-5"})(templateObject_6$h||(templateObject_6$h=__makeTemplateObject(["\n && {\n i {\n font-size: ","px;\n margin: 0;\n }\n }\n"],["\n && {\n i {\n font-size: ","px;\n margin: 0;\n }\n }\n"])),fontSizeMedium);var templateObject_1$1Q,templateObject_2$17,templateObject_3$M,templateObject_4$v,templateObject_5$r,templateObject_6$h;var AttachmentList=function AttachmentList(_a){var className=_a.className,files=_a.files,onDeleteAttachmentClick=_a.onDeleteAttachmentClick,disabled=_a.disabled,previewTheme=_a.previewTheme,disableVideoPreview=_a.disableVideoPreview,disableEmbeddedObjectPreview=_a.disableEmbeddedObjectPreview;var attachedImages=files.filter(function(f){return f.type===AttachmentType.Image;});var attachedFiles=files.filter(function(f){return f.type===AttachmentType.File;});var palette=useContext(ThemeContext$1).theme.palette;return jsxs(Host$G,__assign({className:className,"data-attachment-list":true},{children:[jsx$1(GifEditList,{attachments:files,onDeleteClick:function(v){return onDeleteAttachmentClick(v);},previewTheme:previewTheme},void 0),jsx$1(ImageAttachmentList,{images:attachedImages,disabled:disabled,onDeleteClick:function(i){return onDeleteAttachmentClick(i);},imageBackgroundColor:previewTheme==='dark'?palette.neutralLight:palette.white},void 0),!disableVideoPreview&&jsx$1(VideoList,{attachments:files,onDeleteClick:function(v){return onDeleteAttachmentClick(v);}},void 0),!disableEmbeddedObjectPreview&&jsx$1(EmbeddedObjectList,{attachments:files,onDeleteClick:function(v){return onDeleteAttachmentClick(v);},previewTheme:previewTheme},void 0),jsx$1(FilesList$1,{files:attachedFiles,onDeleteClick:function(f){return onDeleteAttachmentClick(f);},disabled:disabled},void 0),jsx$1("div",{style:{clear:'both'}},void 0)]}),void 0);};var FilesList$1=_styled(FileAttachmentList).withConfig({displayName:"AttachmentList__FilesList",componentId:"sc-1s0cqp9-0"})(templateObject_1$1P||(templateObject_1$1P=__makeTemplateObject(["\n margin-top: ","px;\n"],["\n margin-top: ","px;\n"])),spacingM);var Host$G=_styled.div.withConfig({displayName:"AttachmentList__Host",componentId:"sc-1s0cqp9-1"})(templateObject_2$16||(templateObject_2$16=__makeTemplateObject([""],[""])));var templateObject_1$1P,templateObject_2$16;var RichCommentInputWithAttachmentList=/*#__PURE__*/forwardRef(function(props,ref){return jsxs(Fragment,{children:[jsx$1(RichCommentInput,__assign({},props,{ref:ref}),void 0),jsx$1(AttachmentList,{files:props.attachments,disabled:props.disabled,onDeleteAttachmentClick:props.onDeleteAttachment,previewTheme:props.attachmentPreviewTheme,disableVideoPreview:props.disableVideoPreview,disableEmbeddedObjectPreview:props.disableEmbeddedObjectPreview},void 0)]},void 0);});var KeywordPickerGroup=function KeywordPickerGroup(_a){var group=_a.group,keywords=_a.keywords,expanded=_a.expanded,selectedKeywords=_a.selectedKeywords,onChange=_a.onChange,mandatoryKeywordIds=_a.mandatoryKeywordIds;var _b=useState$2(null),isExpanded=_b[0],setIsExpanded=_b[1];var isSelected=!!selectedKeywords.find(function(k){return k.groupId===group.id;});var isCollapsed=!(isExpanded===true||expanded);return jsxs(Host$F,{children:[jsxs(GroupButton,__assign({onClick:toggle,iconProps:{iconName:isCollapsed?'CaretRightSolid8':'CaretDownSolid8'},"aria-expanded":!isCollapsed,"aria-controls":group.name+"-list"},{children:[isSelected&&jsx$1(CheckMarkIcon,{iconName:"CheckMark"},void 0),jsx$1(ButtonLabel,__assign({"data-keyword-group":group.name,isSelected:isSelected},{children:jsx$1(KeywordTitle,{groupName:group.name},void 0)}),void 0)]}),void 0),jsx$1(KeywordsList,__assign({id:group.name+"-list","data-keyword-picker-group-list":true,isCollapsed:isCollapsed},{children:keywords.map(function(k){var checked=isKeywordSelected(k);var disabled=isKeywordDisabled(k);return jsx$1(KeywordItem$1,__assign({"data-keyword":k.name,"data-is-checked":checked,"data-is-disabled":disabled},{children:jsx$1(Checkbox,{label:k.name,onRenderLabel:function(){return jsx$1(KeywordTitle,{groupName:group.name,keywordName:k.name},void 0);},checked:checked,onChange:function(_e,isChecked){return handleChange(isChecked,k);},disabled:disabled},k.id)}),k.name);})}),void 0)]},void 0);function toggle(){setIsExpanded(!isExpanded);}function isKeywordSelected(keyword){return !!selectedKeywords.find(function(k){return k.id===keyword.id;});}function isKeywordDisabled(keyword){return mandatoryKeywordIds===null||mandatoryKeywordIds===void 0?void 0:mandatoryKeywordIds.some(function(id){return id===keyword.id;});}function handleChange(add,keyword){if(onChange){var result=selectedKeywords.filter(function(k){return keyword.id!==k.id;});if(add){result.push(keyword);}onChange(result);}}};var Host$F=_styled.div.withConfig({displayName:"KeywordPickerGroup__Host",componentId:"sc-pu16jm-0"})(templateObject_1$1O||(templateObject_1$1O=__makeTemplateObject(["\n margin-bottom: ","px;\n"],["\n margin-bottom: ","px;\n"])),spacingS);var GroupButton=_styled(ActionButton).withConfig({displayName:"KeywordPickerGroup__GroupButton",componentId:"sc-pu16jm-1"})(templateObject_2$15||(templateObject_2$15=__makeTemplateObject(["\n && {\n height: auto;\n font-size: ","px;\n padding: 0;\n border: 0;\n\n i {\n font-size: ","px;\n\n &:first-child {\n margin: 0;\n }\n }\n }\n"],["\n && {\n height: auto;\n font-size: ","px;\n padding: 0;\n border: 0;\n\n i {\n font-size: ","px;\n\n &:first-child {\n margin: 0;\n }\n }\n }\n"])),fontSizeNormal,fontSizeSmall);var CheckMarkIcon=_styled(Icon).withConfig({displayName:"KeywordPickerGroup__CheckMarkIcon",componentId:"sc-pu16jm-2"})(templateObject_3$L||(templateObject_3$L=__makeTemplateObject(["\n margin-right: 6px;\n margin-left: 12px;\n width: 15px;\n"],["\n margin-right: 6px;\n margin-left: 12px;\n width: 15px;\n"])));var ButtonLabel=_styled.span.withConfig({displayName:"KeywordPickerGroup__ButtonLabel",componentId:"sc-pu16jm-3"})(templateObject_5$q||(templateObject_5$q=__makeTemplateObject(["\n display: inline-flex;\n flex: 1 0 auto;\n\n ","\n"],["\n display: inline-flex;\n flex: 1 0 auto;\n\n ","\n"])),function(p){return !p.isSelected&&css$2(templateObject_4$u||(templateObject_4$u=__makeTemplateObject(["\n margin-left: 33px; // checkmark icon space\n "],["\n margin-left: 33px; // checkmark icon space\n "])));});var KeywordsList=_styled.ul.withConfig({displayName:"KeywordPickerGroup__KeywordsList",componentId:"sc-pu16jm-4"})(templateObject_7$b||(templateObject_7$b=__makeTemplateObject(["\n ","\n padding: 0;\n margin: 0 0 0 ","px;\n list-style: none;\n"],["\n ","\n padding: 0;\n margin: 0 0 0 ","px;\n list-style: none;\n"])),function(p){return p.isCollapsed&&css$2(templateObject_6$g||(templateObject_6$g=__makeTemplateObject(["\n display: none;\n "],["\n display: none;\n "])));},spacingX+10);var KeywordItem$1=_styled.li.withConfig({displayName:"KeywordPickerGroup__KeywordItem",componentId:"sc-pu16jm-5"})(templateObject_8$a||(templateObject_8$a=__makeTemplateObject(["\n display: flex;\n align-items: center;\n margin-top: 9px;\n"],["\n display: flex;\n align-items: center;\n margin-top: 9px;\n"])));var templateObject_1$1O,templateObject_2$15,templateObject_3$L,templateObject_4$u,templateObject_5$q,templateObject_6$g,templateObject_7$b,templateObject_8$a;var KeywordPicker=function KeywordPicker(_a){var _b;var value=_a.value,onChange=_a.onChange,showSelectionToggle=_a.showSelectionToggle,incomingAvailableKeywords=_a.availableKeywords,mandatoryKeywordIds=_a.mandatoryKeywordIds,className=_a.className;var formatMessage=useIntl().formatMessage;var user=useCurrentUser();var _c=useContext(LazySubscriptionContext),allKeywords=_c.allKeywords,selectedKeywordGroups=_c.selectedKeywordGroups;var _d=useState$2(null),searchedKeywords=_d[0],setSearchedKeywords=_d[1];var _e=useState$2(null),searchText=_e[0],setSearchText=_e[1];var selectedKeywords=getSelectedKeywords();var availableKeywords=incomingAvailableKeywords!==null&&incomingAvailableKeywords!==void 0?incomingAvailableKeywords:allKeywords;var visibleKeywords=(_b=searchedKeywords!==null&&searchedKeywords!==void 0?searchedKeywords:availableKeywords)!==null&&_b!==void 0?_b:[];var mandatoryKeywords=mandatoryKeywordIds?availableKeywords.filter(function(k){return mandatoryKeywordIds.includes(k.id);}):[];var noKeywordGroups=(selectedKeywordGroups===null||selectedKeywordGroups===void 0?void 0:selectedKeywordGroups.length)===0;var noAvailableKeywords=!noKeywordGroups&&(availableKeywords===null||availableKeywords===void 0?void 0:availableKeywords.length)===0;var isEmpty=visibleKeywords.length===0;return jsxs(Host$E,__assign({className:classNames('keyword-picker',className)},{children:[(noKeywordGroups||noAvailableKeywords)&&jsx$1("span",__assign({className:"keyword-picker-empty"},{children:jsx$1(FormattedMessage$1,{id:noKeywordGroups?'KeywordPicker.noGroupsDefined':'KeywordPicker.noAvailableKeywordsForGroup'},void 0)}),void 0),!noKeywordGroups&&!noAvailableKeywords&&jsxs("div",{children:[jsxs(SearchHost,__assign({className:"keyword-picker-search","data-keyword-picker-search":true},{children:[jsx$1(TextField,{onChange:handleSearch,value:searchText||'',placeholder:formatMessage({id:'KeywordPicker.search'}),ariaLabel:formatMessage({id:'KeywordPicker.search'})},void 0),searchText&&jsx$1(SearchCancelButton,{iconProps:{iconName:'Cancel'},onClick:function(){return handleSearch(null,null);},"aria-hidden":"true"},void 0)]}),void 0),showSelectionToggle&&jsx$1(StyledToggleAllButtons$1,{toggleAll:handleToggleAll},void 0),jsxs(KeywordPickerTree,__assign({className:"keyword-picker-tree"},{children:[isEmpty&&jsx$1(FormattedMessage$1,{id:"KeywordPicker.emptySearch"},void 0),!isEmpty&&selectedKeywordGroups&&selectedKeywordGroups.sort(function(a,b){return a.name.localeCompare(b.name);}).map(function(g){var keywords=visibleKeywords.filter(function(k){return k.groupId===g.id;});return keywords.length===0?null:jsx$1(KeywordPickerGroup,{expanded:!!searchText,group:g,keywords:keywords,selectedKeywords:selectedKeywords,onChange:onChange,mandatoryKeywordIds:mandatoryKeywordIds},g.id);})]}),void 0)]},void 0)]}),void 0);function getSelectedKeywords(){if(value==null||allKeywords==null){return [];}return value.map(function(k){return typeof k==='string'?allKeywords.find(function(a){return a.id===k;}):k;}).filter(function(k){return k;});}function handleSearch(_,text){var hasSearch=text&&text.length;var keywords=hasSearch?availableKeywords.filter(function(k){return getKeywordTitle(user,k.translations,k.name).toLocaleLowerCase().indexOf(text.toLocaleLowerCase())>=0;}):availableKeywords;setSearchedKeywords(keywords);setSearchText(hasSearch?text:null);}function handleToggleAll(checkAll){onChange(checkAll?availableKeywords:mandatoryKeywords);}};var KeywordPickerTree=_styled.div.withConfig({displayName:"KeywordPicker__KeywordPickerTree",componentId:"sc-1ejjfwa-0"})(templateObject_1$1N||(templateObject_1$1N=__makeTemplateObject(["\n padding-left: 4px;\n"],["\n padding-left: 4px;\n"])));var StyledToggleAllButtons$1=_styled(ToggleAllButtons).withConfig({displayName:"KeywordPicker__StyledToggleAllButtons",componentId:"sc-1ejjfwa-1"})(templateObject_2$14||(templateObject_2$14=__makeTemplateObject(["\n padding-left: 4px;\n"],["\n padding-left: 4px;\n"])));var Host$E=_styled.div.withConfig({displayName:"KeywordPicker__Host",componentId:"sc-1ejjfwa-2"})(templateObject_3$K||(templateObject_3$K=__makeTemplateObject(["\n overflow-x: hidden;\n overflow-y: auto;\n\n .ms-TextField-fieldGroup {\n background: none;\n }\n"],["\n overflow-x: hidden;\n overflow-y: auto;\n\n .ms-TextField-fieldGroup {\n background: none;\n }\n"])));var SearchHost=_styled.div.withConfig({displayName:"KeywordPicker__SearchHost",componentId:"sc-1ejjfwa-3"})(templateObject_4$t||(templateObject_4$t=__makeTemplateObject(["\n position: relative;\n margin-bottom: 8px;\n"],["\n position: relative;\n margin-bottom: 8px;\n"])));var SearchCancelButton=_styled(IconButton).withConfig({displayName:"KeywordPicker__SearchCancelButton",componentId:"sc-1ejjfwa-4"})(templateObject_5$p||(templateObject_5$p=__makeTemplateObject(["\n position: absolute;\n top: 0;\n right: 0;\n z-index: 10;\n\n &&&:focus::after {\n outline-offset: -2px;\n }\n"],["\n position: absolute;\n top: 0;\n right: 0;\n z-index: 10;\n\n &&&:focus::after {\n outline-offset: -2px;\n }\n"])));var templateObject_1$1N,templateObject_2$14,templateObject_3$K,templateObject_4$t,templateObject_5$p;var AddKeywordsButton=function AddKeywordsButton(_a){var availableKeywords=_a.availableKeywords,mandatoryKeywords=_a.mandatoryKeywords,preselectedKeywords=_a.preselectedKeywords,onKeywordsChange=_a.onKeywordsChange,disabled=_a.disabled,keywordPickerTitleResourceKey=_a.keywordPickerTitleResourceKey;var features=useFeatures();var formatMessage=useIntl().formatMessage;var refButton=useRef$1();var _b=useState$2(false),showKeywordsPicker=_b[0],setShowKeywordsPicker=_b[1];if(!features.keywords){return null;}return jsxs("div",{children:[jsx$1("div",__assign({ref:refButton},{children:jsx$1(IconButton,{iconProps:{iconName:'Tag'},onClick:function(){setShowKeywordsPicker(!showKeywordsPicker);},disabled:disabled,"data-button-type":"keywords",ariaLabel:formatMessage({id:'AriaLabel.keywordsButton'})},void 0)}),void 0),showKeywordsPicker&&jsx$1(KeywordPickerInternal,{target:refButton.current,availableKeywords:availableKeywords,mandatoryKeywords:mandatoryKeywords,preselectedKeywords:preselectedKeywords,keywordPickerTitleResourceKey:keywordPickerTitleResourceKey,onCancel:handleOnCancel,onSave:handleOnSave},void 0)]},void 0);function handleOnCancel(){setShowKeywordsPicker(false);}function handleOnSave(keywords){onKeywordsChange(keywords);setShowKeywordsPicker(false);}};var KeywordPickerInternal=function KeywordPickerInternal(_a){var target=_a.target,availableKeywords=_a.availableKeywords,mandatoryKeywords=_a.mandatoryKeywords,preselectedKeywords=_a.preselectedKeywords,keywordPickerTitleResourceKey=_a.keywordPickerTitleResourceKey,onCancel=_a.onCancel,onSave=_a.onSave;useIntl().formatMessage;var _b=useState$2(null),selectedKeywords=_b[0],setSelectedKeywords=_b[1];var disabled=(availableKeywords!==null&&availableKeywords!==void 0?availableKeywords:[]).length===0;var calloutTitleId="keywordPickerTitle-"+createId();return jsxs(Callout,__assign({target:target,directionalHint:DirectionalHint.bottomCenter,ariaLabelledBy:keywordPickerTitleResourceKey?calloutTitleId:null,calloutWidth:300,styles:{calloutMain:{padding:spacingM}}},{children:[keywordPickerTitleResourceKey&&jsx$1(Title$6,__assign({id:calloutTitleId},{children:jsx$1(FormattedMessage$1,{id:keywordPickerTitleResourceKey},void 0)}),void 0),jsx$1(StyledKeywordPicker$1,{showSelectionToggle:true,value:selectedKeywords!==null&&selectedKeywords!==void 0?selectedKeywords:ensureMandatoryKeywords(mandatoryKeywords,preselectedKeywords),onChange:function(keywords){return setSelectedKeywords(keywords);},availableKeywords:availableKeywords,mandatoryKeywordIds:mandatoryKeywords===null||mandatoryKeywords===void 0?void 0:mandatoryKeywords.map(function(k){return k.id;})},void 0),jsx$1(Buttons$2,{onDismiss:handleOnCancel,onSave:handleOnSave,disabled:disabled},void 0)]}),void 0);function handleOnCancel(){setSelectedKeywords(null);onCancel===null||onCancel===void 0?void 0:onCancel();}function handleOnSave(){onSave===null||onSave===void 0?void 0:onSave(selectedKeywords);setSelectedKeywords(null);}};var Title$6=_styled.div.withConfig({displayName:"AddKeywordsButton__Title",componentId:"sc-l8ish9-0"})(templateObject_1$1M||(templateObject_1$1M=__makeTemplateObject(["\n font-weight: bold;\n margin-bottom: ","px;\n font-size: ","px;\n"],["\n font-weight: bold;\n margin-bottom: ","px;\n font-size: ","px;\n"])),spacingM,fontSizeMedium);var Buttons$2=function Buttons(_a){var onSave=_a.onSave,onDismiss=_a.onDismiss,disabled=_a.disabled;return jsxs(ButtonsContainer$1,{children:[jsx$1(DefaultButton,__assign({onClick:onDismiss},{children:jsx$1(FormattedMessage$1,{id:"Generic.Cancel"},void 0)}),void 0),jsx$1(PrimaryButton,__assign({onClick:onSave,disabled:disabled},{children:jsx$1(FormattedMessage$1,{id:"Generic.apply"},void 0)}),void 0)]},void 0);};var ButtonsContainer$1=_styled.div.withConfig({displayName:"AddKeywordsButton__ButtonsContainer",componentId:"sc-l8ish9-1"})(templateObject_2$13||(templateObject_2$13=__makeTemplateObject(["\n display: flex;\n gap: ","px;\n margin-top: ","px;\n\n > button {\n flex: 1;\n }\n"],["\n display: flex;\n gap: ","px;\n margin-top: ","px;\n\n > button {\n flex: 1;\n }\n"])),spacingM,spacingM);var StyledKeywordPicker$1=_styled(KeywordPicker).withConfig({displayName:"AddKeywordsButton__StyledKeywordPicker",componentId:"sc-l8ish9-2"})(templateObject_3$J||(templateObject_3$J=__makeTemplateObject(["\n .keyword-picker-tree {\n max-height: 256px;\n overflow-y: auto;\n }\n"],["\n .keyword-picker-tree {\n max-height: 256px;\n overflow-y: auto;\n }\n"])));var templateObject_1$1M,templateObject_2$13,templateObject_3$J;var EditableKeywordsList=function EditableKeywordsList(_a){var keywords=_a.keywords,mandatoryKeywordIds=_a.mandatoryKeywordIds,onRemoveKeyword=_a.onRemoveKeyword;var formatMessage=useIntl().formatMessage;if(!(keywords===null||keywords===void 0?void 0:keywords.length)){return null;}var sortedKeywords=keywords.sort(function(a,b){return mandatoryKeywordIds.findIndex(function(id){return id===b.id;})-mandatoryKeywordIds.findIndex(function(id){return id===a.id;});});return jsx$1(Host$D,{children:sortedKeywords.map(function(k){var isMandatory=mandatoryKeywordIds.includes(k.id);return jsxs(KeywordItem,__assign({"data-keyword":k.name},{children:[jsx$1(KeywordTitle,{keywordName:k.name,groupId:k.groupId},void 0),!isMandatory&&jsx$1(RemoveKeywordButton,{iconProps:{iconName:'Cancel'},onClick:function(){return onRemoveKeyword(k.id);},ariaLabel:formatMessage({id:'AriaLabel.removeKeywordButton'}),"data-remove-keyword-button":true},void 0)]}),""+k.id);})},void 0);};var Host$D=_styled.ul.withConfig({displayName:"EditableKeywordsList__Host",componentId:"sc-1e7e0qj-0"})(templateObject_1$1L||(templateObject_1$1L=__makeTemplateObject(["\n padding: 0;\n margin: ","px 0 0 0;\n list-style: none;\n display: flex;\n flex-wrap: wrap;\n"],["\n padding: 0;\n margin: ","px 0 0 0;\n list-style: none;\n display: flex;\n flex-wrap: wrap;\n"])),spacingS);var KeywordItem=_styled.li.withConfig({displayName:"EditableKeywordsList__KeywordItem",componentId:"sc-1e7e0qj-1"})(templateObject_2$12||(templateObject_2$12=__makeTemplateObject(["\n margin: 0 ","px ","px 0;\n height: 32px;\n display: flex;\n align-items: center;\n background-color: ",";\n\n text-overflow: ellipis;\n overflow: hidden;\n white-space: nowrap;\n\n > span {\n padding: 0 6px;\n max-width: 100%;\n display: inline-block;\n text-overflow: ellipis;\n overflow: hidden;\n white-space: nowrap;\n }\n"],["\n margin: 0 ","px ","px 0;\n height: 32px;\n display: flex;\n align-items: center;\n background-color: ",";\n\n text-overflow: ellipis;\n overflow: hidden;\n white-space: nowrap;\n\n > span {\n padding: 0 6px;\n max-width: 100%;\n display: inline-block;\n text-overflow: ellipis;\n overflow: hidden;\n white-space: nowrap;\n }\n"])),spacingS,spacingXs,function(p){return p.theme.palette.neutralLight;});var RemoveKeywordButton=_styled(IconButton).withConfig({displayName:"EditableKeywordsList__RemoveKeywordButton",componentId:"sc-1e7e0qj-2"})(templateObject_3$I||(templateObject_3$I=__makeTemplateObject([""],[""])));var templateObject_1$1L,templateObject_2$12,templateObject_3$I;var CreateComment=function CreateComment(_a){var className=_a.className,onPost=_a.onPost,autoFocus=_a.autoFocus,readOnly=_a.readOnly,initialContent=_a.content,allowAttachments=_a.allowAttachments,mentionSearchHandler=_a.mentionSearchHandler,useLargeDropTarget=_a.useLargeDropTarget,placeHolderStringResourceKey=_a.placeHolderStringResourceKey,placeHolderStringResourceValues=_a.placeHolderStringResourceValues,_b=_a.focusAfterPost,focusAfterPost=_b===void 0?true:_b,onAttachmentsChanged=_a.onAttachmentsChanged,_c=_a.attachments,attachments=_c===void 0?[]:_c,deletedAttachmentUrls=_a.deletedAttachmentUrls,onDeleteAttachment=_a.onDeleteAttachment,disableDragAndDrop=_a.disableDragAndDrop,allowKeywords=_a.allowKeywords,allowSaveWithoutContent=_a.allowSaveWithoutContent,saveOnEnter=_a.saveOnEnter,saveOnCtrlEnter=_a.saveOnCtrlEnter,keywordSettings=_a.keywordSettings,disableBoxShadow=_a.disableBoxShadow,ariaLabel=_a.ariaLabel;var availableKeywords=(keywordSettings===null||keywordSettings===void 0?void 0:keywordSettings.availableKeywords)||[];var defaultKeywords=(keywordSettings===null||keywordSettings===void 0?void 0:keywordSettings.defaultKeywords)||[];var mandatoryKeywords=(keywordSettings===null||keywordSettings===void 0?void 0:keywordSettings.mandatoryKeywords)||[];var _d=useState$2(false),isSaving=_d[0],setIsSaving=_d[1];var _e=useState$2(initialContent||''),content=_e[0],setContent=_e[1];var _f=useState$2(null),selectedKeywords=_f[0],setSelectedKeywords=_f[1];var inputRef=useRef$1(null);var formatMessage=useIntl().formatMessage;var isReadOnly=readOnly||isSaving;var ignoreRef=useRef$1(false);useEffect$1(function(){return function(){ignoreRef.current=true;};},[]);var initialSelectedKeywords=defaultKeywords.concat(mandatoryKeywords);var initialSelectedKeywordIds=initialSelectedKeywords.map(function(k){return k.id;}).join('-');useEffect$1(function(){setSelectedKeywords(initialSelectedKeywords);},[initialSelectedKeywordIds]);return jsx$1("div",__assign({className:className,"data-comment":"create"},{children:jsx$1(RichCommentInputWithAttachmentList,{ref:inputRef,content:content,attachments:attachments,deletedAttachmentUrls:deletedAttachmentUrls,onAttachmentsChange:onAttachmentsChanged,onDeleteAttachment:onDeleteAttachment,onEnter:saveOnEnter&&handleSave,onCtrlEnter:saveOnCtrlEnter&&handleSave,onChange:function(value){return setContent(value);},disabled:isReadOnly,autoFocus:autoFocus,mentionSearchHandler:mentionSearchHandler,allowAttachments:allowAttachments,disableDragAndDrop:disableDragAndDrop,useLargeDropTarget:useLargeDropTarget,placeHolderStringResourceKey:placeHolderStringResourceKey,placeHolderStringResourceValues:placeHolderStringResourceValues,disableBoxShadow:disableBoxShadow,ariaLabel:ariaLabel,additionalInputControl:allowKeywords&&selectedKeywords&&jsx$1(EditableKeywordsList,{keywords:selectedKeywords,mandatoryKeywordIds:mandatoryKeywords.map(function(k){return k.id;}),onRemoveKeyword:function(id){return setSelectedKeywords(function(prev){return prev.filter(function(k){return k.id!==id;});});}},void 0),buttons:{leftSide:allowKeywords&&jsx$1(AddKeywordsButton,{availableKeywords:availableKeywords,mandatoryKeywords:mandatoryKeywords,preselectedKeywords:selectedKeywords,onKeywordsChange:function(keywords){return setSelectedKeywords(keywords);},disabled:isReadOnly,keywordPickerTitleResourceKey:"Post.keywords.title"},void 0),rightSide:jsx$1(IconButton,{iconProps:{iconName:'Send'},disabled:isSaveDisabled(),onClick:handleSave,"data-button-type":"save",ariaLabel:formatMessage({id:'AriaLabel.sendButton'})},'saveButton'+isSaveDisabled())}},void 0)}),void 0);function handleSave(){return __awaiter(this,void 0,void 0,function(){var groupedKeywords;return __generator(this,function(_a){switch(_a.label){case 0:if(isSaveDisabled()){return [2/*return*/];}setIsSaving(true);groupedKeywords=getGroupedKeywords(selectedKeywords);return [4/*yield*/,onPost({content:content.trim()},groupedKeywords)];case 1:_a.sent();setSelectedKeywords(initialSelectedKeywords||[]);if(!ignoreRef.current){setIsSaving(false);setContent('');if(focusAfterPost){inputRef.current.focus();}}return [2/*return*/];}});});}function isSaveDisabled(){return isReadOnly||!canSaveInput(allowSaveWithoutContent,attachments,content);}};var gutter=2;_styled.div.withConfig({displayName:"LegacyPostPhotoGallery__Gallery",componentId:"sc-ir1n2k-0"})(templateObject_1$1K||(templateObject_1$1K=__makeTemplateObject(["\n overflow: hidden;\n\n margin-left: -","px;\n margin-right: -","px;\n"],["\n overflow: hidden;\n\n margin-left: -","px;\n margin-right: -","px;\n"])),gutter,gutter);_styled.a.withConfig({displayName:"LegacyPostPhotoGallery__ImageItem",componentId:"sc-ir1n2k-1"})(templateObject_2$11||(templateObject_2$11=__makeTemplateObject(["\n background-color: #eee;\n box-sizing: border-box;\n float: left;\n margin: ","px;\n overflow: hidden;\n position: relative;\n width: 100%;\n height: 200px;\n cursor: pointer;\n\n :hover {\n opacity: 0.9;\n }\n\n > * {\n height: 100%;\n }\n\n @media (min-width: ","px) {\n width: calc(50% - ","px);\n height: 200px;\n }\n\n @media (min-width: ","px) {\n width: calc(25% - ","px);\n height: 150px;\n }\n"],["\n background-color: #eee;\n box-sizing: border-box;\n float: left;\n margin: ","px;\n overflow: hidden;\n position: relative;\n width: 100%;\n height: 200px;\n cursor: pointer;\n\n :hover {\n opacity: 0.9;\n }\n\n > * {\n height: 100%;\n }\n\n @media (min-width: ","px) {\n width: calc(50% - ","px);\n height: 200px;\n }\n\n @media (min-width: ","px) {\n width: calc(25% - ","px);\n height: 150px;\n }\n"])),gutter,minScreenSize.small,gutter*2,minScreenSize.medium,gutter*2);var templateObject_1$1K,templateObject_2$11;var ImagesAndFilesList=function ImagesAndFilesList(_a){var item=_a.item,basePath=_a.basePath,imagesGridBackgroundColor=_a.imagesGridBackgroundColor,className=_a.className;var user=useCurrentUser();var _b=useAttachmentsApi(),getImageUrl=_b.getImageUrl,getFileUrl=_b.getFileUrl;var subscriptionId=user.subscription.id;var files=item.attachments.filter(function(a){return a.type===AttachmentType.File;});var images=item.attachments.filter(function(a){return a.type===AttachmentType.Image;});var maxImageWidth=images.length>=4?minScreenSize.medium-spacingX:minScreenSize.large;var galleryDetails=useMemo(function(){var galleryImages=images.map(function(a){var _a;return {previewUrl:(_a=a.previewUrl)!==null&&_a!==void 0?_a:getImageUrl(basePath,subscriptionId,item,a.id,maxImageWidth),imageId:a.id,width:a.width,height:a.height};});return {galleryId:createId(),images:galleryImages};// eslint-disable-next-line react-hooks/exhaustive-deps
122254
+ },[item.attachments,item.fileAccessToken,item.attachmentContainerId]);if(images.length===0&&files.length===0){return null;}return jsxs("div",__assign({className:className},{children:[jsx$1(PhotoGrid,{images:galleryDetails.images,imageUrlResolver:function(imageId,width,height){return getImageUrl(basePath,subscriptionId,item,imageId,width,height);},gridBackgroundColor:imagesGridBackgroundColor},void 0),jsx$1(FilesList,{files:files,getFileUrl:function(attachmentId,token){return getFileUrl(basePath,subscriptionId,item,attachmentId,token);},fileAccessToken:item.fileAccessToken},void 0)]}),void 0);};var FilesList=_styled(FileAttachmentList).withConfig({displayName:"ImagesAndFilesList__FilesList",componentId:"sc-1wjy8l6-0"})(templateObject_1$1J||(templateObject_1$1J=__makeTemplateObject(["\n :not(:first-child) {\n margin-top: ","px;\n }\n"],["\n :not(:first-child) {\n margin-top: ","px;\n }\n"])),spacingM);var templateObject_1$1J;var EditComment=function EditComment(_a){var content=_a.content,files=_a.files,deletedFileUrls=_a.deletedFileUrls,onSave=_a.onSave,onCancel=_a.onCancel,className=_a.className,mentionSearchHandler=_a.mentionSearchHandler,allowAttachments=_a.allowAttachments,onAttachmentAdded=_a.onAttachmentAdded,onDeleteAttachment=_a.onDeleteAttachment,allowKeywords=_a.allowKeywords,keywordSettings=_a.keywordSettings,keywords=_a.keywords,allowSaveWithoutContent=_a.allowSaveWithoutContent,saveOnEnter=_a.saveOnEnter,saveOnCtrlEnter=_a.saveOnCtrlEnter,attachmentPreviewTheme=_a.attachmentPreviewTheme,ariaLabel=_a.ariaLabel;var availableKeywords=(keywordSettings===null||keywordSettings===void 0?void 0:keywordSettings.availableKeywords)||[];var defaultKeywords=(keywordSettings===null||keywordSettings===void 0?void 0:keywordSettings.defaultKeywords)||[];var mandatoryKeywords=(keywordSettings===null||keywordSettings===void 0?void 0:keywordSettings.mandatoryKeywords)||[];var formatMessage=useIntl().formatMessage;var _b=useState$2(content||''),newContent=_b[0],setContent=_b[1];var _c=useState$2(getInitialSelectedKeywords()),selectedKeywords=_c[0],setSelectedKeywords=_c[1];return jsx$1(RichCommentInputWithAttachmentList,{className:className,content:newContent,attachments:files,deletedAttachmentUrls:deletedFileUrls,autoFocus:true,mentionSearchHandler:mentionSearchHandler,onChange:function(value){return setContent(value);},onEnter:saveOnEnter&&handleSave,onCtrlEnter:saveOnCtrlEnter&&handleSave,onAttachmentsChange:onAttachmentAdded,onDeleteAttachment:onDeleteAttachment,allowAttachments:allowAttachments,disableBoxShadow:true,ariaLabel:ariaLabel,attachmentPreviewTheme:attachmentPreviewTheme,additionalInputControl:allowKeywords&&selectedKeywords&&jsx$1(EditableKeywordsList,{keywords:selectedKeywords,mandatoryKeywordIds:mandatoryKeywords.map(function(k){return k.id;}),onRemoveKeyword:function(id){return setSelectedKeywords(function(prev){return prev.filter(function(k){return k.id!==id;});});}},void 0),buttons:{leftSide:allowKeywords&&jsx$1(AddKeywordsButton,{availableKeywords:availableKeywords,mandatoryKeywords:mandatoryKeywords,preselectedKeywords:selectedKeywords,onKeywordsChange:function(keywords){return setSelectedKeywords(keywords);},keywordPickerTitleResourceKey:"Post.keywords.title"},void 0),rightSide:jsxs(Fragment,{children:[jsx$1(IconButton,{iconProps:{iconName:'Cancel'},onClick:onCancel,"data-button":"cancel",ariaLabel:formatMessage({id:'AriaLabel.cancelButton'})},void 0),jsx$1(IconButton,{iconProps:{iconName:'CheckMark'},disabled:!canSaveInput(allowSaveWithoutContent,files,newContent),onClick:handleSave,"data-button":"save",ariaLabel:formatMessage({id:'AriaLabel.sendButton'})},void 0)]},void 0)}},void 0);function getInitialSelectedKeywords(){if(!availableKeywords.length&&!mandatoryKeywords.length&&!defaultKeywords.length){return [];}var existingKeywords=getFlatKeywordList(keywords)||[];// check if existing keywords are still in the availableKeywords or defaultKeywords
122255
+ var availableKeywordIds=availableKeywords.map(function(k){return k.id;});var defaultKeywordIds=defaultKeywords.map(function(k){return k.id;});var filteredKeywords=existingKeywords.filter(function(k){return availableKeywordIds.includes(k.id)||defaultKeywordIds.includes(k.id);});return ensureMandatoryKeywords$1(mandatoryKeywords,filteredKeywords);}function handleSave(){var groupedKeywords=getGroupedKeywords(selectedKeywords);onSave(newContent.trim(),groupedKeywords);}};function useAttachmentUploader(initialAttachments,containerId,basePath){var ignoreRef=useRef$1(false);var warningToastHandle=useRef$1();var _a=useAttachmentsApi(),uploadFile=_a.uploadFile,uploadImage=_a.uploadImage;var showToastWarning=useNotificationContext().showToastWarning;useEffect$1(function(){return function(){ignoreRef.current=true;};},[]);var user=useCurrentUser();var _b=useState$2(initialAttachments),attachments=_b[0],setAttachments=_b[1];var _c=useState$2([]),deletedAttachmentUrls=_c[0],setDeletedAttachmentUrls=_c[1];// eslint-disable-next-line react-hooks/exhaustive-deps
122259
122256
  var handleAttachmentCallback=useCallback(handleAttachmentsAdded,[attachments,setAttachments,basePath,containerId]);return [attachments,handleAttachmentCallback,clearAttachments,deletedAttachmentUrls,deleteAttachment];function handleAttachmentsAdded(updatedAttachments){return __awaiter(this,void 0,void 0,function(){var newAttachments,_loop_1,_i,newAttachments_1,newAttachment;return __generator(this,function(_a){newAttachments=updatedAttachments.filter(function(a){return attachments.every(function(old){return old.id!==a.id;});});setAttachments(updatedAttachments.map(function(a){return __assign(__assign({},a),{isUploadInProgress:(a.type===AttachmentType.Image||a.type===AttachmentType.File)&&!!newAttachments.find(function(x){return x.id===a.id;})});}));_loop_1=function(newAttachment){(newAttachment.type===AttachmentType.Image||newAttachment.type===AttachmentType.File)&&uploadAttachment(basePath,newAttachment).then(function(response){if((response===null||response===void 0?void 0:response.status)!==200&&(response===null||response===void 0?void 0:response.status)!==204){throw new Error("Request failed with status "+(response===null||response===void 0?void 0:response.status));}})// todo: add proper error handling when uploading a attachment fails
122260
122257
  // => we should display a retry button on the attachment preview
122261
- .then(function(){if(ignoreRef.current){return;}setAttachments(function(attachments){return attachments.map(function(a){return a.id!==newAttachment.id?a:__assign(__assign({},a),{isUploadInProgress:false});});});},function(error){logger.error(error);if(!warningToastHandle.current){warningToastHandle.current=showToastWarning('Attachments.uploadError',undefined,function(){return warningToastHandle.current=null;});}if(ignoreRef.current){return;}setAttachments(function(attachments){return attachments.map(function(a){return a.id!==newAttachment.id?a:__assign(__assign({},a),{hasError:true,isUploadInProgress:false});});});});};for(_i=0,newAttachments_1=newAttachments;_i<newAttachments_1.length;_i++){newAttachment=newAttachments_1[_i];_loop_1(newAttachment);}return [2/*return*/];});});}function clearAttachments(){if(!ignoreRef.current){setAttachments([]);setDeletedAttachmentUrls([]);}}function deleteAttachment(attachment){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,handleAttachmentsAdded(attachments.filter(function(f){return f.id!==attachment.id;}))];case 1:_a.sent();setDeletedAttachmentUrls(__spreadArray(__spreadArray([],deletedAttachmentUrls),[attachment.url]));return [2/*return*/];}});});}function uploadAttachment(basePath,attachment){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){if(attachment.type===AttachmentType.Image){return [2/*return*/,uploadImage(basePath,user.subscription.id,attachment.id,containerId,attachment.file)];}else {return [2/*return*/,uploadFile(basePath,user.subscription.id,attachment.id,containerId,attachment.file)];}});});}}var EditCommentWithAttachments=function EditCommentWithAttachments(props){var user=useCurrentUser();var getImageUrl=useAttachmentsApi().getImageUrl;var _a=useAttachmentUploader(props.item.attachments,props.item.attachmentContainerId,props.basePath),attachments=_a[0],handleAttachmentsAdded=_a[1],deletedAttachmentUrls=_a[3],onDeleteAttachment=_a[4];return jsx$1(EditComment,__assign({},props,{allowSaveWithoutContent:props.allowSaveWithoutContent,saveOnEnter:props.saveOnEnter,saveOnCtrlEnter:props.saveOnCtrlEnter,files:attachments.map(function(a){return __assign(__assign({},a),!isClientAttachment(a)&&{previewUrl:getImageUrl(props.basePath,user.subscription.id,props.item,a.id)});}),allowAttachments:!!props.basePath,onSave:handlePost,onAttachmentAdded:handleAttachmentsAdded,allowKeywords:props.allowKeywords,availableKeywords:props.availableKeywords,mandatoryKeywords:props.mandatoryKeywords,keywords:props.keywords,deletedFileUrls:deletedAttachmentUrls,onDeleteAttachment:onDeleteAttachment}),void 0);function handlePost(newContent,keywords){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,props.onSave(newContent,attachments,keywords)];case 1:_a.sent();return [2/*return*/];}});});}};function isClientAttachment(value){return value.file!=null;}var CommentDisplay=function CommentDisplay(_a){var _b;var type=_a.type,baseAttachmentPath=_a.baseAttachmentPath,message=_a.message,onDelete=_a.onDelete,showDelete=_a.showDelete,showAutoTranslate=_a.showAutoTranslate,showEdit=_a.showEdit,scope=_a.scope,mentionSearchHandler=_a.mentionSearchHandler,getHashtagFilterRoute=_a.getHashtagFilterRoute,highlight=_a.highlight,isInitialLiked=_a.isInitialLiked,onReplyIconClick=_a.onReplyIconClick,onReply=_a.onReply,replyCount=_a.replyCount,readOnly=_a.readOnly,className=_a.className;var _c=useCommentApi(),toggleCommentLike=_c.toggleCommentLike,translateComment=_c.translateComment,updateComment=_c.updateComment;var formatMessage=useIntl().formatMessage;var _d=useNotificationContext(),showToast=_d.showToast,showError=_d.showError;var _e=useState$2(false),isEditMode=_e[0],setIsEditMode=_e[1];var _f=useState$2(message.content),content=_f[0],setContent=_f[1];var _g=useState$2(message.attachments),attachments=_g[0],setAttachments=_g[1];var _h=useState$2(message.modified),modifiedTime=_h[0],setModifiedTime=_h[1];var _j=useState$2(message.content),originalContent=_j[0],setOriginalContent=_j[1];var _k=useState$2(isInitialLiked),isLiked=_k[0],setIsLiked=_k[1];var _l=useState$2(((_b=message.statistics)===null||_b===void 0?void 0:_b.likeCount)||0),likeCounter=_l[0],setLikeCounter=_l[1];var features=useFeatures();var palette=useContext(ThemeContext$1).theme.palette;var hasContent=content.length>0;message=__assign(__assign({},message),{attachments:attachments});return jsxs(Container$1,__assign({className:className,"data-comment-id":message.id,"data-has-auto-translate":showAutoTranslate,"data-can-edit":showEdit,"data-can-delete":showDelete,"data-show-highlight":highlight,highlight:highlight,id:"Comment-"+message.id},{children:[jsxs(Header$1,{children:[jsx$1(CommentUser,__assign({upn:message.sender.userPrincipalName,domIdentifier:"avatar"},{children:jsx$1(Avatar,{upn:message.sender.userPrincipalName,text:message.sender.displayName,size:PersonaSize.small,hidePersonaDetails:true},void 0)}),void 0),jsxs(HeaderMetadata$1,{children:[jsx$1(CommentDisplayName,{children:jsx$1(StyledPersonaCard$1,__assign({upn:message.sender.userPrincipalName},{children:message.sender.displayName}),void 0)},void 0),jsx$1(CommentDateTime,{className:"ms-fontColor-neutralTertiary",value:message.receivedDateTime},void 0),jsx$1(Modified,{modified:modifiedTime},void 0)]},void 0),message.id&&jsxs(Buttons$1,{children:[features.replyToComments&&replyCount>0&&jsx$1(ReplyCountButton,{tooltipResourceKey:"Comment.numberOfReplies",tooltipResourceKeyValues:{count:replyCount},ariaLabel:formatMessage({id:onReplyIconClick?'AriaLabel.commentsButton':'AriaLabel.repliesButton'}),iconName:"Chat",count:replyCount,feedbackType:"comment",onClick:onReplyIconClick!==null&&onReplyIconClick!==void 0?onReplyIconClick:onReply?function(){return onReply(message.id);}:null,highlight:message.hasUnreadReplies,readOnly:readOnly},void 0),jsx$1(StyledLikeButton$1,{itemId:message.id,itemType:ItemResourceTypes.Comments,count:likeCounter,isActive:isLiked,onClick:function(){return handleLike(!isLiked);},doNotRenderZeroCount:true,isDemoContent:message.isDemoContent,readOnly:readOnly},void 0),jsx$1(CommentActionMenu,{comment:message,showEdit:showEdit,onDelete:onDelete,showDelete:showDelete,isEditMode:isEditMode,toggleEditMode:setIsEditMode,originalContent:originalContent,currentContent:content,setContent:setContent,handleTranslate:handleTranslate,showAutoTranslate:showAutoTranslate,onReply:onReply,disabled:readOnly},void 0)]},void 0)]},void 0),jsxs(Body,{children:[isEditMode&&jsx$1(StyledEditCommentWithAttachments,{content:content,mentionSearchHandler:mentionSearchHandler,onSave:handleSaveComment,onCancel:function(){return setIsEditMode(false);},basePath:baseAttachmentPath,item:message,allowSaveWithoutContent:true,saveOnCtrlEnter:true},void 0),!isEditMode&&hasContent&&jsx$1(Fragment,{children:jsx$1(Content$4,__assign({"data-comment-content":message.id},{children:jsx$1(ContentDisplay,{content:content,handlers:[ContentDisplayHandler.LineBreak,ContentDisplayHandler.Link,ContentDisplayHandler.Mention,ContentDisplayHandler.Hashtag],getHashtagRoute:getHashtagFilterRoute},void 0)}),void 0)},void 0)]},void 0),!isEditMode&&(attachments===null||attachments===void 0?void 0:attachments.length)>0&&jsxs("div",__assign({"data-mixed-attachment-list":true},{children:[jsx$1(GifList,{attachments:message.attachments},void 0),jsx$1(StyledImagesAndFilesList$1,{item:message,basePath:baseAttachmentPath,imagesGridBackgroundColor:palette.white},void 0),jsx$1(VideoList,{attachments:message.attachments},void 0),jsx$1(EmbeddedObjectList,{attachments:message.attachments},void 0)]}),void 0)]}),void 0);function handleLike(newIsLiked){return __awaiter(this,void 0,void 0,function(){var oldCounter,error_1;return __generator(this,function(_a){switch(_a.label){case 0:oldCounter=likeCounter;_a.label=1;case 1:_a.trys.push([1,3,,4]);setIsLiked(newIsLiked);setLikeCounter(newIsLiked?oldCounter+1:oldCounter-1);return [4/*yield*/,toggleCommentLike(message.id,newIsLiked)];case 2:_a.sent();return [3/*break*/,4];case 3:error_1=_a.sent();setIsLiked(!newIsLiked);setLikeCounter(oldCounter);logger.error(error_1);showError('Generic.error');return [3/*break*/,4];case 4:return [2/*return*/];}});});}function handleSaveComment(newContent,newAttachments){return __awaiter(this,void 0,void 0,function(){var error_2;return __generator(this,function(_a){switch(_a.label){case 0:setContent(newContent);setAttachments(newAttachments);setIsEditMode(false);setModifiedTime(new Date().toISOString());setOriginalContent(newContent);_a.label=1;case 1:_a.trys.push([1,3,,4]);return [4/*yield*/,updateComment(scope,message.parentItemId,message.id,newContent,newAttachments,type)];case 2:_a.sent();showToast('Comment.successfullyUpdated');return [3/*break*/,4];case 3:error_2=_a.sent();logger.error(error_2);showError('Generic.error');return [3/*break*/,4];case 4:return [2/*return*/];}});});}function handleTranslate(preferredContentLanguageCode){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_b){switch(_b.label){case 0:_b.trys.push([0,2,,3]);return [4/*yield*/,translateComment(type,scope,message.parentItemId,message.id,preferredContentLanguageCode)];case 1:return [2/*return*/,_b.sent()];case 2:_b.sent();showError('Generic.error');return [2/*return*/,null];case 3:return [2/*return*/];}});});}};var Header$1=_styled.div.withConfig({displayName:"CommentDisplay__Header",componentId:"sc-el7c23-0"})(templateObject_1$1K||(templateObject_1$1K=__makeTemplateObject(["\n display: flex;\n align-items: center;\n"],["\n display: flex;\n align-items: center;\n"])));var avatarWidth$1=40;var maxButtonsWidth$1=125;// max 3 buttons (menu button, replies, like)
122262
- var paddingLeft$1=spacingS;var HeaderMetadata$1=_styled.div.withConfig({displayName:"CommentDisplay__HeaderMetadata",componentId:"sc-el7c23-1"})(templateObject_2$12||(templateObject_2$12=__makeTemplateObject(["\n flex: 1;\n box-sizing: border-box;\n font-size: ","px;\n padding-left: ","px;\n max-width: calc(100% - ","px - ","px);\n"],["\n flex: 1;\n box-sizing: border-box;\n font-size: ","px;\n padding-left: ","px;\n max-width: calc(100% - ","px - ","px);\n"])),fontSizeSmall,paddingLeft$1,avatarWidth$1,maxButtonsWidth$1);var CommentDisplayName=_styled.div.withConfig({displayName:"CommentDisplay__CommentDisplayName",componentId:"sc-el7c23-2"})(templateObject_3$J||(templateObject_3$J=__makeTemplateObject(["\n font-weight: bold;\n"],["\n font-weight: bold;\n"])));var StyledPersonaCard$1=_styled(PersonaCard).withConfig({displayName:"CommentDisplay__StyledPersonaCard",componentId:"sc-el7c23-3"})(templateObject_4$u||(templateObject_4$u=__makeTemplateObject(["\n && {\n max-width: 100%;\n .ms-Button {\n width: 100%;\n }\n .ms-Button-textContainer {\n width: 100%;\n }\n\n .ms-Button-label {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n }\n"],["\n && {\n max-width: 100%;\n .ms-Button {\n width: 100%;\n }\n .ms-Button-textContainer {\n width: 100%;\n }\n\n .ms-Button-label {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n }\n"])));var CommentDateTime=_styled(DateTime).withConfig({displayName:"CommentDisplay__CommentDateTime",componentId:"sc-el7c23-4"})(templateObject_5$q||(templateObject_5$q=__makeTemplateObject(["\n font-size: 12px;\n"],["\n font-size: 12px;\n"])));var Buttons$1=_styled.div.withConfig({displayName:"CommentDisplay__Buttons",componentId:"sc-el7c23-5"})(templateObject_6$g||(templateObject_6$g=__makeTemplateObject(["\n display: flex;\n align-items: center;\n margin-left: auto;\n\n button {\n height: auto;\n min-height: ","px; /* icons have a font-size of 20px */\n }\n"],["\n display: flex;\n align-items: center;\n margin-left: auto;\n\n button {\n height: auto;\n min-height: ","px; /* icons have a font-size of 20px */\n }\n"])),fontSizeLarge);var Body=_styled.div.withConfig({displayName:"CommentDisplay__Body",componentId:"sc-el7c23-6"})(templateObject_7$b||(templateObject_7$b=__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n margin-top: 5px;\n"],["\n display: flex;\n flex-direction: column;\n margin-top: 5px;\n"])));var Content$4=_styled.div.withConfig({displayName:"CommentDisplay__Content",componentId:"sc-el7c23-7"})(templateObject_8$a||(templateObject_8$a=__makeTemplateObject(["\n padding-top: ","px;\n flex: 1 1 auto;\n a {\n font-weight: bold;\n &:hover,\n &:active {\n text-decoration: underline;\n }\n }\n"],["\n padding-top: ","px;\n flex: 1 1 auto;\n a {\n font-weight: bold;\n &:hover,\n &:active {\n text-decoration: underline;\n }\n }\n"])),spacingXs);var Container$1=_styled.div.withConfig({displayName:"CommentDisplay__Container",componentId:"sc-el7c23-8"})(templateObject_10$7||(templateObject_10$7=__makeTemplateObject(["\n padding-bottom: 15px;\n font-size: ","px;\n line-height: ","px;\n\n ","\n"],["\n padding-bottom: 15px;\n font-size: ","px;\n line-height: ","px;\n\n ","\n"])),fontSizeSmall,spacingM,function(p){return p.highlight&&css$2(templateObject_9$8||(templateObject_9$8=__makeTemplateObject(["\n position: relative;\n\n &::after {\n content: '';\n position: absolute;\n top: -","px;\n bottom: 0;\n right: -","px;\n width: ","px;\n display: block;\n background-color: ",";\n }\n "],["\n position: relative;\n\n &::after {\n content: '';\n position: absolute;\n top: -","px;\n bottom: 0;\n right: -","px;\n width: ","px;\n display: block;\n background-color: ",";\n }\n "])),postsSectionPadding,postsSectionPadding,spacingXs,function(p){return p.theme.palette.accent;});});var CommentUser=_styled(PersonaCard).withConfig({displayName:"CommentDisplay__CommentUser",componentId:"sc-el7c23-9"})(templateObject_11$3||(templateObject_11$3=__makeTemplateObject(["\n align-self: flex-start;\n"],["\n align-self: flex-start;\n"])));var StyledEditCommentWithAttachments=_styled(EditCommentWithAttachments).withConfig({displayName:"CommentDisplay__StyledEditCommentWithAttachments",componentId:"sc-el7c23-10"})(templateObject_12$2$1||(templateObject_12$2$1=__makeTemplateObject(["\n width: 100%;\n position: relative;\n"],["\n width: 100%;\n position: relative;\n"])));var StyledImagesAndFilesList$1=_styled(ImagesAndFilesList).withConfig({displayName:"CommentDisplay__StyledImagesAndFilesList",componentId:"sc-el7c23-11"})(templateObject_13$2$1||(templateObject_13$2$1=__makeTemplateObject(["\n margin-top: ","px;\n\n && [data-preload-video='true'] video {\n background-color: ",";\n }\n"],["\n margin-top: ","px;\n\n && [data-preload-video='true'] video {\n background-color: ",";\n }\n"])),spacingM,function(p){return p.theme.palette.white;});var FeedbackButtonStyle=css$2(templateObject_14$2$1||(templateObject_14$2$1=__makeTemplateObject(["\n min-width: auto;\n padding: 0 4px;\n\n && {\n margin-right: 0;\n }\n\n i {\n font-size: ","px;\n height: ","px;\n line-height: ","px;\n }\n"],["\n min-width: auto;\n padding: 0 4px;\n\n && {\n margin-right: 0;\n }\n\n i {\n font-size: ","px;\n height: ","px;\n line-height: ","px;\n }\n"])),fontSizeMedium+2,fontSizeMedium+2,fontSizeMedium+2);var StyledLikeButton$1=_styled(LikeButton).withConfig({displayName:"CommentDisplay__StyledLikeButton",componentId:"sc-el7c23-12"})(templateObject_15$2$1||(templateObject_15$2$1=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),FeedbackButtonStyle);var ReplyCountButton=_styled(FeedbackCountButton).withConfig({displayName:"CommentDisplay__ReplyCountButton",componentId:"sc-el7c23-13"})(templateObject_16$2||(templateObject_16$2=__makeTemplateObject(["\n &&& {\n margin-right: ","px;\n }\n ","\n"],["\n &&& {\n margin-right: ","px;\n }\n ","\n"])),spacingS,FeedbackButtonStyle);var templateObject_1$1K,templateObject_2$12,templateObject_3$J,templateObject_4$u,templateObject_5$q,templateObject_6$g,templateObject_7$b,templateObject_8$a,templateObject_9$8,templateObject_10$7,templateObject_11$3,templateObject_12$2$1,templateObject_13$2$1,templateObject_14$2$1,templateObject_15$2$1,templateObject_16$2;var CardStatisticItem=function CardStatisticItem(_a){var count=_a.count,tooltipResourceKey=_a.tooltipResourceKey,icon=_a.icon,ariaLabel=_a.ariaLabel,targetRoute=_a.targetRoute,highlight=_a.highlight,onClick=_a.onClick,className=_a.className,domIdentifier=_a.domIdentifier;var formatMessage=useIntl().formatMessage;return jsx$1(Tooltip,__assign({resourceKey:tooltipResourceKey,values:{count:count},className:className},{children:onClick?jsx$1(StatisticButton,__assign({"data-statistic-button":domIdentifier,iconProps:{iconName:icon},onClick:onClick,"aria-label":formatMessage({id:ariaLabel})},{children:count>0&&jsx$1(StatisticCount,__assign({"aria-hidden":"true"},{children:count}),void 0)}),void 0):jsxs(StatisticLink,__assign({to:targetRoute,"aria-label":formatMessage({id:ariaLabel})},{children:[jsx$1(StatisticIcon,{iconName:icon,highlight:highlight},void 0),count>0&&jsx$1(StatisticCount,__assign({"aria-hidden":"true"},{children:count}),void 0)]}),void 0)}),void 0);};var StatisticLink=_styled(NavLink).withConfig({displayName:"CardStatisticItem__StatisticLink",componentId:"sc-1ll8iv5-0"})(templateObject_1$1J||(templateObject_1$1J=__makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n color: ",";\n height: ","px;\n"],["\n display: inline-flex;\n align-items: center;\n color: ",";\n height: ","px;\n"])),function(p){return p.theme.textColors.default;},feedbackButtonHeight);var StatisticButton=_styled(IconButton).withConfig({displayName:"CardStatisticItem__StatisticButton",componentId:"sc-1ll8iv5-1"})(templateObject_2$11||(templateObject_2$11=__makeTemplateObject(["\n && {\n width: auto;\n margin: 0;\n padding: 0;\n\n i {\n font-size: ","px;\n }\n }\n"],["\n && {\n width: auto;\n margin: 0;\n padding: 0;\n\n i {\n font-size: ","px;\n }\n }\n"])),fontSizeLarge-3);var StatisticIcon=_styled(Icon).withConfig({displayName:"CardStatisticItem__StatisticIcon",componentId:"sc-1ll8iv5-2"})(templateObject_3$I||(templateObject_3$I=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),function(p){return p.highlight&&unreadCommentHighlight;});var StatisticCount=_styled.span.withConfig({displayName:"CardStatisticItem__StatisticCount",componentId:"sc-1ll8iv5-3"})(templateObject_4$t||(templateObject_4$t=__makeTemplateObject(["\n flex: 1 0 auto;\n padding-left: 5px;\n font-size: 0.9rem;\n"],["\n flex: 1 0 auto;\n padding-left: 5px;\n font-size: 0.9rem;\n"])));var templateObject_1$1J,templateObject_2$11,templateObject_3$I,templateObject_4$t;var BookmarkButton=function BookmarkButton(_a){var item=_a.item,isReadOnly=_a.isReadOnly,className=_a.className;var formatMessage=useIntl().formatMessage;var refreshStatistics=useNewsApi().refreshStatistics;var toggleBookmark=useManageCurrentUserApi().toggleBookmark;var user=useCurrentUser();var showError=useNotificationContext().showError;var _b=useState$2(isUserBookmarked),isBookmarked=_b[0],setIsBookmarked=_b[1];var _c=useState$2(false),isSaving=_c[0],setIsSaving=_c[1];var itemId=item===null||item===void 0?void 0:item.id;var resourceKey="BookmarkButton."+(isBookmarked?'remove':'add')+"Tooltip";useEffect$1(function(){setIsBookmarked(isUserBookmarked());// eslint-disable-next-line react-hooks/exhaustive-deps
122263
- },[itemId]);return jsx$1(Tooltip,__assign({className:className,resourceKey:resourceKey},{children:jsx$1(StyledIconButton$5,{iconProps:{iconName:isBookmarked?'SingleBookmarkSolid':'SingleBookmark'},"data-bookmark-button":itemId,onClick:toggle,"aria-label":formatMessage({id:resourceKey}),disabled:isReadOnly},void 0)}),void 0);function isUserBookmarked(){var _a;return (_a=user.bookmarks)===null||_a===void 0?void 0:_a.some(function(id){return id===(item===null||item===void 0?void 0:item.id);});}function toggle(e){return __awaiter(this,void 0,void 0,function(){var isNowBookmarked;return __generator(this,function(_a){switch(_a.label){case 0:e.preventDefault();e.stopPropagation();if(isSaving){return [2/*return*/];}setIsSaving(true);isNowBookmarked=!isBookmarked;setIsBookmarked(isNowBookmarked);_a.label=1;case 1:_a.trys.push([1,4,5,6]);return [4/*yield*/,toggleBookmark(itemId,user)];case 2:_a.sent();return [4/*yield*/,refreshStatistics(itemId,{bookmarkCount:isNowBookmarked?1:-1})];case 3:_a.sent();return [3/*break*/,6];case 4:_a.sent();setIsBookmarked(!isNowBookmarked);showError('Profile.bookmarkError');return [3/*break*/,6];case 5:setIsSaving(false);return [7/*endfinally*/];case 6:return [2/*return*/];}});});}};var StyledIconButton$5=_styled(IconButton).withConfig({displayName:"BookmarkButton__StyledIconButton",componentId:"sc-1ni4s3y-0"})(templateObject_1$1I||(templateObject_1$1I=__makeTemplateObject(["\n padding-left: 0;\n padding-right: 0;\n margin-left: -3px;\n\n i {\n font-size: 22px;\n }\n\n &[disabled] {\n background: transparent;\n }\n"],["\n padding-left: 0;\n padding-right: 0;\n margin-left: -3px;\n\n i {\n font-size: 22px;\n }\n\n &[disabled] {\n background: transparent;\n }\n"])));var templateObject_1$1I;var CardFooter=function CardFooter(_a){var item=_a.item,showComments=_a.showComments,targetRoute=_a.targetRoute;var metadata=item.metadata||{};var user=useCurrentUser();var showCommentsIcon=showComments&&item.statistics&&item.statistics.commentCount>0&&hasFeedbackType(metadata.feedbackSettings,'comment');return jsx$1(CardFooterHost,{children:jsxs(FooterRightSection,{children:[jsx$1(CardLikeButton,{item:item,itemResourceType:ItemResourceTypes.News},void 0),!user.isPublicUser&&showCommentsIcon&&jsx$1(CardStatisticItem,{count:item.statistics.commentCount,tooltipResourceKey:"NewsArticle.numberOfComments",icon:"Chat",targetRoute:targetRoute+"#comments",highlight:item.hasNewComments,ariaLabel:"AriaLabel.commentsButton"},void 0),jsx$1(BookmarkButton,{item:item},void 0)]},void 0)},void 0);};var CardFooterHost=_styled.footer.withConfig({displayName:"CardFooter__CardFooterHost",componentId:"sc-8sbpem-0"})(templateObject_1$1H||(templateObject_1$1H=__makeTemplateObject(["\n display: flex;\n margin-top: auto;\n margin-bottom: -4px;\n flex-direction: row;\n justify-content: space-between;\n\n padding-top: ","px;\n\n font-size: ","px;\n\n > div {\n display: flex;\n }\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"],["\n display: flex;\n margin-top: auto;\n margin-bottom: -4px;\n flex-direction: row;\n justify-content: space-between;\n\n padding-top: ","px;\n\n font-size: ","px;\n\n > div {\n display: flex;\n }\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"])),spacingM,fontSizeMedium+4);var FooterRightSection=_styled.div.withConfig({displayName:"CardFooter__FooterRightSection",componentId:"sc-8sbpem-1"})(templateObject_2$10||(templateObject_2$10=__makeTemplateObject(["\n .ms-TooltipHost {\n display: flex;\n align-items: center;\n }\n\n flex: 1 0 ","px;\n justify-content: flex-end;\n > * {\n margin-left: ","px;\n }\n"],["\n .ms-TooltipHost {\n display: flex;\n align-items: center;\n }\n\n flex: 1 0 ","px;\n justify-content: flex-end;\n > * {\n margin-left: ","px;\n }\n"])),spacingXl,spacingS+5);var templateObject_1$1H,templateObject_2$10;var DetailViewContextProvider=function DetailViewContextProvider(_a){var itemId=_a.itemId,type=_a.type,loadItemFunc=_a.loadItemFunc,isEditorPreview=_a.isEditorPreview,children=_a.children;var user=useCurrentUserContext().user;var handleFatalError=useContext(ErrorContext).handleFatalError;var translateContents=useTranslateApi().translateContents;var _b=useState$2(),item=_b[0],setItem=_b[1];var _c=useState$2(),originalItem=_c[0],setOriginalItem=_c[1];var _d=useState$2(),selectedLanguage=_d[0],setSelectedLanguage=_d[1];var _e=useState$2(false),hasError=_e[0],setHasError=_e[1];var _f=useState$2(true),isLoading=_f[0],setIsLoading=_f[1];var _g=useState$2(false),showAccessDenied=_g[0],setShowAccessDenied=_g[1];var handleAccessDeniedError=useContext(ErrorContext).handleAccessDeniedError;var isValid=true;useEffect$1(function(){refreshItem();return function(){// eslint-disable-next-line react-hooks/exhaustive-deps
122258
+ .then(function(){if(ignoreRef.current){return;}setAttachments(function(attachments){return attachments.map(function(a){return a.id!==newAttachment.id?a:__assign(__assign({},a),{isUploadInProgress:false});});});},function(error){logger.error(error);if(!warningToastHandle.current){warningToastHandle.current=showToastWarning('Attachments.uploadError',undefined,function(){return warningToastHandle.current=null;});}if(ignoreRef.current){return;}setAttachments(function(attachments){return attachments.map(function(a){return a.id!==newAttachment.id?a:__assign(__assign({},a),{hasError:true,isUploadInProgress:false});});});});};for(_i=0,newAttachments_1=newAttachments;_i<newAttachments_1.length;_i++){newAttachment=newAttachments_1[_i];_loop_1(newAttachment);}return [2/*return*/];});});}function clearAttachments(){if(!ignoreRef.current){setAttachments([]);setDeletedAttachmentUrls([]);}}function deleteAttachment(attachment){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,handleAttachmentsAdded(attachments.filter(function(f){return f.id!==attachment.id;}))];case 1:_a.sent();setDeletedAttachmentUrls(__spreadArray(__spreadArray([],deletedAttachmentUrls),[attachment.url]));return [2/*return*/];}});});}function uploadAttachment(basePath,attachment){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){if(attachment.type===AttachmentType.Image){return [2/*return*/,uploadImage(basePath,user.subscription.id,attachment.id,containerId,attachment.file)];}else {return [2/*return*/,uploadFile(basePath,user.subscription.id,attachment.id,containerId,attachment.file)];}});});}}var EditCommentWithAttachments=function EditCommentWithAttachments(props){var user=useCurrentUser();var getImageUrl=useAttachmentsApi().getImageUrl;var _a=useAttachmentUploader(props.item.attachments,props.item.attachmentContainerId,props.basePath),attachments=_a[0],handleAttachmentsAdded=_a[1],deletedAttachmentUrls=_a[3],onDeleteAttachment=_a[4];return jsx$1(EditComment,__assign({},props,{allowSaveWithoutContent:props.allowSaveWithoutContent,saveOnEnter:props.saveOnEnter,saveOnCtrlEnter:props.saveOnCtrlEnter,files:attachments.map(function(a){return __assign(__assign({},a),!isClientAttachment(a)&&{previewUrl:getImageUrl(props.basePath,user.subscription.id,props.item,a.id)});}),allowAttachments:!!props.basePath,onSave:handlePost,onAttachmentAdded:handleAttachmentsAdded,allowKeywords:props.allowKeywords,keywordSettings:props.keywordSettings,keywords:props.keywords,deletedFileUrls:deletedAttachmentUrls,onDeleteAttachment:onDeleteAttachment,attachmentPreviewTheme:props.attachmentPreviewTheme}),void 0);function handlePost(newContent,keywords){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,props.onSave(newContent,attachments,keywords)];case 1:_a.sent();return [2/*return*/];}});});}};function isClientAttachment(value){return value.file!=null;}var CommentDisplay=function CommentDisplay(_a){var _b;var type=_a.type,baseAttachmentPath=_a.baseAttachmentPath,message=_a.message,onDelete=_a.onDelete,showDelete=_a.showDelete,showAutoTranslate=_a.showAutoTranslate,showEdit=_a.showEdit,scope=_a.scope,mentionSearchHandler=_a.mentionSearchHandler,getHashtagFilterRoute=_a.getHashtagFilterRoute,highlight=_a.highlight,isInitialLiked=_a.isInitialLiked,onReplyIconClick=_a.onReplyIconClick,onReply=_a.onReply,replyCount=_a.replyCount,readOnly=_a.readOnly,className=_a.className;var _c=useCommentApi(),toggleCommentLike=_c.toggleCommentLike,translateComment=_c.translateComment,updateComment=_c.updateComment;var formatMessage=useIntl().formatMessage;var _d=useNotificationContext(),showToast=_d.showToast,showError=_d.showError;var _e=useState$2(false),isEditMode=_e[0],setIsEditMode=_e[1];var _f=useState$2(message.content),content=_f[0],setContent=_f[1];var _g=useState$2(message.attachments),attachments=_g[0],setAttachments=_g[1];var _h=useState$2(message.modified),modifiedTime=_h[0],setModifiedTime=_h[1];var _j=useState$2(message.content),originalContent=_j[0],setOriginalContent=_j[1];var _k=useState$2(isInitialLiked),isLiked=_k[0],setIsLiked=_k[1];var _l=useState$2(((_b=message.statistics)===null||_b===void 0?void 0:_b.likeCount)||0),likeCounter=_l[0],setLikeCounter=_l[1];var features=useFeatures();var palette=useContext(ThemeContext$1).theme.palette;var hasContent=content.length>0;message=__assign(__assign({},message),{attachments:attachments});return jsxs(Container$1,__assign({className:className,"data-comment-id":message.id,"data-has-auto-translate":showAutoTranslate,"data-can-edit":showEdit,"data-can-delete":showDelete,"data-show-highlight":highlight,highlight:highlight,id:"Comment-"+message.id},{children:[jsxs(Header$1,{children:[jsx$1(CommentUser,__assign({upn:message.sender.userPrincipalName,domIdentifier:"avatar"},{children:jsx$1(Avatar,{upn:message.sender.userPrincipalName,text:message.sender.displayName,size:PersonaSize.small,hidePersonaDetails:true},void 0)}),void 0),jsxs(HeaderMetadata$1,{children:[jsx$1(CommentDisplayName,{children:jsx$1(StyledPersonaCard$1,__assign({upn:message.sender.userPrincipalName},{children:message.sender.displayName}),void 0)},void 0),jsx$1(CommentDateTime,{className:"ms-fontColor-neutralTertiary",value:message.receivedDateTime},void 0),jsx$1(Modified,{modified:modifiedTime},void 0)]},void 0),message.id&&jsxs(Buttons$1,{children:[features.replyToComments&&replyCount>0&&jsx$1(ReplyCountButton,{tooltipResourceKey:"Comment.numberOfReplies",tooltipResourceKeyValues:{count:replyCount},ariaLabel:formatMessage({id:onReplyIconClick?'AriaLabel.commentsButton':'AriaLabel.repliesButton'}),iconName:"Chat",count:replyCount,feedbackType:"comment",onClick:onReplyIconClick!==null&&onReplyIconClick!==void 0?onReplyIconClick:onReply?function(){return onReply(message.id);}:null,highlight:message.hasUnreadReplies,readOnly:readOnly},void 0),jsx$1(StyledLikeButton$1,{itemId:message.id,itemType:ItemResourceTypes.Comments,count:likeCounter,isActive:isLiked,onClick:function(){return handleLike(!isLiked);},doNotRenderZeroCount:true,isDemoContent:message.isDemoContent,readOnly:readOnly},void 0),jsx$1(CommentActionMenu,{comment:message,showEdit:showEdit,onDelete:onDelete,showDelete:showDelete,isEditMode:isEditMode,toggleEditMode:setIsEditMode,originalContent:originalContent,currentContent:content,setContent:setContent,handleTranslate:handleTranslate,showAutoTranslate:showAutoTranslate,onReply:onReply,disabled:readOnly},void 0)]},void 0)]},void 0),jsxs(Body,{children:[isEditMode&&jsx$1(StyledEditCommentWithAttachments,{content:content,mentionSearchHandler:mentionSearchHandler,onSave:handleSaveComment,onCancel:function(){return setIsEditMode(false);},basePath:baseAttachmentPath,item:message,allowSaveWithoutContent:true,saveOnCtrlEnter:true,ariaLabel:formatMessage({id:'AriaLabel.commentInput'})},void 0),!isEditMode&&hasContent&&jsx$1(Fragment,{children:jsx$1(Content$4,__assign({"data-comment-content":message.id},{children:jsx$1(ContentDisplay,{content:content,handlers:[ContentDisplayHandler.LineBreak,ContentDisplayHandler.Link,ContentDisplayHandler.Mention,ContentDisplayHandler.Hashtag],getHashtagRoute:getHashtagFilterRoute},void 0)}),void 0)},void 0)]},void 0),!isEditMode&&(attachments===null||attachments===void 0?void 0:attachments.length)>0&&jsxs("div",__assign({"data-mixed-attachment-list":true},{children:[jsx$1(GifList,{attachments:message.attachments},void 0),jsx$1(StyledImagesAndFilesList$1,{item:message,basePath:baseAttachmentPath,imagesGridBackgroundColor:palette.white},void 0),jsx$1(VideoList,{attachments:message.attachments},void 0),jsx$1(EmbeddedObjectList,{attachments:message.attachments},void 0)]}),void 0)]}),void 0);function handleLike(newIsLiked){return __awaiter(this,void 0,void 0,function(){var oldCounter,error_1;return __generator(this,function(_a){switch(_a.label){case 0:oldCounter=likeCounter;_a.label=1;case 1:_a.trys.push([1,3,,4]);setIsLiked(newIsLiked);setLikeCounter(newIsLiked?oldCounter+1:oldCounter-1);return [4/*yield*/,toggleCommentLike(message.id,newIsLiked)];case 2:_a.sent();return [3/*break*/,4];case 3:error_1=_a.sent();setIsLiked(!newIsLiked);setLikeCounter(oldCounter);logger.error(error_1);showError('Generic.error');return [3/*break*/,4];case 4:return [2/*return*/];}});});}function handleSaveComment(newContent,newAttachments){return __awaiter(this,void 0,void 0,function(){var error_2;return __generator(this,function(_a){switch(_a.label){case 0:setContent(newContent);setAttachments(newAttachments);setIsEditMode(false);setModifiedTime(new Date().toISOString());setOriginalContent(newContent);_a.label=1;case 1:_a.trys.push([1,3,,4]);return [4/*yield*/,updateComment(scope,message.parentItemId,message.id,newContent,newAttachments,type)];case 2:_a.sent();showToast('Comment.successfullyUpdated');return [3/*break*/,4];case 3:error_2=_a.sent();logger.error(error_2);showError('Generic.error');return [3/*break*/,4];case 4:return [2/*return*/];}});});}function handleTranslate(preferredContentLanguageCode){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_b){switch(_b.label){case 0:_b.trys.push([0,2,,3]);return [4/*yield*/,translateComment(type,scope,message.parentItemId,message.id,preferredContentLanguageCode)];case 1:return [2/*return*/,_b.sent()];case 2:_b.sent();showError('Generic.error');return [2/*return*/,null];case 3:return [2/*return*/];}});});}};var Header$1=_styled.div.withConfig({displayName:"CommentDisplay__Header",componentId:"sc-el7c23-0"})(templateObject_1$1I||(templateObject_1$1I=__makeTemplateObject(["\n display: flex;\n align-items: center;\n"],["\n display: flex;\n align-items: center;\n"])));var avatarWidth$1=40;var maxButtonsWidth$1=125;// max 3 buttons (menu button, replies, like)
122259
+ var paddingLeft$1=spacingS;var HeaderMetadata$1=_styled.div.withConfig({displayName:"CommentDisplay__HeaderMetadata",componentId:"sc-el7c23-1"})(templateObject_2$10||(templateObject_2$10=__makeTemplateObject(["\n flex: 1;\n box-sizing: border-box;\n font-size: ","px;\n padding-left: ","px;\n max-width: calc(100% - ","px - ","px);\n"],["\n flex: 1;\n box-sizing: border-box;\n font-size: ","px;\n padding-left: ","px;\n max-width: calc(100% - ","px - ","px);\n"])),fontSizeSmall,paddingLeft$1,avatarWidth$1,maxButtonsWidth$1);var CommentDisplayName=_styled.div.withConfig({displayName:"CommentDisplay__CommentDisplayName",componentId:"sc-el7c23-2"})(templateObject_3$H||(templateObject_3$H=__makeTemplateObject(["\n font-weight: bold;\n"],["\n font-weight: bold;\n"])));var StyledPersonaCard$1=_styled(PersonaCard).withConfig({displayName:"CommentDisplay__StyledPersonaCard",componentId:"sc-el7c23-3"})(templateObject_4$s||(templateObject_4$s=__makeTemplateObject(["\n && {\n max-width: 100%;\n .ms-Button {\n width: 100%;\n }\n .ms-Button-textContainer {\n width: 100%;\n }\n\n .ms-Button-label {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n }\n"],["\n && {\n max-width: 100%;\n .ms-Button {\n width: 100%;\n }\n .ms-Button-textContainer {\n width: 100%;\n }\n\n .ms-Button-label {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n }\n"])));var CommentDateTime=_styled(DateTime).withConfig({displayName:"CommentDisplay__CommentDateTime",componentId:"sc-el7c23-4"})(templateObject_5$o||(templateObject_5$o=__makeTemplateObject(["\n font-size: 12px;\n"],["\n font-size: 12px;\n"])));var Buttons$1=_styled.div.withConfig({displayName:"CommentDisplay__Buttons",componentId:"sc-el7c23-5"})(templateObject_6$f||(templateObject_6$f=__makeTemplateObject(["\n display: flex;\n align-items: center;\n margin-left: auto;\n\n button {\n height: auto;\n min-height: ","px; /* icons have a font-size of 20px */\n }\n"],["\n display: flex;\n align-items: center;\n margin-left: auto;\n\n button {\n height: auto;\n min-height: ","px; /* icons have a font-size of 20px */\n }\n"])),fontSizeLarge);var Body=_styled.div.withConfig({displayName:"CommentDisplay__Body",componentId:"sc-el7c23-6"})(templateObject_7$a||(templateObject_7$a=__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n margin-top: 5px;\n"],["\n display: flex;\n flex-direction: column;\n margin-top: 5px;\n"])));var Content$4=_styled.div.withConfig({displayName:"CommentDisplay__Content",componentId:"sc-el7c23-7"})(templateObject_8$9||(templateObject_8$9=__makeTemplateObject(["\n padding-top: ","px;\n flex: 1 1 auto;\n a {\n font-weight: bold;\n &:hover,\n &:active {\n text-decoration: underline;\n }\n }\n"],["\n padding-top: ","px;\n flex: 1 1 auto;\n a {\n font-weight: bold;\n &:hover,\n &:active {\n text-decoration: underline;\n }\n }\n"])),spacingXs);var Container$1=_styled.div.withConfig({displayName:"CommentDisplay__Container",componentId:"sc-el7c23-8"})(templateObject_10$7||(templateObject_10$7=__makeTemplateObject(["\n padding-bottom: 15px;\n font-size: ","px;\n line-height: ","px;\n\n ","\n"],["\n padding-bottom: 15px;\n font-size: ","px;\n line-height: ","px;\n\n ","\n"])),fontSizeSmall,spacingM,function(p){return p.highlight&&css$2(templateObject_9$8||(templateObject_9$8=__makeTemplateObject(["\n position: relative;\n\n &::after {\n content: '';\n position: absolute;\n top: -","px;\n bottom: 0;\n right: -","px;\n width: ","px;\n display: block;\n background-color: ",";\n }\n "],["\n position: relative;\n\n &::after {\n content: '';\n position: absolute;\n top: -","px;\n bottom: 0;\n right: -","px;\n width: ","px;\n display: block;\n background-color: ",";\n }\n "])),postsSectionPadding,postsSectionPadding,spacingXs,function(p){return p.theme.palette.accent;});});var CommentUser=_styled(PersonaCard).withConfig({displayName:"CommentDisplay__CommentUser",componentId:"sc-el7c23-9"})(templateObject_11$3||(templateObject_11$3=__makeTemplateObject(["\n align-self: flex-start;\n"],["\n align-self: flex-start;\n"])));var StyledEditCommentWithAttachments=_styled(EditCommentWithAttachments).withConfig({displayName:"CommentDisplay__StyledEditCommentWithAttachments",componentId:"sc-el7c23-10"})(templateObject_12$2$1||(templateObject_12$2$1=__makeTemplateObject(["\n width: 100%;\n position: relative;\n"],["\n width: 100%;\n position: relative;\n"])));var StyledImagesAndFilesList$1=_styled(ImagesAndFilesList).withConfig({displayName:"CommentDisplay__StyledImagesAndFilesList",componentId:"sc-el7c23-11"})(templateObject_13$2$1||(templateObject_13$2$1=__makeTemplateObject(["\n margin-top: ","px;\n\n && [data-preload-video='true'] video {\n background-color: ",";\n }\n"],["\n margin-top: ","px;\n\n && [data-preload-video='true'] video {\n background-color: ",";\n }\n"])),spacingM,function(p){return p.theme.palette.white;});var FeedbackButtonStyle=css$2(templateObject_14$2$1||(templateObject_14$2$1=__makeTemplateObject(["\n min-width: auto;\n padding: 0 4px;\n\n && {\n margin-right: 0;\n }\n\n i {\n font-size: ","px;\n height: ","px;\n line-height: ","px;\n }\n"],["\n min-width: auto;\n padding: 0 4px;\n\n && {\n margin-right: 0;\n }\n\n i {\n font-size: ","px;\n height: ","px;\n line-height: ","px;\n }\n"])),fontSizeMedium+2,fontSizeMedium+2,fontSizeMedium+2);var StyledLikeButton$1=_styled(LikeButton).withConfig({displayName:"CommentDisplay__StyledLikeButton",componentId:"sc-el7c23-12"})(templateObject_15$2$1||(templateObject_15$2$1=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),FeedbackButtonStyle);var ReplyCountButton=_styled(FeedbackCountButton).withConfig({displayName:"CommentDisplay__ReplyCountButton",componentId:"sc-el7c23-13"})(templateObject_16$2||(templateObject_16$2=__makeTemplateObject(["\n &&& {\n margin-right: ","px;\n }\n ","\n"],["\n &&& {\n margin-right: ","px;\n }\n ","\n"])),spacingS,FeedbackButtonStyle);var templateObject_1$1I,templateObject_2$10,templateObject_3$H,templateObject_4$s,templateObject_5$o,templateObject_6$f,templateObject_7$a,templateObject_8$9,templateObject_9$8,templateObject_10$7,templateObject_11$3,templateObject_12$2$1,templateObject_13$2$1,templateObject_14$2$1,templateObject_15$2$1,templateObject_16$2;var CardStatisticItem=function CardStatisticItem(_a){var count=_a.count,tooltipResourceKey=_a.tooltipResourceKey,icon=_a.icon,ariaLabel=_a.ariaLabel,targetRoute=_a.targetRoute,highlight=_a.highlight,onClick=_a.onClick,className=_a.className,domIdentifier=_a.domIdentifier;var formatMessage=useIntl().formatMessage;return jsx$1(Tooltip,__assign({resourceKey:tooltipResourceKey,values:{count:count},className:className},{children:onClick?jsx$1(StatisticButton,__assign({"data-statistic-button":domIdentifier,iconProps:{iconName:icon},onClick:onClick,"aria-label":formatMessage({id:ariaLabel})},{children:count>0&&jsx$1(StatisticCount,__assign({"aria-hidden":"true"},{children:count}),void 0)}),void 0):jsxs(StatisticLink,__assign({to:targetRoute,"aria-label":formatMessage({id:ariaLabel})},{children:[jsx$1(StatisticIcon,{iconName:icon,highlight:highlight},void 0),count>0&&jsx$1(StatisticCount,__assign({"aria-hidden":"true"},{children:count}),void 0)]}),void 0)}),void 0);};var StatisticLink=_styled(NavLink).withConfig({displayName:"CardStatisticItem__StatisticLink",componentId:"sc-1ll8iv5-0"})(templateObject_1$1H||(templateObject_1$1H=__makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n color: ",";\n height: ","px;\n"],["\n display: inline-flex;\n align-items: center;\n color: ",";\n height: ","px;\n"])),function(p){return p.theme.textColors.default;},feedbackButtonHeight);var StatisticButton=_styled(IconButton).withConfig({displayName:"CardStatisticItem__StatisticButton",componentId:"sc-1ll8iv5-1"})(templateObject_2$$||(templateObject_2$$=__makeTemplateObject(["\n && {\n width: auto;\n margin: 0;\n padding: 0;\n\n i {\n font-size: ","px;\n }\n }\n"],["\n && {\n width: auto;\n margin: 0;\n padding: 0;\n\n i {\n font-size: ","px;\n }\n }\n"])),fontSizeLarge-3);var StatisticIcon=_styled(Icon).withConfig({displayName:"CardStatisticItem__StatisticIcon",componentId:"sc-1ll8iv5-2"})(templateObject_3$G||(templateObject_3$G=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),function(p){return p.highlight&&unreadCommentHighlight;});var StatisticCount=_styled.span.withConfig({displayName:"CardStatisticItem__StatisticCount",componentId:"sc-1ll8iv5-3"})(templateObject_4$r||(templateObject_4$r=__makeTemplateObject(["\n flex: 1 0 auto;\n padding-left: 5px;\n font-size: 0.9rem;\n"],["\n flex: 1 0 auto;\n padding-left: 5px;\n font-size: 0.9rem;\n"])));var templateObject_1$1H,templateObject_2$$,templateObject_3$G,templateObject_4$r;var BookmarkButton=function BookmarkButton(_a){var item=_a.item,isReadOnly=_a.isReadOnly,className=_a.className;var formatMessage=useIntl().formatMessage;var refreshStatistics=useNewsApi().refreshStatistics;var toggleBookmark=useManageCurrentUserApi().toggleBookmark;var user=useCurrentUser();var showError=useNotificationContext().showError;var _b=useState$2(isUserBookmarked),isBookmarked=_b[0],setIsBookmarked=_b[1];var _c=useState$2(false),isSaving=_c[0],setIsSaving=_c[1];var itemId=item===null||item===void 0?void 0:item.id;var resourceKey="BookmarkButton."+(isBookmarked?'remove':'add')+"Tooltip";useEffect$1(function(){setIsBookmarked(isUserBookmarked());// eslint-disable-next-line react-hooks/exhaustive-deps
122260
+ },[itemId]);return jsx$1(Tooltip,__assign({className:className,resourceKey:resourceKey},{children:jsx$1(StyledIconButton$5,{iconProps:{iconName:isBookmarked?'SingleBookmarkSolid':'SingleBookmark'},"data-bookmark-button":itemId,onClick:toggle,"aria-label":formatMessage({id:resourceKey}),disabled:isReadOnly},void 0)}),void 0);function isUserBookmarked(){var _a;return (_a=user.bookmarks)===null||_a===void 0?void 0:_a.some(function(id){return id===(item===null||item===void 0?void 0:item.id);});}function toggle(e){return __awaiter(this,void 0,void 0,function(){var isNowBookmarked;return __generator(this,function(_a){switch(_a.label){case 0:e.preventDefault();e.stopPropagation();if(isSaving){return [2/*return*/];}setIsSaving(true);isNowBookmarked=!isBookmarked;setIsBookmarked(isNowBookmarked);_a.label=1;case 1:_a.trys.push([1,4,5,6]);return [4/*yield*/,toggleBookmark(itemId,user)];case 2:_a.sent();return [4/*yield*/,refreshStatistics(itemId,{bookmarkCount:isNowBookmarked?1:-1})];case 3:_a.sent();return [3/*break*/,6];case 4:_a.sent();setIsBookmarked(!isNowBookmarked);showError('Profile.bookmarkError');return [3/*break*/,6];case 5:setIsSaving(false);return [7/*endfinally*/];case 6:return [2/*return*/];}});});}};var StyledIconButton$5=_styled(IconButton).withConfig({displayName:"BookmarkButton__StyledIconButton",componentId:"sc-1ni4s3y-0"})(templateObject_1$1G||(templateObject_1$1G=__makeTemplateObject(["\n padding-left: 0;\n padding-right: 0;\n margin-left: -3px;\n\n i {\n font-size: 22px;\n }\n\n &[disabled] {\n background: transparent;\n }\n"],["\n padding-left: 0;\n padding-right: 0;\n margin-left: -3px;\n\n i {\n font-size: 22px;\n }\n\n &[disabled] {\n background: transparent;\n }\n"])));var templateObject_1$1G;var CardFooter=function CardFooter(_a){var item=_a.item,showComments=_a.showComments,targetRoute=_a.targetRoute;var metadata=item.metadata||{};var user=useCurrentUser();var showCommentsIcon=showComments&&item.statistics&&item.statistics.commentCount>0&&hasFeedbackType(metadata.feedbackSettings,'comment');return jsx$1(CardFooterHost,{children:jsxs(FooterRightSection,{children:[jsx$1(CardLikeButton,{item:item,itemResourceType:ItemResourceTypes.News},void 0),!user.isPublicUser&&showCommentsIcon&&jsx$1(CardStatisticItem,{count:item.statistics.commentCount,tooltipResourceKey:"NewsArticle.numberOfComments",icon:"Chat",targetRoute:targetRoute+"#comments",highlight:item.hasNewComments,ariaLabel:"AriaLabel.commentsButton"},void 0),jsx$1(BookmarkButton,{item:item},void 0)]},void 0)},void 0);};var CardFooterHost=_styled.footer.withConfig({displayName:"CardFooter__CardFooterHost",componentId:"sc-8sbpem-0"})(templateObject_1$1F||(templateObject_1$1F=__makeTemplateObject(["\n display: flex;\n margin-top: auto;\n margin-bottom: -4px;\n flex-direction: row;\n justify-content: space-between;\n\n padding-top: ","px;\n\n font-size: ","px;\n\n > div {\n display: flex;\n }\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"],["\n display: flex;\n margin-top: auto;\n margin-bottom: -4px;\n flex-direction: row;\n justify-content: space-between;\n\n padding-top: ","px;\n\n font-size: ","px;\n\n > div {\n display: flex;\n }\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"])),spacingM,fontSizeMedium+4);var FooterRightSection=_styled.div.withConfig({displayName:"CardFooter__FooterRightSection",componentId:"sc-8sbpem-1"})(templateObject_2$_||(templateObject_2$_=__makeTemplateObject(["\n .ms-TooltipHost {\n display: flex;\n align-items: center;\n }\n\n flex: 1 0 ","px;\n justify-content: flex-end;\n > * {\n margin-left: ","px;\n }\n"],["\n .ms-TooltipHost {\n display: flex;\n align-items: center;\n }\n\n flex: 1 0 ","px;\n justify-content: flex-end;\n > * {\n margin-left: ","px;\n }\n"])),spacingXl,spacingS+5);var templateObject_1$1F,templateObject_2$_;var DetailViewContextProvider=function DetailViewContextProvider(_a){var itemId=_a.itemId,type=_a.type,loadItemFunc=_a.loadItemFunc,isEditorPreview=_a.isEditorPreview,children=_a.children;var user=useCurrentUserContext().user;var handleFatalError=useContext(ErrorContext).handleFatalError;var translateContents=useTranslateApi().translateContents;var _b=useState$2(),item=_b[0],setItem=_b[1];var _c=useState$2(),originalItem=_c[0],setOriginalItem=_c[1];var _d=useState$2(),selectedLanguage=_d[0],setSelectedLanguage=_d[1];var _e=useState$2(false),hasError=_e[0],setHasError=_e[1];var _f=useState$2(true),isLoading=_f[0],setIsLoading=_f[1];var _g=useState$2(false),showAccessDenied=_g[0],setShowAccessDenied=_g[1];var handleAccessDeniedError=useContext(ErrorContext).handleAccessDeniedError;var isValid=true;useEffect$1(function(){refreshItem();return function(){// eslint-disable-next-line react-hooks/exhaustive-deps
122264
122261
  isValid=false;};},[itemId]);if(showAccessDenied){handleAccessDeniedError({});return null;}var activeLanguages=NewsService.getItemContentLanguages(originalItem,user.subscription.languages);return jsx$1(DetailViewContext.Provider,__assign({value:getContextValues()},{children:children}),void 0);function getContextValues(){return {isLoading:isLoading,hasError:hasError,resourceType:type,item:item,itemId:itemId,contentLanguage:selectedLanguage===null||selectedLanguage===void 0?void 0:selectedLanguage.lang,userPreferredLanguage:(selectedLanguage===null||selectedLanguage===void 0?void 0:selectedLanguage.isUserSet)?selectedLanguage.lang:getPreferredContentLanguage(user),activeLanguages:activeLanguages,content:item&&selectedLanguage?item.contents[selectedLanguage.lang]:null,updateSelectedLanguage:function(l){return setSelectedLanguage({lang:l,isUserSet:true});},handleRefresh:handleRefresh,handleLanguageChange:handleLanguageChange,isEditorPreview:isEditorPreview};}function handleRefresh(onFinished){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,refreshItem()];case 1:_a.sent();onFinished&&onFinished();return [2/*return*/];}});});}function refreshItem(){return __awaiter(this,void 0,void 0,function(){var p,selectedLanguage_1,err_1;return __generator(this,function(_a){switch(_a.label){case 0:_a.trys.push([0,2,3,4]);return [4/*yield*/,loadItemFunc(itemId)];case 1:p=_a.sent();selectedLanguage_1=NewsService.getLanguageForPublishableItem(p,user);if(isValid){setItem(p);setOriginalItem(p);setSelectedLanguage({isUserSet:false,lang:selectedLanguage_1});setHasError(false);}return [3/*break*/,4];case 2:err_1=_a.sent();if(err_1&&err_1.response&&err_1.response.statusCode===404){if(isValid){setItem(null);setSelectedLanguage(null);setHasError(true);}}else if(err_1&&err_1.response&&err_1.response.statusCode===403){setShowAccessDenied(true);}else {logger.error(err_1);handleFatalError({error:err_1,messageId:'Generic.error'});}return [3/*break*/,4];case 3:isValid&&setIsLoading(false);return [7/*endfinally*/];case 4:return [2/*return*/];}});});}function handleLanguageChange(language){return __awaiter(this,void 0,void 0,function(){var content;var _a;return __generator(this,function(_b){switch(_b.label){case 0:if(item.contents[language]){setSelectedLanguage({isUserSet:true,lang:language});return [2/*return*/];}return [4/*yield*/,translateContents(type,itemId,language)];case 1:content=_b.sent();setItem(__assign(__assign({},item),{contents:__assign(__assign({},item.contents),(_a={},_a[language]=content,_a))}));setSelectedLanguage({isUserSet:true,lang:language});return [2/*return*/];}});});}};var EntityType;(function(EntityType){EntityType["Video"]="video";EntityType["Image"]="image";EntityType["File"]="file";EntityType["Quote"]="quote";EntityType["InlineCode"]="inline-code";EntityType["Gallery"]="gallery";EntityType["Table"]="table";EntityType["Contact"]="contact";EntityType["InlinePageList"]="inline-page-list";EntityType["UrlPreview"]="url-preview";EntityType["ActionButton"]="action-button";})(EntityType||(EntityType={}));var TextViewer=function TextViewer(_a){var html=_a.html,componentMappers=_a.componentMappers;var _b=useState$2(null),editorState=_b[0],setEditorState=_b[1];useEffect$1(function(){setEditorState(getInitialEditorState());// eslint-disable-next-line react-hooks/exhaustive-deps
122265
122262
  },[html]);if(!editorState){return null;}var currentContent=editorState.getCurrentContent();return jsx$1(Draft$1.Editor,{readOnly:true,editorState:editorState,onChange:function(){return null;},blockRendererFn:blockRenderer,blockStyleFn:blockStyle,blockRenderMap:headingRenderMap},void 0);function blockStyle(block){var type=block.getType();if(type==='unstyled'){return 'paragraph';}return null;}function blockRenderer(block){if(block.getType()!=='atomic'){return null;}var entityKey=block.getEntityAt(0);if(entityKey==null){return null;}var entity=currentContent.getEntity(entityKey);var handler=componentMappers.find(function(h){return h.type===entity.getType();});if(handler!=null){return {component:handler.component,editable:false,props:__assign({},entity.getData())};}return null;}function getInitialEditorState(){var contentState=convertFromHTML$1({htmlToEntity:convertHtmlToEntity,htmlToBlock:createHtmlToBlockConverter(componentMappers)})(html||'');return Draft$1.EditorState.createWithContent(contentState,decorator);}function convertHtmlToEntity(nodeName,node,createEntity){for(var _i=0,componentMappers_1=componentMappers;_i<componentMappers_1.length;_i++){var handler=componentMappers_1[_i];var match=handler.getPropsFromHtml(nodeName,node);if(match){return createEntity(handler.type,'IMMUTABLE',match);}}if(nodeName==='a'){return createEntity('LINK','MUTABLE',{url:node.getAttribute('href')});}return null;}};var Link$2=function Link(_a){var contentState=_a.contentState,entityKey=_a.entityKey,children=_a.children;var url=contentState.getEntity(entityKey).getData().url;return jsx$1(TextLink,__assign({url:url},{children:children}),void 0);};function findLinkEntities(contentBlock,callback,contentState){contentBlock.findEntityRanges(function(character){var entityKey=character.getEntity();return entityKey!==null&&contentState.getEntity(entityKey).getType()==='LINK';},callback);}var decorator=new Draft$1.CompositeDecorator([{strategy:findLinkEntities,component:Link$2}]);function createHtmlToBlockConverter(componentMappers){var componentMapperParentNodes=[];return function(nodeName,node){// note (sl): draftJS does call this for all root elements AND
122266
122263
  // their children. We only want to handle an element,
@@ -122278,7 +122275,7 @@ isValid=false;};},[itemId]);if(showAccessDenied){handleAccessDeniedError({});ret
122278
122275
  var _a;if(componentMapperParentNodes.some(function(n){return n.contains(node);})){return false;}for(var _i=0,componentMappers_2=componentMappers;_i<componentMappers_2.length;_i++){var handler=componentMappers_2[_i];var match=handler.getPropsFromHtml(nodeName,node);if(match){componentMapperParentNodes.push(node);handler.prepareRootNode&&handler.prepareRootNode(node);}}if(nodeName==='div'){return 'atomic';}if(nodeName==='p'&&((_a=node.innerHTML)===null||_a===void 0?void 0:_a.trim())==='<br>'){// Quill used to generate <p><br></p> for empty rows
122279
122276
  // This is not compatible with draftJS.
122280
122277
  // Hence we remove the innerHTML for empty p tags.
122281
- node.innerHTML='';}return null;};}var headingRenderMap=Draft$1.DefaultDraftBlockRenderMap.merge(Map$1({'header-one':{element:'h2'},'header-two':{element:'h3'},'header-three':{element:'h4'},'header-four':{element:'h5'},'header-five':{element:'h6'}}));var InlineUrlPreview=function InlineUrlPreview(_a){var _b=_a.blockProps,itemId=_b.itemId,type=_b.type,subscriptionIdentifier=_b.subscriptionIdentifier;var user=useCurrentUser();if(subscriptionIdentifier!==user.subscription.id&&subscriptionIdentifier!==user.subscription.subscriptionHandle){return null;}return jsx$1(EmbeddedObjectTile,{id:itemId,type:parseInt(type),previewTheme:"dark"},void 0);};var InlineUrlPreviewMapper={component:InlineUrlPreview,type:EntityType.UrlPreview,getPropsFromHtml:function(nodeName,node){if(nodeName!=='div'){return null;}var itemId=node.getAttribute('data-item-id');if(itemId==null){return null;}return {itemId:itemId,type:node.getAttribute('data-type'),subscriptionIdentifier:node.getAttribute('data-subscription-identifier')};}};var InlineObjectToolbar=function InlineObjectToolbar(_a){var onDelete=_a.onDelete,additionalButtons=_a.additionalButtons;var formatMessage=useIntl().formatMessage;if(!onDelete&&!additionalButtons){return null;}return jsxs(Toolbar,__assign({className:"inline-object-toolbar",alwaysShown:env.isTouchDevice},{children:[onDelete&&jsx$1(IconButton,{iconProps:{iconName:'Delete'},onMouseDown:function(e){return e.preventDefault();},onClick:onDelete,"data-inline-object-toolbar-delete-button":true,ariaLabel:formatMessage({id:'AriaLabel.editor.removeItem'})},void 0),additionalButtons]}),void 0);};var Toolbar=_styled.div.withConfig({displayName:"InlineObjectToolbar__Toolbar",componentId:"sc-1cbis2b-0"})(templateObject_3$H||(templateObject_3$H=__makeTemplateObject(["\n position: absolute;\n top: 0;\n right: 0;\n padding: 0 ","px;\n height: 36px;\n display: flex;\n align-items: center;\n\n transition: 0.2s ease-out;\n transition-property: opacity, margin;\n background-color: rgba(255, 255, 255, 0.81);\n ","\n\n i {\n text-shadow: white 1px 1px 3px;\n }\n\n &:focus-within {\n opacity: 1;\n z-index: 2;\n }\n"],["\n position: absolute;\n top: 0;\n right: 0;\n padding: 0 ","px;\n height: 36px;\n display: flex;\n align-items: center;\n\n transition: 0.2s ease-out;\n transition-property: opacity, margin;\n background-color: rgba(255, 255, 255, 0.81);\n ","\n\n i {\n text-shadow: white 1px 1px 3px;\n }\n\n &:focus-within {\n opacity: 1;\n z-index: 2;\n }\n"])),spacingS,function(p){return p.alwaysShown?css$2(templateObject_1$1G||(templateObject_1$1G=__makeTemplateObject(["\n opacity: 1;\n z-index: 2;\n "],["\n opacity: 1;\n z-index: 2;\n "]))):css$2(templateObject_2$$||(templateObject_2$$=__makeTemplateObject(["\n opacity: 0;\n z-index: -1;\n "],["\n opacity: 0;\n z-index: -1;\n "])));});var InlineObjectToolbarWrapper=function InlineObjectToolbarWrapper(_a){var toolbar=_a.toolbar,children=_a.children;return jsxs(ObjectHost,__assign({showToolbarOnHover:toolbar!=null},{children:[toolbar,children]}),void 0);};var ObjectHost=_styled.div.withConfig({displayName:"InlineObjectToolbar__ObjectHost",componentId:"sc-1cbis2b-1"})(templateObject_5$p||(templateObject_5$p=__makeTemplateObject(["\n position: relative;\n display: block;\n height: 100%;\n width: 100%;\n\n ","\n"],["\n position: relative;\n display: block;\n height: 100%;\n width: 100%;\n\n ","\n"])),function(p){return p.showToolbarOnHover&&css$2(templateObject_4$s||(templateObject_4$s=__makeTemplateObject(["\n &:hover .inline-object-toolbar {\n opacity: 1;\n z-index: 2;\n }\n "],["\n &:hover .inline-object-toolbar {\n opacity: 1;\n z-index: 2;\n }\n "])));});var templateObject_1$1G,templateObject_2$$,templateObject_3$H,templateObject_4$s,templateObject_5$p;var ImageToolbar=function ImageToolbar(_a){var onDelete=_a.onDelete,onFullScreen=_a.onFullScreen,onClose=_a.onClose,onCrop=_a.onCrop,showFullScreenButton=_a.showFullScreenButton,showCloseButton=_a.showCloseButton,showCropButton=_a.showCropButton;var formatMessage=useIntl().formatMessage;var hasAdditionalButtons=showFullScreenButton||showCropButton||showCloseButton;return jsx$1(InlineObjectToolbar,{onDelete:onDelete,additionalButtons:hasAdditionalButtons&&jsxs(Fragment,{children:[showFullScreenButton&&jsx$1(IconButton,{iconProps:{iconName:'FullScreen'},onMouseDown:function(e){return e.preventDefault();},onClick:onFullScreen,"data-image-toolbar-full-screen-button":true,ariaLabel:formatMessage({id:'AriaLabel.editor.viewFullScreen'})},void 0),showCropButton&&jsx$1(IconButton,{iconProps:{iconName:'EditPhoto'},onMouseDown:function(e){return e.preventDefault();},onClick:onCrop,"data-image-toolbar-crop-button":true,ariaLabel:formatMessage({id:'AriaLabel.editor.editImage'})},void 0),showCloseButton&&jsx$1(IconButton,{iconProps:{iconName:'ChromeClose'},onMouseDown:function(e){return e.preventDefault();},onClick:onClose,"data-image-toolbar-close-button":true,ariaLabel:formatMessage({id:'AriaLabel.cancelButton'})},void 0)]},void 0)},void 0);};var PhotoGallerySlider=function PhotoGallerySlider(_a){var gallery=_a.gallery,imageUrlResolver=_a.imageUrlResolver,onCloseGallery=_a.onCloseGallery,onOpenFullScreen=_a.onOpenFullScreen,showFullScreenButton=_a.showFullScreenButton,showCloseButton=_a.showCloseButton,height=_a.height;var pullToRefreshContext=useContext(PullToRefreshContext);var _b=useState$2(null),fullScreenItemIndex=_b[0],setFullScreenItemIndex=_b[1];var _c=useState$2(false),isFullScreenOpen=_c[0],setIsFullScreenOpen=_c[1];var formatMessage=useIntl().formatMessage;var themePrimary=useContext(ThemeContext$1).theme.palette.themePrimary;useEffect$1(function(){addBackButtonListener(handleBackButton);return function(){return removeBackButtonListener(handleBackButton);};function handleBackButton(){if(isFullScreenOpen){handleCloseFullScreen();return true;}return false;}// eslint-disable-next-line react-hooks/exhaustive-deps
122278
+ node.innerHTML='';}return null;};}var headingRenderMap=Draft$1.DefaultDraftBlockRenderMap.merge(Map$1({'header-one':{element:'h2'},'header-two':{element:'h3'},'header-three':{element:'h4'},'header-four':{element:'h5'},'header-five':{element:'h6'}}));var InlineUrlPreview=function InlineUrlPreview(_a){var _b=_a.blockProps,itemId=_b.itemId,type=_b.type,subscriptionIdentifier=_b.subscriptionIdentifier;var user=useCurrentUser();if(subscriptionIdentifier!==user.subscription.id&&subscriptionIdentifier!==user.subscription.subscriptionHandle){return null;}return jsx$1(EmbeddedObjectTile,{id:itemId,type:parseInt(type),previewTheme:"dark"},void 0);};var InlineUrlPreviewMapper={component:InlineUrlPreview,type:EntityType.UrlPreview,getPropsFromHtml:function(nodeName,node){if(nodeName!=='div'){return null;}var itemId=node.getAttribute('data-item-id');if(itemId==null){return null;}return {itemId:itemId,type:node.getAttribute('data-type'),subscriptionIdentifier:node.getAttribute('data-subscription-identifier')};}};var InlineObjectToolbar=function InlineObjectToolbar(_a){var onDelete=_a.onDelete,additionalButtons=_a.additionalButtons;var formatMessage=useIntl().formatMessage;if(!onDelete&&!additionalButtons){return null;}return jsxs(Toolbar,__assign({className:"inline-object-toolbar",alwaysShown:env.isTouchDevice},{children:[onDelete&&jsx$1(IconButton,{iconProps:{iconName:'Delete'},onMouseDown:function(e){return e.preventDefault();},onClick:onDelete,"data-inline-object-toolbar-delete-button":true,ariaLabel:formatMessage({id:'AriaLabel.editor.removeItem'})},void 0),additionalButtons]}),void 0);};var Toolbar=_styled.div.withConfig({displayName:"InlineObjectToolbar__Toolbar",componentId:"sc-1cbis2b-0"})(templateObject_3$F||(templateObject_3$F=__makeTemplateObject(["\n position: absolute;\n top: 0;\n right: 0;\n padding: 0 ","px;\n height: 36px;\n display: flex;\n align-items: center;\n\n transition: 0.2s ease-out;\n transition-property: opacity, margin;\n background-color: rgba(255, 255, 255, 0.81);\n ","\n\n i {\n text-shadow: white 1px 1px 3px;\n }\n\n &:focus-within {\n opacity: 1;\n z-index: 2;\n }\n"],["\n position: absolute;\n top: 0;\n right: 0;\n padding: 0 ","px;\n height: 36px;\n display: flex;\n align-items: center;\n\n transition: 0.2s ease-out;\n transition-property: opacity, margin;\n background-color: rgba(255, 255, 255, 0.81);\n ","\n\n i {\n text-shadow: white 1px 1px 3px;\n }\n\n &:focus-within {\n opacity: 1;\n z-index: 2;\n }\n"])),spacingS,function(p){return p.alwaysShown?css$2(templateObject_1$1E||(templateObject_1$1E=__makeTemplateObject(["\n opacity: 1;\n z-index: 2;\n "],["\n opacity: 1;\n z-index: 2;\n "]))):css$2(templateObject_2$Z||(templateObject_2$Z=__makeTemplateObject(["\n opacity: 0;\n z-index: -1;\n "],["\n opacity: 0;\n z-index: -1;\n "])));});var InlineObjectToolbarWrapper=function InlineObjectToolbarWrapper(_a){var toolbar=_a.toolbar,children=_a.children;return jsxs(ObjectHost,__assign({showToolbarOnHover:toolbar!=null},{children:[toolbar,children]}),void 0);};var ObjectHost=_styled.div.withConfig({displayName:"InlineObjectToolbar__ObjectHost",componentId:"sc-1cbis2b-1"})(templateObject_5$n||(templateObject_5$n=__makeTemplateObject(["\n position: relative;\n display: block;\n height: 100%;\n width: 100%;\n\n ","\n"],["\n position: relative;\n display: block;\n height: 100%;\n width: 100%;\n\n ","\n"])),function(p){return p.showToolbarOnHover&&css$2(templateObject_4$q||(templateObject_4$q=__makeTemplateObject(["\n &:hover .inline-object-toolbar {\n opacity: 1;\n z-index: 2;\n }\n "],["\n &:hover .inline-object-toolbar {\n opacity: 1;\n z-index: 2;\n }\n "])));});var templateObject_1$1E,templateObject_2$Z,templateObject_3$F,templateObject_4$q,templateObject_5$n;var ImageToolbar=function ImageToolbar(_a){var onDelete=_a.onDelete,onFullScreen=_a.onFullScreen,onClose=_a.onClose,onCrop=_a.onCrop,showFullScreenButton=_a.showFullScreenButton,showCloseButton=_a.showCloseButton,showCropButton=_a.showCropButton;var formatMessage=useIntl().formatMessage;var hasAdditionalButtons=showFullScreenButton||showCropButton||showCloseButton;return jsx$1(InlineObjectToolbar,{onDelete:onDelete,additionalButtons:hasAdditionalButtons&&jsxs(Fragment,{children:[showFullScreenButton&&jsx$1(IconButton,{iconProps:{iconName:'FullScreen'},onMouseDown:function(e){return e.preventDefault();},onClick:onFullScreen,"data-image-toolbar-full-screen-button":true,ariaLabel:formatMessage({id:'AriaLabel.editor.viewFullScreen'})},void 0),showCropButton&&jsx$1(IconButton,{iconProps:{iconName:'EditPhoto'},onMouseDown:function(e){return e.preventDefault();},onClick:onCrop,"data-image-toolbar-crop-button":true,ariaLabel:formatMessage({id:'AriaLabel.editor.editImage'})},void 0),showCloseButton&&jsx$1(IconButton,{iconProps:{iconName:'ChromeClose'},onMouseDown:function(e){return e.preventDefault();},onClick:onClose,"data-image-toolbar-close-button":true,ariaLabel:formatMessage({id:'AriaLabel.cancelButton'})},void 0)]},void 0)},void 0);};var PhotoGallerySlider=function PhotoGallerySlider(_a){var gallery=_a.gallery,imageUrlResolver=_a.imageUrlResolver,onCloseGallery=_a.onCloseGallery,onOpenFullScreen=_a.onOpenFullScreen,showFullScreenButton=_a.showFullScreenButton,showCloseButton=_a.showCloseButton,height=_a.height;var pullToRefreshContext=useContext(PullToRefreshContext);var _b=useState$2(null),fullScreenItemIndex=_b[0],setFullScreenItemIndex=_b[1];var _c=useState$2(false),isFullScreenOpen=_c[0],setIsFullScreenOpen=_c[1];var formatMessage=useIntl().formatMessage;var themePrimary=useContext(ThemeContext$1).theme.palette.themePrimary;useEffect$1(function(){addBackButtonListener(handleBackButton);return function(){return removeBackButtonListener(handleBackButton);};function handleBackButton(){if(isFullScreenOpen){handleCloseFullScreen();return true;}return false;}// eslint-disable-next-line react-hooks/exhaustive-deps
122282
122279
  },[isFullScreenOpen]);// TODO: improvements - spinners
122283
122280
  var images=useMemo(function(){var _a;return (_a=gallery.images)===null||_a===void 0?void 0:_a.map(function(image){var _a;return __assign(__assign({},image),{// todo: what is a good width for the slider images
122284
122281
  // todo: previewUrl is a bit misleading here
@@ -122287,23 +122284,23 @@ previewUrl:(_a=image.previewUrl)!==null&&_a!==void 0?_a:imageUrlResolver===null|
122287
122284
  },[gallery.images]);if(!images||images.length===0){return null;}var hasMoreImages=images.length>1;// the paging dots should be shown only if the number of images is less than or equal to 15
122288
122285
  // without this limitation the paging dots breaks the layout in mobile view
122289
122286
  var showPagingDots=hasMoreImages&&images.length<=15;return jsxs(Fragment,{children:[jsx$1(GalleryContainer,__assign({"data-photo-gallery-container":true},{children:jsx$1(InlineObjectToolbarWrapper,__assign({toolbar:jsx$1(ImageToolbar,{showFullScreenButton:showFullScreenButton,onFullScreen:function(e){e.stopPropagation();handleOpenFullScreen();},showCloseButton:showCloseButton,onClose:function(e){e.stopPropagation();onCloseGallery===null||onCloseGallery===void 0?void 0:onCloseGallery();}},void 0)},{children:jsx$1(Carousel,__assign({renderBottomCenterControls:function(props){return showPagingDots?jsx$1(PagingDots,__assign({},props),void 0):null;},renderCenterLeftControls:function(_a){var previousSlide=_a.previousSlide;return hasMoreImages&&!env.isTouchDevice?jsx$1(CarouselButton,{iconProps:{iconName:'CaretLeftSolid8'},onClick:function(e){e.stopPropagation();previousSlide();},ariaLabel:formatMessage({id:'Generic.prev'}),"data-button":"prev"},void 0):null;},renderCenterRightControls:function(_a){var nextSlide=_a.nextSlide;return hasMoreImages&&!env.isTouchDevice?jsx$1(CarouselButton,{iconProps:{iconName:'CaretRightSolid8'},onClick:function(e){e.stopPropagation();nextSlide();},ariaLabel:formatMessage({id:'Generic.next'}),"data-button":"next"},void 0):null;},renderTopRightControls:function(_a){_a.currentSlide;return null;},swiping:hasMoreImages,dragging:hasMoreImages,wrapAround:true,afterSlide:function(slideIndex){return setFullScreenItemIndex(slideIndex);},defaultControlsConfig:{pagingDotsStyle:{fill:themePrimary},pagingDotsContainerClassName:'slider-dots'}},{children:images.map(function(image){return jsxs(Slide,{children:[jsx$1(Figure$1,__assign({height:height},{children:jsx$1(ImageWrapper,{children:jsx$1("img",{"data-photo-gallery-image":image.imageId,src:image.previewUrl,alt:image.imageTitle||''},void 0)},void 0)}),void 0),image.imageTitle&&jsx$1(Caption,__assign({"data-photo-gallery-image-caption":image.imageTitle},{children:image.imageTitle}),void 0)]},image.imageId);})}),void 0)}),void 0)}),void 0),jsx$1(FullScreenImageViewer,{images:images,selectedIndex:fullScreenItemIndex,hidden:!isFullScreenOpen,onClose:handleCloseFullScreen,imageUrlResolver:imageUrlResolver},void 0)]},void 0);function handleOpenFullScreen(){onOpenFullScreen===null||onOpenFullScreen===void 0?void 0:onOpenFullScreen();setIsFullScreenOpen(true);// if we are in the editor the pullToRefreshContext is null
122290
- if(pullToRefreshContext){pullToRefreshContext.setEnabled(false);}}function handleCloseFullScreen(){setIsFullScreenOpen(false);if(pullToRefreshContext){pullToRefreshContext.setEnabled(true);}}};var GalleryContainer=_styled.div.withConfig({displayName:"PhotoGallery__GalleryContainer",componentId:"sc-peu8jt-0"})(templateObject_1$1F||(templateObject_1$1F=__makeTemplateObject(["\n position: relative;\n display: flex;\n width: 100%;\n margin-bottom: ","px;\n\n .slider:focus {\n outline: 2px solid ",";\n outline-offset: 2px;\n }\n\n .slider-frame {\n height: auto !important;\n }\n\n .slider-list {\n cursor: default !important;\n }\n\n figure {\n margin: 0;\n }\n\n .slider-control-bottomcenter {\n position: relative !important;\n left: 0 !important;\n transform: none !important;\n }\n\n .slider-dots {\n top: 0 !important;\n justify-content: center;\n .paging-item {\n margin-bottom: 0 !important;\n button {\n width: 18px !important;\n max-width: 18px !important;\n padding: 0 6px !important;\n }\n &:not(.active) button {\n fill: "," !important;\n }\n }\n }\n"],["\n position: relative;\n display: flex;\n width: 100%;\n margin-bottom: ","px;\n\n .slider:focus {\n outline: 2px solid ",";\n outline-offset: 2px;\n }\n\n .slider-frame {\n height: auto !important;\n }\n\n .slider-list {\n cursor: default !important;\n }\n\n figure {\n margin: 0;\n }\n\n .slider-control-bottomcenter {\n position: relative !important;\n left: 0 !important;\n transform: none !important;\n }\n\n .slider-dots {\n top: 0 !important;\n justify-content: center;\n .paging-item {\n margin-bottom: 0 !important;\n button {\n width: 18px !important;\n max-width: 18px !important;\n padding: 0 6px !important;\n }\n &:not(.active) button {\n fill: "," !important;\n }\n }\n }\n"])),spacingS+5,function(p){return p.theme.palette.accent;},function(p){return p.theme.palette.neutralTertiary;});var CarouselButton=_styled(IconButton).withConfig({displayName:"PhotoGallery__CarouselButton",componentId:"sc-peu8jt-1"})(templateObject_2$_||(templateObject_2$_=__makeTemplateObject(["\n && {\n margin: 0 ","px;\n background-color: #fff;\n border-radius: 50%;\n\n &:hover {\n background-color: #fff;\n }\n\n i {\n margin: 0;\n }\n\n &[data-button='prev'] {\n i {\n transform: translate(-1px, 0);\n }\n }\n\n &[data-button='next'] {\n i {\n transform: translate(1px, 0);\n }\n }\n }\n"],["\n && {\n margin: 0 ","px;\n background-color: #fff;\n border-radius: 50%;\n\n &:hover {\n background-color: #fff;\n }\n\n i {\n margin: 0;\n }\n\n &[data-button='prev'] {\n i {\n transform: translate(-1px, 0);\n }\n }\n\n &[data-button='next'] {\n i {\n transform: translate(1px, 0);\n }\n }\n }\n"])),spacingS);var Slide=_styled.div.withConfig({displayName:"PhotoGallery__Slide",componentId:"sc-peu8jt-2"})(templateObject_3$G||(templateObject_3$G=__makeTemplateObject(["\n width: 100%;\n height: auto;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n"],["\n width: 100%;\n height: auto;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n"])));_styled.div.withConfig({displayName:"PhotoGallery__SlideIndicator",componentId:"sc-peu8jt-3"})(templateObject_4$r||(templateObject_4$r=__makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n margin-right: 10px;\n margin-top: 10px;\n background-color: rgba(0, 0, 0, 0.7);\n color: #fff;\n border-radius: 15px;\n font-size: 12px;\n padding: 3px 6px;\n"],["\n display: flex;\n align-items: center;\n justify-content: center;\n margin-right: 10px;\n margin-top: 10px;\n background-color: rgba(0, 0, 0, 0.7);\n color: #fff;\n border-radius: 15px;\n font-size: 12px;\n padding: 3px 6px;\n"])));var Figure$1=_styled.figure.withConfig({displayName:"PhotoGallery__Figure",componentId:"sc-peu8jt-4"})(templateObject_7$a||(templateObject_7$a=__makeTemplateObject(["\n && {\n width: 100%;\n ",";\n\n background-color: ",";\n\n @media (min-width: ","px) {\n ","\n }\n\n img {\n max-width: 100%;\n height: auto;\n position: absolute;\n max-height: 100%;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n }\n"],["\n && {\n width: 100%;\n ",";\n\n background-color: ",";\n\n @media (min-width: ","px) {\n ","\n }\n\n img {\n max-width: 100%;\n height: auto;\n position: absolute;\n max-height: 100%;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n }\n"])),function(p){return p.height?css$2(templateObject_5$o||(templateObject_5$o=__makeTemplateObject(["\n height: ","px;\n "],["\n height: ","px;\n "])),p.height-100):'height: 300px;';},function(p){return p.theme.palette.neutralLighter;},minScreenSize.medium,function(p){return p.height?css$2(templateObject_6$f||(templateObject_6$f=__makeTemplateObject(["\n height: ","px;\n "],["\n height: ","px;\n "])),p.height):'height: 400px;';});var Caption=_styled.span.withConfig({displayName:"PhotoGallery__Caption",componentId:"sc-peu8jt-5"})(templateObject_8$9||(templateObject_8$9=__makeTemplateObject(["\n padding-top: 5px;\n text-align: center;\n ","\n"],["\n padding-top: 5px;\n text-align: center;\n ","\n"])),LineClamp(2,fontSizeSmall,1.2));var ImageWrapper=_styled.div.withConfig({displayName:"PhotoGallery__ImageWrapper",componentId:"sc-peu8jt-6"})(templateObject_9$7||(templateObject_9$7=__makeTemplateObject(["\n position: relative;\n display: block;\n height: 100%;\n width: 100%;\n"],["\n position: relative;\n display: block;\n height: 100%;\n width: 100%;\n"])));_styled.a.withConfig({displayName:"PhotoGallery__ClickableImageWrapper",componentId:"sc-peu8jt-7"})(templateObject_10$6||(templateObject_10$6=__makeTemplateObject(["\n position: relative;\n display: block;\n height: 100%;\n width: 100%;\n text-decoration: none;\n"],["\n position: relative;\n display: block;\n height: 100%;\n width: 100%;\n text-decoration: none;\n"])));var templateObject_1$1F,templateObject_2$_,templateObject_3$G,templateObject_4$r,templateObject_5$o,templateObject_6$f,templateObject_7$a,templateObject_8$9,templateObject_9$7,templateObject_10$6;var DetailViewContext=/*#__PURE__*/createContext(null);function useDetailViewContext(){return useContext(DetailViewContext);}var InlineGallery=function InlineGallery(_a){var galleryDetails=_a.blockProps;var _b=useDetailViewContext(),item=_b.item,resourceType=_b.resourceType,isEditorPreview=_b.isEditorPreview;var user=useCurrentUser();var getImageUrlWithToken=useNewsApi().getImageUrlWithToken;var getImageEditorUrlWithToken=useImageEditorApi().getImageEditorUrlWithToken;return jsx$1(PhotoGallerySlider,{gallery:galleryDetails,imageUrlResolver:getImageUrl,showFullScreenButton:true},void 0);function getImageUrl(imageId,width,height){if(!item.fileAccessToken){return null;}var imageWidth=width!==null&&width!==void 0?width:getMaxImageWidth();if(isEditorPreview){return getImageEditorUrlWithToken(item.fileAccessToken,item.id,user.subscription.id,imageId,resourceType,imageWidth,height);}else {return getImageUrlWithToken(item.fileAccessToken,item.id,user.subscription.id,resourceType,imageId,imageWidth,height);}}};var InlineGalleryMapper={component:InlineGallery,type:EntityType.Gallery,getPropsFromHtml:function(nodeName,node){if(nodeName!=='div'){return null;}var galleryId=node.getAttribute('data-gallery-id');if(galleryId==null){return null;}return {galleryId:galleryId,images:Array.from(node.querySelectorAll('img')).map(function(imageNode){var _a,_b,_c,_d;var imageTitle=(_d=(_b=(_a=imageNode.nextSibling)===null||_a===void 0?void 0:_a.textContent)!==null&&_b!==void 0?_b:// @ts-ignore
122291
- (_c=imageNode.nextSibling)===null||_c===void 0?void 0:_c.innerText)!==null&&_d!==void 0?_d:imageNode.getAttribute('data-image-title');return {imageId:imageNode.getAttribute('data-image-id'),imageTitle:imageTitle,width:imageNode.getAttribute('width'),height:imageNode.getAttribute('height')};}).filter(function(image){return image.imageId!==null;})};}};var InlineImage=function InlineImage(_a){var image=_a.blockProps;var _b=useDetailViewContext(),item=_b.item,resourceType=_b.resourceType,isEditorPreview=_b.isEditorPreview;var getImageUrlWithToken=useNewsApi().getImageUrlWithToken;var getImageEditorUrlWithToken=useImageEditorApi().getImageEditorUrlWithToken;var user=useCurrentUser();var imageWidth=getImageWidth(image);var imageUrl=getImageUrl();return jsx$1(Host$E,{children:jsxs(Figure,__assign({width:imageWidth,onClick:!isEditorPreview?function(){return showPhoto(getImageUrlWithToken(item.fileAccessToken,item.id,null,resourceType,image.imageId,'default'));}:null},{children:[jsx$1("img",{src:imageUrl,alt:image.imageTitle||'',width:imageWidth},void 0),image.imageTitle&&jsx$1("figcaption",{children:image.imageTitle},void 0)]}),void 0)},void 0);function getImageUrl(){var _a;if(isEditorPreview){return getImageEditorUrlWithToken(item.fileAccessToken,item.id,user.subscription.id,image.imageId,resourceType,imageWidth);}else {return (_a=image.previewUrl)!==null&&_a!==void 0?_a:getImageUrlWithToken(item.fileAccessToken,item.id,null,resourceType,image.imageId,imageWidth);}}};var Host$E=_styled.div.withConfig({displayName:"InlineImage__Host",componentId:"sc-14k2cj1-0"})(templateObject_1$1E||(templateObject_1$1E=__makeTemplateObject(["\n margin-bottom: ","px;\n"],["\n margin-bottom: ","px;\n"])),spacingS+5);var Figure=_styled.figure.withConfig({displayName:"InlineImage__Figure",componentId:"sc-14k2cj1-1"})(templateObject_2$Z||(templateObject_2$Z=__makeTemplateObject(["\n display: inline-block;\n max-width: 100%;\n img {\n max-width: 100%;\n }\n\n figcaption {\n text-align: center;\n width: ","px;\n max-width: 100%;\n }\n"],["\n display: inline-block;\n max-width: 100%;\n img {\n max-width: 100%;\n }\n\n figcaption {\n text-align: center;\n width: ","px;\n max-width: 100%;\n }\n"])),function(p){return p.width;});var InlineImageMapper={component:InlineImage,type:EntityType.Image,getPropsFromHtml:function(nodeName,node){var _a,_b;if(nodeName!=='div'){return null;}var imageId=node.getAttribute('data-image-id');if(imageId==null){return null;}var imageTitle=(_b=(_a=node.querySelector('p[data-image-caption]'))===null||_a===void 0?void 0:_a.innerText)!==null&&_b!==void 0?_b:// use legacy attribute for old content
122292
- node.getAttribute('data-image-caption');return {imageId:imageId,imageTitle:imageTitle,width:getImageWidth(node.getAttribute('data-image-width')),height:node.getAttribute('data-image-height')};}};var templateObject_1$1E,templateObject_2$Z;var InlineContactViewer=function InlineContactViewer(_a){var _b,_c,_d,_e,_f,_g,_h,_j,_k,_l,_m,_o,_p,_q,_r,_s,_t,_u,_v,_w,_x;var contact=_a.contact;var user=useCurrentUser();var userInfo=usePromise$2(function(){return getContactInfo();},null,[contact])[0];var getUserInfo=useAccountApi().getUserInfo;var additionalPropertyKeys=['mail','company','mobilePhone','officePhone','address','additionalInfo'];var showMoreProperties=contact.properties&&Object.keys(contact.properties).filter(function(key){return additionalPropertyKeys.indexOf(key)>=0&&contact.properties[key].value!==null;}).length>0;return jsxs(Host$D,{children:[jsx$1(StyledAvatar$1,{upn:contact.upn,text:contact.properties.displayName.shouldAutoLoad&&userInfo?userInfo.displayName||contact.properties.displayName.value:contact.properties.displayName.value,secondaryText:((_b=contact.properties.department)===null||_b===void 0?void 0:_b.shouldAutoLoad)&&userInfo?((_c=userInfo.properties)===null||_c===void 0?void 0:_c.department)||((_d=contact.properties.department)===null||_d===void 0?void 0:_d.value):(_e=contact.properties.department)===null||_e===void 0?void 0:_e.value,tertiaryText:((_f=contact.properties.jobTitle)===null||_f===void 0?void 0:_f.shouldAutoLoad)&&userInfo?((_g=userInfo.properties)===null||_g===void 0?void 0:_g.jobTitle)||((_h=contact.properties.jobTitle)===null||_h===void 0?void 0:_h.value):(_j=contact.properties.jobTitle)===null||_j===void 0?void 0:_j.value},void 0),showMoreProperties&&jsx$1(PropertiesContainer,{children:jsxs("ul",{children:[((_k=contact.properties.company)===null||_k===void 0?void 0:_k.value)&&jsx$1("li",{children:jsx$1(UserPropertyWrapper,__assign({iconName:"EMI",tooltipResourceKey:"Generic.company"},{children:contact.properties.company.shouldAutoLoad&&userInfo?((_l=userInfo.properties)===null||_l===void 0?void 0:_l.company)||contact.properties.company.value:contact.properties.company.value}),void 0)},void 0),((_m=contact.properties.mail)===null||_m===void 0?void 0:_m.value)&&jsx$1("li",{children:jsx$1(EmailProperty,{email:contact.properties.mail.shouldAutoLoad&&userInfo?userInfo.mail||contact.properties.mail.value:contact.properties.mail.value},void 0)},void 0),((_o=contact.properties.officePhone)===null||_o===void 0?void 0:_o.value)&&jsx$1("li",{children:jsx$1(OfficePhoneProperty,{value:contact.properties.officePhone.shouldAutoLoad&&userInfo?((_p=userInfo.properties)===null||_p===void 0?void 0:_p.businessPhones[0])||contact.properties.officePhone.value:contact.properties.officePhone.value},void 0)},void 0),((_q=contact.properties.mobilePhone)===null||_q===void 0?void 0:_q.value)&&jsx$1("li",{children:jsx$1(MobilePhoneProperty,{value:contact.properties.mobilePhone.shouldAutoLoad&&userInfo?((_r=userInfo.properties)===null||_r===void 0?void 0:_r.mobilePhone)||contact.properties.mobilePhone.value:contact.properties.mobilePhone.value},void 0)},void 0),((_s=contact.properties.address)===null||_s===void 0?void 0:_s.value)&&jsx$1("li",{children:jsx$1(LocationProperty,{value:contact.properties.address.shouldAutoLoad&&userInfo?((_u=(_t=userInfo.properties)===null||_t===void 0?void 0:_t.officeLocation)!==null&&_u!==void 0?_u:(_v=userInfo.properties)===null||_v===void 0?void 0:_v.address)||contact.properties.address.value:contact.properties.address.value,tooltipResourceKey:"Generic.address"},void 0)},void 0),((_w=contact.properties.additionalInfo)===null||_w===void 0?void 0:_w.value)&&jsx$1("li",{children:jsx$1(UserPropertyWrapper,__assign({iconName:"ContactInfo",tooltipResourceKey:"Generic.additionalInfo"},{children:contact.properties.additionalInfo.shouldAutoLoad&&userInfo?((_x=userInfo.properties)===null||_x===void 0?void 0:_x.notes)||contact.properties.additionalInfo.value:contact.properties.additionalInfo.value}),void 0)},void 0)]},void 0)},void 0)]},void 0);function getContactInfo(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:if(!contact.upn||user.isPublicUser){return [2/*return*/,null];}_a.label=1;case 1:_a.trys.push([1,3,,4]);return [4/*yield*/,getUserInfo(contact.upn)];case 2:return [2/*return*/,_a.sent()];case 3:_a.sent();// no exception is thrown because the backup values will be set from the contact
122293
- return [2/*return*/,null];case 4:return [2/*return*/];}});});}};var Host$D=_styled.div.withConfig({displayName:"InlineContactViewer__Host",componentId:"sc-1rvwltt-0"})(templateObject_1$1D||(templateObject_1$1D=__makeTemplateObject(["\n margin-bottom: ","px;\n"],["\n margin-bottom: ","px;\n"])),spacingS+5);var PropertiesContainer=_styled.div.withConfig({displayName:"InlineContactViewer__PropertiesContainer",componentId:"sc-1rvwltt-1"})(templateObject_2$Y||(templateObject_2$Y=__makeTemplateObject(["\n margin: ","px;\n\n && {\n ul {\n margin: 0;\n padding: 0;\n list-style: none;\n font-size: ","px;\n }\n }\n"],["\n margin: ","px;\n\n && {\n ul {\n margin: 0;\n padding: 0;\n list-style: none;\n font-size: ","px;\n }\n }\n"])),spacingS,fontSizeSmall);var StyledAvatar$1=_styled(Avatar).withConfig({displayName:"InlineContactViewer__StyledAvatar",componentId:"sc-1rvwltt-2"})(templateObject_3$F||(templateObject_3$F=__makeTemplateObject(["\n && {\n .ms-Persona-tertiaryText,\n .ms-Persona-secondaryText {\n display: block;\n font-size: ","px;\n }\n }\n"],["\n && {\n .ms-Persona-tertiaryText,\n .ms-Persona-secondaryText {\n display: block;\n font-size: ","px;\n }\n }\n"])),fontSizeSmall);var templateObject_1$1D,templateObject_2$Y,templateObject_3$F;var FileListHost=_styled.ul.withConfig({displayName:"InlineFileStyles__FileListHost",componentId:"sc-1qjkw11-0"})(templateObject_1$1C||(templateObject_1$1C=__makeTemplateObject(["\n display: flex;\n flex-wrap: wrap;\n justify-content: space-between;\n\n // ensure higher specificity for overwriting the editor list styling\n &&& {\n margin: 0;\n padding: 0;\n list-style: none;\n }\n"],["\n display: flex;\n flex-wrap: wrap;\n justify-content: space-between;\n\n // ensure higher specificity for overwriting the editor list styling\n &&& {\n margin: 0;\n padding: 0;\n list-style: none;\n }\n"])));var FileListItem=_styled.li.withConfig({displayName:"InlineFileStyles__FileListItem",componentId:"sc-1qjkw11-1"})(templateObject_2$X||(templateObject_2$X=__makeTemplateObject(["\n width: 100%;\n display: flex;\n align-items: center;\n\n // ensure higher specificity for overwriting the editor list styling\n &&& {\n margin-bottom: ","px;\n }\n\n @media (min-width: ","px) {\n width: calc(50% - ","px);\n\n audio {\n width: 100%;\n }\n }\n"],["\n width: 100%;\n display: flex;\n align-items: center;\n\n // ensure higher specificity for overwriting the editor list styling\n &&& {\n margin-bottom: ","px;\n }\n\n @media (min-width: ","px) {\n width: calc(50% - ","px);\n\n audio {\n width: 100%;\n }\n }\n"])),spacingM,minScreenSize.small,spacingS-5);var FileContainerStyle=css$2(templateObject_3$E||(templateObject_3$E=__makeTemplateObject(["\n display: flex;\n align-items: center;\n min-width: 200px;\n padding: ","px ","px;\n box-sizing: border-box;\n border: 1px solid #95989a;\n border-radius: 2px;\n font-size: ","px;\n line-height: 1.5em;\n"],["\n display: flex;\n align-items: center;\n min-width: 200px;\n padding: ","px ","px;\n box-sizing: border-box;\n border: 1px solid #95989a;\n border-radius: 2px;\n font-size: ","px;\n line-height: 1.5em;\n"])),spacingS,spacingS+5,fontSizeSmall);var FileIconStyle=css$2(templateObject_4$q||(templateObject_4$q=__makeTemplateObject(["\n margin: 0 ","px 0 0;\n font-size: ","px;\n"],["\n margin: 0 ","px 0 0;\n font-size: ","px;\n"])),spacingS,fontSizeLarge-3);var templateObject_1$1C,templateObject_2$X,templateObject_3$E,templateObject_4$q;var InlineFileDownloadButton=function InlineFileDownloadButton(_a){var getFileUrl=_a.getFileUrl,fileName=_a.fileName,title=_a.title,fileAccessToken=_a.fileAccessToken,additionalContent=_a.additionalContent,className=_a.className;var _b=useFileAccessTokenApi(),exchangeShortLivedToken=_b.exchangeShortLivedToken,createDownloadClickHandler=_b.createDownloadClickHandler;var iconName=getFileIcon(fileName);if(!getFileUrl){return jsxs(FileHost,__assign({className:className,title:title!==null&&title!==void 0?title:fileName},{children:[additionalContent,jsx$1(Icon,{iconName:iconName},void 0),jsx$1("span",{children:title!==null&&title!==void 0?title:fileName},void 0)]}),void 0);}return jsx$1(DownloadButton$3,__assign({className:className,onClick:createDownloadClickHandler('_blank',function(){return __awaiter(void 0,void 0,void 0,function(){var token;return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,exchangeShortLivedToken(fileAccessToken)];case 1:token=_a.sent();return [2/*return*/,getFileUrl(token)];}});});})},{children:jsxs(FileHost,__assign({title:title!==null&&title!==void 0?title:fileName},{children:[additionalContent,jsx$1(Icon,{iconName:iconName},void 0),jsx$1("span",{children:title!==null&&title!==void 0?title:fileName},void 0)]}),void 0)}),void 0);};var FileHost=_styled.div.withConfig({displayName:"InlineFileDownloadButton__FileHost",componentId:"sc-1nadbt8-0"})(templateObject_1$1B||(templateObject_1$1B=__makeTemplateObject(["\n ","\n\n width: 100%;\n\n i {\n ","\n }\n\n span {\n display: block;\n max-width: calc(100% - 32px); // icon width\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n"],["\n ","\n\n width: 100%;\n\n i {\n ","\n }\n\n span {\n display: block;\n max-width: calc(100% - 32px); // icon width\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n"])),FileContainerStyle,FileIconStyle);var DownloadButton$3=_styled(DefaultButton).withConfig({displayName:"InlineFileDownloadButton__DownloadButton",componentId:"sc-1nadbt8-1"})(templateObject_2$W||(templateObject_2$W=__makeTemplateObject(["\n border: 0;\n padding: 0;\n width: 100%;\n height: auto; /* Fixes the top and bottom border for safari */\n\n color: ",";\n text-decoration: none;\n\n &:hover {\n color: ",";\n background-color: initial;\n }\n\n > span {\n height: auto; /* Fixes the top and bottom border for safari */\n }\n"],["\n border: 0;\n padding: 0;\n width: 100%;\n height: auto; /* Fixes the top and bottom border for safari */\n\n color: ",";\n text-decoration: none;\n\n &:hover {\n color: ",";\n background-color: initial;\n }\n\n > span {\n height: auto; /* Fixes the top and bottom border for safari */\n }\n"])),function(p){return p.theme.palette.neutralPrimary;},function(p){return p.theme.palette.neutralPrimary;});var DownloadLink$1=_styled.a.withConfig({displayName:"InlineFileDownloadButton__DownloadLink",componentId:"sc-1nadbt8-2"})(templateObject_3$D||(templateObject_3$D=__makeTemplateObject(["\n display: flex;\n align-items: center;\n width: 100%;\n\n &&& {\n color: ",";\n text-decoration: none;\n }\n"],["\n display: flex;\n align-items: center;\n width: 100%;\n\n &&& {\n color: ",";\n text-decoration: none;\n }\n"])),function(p){return p.theme.palette.neutralPrimary;});var templateObject_1$1B,templateObject_2$W,templateObject_3$D;var InlinePageDocumentDownloadButton=function InlinePageDocumentDownloadButton(_a){var fileUrl=_a.fileUrl,fileName=_a.fileName,title=_a.title,fileIconName=_a.fileIconName,onClick=_a.onClick,className=_a.className;var iconName=fileIconName||getFileIcon(fileName);return jsx$1(DownloadLink$1,__assign({href:fileUrl,target:"_blank",rel:"noopener noreferrer",onClick:onClick,className:className},{children:jsxs(FileHost,__assign({title:title!==null&&title!==void 0?title:fileName},{children:[jsx$1(Icon,{iconName:iconName},void 0),jsx$1("span",{children:title!==null&&title!==void 0?title:fileName},void 0)]}),void 0)}),void 0);};var InlineQuoteViewer=function InlineQuoteViewer(_a){var _b,_c;var quoteDetails=_a.quoteDetails,onClick=_a.onClick,className=_a.className;var upn=(_b=quoteDetails.author)===null||_b===void 0?void 0:_b.userPrincipalName;var displayName=(_c=quoteDetails.author)===null||_c===void 0?void 0:_c.displayName;var showAvatar=upn&&quoteDetails.showAvatar;return jsxs(Host$C,__assign({onClick:onClick,"data-inline-quote":true,className:className},{children:[jsx$1("blockquote",{children:quoteDetails.text},void 0),showAvatar&&jsx$1("figcaption",{children:jsx$1(PersonaCard,__assign({upn:upn},{children:jsx$1(Avatar,{upn:upn,text:displayName,secondaryText:upn},void 0)}),void 0)},void 0),!showAvatar&&displayName&&jsx$1("figcaption",{children:displayName},void 0)]}),void 0);};var Host$C=_styled.figure.withConfig({displayName:"InlineQuoteViewer__Host",componentId:"sc-1kb6gh1-0"})(templateObject_1$1A||(templateObject_1$1A=__makeTemplateObject(["\n && {\n display: inline-block;\n\n border-left: solid 4px ",";\n padding-left: ","px;\n width: calc(100% - ","px);\n box-sizing: border-box;\n margin: 0 ","px ","px ","px;\n\n blockquote {\n border-left: 0;\n margin: 0;\n }\n\n figcaption {\n text-align: right;\n margin-top: ","px;\n position: relative;\n font-size: ","px;\n }\n\n @media (max-width: ","px) {\n margin: 0 0 ","px;\n width: 100%;\n figcaption {\n margin-right: 10px;\n }\n }\n }\n"],["\n && {\n display: inline-block;\n\n border-left: solid 4px ",";\n padding-left: ","px;\n width: calc(100% - ","px);\n box-sizing: border-box;\n margin: 0 ","px ","px ","px;\n\n blockquote {\n border-left: 0;\n margin: 0;\n }\n\n figcaption {\n text-align: right;\n margin-top: ","px;\n position: relative;\n font-size: ","px;\n }\n\n @media (max-width: ","px) {\n margin: 0 0 ","px;\n width: 100%;\n figcaption {\n margin-right: 10px;\n }\n }\n }\n"])),function(p){return p.theme.palette.accent;},spacingM,2*spacingXl,spacingXl,spacingS+spacingXs,spacingXl,spacingS,fontSizeSmall,maxScreenSize.medium,spacingS+spacingXxs+1);var templateObject_1$1A;var InlineQuote=function InlineQuote(_a){var quoteDetails=_a.blockProps;return jsx$1(InlineQuoteViewer,{quoteDetails:quoteDetails},void 0);};var InlineQuoteMapper={component:InlineQuote,type:EntityType.Quote,getPropsFromHtml:function(nodeName,node){var _a,_b,_c,_d,_e;if(nodeName!=='div'){return null;}var quoteId=node.getAttribute('data-quote-id');if(quoteId==null){return null;}var upn=node.getAttribute('data-quote-authorupn');var text=(_a=node.getAttribute('data-quote-text'))!==null&&_a!==void 0?_a:// use legacy attribute for old content
122287
+ if(pullToRefreshContext){pullToRefreshContext.setEnabled(false);}}function handleCloseFullScreen(){setIsFullScreenOpen(false);if(pullToRefreshContext){pullToRefreshContext.setEnabled(true);}}};var GalleryContainer=_styled.div.withConfig({displayName:"PhotoGallery__GalleryContainer",componentId:"sc-peu8jt-0"})(templateObject_1$1D||(templateObject_1$1D=__makeTemplateObject(["\n position: relative;\n display: flex;\n width: 100%;\n margin-bottom: ","px;\n\n .slider:focus {\n outline: 2px solid ",";\n outline-offset: 2px;\n }\n\n .slider-frame {\n height: auto !important;\n }\n\n .slider-list {\n cursor: default !important;\n }\n\n figure {\n margin: 0;\n }\n\n .slider-control-bottomcenter {\n position: relative !important;\n left: 0 !important;\n transform: none !important;\n }\n\n .slider-dots {\n top: 0 !important;\n justify-content: center;\n .paging-item {\n margin-bottom: 0 !important;\n button {\n width: 18px !important;\n max-width: 18px !important;\n padding: 0 6px !important;\n }\n &:not(.active) button {\n fill: "," !important;\n }\n }\n }\n"],["\n position: relative;\n display: flex;\n width: 100%;\n margin-bottom: ","px;\n\n .slider:focus {\n outline: 2px solid ",";\n outline-offset: 2px;\n }\n\n .slider-frame {\n height: auto !important;\n }\n\n .slider-list {\n cursor: default !important;\n }\n\n figure {\n margin: 0;\n }\n\n .slider-control-bottomcenter {\n position: relative !important;\n left: 0 !important;\n transform: none !important;\n }\n\n .slider-dots {\n top: 0 !important;\n justify-content: center;\n .paging-item {\n margin-bottom: 0 !important;\n button {\n width: 18px !important;\n max-width: 18px !important;\n padding: 0 6px !important;\n }\n &:not(.active) button {\n fill: "," !important;\n }\n }\n }\n"])),spacingS+5,function(p){return p.theme.palette.accent;},function(p){return p.theme.palette.neutralTertiary;});var CarouselButton=_styled(IconButton).withConfig({displayName:"PhotoGallery__CarouselButton",componentId:"sc-peu8jt-1"})(templateObject_2$Y||(templateObject_2$Y=__makeTemplateObject(["\n && {\n margin: 0 ","px;\n background-color: #fff;\n border-radius: 50%;\n\n &:hover {\n background-color: #fff;\n }\n\n i {\n margin: 0;\n }\n\n &[data-button='prev'] {\n i {\n transform: translate(-1px, 0);\n }\n }\n\n &[data-button='next'] {\n i {\n transform: translate(1px, 0);\n }\n }\n }\n"],["\n && {\n margin: 0 ","px;\n background-color: #fff;\n border-radius: 50%;\n\n &:hover {\n background-color: #fff;\n }\n\n i {\n margin: 0;\n }\n\n &[data-button='prev'] {\n i {\n transform: translate(-1px, 0);\n }\n }\n\n &[data-button='next'] {\n i {\n transform: translate(1px, 0);\n }\n }\n }\n"])),spacingS);var Slide=_styled.div.withConfig({displayName:"PhotoGallery__Slide",componentId:"sc-peu8jt-2"})(templateObject_3$E||(templateObject_3$E=__makeTemplateObject(["\n width: 100%;\n height: auto;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n"],["\n width: 100%;\n height: auto;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n"])));_styled.div.withConfig({displayName:"PhotoGallery__SlideIndicator",componentId:"sc-peu8jt-3"})(templateObject_4$p||(templateObject_4$p=__makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n margin-right: 10px;\n margin-top: 10px;\n background-color: rgba(0, 0, 0, 0.7);\n color: #fff;\n border-radius: 15px;\n font-size: 12px;\n padding: 3px 6px;\n"],["\n display: flex;\n align-items: center;\n justify-content: center;\n margin-right: 10px;\n margin-top: 10px;\n background-color: rgba(0, 0, 0, 0.7);\n color: #fff;\n border-radius: 15px;\n font-size: 12px;\n padding: 3px 6px;\n"])));var Figure$1=_styled.figure.withConfig({displayName:"PhotoGallery__Figure",componentId:"sc-peu8jt-4"})(templateObject_7$9||(templateObject_7$9=__makeTemplateObject(["\n && {\n width: 100%;\n ",";\n\n background-color: ",";\n\n @media (min-width: ","px) {\n ","\n }\n\n img {\n max-width: 100%;\n height: auto;\n position: absolute;\n max-height: 100%;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n }\n"],["\n && {\n width: 100%;\n ",";\n\n background-color: ",";\n\n @media (min-width: ","px) {\n ","\n }\n\n img {\n max-width: 100%;\n height: auto;\n position: absolute;\n max-height: 100%;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n }\n"])),function(p){return p.height?css$2(templateObject_5$m||(templateObject_5$m=__makeTemplateObject(["\n height: ","px;\n "],["\n height: ","px;\n "])),p.height-100):'height: 300px;';},function(p){return p.theme.palette.neutralLighter;},minScreenSize.medium,function(p){return p.height?css$2(templateObject_6$e||(templateObject_6$e=__makeTemplateObject(["\n height: ","px;\n "],["\n height: ","px;\n "])),p.height):'height: 400px;';});var Caption=_styled.span.withConfig({displayName:"PhotoGallery__Caption",componentId:"sc-peu8jt-5"})(templateObject_8$8||(templateObject_8$8=__makeTemplateObject(["\n padding-top: 5px;\n text-align: center;\n ","\n"],["\n padding-top: 5px;\n text-align: center;\n ","\n"])),LineClamp(2,fontSizeSmall,1.2));var ImageWrapper=_styled.div.withConfig({displayName:"PhotoGallery__ImageWrapper",componentId:"sc-peu8jt-6"})(templateObject_9$7||(templateObject_9$7=__makeTemplateObject(["\n position: relative;\n display: block;\n height: 100%;\n width: 100%;\n"],["\n position: relative;\n display: block;\n height: 100%;\n width: 100%;\n"])));_styled.a.withConfig({displayName:"PhotoGallery__ClickableImageWrapper",componentId:"sc-peu8jt-7"})(templateObject_10$6||(templateObject_10$6=__makeTemplateObject(["\n position: relative;\n display: block;\n height: 100%;\n width: 100%;\n text-decoration: none;\n"],["\n position: relative;\n display: block;\n height: 100%;\n width: 100%;\n text-decoration: none;\n"])));var templateObject_1$1D,templateObject_2$Y,templateObject_3$E,templateObject_4$p,templateObject_5$m,templateObject_6$e,templateObject_7$9,templateObject_8$8,templateObject_9$7,templateObject_10$6;var DetailViewContext=/*#__PURE__*/createContext(null);function useDetailViewContext(){return useContext(DetailViewContext);}var InlineGallery=function InlineGallery(_a){var galleryDetails=_a.blockProps;var _b=useDetailViewContext(),item=_b.item,resourceType=_b.resourceType,isEditorPreview=_b.isEditorPreview;var user=useCurrentUser();var getImageUrlWithToken=useNewsApi().getImageUrlWithToken;var getImageEditorUrlWithToken=useImageEditorApi().getImageEditorUrlWithToken;return jsx$1(PhotoGallerySlider,{gallery:galleryDetails,imageUrlResolver:getImageUrl,showFullScreenButton:true},void 0);function getImageUrl(imageId,width,height){if(!item.fileAccessToken){return null;}var imageWidth=width!==null&&width!==void 0?width:getMaxImageWidth();if(isEditorPreview){return getImageEditorUrlWithToken(item.fileAccessToken,item.id,user.subscription.id,imageId,resourceType,imageWidth,height);}else {return getImageUrlWithToken(item.fileAccessToken,item.id,user.subscription.id,resourceType,imageId,imageWidth,height);}}};var InlineGalleryMapper={component:InlineGallery,type:EntityType.Gallery,getPropsFromHtml:function(nodeName,node){if(nodeName!=='div'){return null;}var galleryId=node.getAttribute('data-gallery-id');if(galleryId==null){return null;}return {galleryId:galleryId,images:Array.from(node.querySelectorAll('img')).map(function(imageNode){var _a,_b,_c,_d;var imageTitle=(_d=(_b=(_a=imageNode.nextSibling)===null||_a===void 0?void 0:_a.textContent)!==null&&_b!==void 0?_b:// @ts-ignore
122288
+ (_c=imageNode.nextSibling)===null||_c===void 0?void 0:_c.innerText)!==null&&_d!==void 0?_d:imageNode.getAttribute('data-image-title');return {imageId:imageNode.getAttribute('data-image-id'),imageTitle:imageTitle,width:imageNode.getAttribute('width'),height:imageNode.getAttribute('height')};}).filter(function(image){return image.imageId!==null;})};}};var InlineImage=function InlineImage(_a){var image=_a.blockProps;var _b=useDetailViewContext(),item=_b.item,resourceType=_b.resourceType,isEditorPreview=_b.isEditorPreview;var getImageUrlWithToken=useNewsApi().getImageUrlWithToken;var getImageEditorUrlWithToken=useImageEditorApi().getImageEditorUrlWithToken;var user=useCurrentUser();var imageWidth=getImageWidth(image);var imageUrl=getImageUrl();return jsx$1(Host$C,{children:jsxs(Figure,__assign({width:imageWidth,onClick:!isEditorPreview?function(){return showPhoto(getImageUrlWithToken(item.fileAccessToken,item.id,null,resourceType,image.imageId,'default'));}:null},{children:[jsx$1("img",{src:imageUrl,alt:image.imageTitle||'',width:imageWidth},void 0),image.imageTitle&&jsx$1("figcaption",{children:image.imageTitle},void 0)]}),void 0)},void 0);function getImageUrl(){var _a;if(isEditorPreview){return getImageEditorUrlWithToken(item.fileAccessToken,item.id,user.subscription.id,image.imageId,resourceType,imageWidth);}else {return (_a=image.previewUrl)!==null&&_a!==void 0?_a:getImageUrlWithToken(item.fileAccessToken,item.id,null,resourceType,image.imageId,imageWidth);}}};var Host$C=_styled.div.withConfig({displayName:"InlineImage__Host",componentId:"sc-14k2cj1-0"})(templateObject_1$1C||(templateObject_1$1C=__makeTemplateObject(["\n margin-bottom: ","px;\n"],["\n margin-bottom: ","px;\n"])),spacingS+5);var Figure=_styled.figure.withConfig({displayName:"InlineImage__Figure",componentId:"sc-14k2cj1-1"})(templateObject_2$X||(templateObject_2$X=__makeTemplateObject(["\n display: inline-block;\n max-width: 100%;\n img {\n max-width: 100%;\n }\n\n figcaption {\n text-align: center;\n width: ","px;\n max-width: 100%;\n }\n"],["\n display: inline-block;\n max-width: 100%;\n img {\n max-width: 100%;\n }\n\n figcaption {\n text-align: center;\n width: ","px;\n max-width: 100%;\n }\n"])),function(p){return p.width;});var InlineImageMapper={component:InlineImage,type:EntityType.Image,getPropsFromHtml:function(nodeName,node){var _a,_b;if(nodeName!=='div'){return null;}var imageId=node.getAttribute('data-image-id');if(imageId==null){return null;}var imageTitle=(_b=(_a=node.querySelector('p[data-image-caption]'))===null||_a===void 0?void 0:_a.innerText)!==null&&_b!==void 0?_b:// use legacy attribute for old content
122289
+ node.getAttribute('data-image-caption');return {imageId:imageId,imageTitle:imageTitle,width:getImageWidth(node.getAttribute('data-image-width')),height:node.getAttribute('data-image-height')};}};var templateObject_1$1C,templateObject_2$X;var InlineContactViewer=function InlineContactViewer(_a){var _b,_c,_d,_e,_f,_g,_h,_j,_k,_l,_m,_o,_p,_q,_r,_s,_t,_u,_v,_w,_x;var contact=_a.contact;var user=useCurrentUser();var userInfo=usePromise$2(function(){return getContactInfo();},null,[contact])[0];var getUserInfo=useAccountApi().getUserInfo;var additionalPropertyKeys=['mail','company','mobilePhone','officePhone','address','additionalInfo'];var showMoreProperties=contact.properties&&Object.keys(contact.properties).filter(function(key){return additionalPropertyKeys.indexOf(key)>=0&&contact.properties[key].value!==null;}).length>0;return jsxs(Host$B,{children:[jsx$1(StyledAvatar$1,{upn:contact.upn,text:contact.properties.displayName.shouldAutoLoad&&userInfo?userInfo.displayName||contact.properties.displayName.value:contact.properties.displayName.value,secondaryText:((_b=contact.properties.department)===null||_b===void 0?void 0:_b.shouldAutoLoad)&&userInfo?((_c=userInfo.properties)===null||_c===void 0?void 0:_c.department)||((_d=contact.properties.department)===null||_d===void 0?void 0:_d.value):(_e=contact.properties.department)===null||_e===void 0?void 0:_e.value,tertiaryText:((_f=contact.properties.jobTitle)===null||_f===void 0?void 0:_f.shouldAutoLoad)&&userInfo?((_g=userInfo.properties)===null||_g===void 0?void 0:_g.jobTitle)||((_h=contact.properties.jobTitle)===null||_h===void 0?void 0:_h.value):(_j=contact.properties.jobTitle)===null||_j===void 0?void 0:_j.value},void 0),showMoreProperties&&jsx$1(PropertiesContainer,{children:jsxs("ul",{children:[((_k=contact.properties.company)===null||_k===void 0?void 0:_k.value)&&jsx$1("li",{children:jsx$1(UserPropertyWrapper,__assign({iconName:"EMI",tooltipResourceKey:"Generic.company"},{children:contact.properties.company.shouldAutoLoad&&userInfo?((_l=userInfo.properties)===null||_l===void 0?void 0:_l.company)||contact.properties.company.value:contact.properties.company.value}),void 0)},void 0),((_m=contact.properties.mail)===null||_m===void 0?void 0:_m.value)&&jsx$1("li",{children:jsx$1(EmailProperty,{email:contact.properties.mail.shouldAutoLoad&&userInfo?userInfo.mail||contact.properties.mail.value:contact.properties.mail.value},void 0)},void 0),((_o=contact.properties.officePhone)===null||_o===void 0?void 0:_o.value)&&jsx$1("li",{children:jsx$1(OfficePhoneProperty,{value:contact.properties.officePhone.shouldAutoLoad&&userInfo?((_p=userInfo.properties)===null||_p===void 0?void 0:_p.businessPhones[0])||contact.properties.officePhone.value:contact.properties.officePhone.value},void 0)},void 0),((_q=contact.properties.mobilePhone)===null||_q===void 0?void 0:_q.value)&&jsx$1("li",{children:jsx$1(MobilePhoneProperty,{value:contact.properties.mobilePhone.shouldAutoLoad&&userInfo?((_r=userInfo.properties)===null||_r===void 0?void 0:_r.mobilePhone)||contact.properties.mobilePhone.value:contact.properties.mobilePhone.value},void 0)},void 0),((_s=contact.properties.address)===null||_s===void 0?void 0:_s.value)&&jsx$1("li",{children:jsx$1(LocationProperty,{value:contact.properties.address.shouldAutoLoad&&userInfo?((_u=(_t=userInfo.properties)===null||_t===void 0?void 0:_t.officeLocation)!==null&&_u!==void 0?_u:(_v=userInfo.properties)===null||_v===void 0?void 0:_v.address)||contact.properties.address.value:contact.properties.address.value,tooltipResourceKey:"Generic.address"},void 0)},void 0),((_w=contact.properties.additionalInfo)===null||_w===void 0?void 0:_w.value)&&jsx$1("li",{children:jsx$1(UserPropertyWrapper,__assign({iconName:"ContactInfo",tooltipResourceKey:"Generic.additionalInfo"},{children:contact.properties.additionalInfo.shouldAutoLoad&&userInfo?((_x=userInfo.properties)===null||_x===void 0?void 0:_x.notes)||contact.properties.additionalInfo.value:contact.properties.additionalInfo.value}),void 0)},void 0)]},void 0)},void 0)]},void 0);function getContactInfo(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:if(!contact.upn||user.isPublicUser){return [2/*return*/,null];}_a.label=1;case 1:_a.trys.push([1,3,,4]);return [4/*yield*/,getUserInfo(contact.upn)];case 2:return [2/*return*/,_a.sent()];case 3:_a.sent();// no exception is thrown because the backup values will be set from the contact
122290
+ return [2/*return*/,null];case 4:return [2/*return*/];}});});}};var Host$B=_styled.div.withConfig({displayName:"InlineContactViewer__Host",componentId:"sc-1rvwltt-0"})(templateObject_1$1B||(templateObject_1$1B=__makeTemplateObject(["\n margin-bottom: ","px;\n"],["\n margin-bottom: ","px;\n"])),spacingS+5);var PropertiesContainer=_styled.div.withConfig({displayName:"InlineContactViewer__PropertiesContainer",componentId:"sc-1rvwltt-1"})(templateObject_2$W||(templateObject_2$W=__makeTemplateObject(["\n margin: ","px;\n\n && {\n ul {\n margin: 0;\n padding: 0;\n list-style: none;\n font-size: ","px;\n }\n }\n"],["\n margin: ","px;\n\n && {\n ul {\n margin: 0;\n padding: 0;\n list-style: none;\n font-size: ","px;\n }\n }\n"])),spacingS,fontSizeSmall);var StyledAvatar$1=_styled(Avatar).withConfig({displayName:"InlineContactViewer__StyledAvatar",componentId:"sc-1rvwltt-2"})(templateObject_3$D||(templateObject_3$D=__makeTemplateObject(["\n && {\n .ms-Persona-tertiaryText,\n .ms-Persona-secondaryText {\n display: block;\n font-size: ","px;\n }\n }\n"],["\n && {\n .ms-Persona-tertiaryText,\n .ms-Persona-secondaryText {\n display: block;\n font-size: ","px;\n }\n }\n"])),fontSizeSmall);var templateObject_1$1B,templateObject_2$W,templateObject_3$D;var FileListHost=_styled.ul.withConfig({displayName:"InlineFileStyles__FileListHost",componentId:"sc-1qjkw11-0"})(templateObject_1$1A||(templateObject_1$1A=__makeTemplateObject(["\n display: flex;\n flex-wrap: wrap;\n justify-content: space-between;\n\n // ensure higher specificity for overwriting the editor list styling\n &&& {\n margin: 0;\n padding: 0;\n list-style: none;\n }\n"],["\n display: flex;\n flex-wrap: wrap;\n justify-content: space-between;\n\n // ensure higher specificity for overwriting the editor list styling\n &&& {\n margin: 0;\n padding: 0;\n list-style: none;\n }\n"])));var FileListItem=_styled.li.withConfig({displayName:"InlineFileStyles__FileListItem",componentId:"sc-1qjkw11-1"})(templateObject_2$V||(templateObject_2$V=__makeTemplateObject(["\n width: 100%;\n display: flex;\n align-items: center;\n\n // ensure higher specificity for overwriting the editor list styling\n &&& {\n margin-bottom: ","px;\n }\n\n @media (min-width: ","px) {\n width: calc(50% - ","px);\n\n audio {\n width: 100%;\n }\n }\n"],["\n width: 100%;\n display: flex;\n align-items: center;\n\n // ensure higher specificity for overwriting the editor list styling\n &&& {\n margin-bottom: ","px;\n }\n\n @media (min-width: ","px) {\n width: calc(50% - ","px);\n\n audio {\n width: 100%;\n }\n }\n"])),spacingM,minScreenSize.small,spacingS-5);var FileContainerStyle=css$2(templateObject_3$C||(templateObject_3$C=__makeTemplateObject(["\n display: flex;\n align-items: center;\n min-width: 200px;\n padding: ","px ","px;\n box-sizing: border-box;\n border: 1px solid #95989a;\n border-radius: 2px;\n font-size: ","px;\n line-height: 1.5em;\n"],["\n display: flex;\n align-items: center;\n min-width: 200px;\n padding: ","px ","px;\n box-sizing: border-box;\n border: 1px solid #95989a;\n border-radius: 2px;\n font-size: ","px;\n line-height: 1.5em;\n"])),spacingS,spacingS+5,fontSizeSmall);var FileIconStyle=css$2(templateObject_4$o||(templateObject_4$o=__makeTemplateObject(["\n margin: 0 ","px 0 0;\n font-size: ","px;\n"],["\n margin: 0 ","px 0 0;\n font-size: ","px;\n"])),spacingS,fontSizeLarge-3);var templateObject_1$1A,templateObject_2$V,templateObject_3$C,templateObject_4$o;var InlineFileDownloadButton=function InlineFileDownloadButton(_a){var getFileUrl=_a.getFileUrl,fileName=_a.fileName,title=_a.title,fileAccessToken=_a.fileAccessToken,additionalContent=_a.additionalContent,className=_a.className;var _b=useFileAccessTokenApi(),exchangeShortLivedToken=_b.exchangeShortLivedToken,createDownloadClickHandler=_b.createDownloadClickHandler;var iconName=getFileIcon(fileName);if(!getFileUrl){return jsxs(FileHost,__assign({className:className,title:title!==null&&title!==void 0?title:fileName},{children:[additionalContent,jsx$1(Icon,{iconName:iconName},void 0),jsx$1("span",{children:title!==null&&title!==void 0?title:fileName},void 0)]}),void 0);}return jsx$1(DownloadButton$3,__assign({className:className,onClick:createDownloadClickHandler('_blank',function(){return __awaiter(void 0,void 0,void 0,function(){var token;return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,exchangeShortLivedToken(fileAccessToken)];case 1:token=_a.sent();return [2/*return*/,getFileUrl(token)];}});});})},{children:jsxs(FileHost,__assign({title:title!==null&&title!==void 0?title:fileName},{children:[additionalContent,jsx$1(Icon,{iconName:iconName},void 0),jsx$1("span",{children:title!==null&&title!==void 0?title:fileName},void 0)]}),void 0)}),void 0);};var FileHost=_styled.div.withConfig({displayName:"InlineFileDownloadButton__FileHost",componentId:"sc-1nadbt8-0"})(templateObject_1$1z||(templateObject_1$1z=__makeTemplateObject(["\n ","\n\n width: 100%;\n\n i {\n ","\n }\n\n span {\n display: block;\n max-width: calc(100% - 32px); // icon width\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n"],["\n ","\n\n width: 100%;\n\n i {\n ","\n }\n\n span {\n display: block;\n max-width: calc(100% - 32px); // icon width\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n"])),FileContainerStyle,FileIconStyle);var DownloadButton$3=_styled(DefaultButton).withConfig({displayName:"InlineFileDownloadButton__DownloadButton",componentId:"sc-1nadbt8-1"})(templateObject_2$U||(templateObject_2$U=__makeTemplateObject(["\n border: 0;\n padding: 0;\n width: 100%;\n height: auto; /* Fixes the top and bottom border for safari */\n\n color: ",";\n text-decoration: none;\n\n &:hover {\n color: ",";\n background-color: initial;\n }\n\n > span {\n height: auto; /* Fixes the top and bottom border for safari */\n }\n"],["\n border: 0;\n padding: 0;\n width: 100%;\n height: auto; /* Fixes the top and bottom border for safari */\n\n color: ",";\n text-decoration: none;\n\n &:hover {\n color: ",";\n background-color: initial;\n }\n\n > span {\n height: auto; /* Fixes the top and bottom border for safari */\n }\n"])),function(p){return p.theme.palette.neutralPrimary;},function(p){return p.theme.palette.neutralPrimary;});var DownloadLink$1=_styled.a.withConfig({displayName:"InlineFileDownloadButton__DownloadLink",componentId:"sc-1nadbt8-2"})(templateObject_3$B||(templateObject_3$B=__makeTemplateObject(["\n display: flex;\n align-items: center;\n width: 100%;\n\n &&& {\n color: ",";\n text-decoration: none;\n }\n"],["\n display: flex;\n align-items: center;\n width: 100%;\n\n &&& {\n color: ",";\n text-decoration: none;\n }\n"])),function(p){return p.theme.palette.neutralPrimary;});var templateObject_1$1z,templateObject_2$U,templateObject_3$B;var InlinePageDocumentDownloadButton=function InlinePageDocumentDownloadButton(_a){var fileUrl=_a.fileUrl,fileName=_a.fileName,title=_a.title,fileIconName=_a.fileIconName,onClick=_a.onClick,className=_a.className;var iconName=fileIconName||getFileIcon(fileName);return jsx$1(DownloadLink$1,__assign({href:fileUrl,target:"_blank",rel:"noopener noreferrer",onClick:onClick,className:className},{children:jsxs(FileHost,__assign({title:title!==null&&title!==void 0?title:fileName},{children:[jsx$1(Icon,{iconName:iconName},void 0),jsx$1("span",{children:title!==null&&title!==void 0?title:fileName},void 0)]}),void 0)}),void 0);};var InlineQuoteViewer=function InlineQuoteViewer(_a){var _b,_c;var quoteDetails=_a.quoteDetails,onClick=_a.onClick,className=_a.className;var upn=(_b=quoteDetails.author)===null||_b===void 0?void 0:_b.userPrincipalName;var displayName=(_c=quoteDetails.author)===null||_c===void 0?void 0:_c.displayName;var showAvatar=upn&&quoteDetails.showAvatar;return jsxs(Host$A,__assign({onClick:onClick,"data-inline-quote":true,className:className},{children:[jsx$1("blockquote",{children:quoteDetails.text},void 0),showAvatar&&jsx$1("figcaption",{children:jsx$1(PersonaCard,__assign({upn:upn},{children:jsx$1(Avatar,{upn:upn,text:displayName,secondaryText:upn},void 0)}),void 0)},void 0),!showAvatar&&displayName&&jsx$1("figcaption",{children:displayName},void 0)]}),void 0);};var Host$A=_styled.figure.withConfig({displayName:"InlineQuoteViewer__Host",componentId:"sc-1kb6gh1-0"})(templateObject_1$1y||(templateObject_1$1y=__makeTemplateObject(["\n && {\n display: inline-block;\n\n border-left: solid 4px ",";\n padding-left: ","px;\n width: calc(100% - ","px);\n box-sizing: border-box;\n margin: 0 ","px ","px ","px;\n\n blockquote {\n border-left: 0;\n margin: 0;\n }\n\n figcaption {\n text-align: right;\n margin-top: ","px;\n position: relative;\n font-size: ","px;\n }\n\n @media (max-width: ","px) {\n margin: 0 0 ","px;\n width: 100%;\n figcaption {\n margin-right: 10px;\n }\n }\n }\n"],["\n && {\n display: inline-block;\n\n border-left: solid 4px ",";\n padding-left: ","px;\n width: calc(100% - ","px);\n box-sizing: border-box;\n margin: 0 ","px ","px ","px;\n\n blockquote {\n border-left: 0;\n margin: 0;\n }\n\n figcaption {\n text-align: right;\n margin-top: ","px;\n position: relative;\n font-size: ","px;\n }\n\n @media (max-width: ","px) {\n margin: 0 0 ","px;\n width: 100%;\n figcaption {\n margin-right: 10px;\n }\n }\n }\n"])),function(p){return p.theme.palette.accent;},spacingM,2*spacingXl,spacingXl,spacingS+spacingXs,spacingXl,spacingS,fontSizeSmall,maxScreenSize.medium,spacingS+spacingXxs+1);var templateObject_1$1y;var InlineQuote=function InlineQuote(_a){var quoteDetails=_a.blockProps;return jsx$1(InlineQuoteViewer,{quoteDetails:quoteDetails},void 0);};var InlineQuoteMapper={component:InlineQuote,type:EntityType.Quote,getPropsFromHtml:function(nodeName,node){var _a,_b,_c,_d,_e;if(nodeName!=='div'){return null;}var quoteId=node.getAttribute('data-quote-id');if(quoteId==null){return null;}var upn=node.getAttribute('data-quote-authorupn');var text=(_a=node.getAttribute('data-quote-text'))!==null&&_a!==void 0?_a:// use legacy attribute for old content
122294
122291
  (_b=node.querySelector('blockquote'))===null||_b===void 0?void 0:_b.innerText;var displayName=(_e=(_c=node.getAttribute('data-quote-author'))!==null&&_c!==void 0?_c:(_d=node.querySelector('figcaption'))===null||_d===void 0?void 0:_d.innerText)!==null&&_e!==void 0?_e:// use legacy attribute for old content
122295
122292
  node.getAttribute('data-quote-authorname');var showAvatar=node.getAttribute('data-quote-showavatar')==='true';var hasAuthor=upn||displayName;return {id:quoteId,text:text,author:hasAuthor?{userPrincipalName:upn,displayName:displayName}:null,showAvatar:showAvatar};},prepareRootNode:function(node){// detect if we a have new (draftJS) content. If not remove innerHTML
122296
122293
  // in order to ensure parsing old blocks
122297
- if(node.querySelector('blockquote[data-quote-text]')==null){node.innerHTML='';}}};var InlineVideo=function InlineVideo(_a){var _b=_a.blockProps,id=_b.id,source=_b.source,url=_b.url,isDirectUrl=_b.isDirectUrl;var user=useCurrentUser();var token=useCurrentToken();var getVideoThumbnailUrl=useVideosApi().getVideoThumbnailUrl;var onOpenExternalLink=useContext(LinkContext).onOpenExternalLink;var isStreamVideo=source===VideoSource.MicrosoftStream;if(isStreamVideo&&env.isAnyMobileApp){return jsx$1(StreamButton,__assign({onClick:handleMicrosoftStreamClick},{children:jsx$1(FormattedMessage$1,{id:"Generic.watchMicrosoftStream"},void 0)}),void 0);}return jsx$1(InlineVideoViewer,{videoInfo:{id:id,source:source,url:url,isDirectUrl:isDirectUrl},videoThumbnailUrl:isDirectUrl?getVideoThumbnailUrl(token,user.subscription.id,source,id):null},void 0);function handleMicrosoftStreamClick(){return __awaiter(this,void 0,void 0,function(){var url;return __generator(this,function(_a){switch(_a.label){case 0:url=getMicrosoftStreamVideoUrl(id);return [4/*yield*/,onOpenExternalLink(url,true)];case 1:_a.sent();return [2/*return*/];}});});}};var InlineVideoViewer=_styled(VideoWithThumbnailView).withConfig({displayName:"InlineVideo__InlineVideoViewer",componentId:"sc-12qdsy1-0"})(templateObject_1$1z||(templateObject_1$1z=__makeTemplateObject(["\n margin-bottom: ","px;\n"],["\n margin-bottom: ","px;\n"])),spacingS+5);var StreamButton=_styled(PrimaryButton).withConfig({displayName:"InlineVideo__StreamButton",componentId:"sc-12qdsy1-1"})(templateObject_2$V||(templateObject_2$V=__makeTemplateObject(["\n margin-bottom: ","px;\n"],["\n margin-bottom: ","px;\n"])),spacingS+5);var InlineVideoMapper={component:InlineVideo,type:EntityType.Video,getPropsFromHtml:function(nodeName,node){if(nodeName!=='div'){return null;}var videoId=node.getAttribute('data-video-id');if(videoId==null){return null;}var source=node.getAttribute('data-video-source');return {id:videoId,source:parseInt(source,10),url:node.getAttribute('data-video-url'),isDirectUrl:node.getAttribute('data-is-direct-video-url')==='true'};},prepareRootNode:function(node){if(node.childNodes.length>0){node.innerHTML='';}}};var templateObject_1$1z,templateObject_2$V;var InlinePageListViewer=function InlinePageListViewer(_a){var items=_a.items,baseRoute=_a.baseRoute,filterBaseUrl=_a.filterBaseUrl,isInitialLoading=_a.isInitialLoading;var theme=useTheme$2();if(!items||items.length===0){return null;}return jsx$1(PagesList,__assign({"data-inline-page-list":true},{children:items.map(function(item){var isPublished=!item.hasHiddenAncestor&&(item.isCurrentPublishedVersion||!!item.publishedVersionId);return jsx$1(StyledPageItemTile,{item:item,baseRoute:baseRoute,filterBaseUrl:filterBaseUrl,styleDefinition:{backgroundColor:theme.palette.neutralLighter,bannerDefaultWidth:70,height:70,applyRoundedCorners:true,titleFontSize:fontSizeSmall,titleMargin:'0',contentPadding:spacingS-2+"px "+(spacingM-5)+"px"},additionalContent:jsx$1(StyledDocumentDownloadButton$2,{page:item},void 0),showBannerPlaceholder:true,isVisible:isPublished||isInitialLoading},item.id);})}),void 0);};var PagesList=_styled.div.withConfig({displayName:"InlinePageListViewer__PagesList",componentId:"sc-qn2xdx-0"})(templateObject_1$1y||(templateObject_1$1y=__makeTemplateObject(["\n a {\n &,\n :link,\n :visited {\n color: "," !important;\n text-decoration: none !important;\n }\n }\n\n > article:not(:first-child) {\n margin-top: ","px;\n }\n"],["\n a {\n &,\n :link,\n :visited {\n color: "," !important;\n text-decoration: none !important;\n }\n }\n\n > article:not(:first-child) {\n margin-top: ","px;\n }\n"])),function(p){return p.theme.textColors.default;},spacingS);var StyledPageItemTile=_styled(PageItemTile).withConfig({displayName:"InlinePageListViewer__StyledPageItemTile",componentId:"sc-qn2xdx-1"})(templateObject_2$U||(templateObject_2$U=__makeTemplateObject(["\n opacity: ",";\n"],["\n opacity: ",";\n"])),function(p){return p.isVisible?'1':'0.3';});var StyledDocumentDownloadButton$2=_styled(DocumentDownloadButton).withConfig({displayName:"InlinePageListViewer__StyledDocumentDownloadButton",componentId:"sc-qn2xdx-2"})(templateObject_3$C||(templateObject_3$C=__makeTemplateObject(["\n margin-left: auto;\n z-index: 1;\n\n > button {\n width: 22px;\n height: 22px;\n i {\n margin: 0;\n }\n }\n"],["\n margin-left: auto;\n z-index: 1;\n\n > button {\n width: 22px;\n height: 22px;\n i {\n margin: 0;\n }\n }\n"])));var templateObject_1$1y,templateObject_2$U,templateObject_3$C;var InlinePageListWithPaging=function InlinePageListWithPaging(_a){var pages=_a.pages,baseRoute=_a.baseRoute,_b=_a.pagingProps,getNextPage=_b.getNextPage,getFirstPage=_b.getFirstPage,getPrevPage=_b.getPrevPage,isFirstPage=_b.isFirstPage,isInitialLoading=_b.isInitialLoading,isLoadingNextPage=_b.isLoadingNextPage,hideNextButton=_b.hideNextButton,filterBaseUrl=_a.filterBaseUrl;return jsxs(Fragment,{children:[jsx$1(InlinePageListViewer,{items:pages,baseRoute:baseRoute,filterBaseUrl:filterBaseUrl,isInitialLoading:isInitialLoading},void 0),jsx$1(HorizontalPager,{onNextClick:getNextPage,onPrevClick:getPrevPage,onFirstClick:getFirstPage,hidePrevButton:isFirstPage||isInitialLoading,hideNextButton:hideNextButton,isLoadingNextPage:isLoadingNextPage},void 0)]},void 0);};function useItemLoaderByCurrentPage(currentPageId,pageSize,navigationContext,settings,getAllItemsHandler,deps){var _a=useState$2(getAllItems()),allItems=_a[0],setAllItems=_a[1];var allItemIdsString=allItems===null||allItems===void 0?void 0:allItems.map(function(i){return i.id;}).join(',');var _b=useItemLoaderWithPreFetch(pageSize,loadNextItems,[allItemIdsString]),items=_b.items,pagingProps=__rest(_b,["items"]);useEffect$1(function(){setAllItems(getAllItems());},__spreadArray([],deps||[]));var skeletonItems=getNextItems();var pageItems=pagingProps.isInitialLoading?skeletonItems:items;var hideNextButton=pagingProps.isInitialLoading?allItems.length<=pageSize:pagingProps.isLastPage;return {pageItems:pageItems,pagingProps:__assign(__assign({},pagingProps),{hideNextButton:hideNextButton})};function getAllItems(){var _a;var children=(_a=navigationContext===null||navigationContext===void 0?void 0:navigationContext.children)!==null&&_a!==void 0?_a:[];if(settings.showPages&&settings.showDocuments){return children;}var filteredChildren=children.filter(function(c){return c.pageType===(settings.showPages?PageType.Page:PageType.Document);});return filteredChildren;}function getNextItems(startIndex,paginationToken){if(startIndex===void 0){startIndex=0;}if(paginationToken===void 0){paginationToken=pageSize;}return allItems.slice(startIndex,paginationToken);}function loadNextItems(pageSize,paginationToken){return __awaiter(this,void 0,void 0,function(){var showSubpagesAndDocuments,pageType,result_1,fullAllItems,token,newPaginationToken;return __generator(this,function(_a){switch(_a.label){case 0:if(!!paginationToken)return [3/*break*/,2];showSubpagesAndDocuments=settings.showPages&&settings.showDocuments;pageType=settings.showPages?PageType.Page:PageType.Document;return [4/*yield*/,getAllItemsHandler(currentPageId,showSubpagesAndDocuments?undefined:pageType)];case 1:result_1=_a.sent();fullAllItems=allItems.map(function(i){return result_1.find(function(r){return r.id===i.id;});});setAllItems(fullAllItems);return [2/*return*/,{items:fullAllItems.slice(0,pageSize),paginationToken:pageSize,hasNextPage:!!fullAllItems[pageSize]}];case 2:token=parseInt(paginationToken);newPaginationToken=token+pageSize;return [2/*return*/,{items:getNextItems(token,newPaginationToken),paginationToken:newPaginationToken,hasNextPage:allItems[newPaginationToken]!==null}];}});});}}var InlinePageListSkeleton=function InlinePageListSkeleton(_a){var isDataLoaded=_a.isDataLoaded,_b=_a.pageSize,pageSize=_b===void 0?5:_b,children=_a.children;var items=Array.from(Array(pageSize).keys());var uniqueId=createId();var palette=useContext(ThemeContext$1).theme.palette;return jsx$1(Shimmer,__assign({isDataLoaded:isDataLoaded,shimmerColors:{shimmer:palette.neutralTertiaryAlt,shimmerWave:palette.neutralTertiary},customElementsGroup:jsx$1(Fragment,{children:items.map(function(i){return jsx$1(PageItemShimmer,{},uniqueId+"-"+i);})},void 0)},{children:children}),void 0);};var PageItemShimmer=function PageItemShimmer(){var palette=useContext(ThemeContext$1).theme.palette;return jsxs(Host$B,{children:[jsxs(Inner$2$1,{children:[jsx$1(ShimmerElementsGroup,{styles:{root:{backgroundColor:palette.accent,borderRadius:5}},width:'70px',shimmerElements:[{type:ShimmerElementType.line,height:70,width:70}]},void 0),jsx$1(ShimmerElementsGroup,{backgroundColor:palette.neutralLighter,width:"calc(100% - 70px)",flexWrap:true,shimmerElements:[{type:ShimmerElementType.gap,width:'100%',height:spacingS},{type:ShimmerElementType.gap,width:spacingM+"px",height:spacingS},{type:ShimmerElementType.line,width:"calc(20% - "+spacingM+"px)",height:spacingS},{type:ShimmerElementType.gap,width:'80%',height:spacingS},{type:ShimmerElementType.gap,width:'100%',height:spacingS},{type:ShimmerElementType.gap,width:spacingM+"px",height:spacingS},{type:ShimmerElementType.line,width:"calc(100% - "+2*spacingM+"px",height:spacingS},{type:ShimmerElementType.gap,width:spacingM+"px",height:spacingS},{type:ShimmerElementType.gap,width:'100%',height:spacingS},{type:ShimmerElementType.gap,width:spacingM+"px",height:spacingS},{type:ShimmerElementType.line,width:"calc(40% - "+spacingM+"px)",height:spacingS},{type:ShimmerElementType.gap,width:'60%',height:spacingS},{type:ShimmerElementType.gap,width:'100%',height:spacingS}]},void 0)]},void 0),jsx$1(ShimmerElementsGroup,{shimmerElements:[{type:ShimmerElementType.gap,width:'100%',height:spacingS}]},void 0)]},void 0);};var Host$B=_styled.div.withConfig({displayName:"InlinePageListSkeleton__Host",componentId:"sc-13wpgyn-0"})(templateObject_1$1x||(templateObject_1$1x=__makeTemplateObject([""],[""])));var Inner$2$1=_styled.div.withConfig({displayName:"InlinePageListSkeleton__Inner",componentId:"sc-13wpgyn-1"})(templateObject_2$T||(templateObject_2$T=__makeTemplateObject(["\n display: flex;\n"],["\n display: flex;\n"])));var templateObject_1$1x,templateObject_2$T;var InlineContact=function InlineContact(_a){var contact=__rest(_a.blockProps,[]);return jsx$1(InlineContactViewer,{contact:contact},void 0);};var InlineContactMapper={component:InlineContact,type:EntityType.Contact,getPropsFromHtml:function(nodeName,node){if(nodeName!=='div'){return null;}var contactId=node.getAttribute('data-contact-id');if(contactId==null){return null;}var properties={};Array.from(node.querySelectorAll('li')).forEach(function(childNode){var _a,_b;var propertyKey=childNode.getAttribute('data-contact-property');var shouldAutoLoad=(_a=childNode.getAttribute('data-auto-load'))!==null&&_a!==void 0?_a:childNode.getAttribute('data-from-directory');var propertyValue=(_b=childNode.getAttribute('data-contact-property-value'))!==null&&_b!==void 0?_b:childNode.innerText;properties[propertyKey]={value:propertyValue,shouldAutoLoad:shouldAutoLoad==='true'};});return {id:contactId,tenantId:node.getAttribute('data-contact-tenantid'),upn:node.getAttribute('data-contact-upn'),properties:properties};}};var InlineCodeViewer=function InlineCodeViewer(_a){var codeDetails=_a.codeDetails,showJsPlaceholder=_a.showJsPlaceholder,readOnly=_a.readOnly;var htmlContainerRef=useRef$1(null);var javascriptContainerRef=useRef$1(null);useEffect$1(function(){if(readOnly){return;}if(htmlContainerRef.current!=null){if(htmlContainerRef.current.innerHTML!==codeDetails.html){htmlContainerRef.current.innerHTML=codeDetails.html;refreshScripts(htmlContainerRef.current);}}if(javascriptContainerRef.current!=null){var oldScript=javascriptContainerRef.current.querySelector('script');var newScriptText=";\n (function() {\n try {\n "+codeDetails.javascript+";\n } catch (err) {\n console.error(err);\n }\n })();";if(!oldScript||oldScript.innerText!==newScriptText){oldScript===null||oldScript===void 0?void 0:oldScript.remove();var script=document.createElement('script');script.type='text/javascript';var scriptContent=document.createTextNode(newScriptText);script.appendChild(scriptContent);javascriptContainerRef.current.appendChild(script);}}// eslint-disable-next-line react-hooks/exhaustive-deps
122298
- },[codeDetails.html,codeDetails.javascript]);if(readOnly){return jsxs(Host$A,{children:[jsx$1("div",{children:codeDetails.html&&JSON.stringify(codeDetails.html)},void 0),jsx$1("div",{children:codeDetails.javascript&&JSON.stringify(codeDetails.javascript)},void 0)]},void 0);}return jsxs(Host$A,{children:[codeDetails.html&&jsx$1("div",{ref:function(c){return htmlContainerRef.current=c;}},void 0),codeDetails.javascript&&jsx$1("div",__assign({ref:function(c){return javascriptContainerRef.current=c;}},{children:!codeDetails.html&&showJsPlaceholder&&jsx$1(JavascriptPlaceholder,{},void 0)}),void 0)]},void 0);};var Host$A=_styled.div.withConfig({displayName:"InlineCodeViewer__Host",componentId:"sc-q9v8du-0"})(templateObject_1$1w||(templateObject_1$1w=__makeTemplateObject(["\n /* Draft js is setting white-space: pre-wrap and it's causing extra spaces */\n /* fix: reset the white-space value (default one) */\n white-space: normal;\n"],["\n /* Draft js is setting white-space: pre-wrap and it's causing extra spaces */\n /* fix: reset the white-space value (default one) */\n white-space: normal;\n"])));var JavascriptPlaceholder=_styled.div.withConfig({displayName:"InlineCodeViewer__JavascriptPlaceholder",componentId:"sc-q9v8du-1"})(templateObject_2$S||(templateObject_2$S=__makeTemplateObject(["\n position: relative;\n height: 2em;\n\n &::before {\n position: absolute;\n content: '<!-- code -->';\n padding-top: 0.5em;\n padding-left: 1em;\n color: grey;\n }\n"],["\n position: relative;\n height: 2em;\n\n &::before {\n position: absolute;\n content: '<!-- code -->';\n padding-top: 0.5em;\n padding-left: 1em;\n color: grey;\n }\n"])));var templateObject_1$1w,templateObject_2$S;var InlineCode=function InlineCode(_a){var _b=_a.blockProps,id=_b.id,html=_b.html,javascript=_b.javascript;var features=useFeatures();if(!features.editorInlineMarkup){return null;}return jsx$1(InlineCodeViewer,{codeDetails:{id:id,html:html,javascript:javascript}},void 0);};var InlineCodeMapper={component:InlineCode,type:EntityType.InlineCode,getPropsFromHtml:function(nodeName,node){var _a,_b,_c,_d;if(nodeName!=='div'){return null;}var codeId=node.getAttribute('data-code-id');if(codeId==null){return null;}var html=(_b=(_a=node.querySelector('[data-code-html]'))===null||_a===void 0?void 0:_a.innerHTML)!==null&&_b!==void 0?_b:node.getAttribute('data-code-html');var javascript=(_d=(_c=node.querySelector('script[type="text/javascript"][data-code-javascript]'))===null||_c===void 0?void 0:_c.innerHTML)!==null&&_d!==void 0?_d:node.getAttribute('data-code-javascript');return {id:codeId,html:html,javascript:javascript};},prepareRootNode:function(node){// detect if we a have new (draftJS) content. If not remove innerHTML
122294
+ if(node.querySelector('blockquote[data-quote-text]')==null){node.innerHTML='';}}};var InlineVideo=function InlineVideo(_a){var _b=_a.blockProps,id=_b.id,source=_b.source,url=_b.url,isDirectUrl=_b.isDirectUrl;var user=useCurrentUser();var token=useCurrentToken();var getVideoThumbnailUrl=useVideosApi().getVideoThumbnailUrl;var onOpenExternalLink=useContext(LinkContext).onOpenExternalLink;var isStreamVideo=source===VideoSource.MicrosoftStream;if(isStreamVideo&&env.isAnyMobileApp){return jsx$1(StreamButton,__assign({onClick:handleMicrosoftStreamClick},{children:jsx$1(FormattedMessage$1,{id:"Generic.watchMicrosoftStream"},void 0)}),void 0);}return jsx$1(InlineVideoViewer,{videoInfo:{id:id,source:source,url:url,isDirectUrl:isDirectUrl},videoThumbnailUrl:isDirectUrl?getVideoThumbnailUrl(token,user.subscription.id,source,id):null},void 0);function handleMicrosoftStreamClick(){return __awaiter(this,void 0,void 0,function(){var url;return __generator(this,function(_a){switch(_a.label){case 0:url=getMicrosoftStreamVideoUrl(id);return [4/*yield*/,onOpenExternalLink(url,true)];case 1:_a.sent();return [2/*return*/];}});});}};var InlineVideoViewer=_styled(VideoWithThumbnailView).withConfig({displayName:"InlineVideo__InlineVideoViewer",componentId:"sc-12qdsy1-0"})(templateObject_1$1x||(templateObject_1$1x=__makeTemplateObject(["\n margin-bottom: ","px;\n"],["\n margin-bottom: ","px;\n"])),spacingS+5);var StreamButton=_styled(PrimaryButton).withConfig({displayName:"InlineVideo__StreamButton",componentId:"sc-12qdsy1-1"})(templateObject_2$T||(templateObject_2$T=__makeTemplateObject(["\n margin-bottom: ","px;\n"],["\n margin-bottom: ","px;\n"])),spacingS+5);var InlineVideoMapper={component:InlineVideo,type:EntityType.Video,getPropsFromHtml:function(nodeName,node){if(nodeName!=='div'){return null;}var videoId=node.getAttribute('data-video-id');if(videoId==null){return null;}var source=node.getAttribute('data-video-source');return {id:videoId,source:parseInt(source,10),url:node.getAttribute('data-video-url'),isDirectUrl:node.getAttribute('data-is-direct-video-url')==='true'};},prepareRootNode:function(node){if(node.childNodes.length>0){node.innerHTML='';}}};var templateObject_1$1x,templateObject_2$T;var InlinePageListViewer=function InlinePageListViewer(_a){var items=_a.items,baseRoute=_a.baseRoute,filterBaseUrl=_a.filterBaseUrl,isInitialLoading=_a.isInitialLoading;var theme=useTheme$2();if(!items||items.length===0){return null;}return jsx$1(PagesList,__assign({"data-inline-page-list":true},{children:items.map(function(item){var isPublished=!item.hasHiddenAncestor&&(item.isCurrentPublishedVersion||!!item.publishedVersionId);return jsx$1(StyledPageItemTile,{item:item,baseRoute:baseRoute,filterBaseUrl:filterBaseUrl,styleDefinition:{backgroundColor:theme.palette.neutralLighter,bannerDefaultWidth:70,height:70,applyRoundedCorners:true,titleFontSize:fontSizeSmall,titleMargin:'0',contentPadding:spacingS-2+"px "+(spacingM-5)+"px"},additionalContent:jsx$1(StyledDocumentDownloadButton$2,{page:item},void 0),showBannerPlaceholder:true,isVisible:isPublished||isInitialLoading},item.id);})}),void 0);};var PagesList=_styled.div.withConfig({displayName:"InlinePageListViewer__PagesList",componentId:"sc-qn2xdx-0"})(templateObject_1$1w||(templateObject_1$1w=__makeTemplateObject(["\n a {\n &,\n :link,\n :visited {\n color: "," !important;\n text-decoration: none !important;\n }\n }\n\n > article:not(:first-child) {\n margin-top: ","px;\n }\n"],["\n a {\n &,\n :link,\n :visited {\n color: "," !important;\n text-decoration: none !important;\n }\n }\n\n > article:not(:first-child) {\n margin-top: ","px;\n }\n"])),function(p){return p.theme.textColors.default;},spacingS);var StyledPageItemTile=_styled(PageItemTile).withConfig({displayName:"InlinePageListViewer__StyledPageItemTile",componentId:"sc-qn2xdx-1"})(templateObject_2$S||(templateObject_2$S=__makeTemplateObject(["\n opacity: ",";\n"],["\n opacity: ",";\n"])),function(p){return p.isVisible?'1':'0.3';});var StyledDocumentDownloadButton$2=_styled(DocumentDownloadButton).withConfig({displayName:"InlinePageListViewer__StyledDocumentDownloadButton",componentId:"sc-qn2xdx-2"})(templateObject_3$A||(templateObject_3$A=__makeTemplateObject(["\n margin-left: auto;\n z-index: 1;\n\n > button {\n width: 22px;\n height: 22px;\n i {\n margin: 0;\n }\n }\n"],["\n margin-left: auto;\n z-index: 1;\n\n > button {\n width: 22px;\n height: 22px;\n i {\n margin: 0;\n }\n }\n"])));var templateObject_1$1w,templateObject_2$S,templateObject_3$A;var InlinePageListWithPaging=function InlinePageListWithPaging(_a){var pages=_a.pages,baseRoute=_a.baseRoute,_b=_a.pagingProps,getNextPage=_b.getNextPage,getFirstPage=_b.getFirstPage,getPrevPage=_b.getPrevPage,isFirstPage=_b.isFirstPage,isInitialLoading=_b.isInitialLoading,isLoadingNextPage=_b.isLoadingNextPage,hideNextButton=_b.hideNextButton,filterBaseUrl=_a.filterBaseUrl;return jsxs(Fragment,{children:[jsx$1(InlinePageListViewer,{items:pages,baseRoute:baseRoute,filterBaseUrl:filterBaseUrl,isInitialLoading:isInitialLoading},void 0),jsx$1(HorizontalPager,{onNextClick:getNextPage,onPrevClick:getPrevPage,onFirstClick:getFirstPage,hidePrevButton:isFirstPage||isInitialLoading,hideNextButton:hideNextButton,isLoadingNextPage:isLoadingNextPage},void 0)]},void 0);};function useItemLoaderByCurrentPage(currentPageId,pageSize,navigationContext,settings,getAllItemsHandler,deps){var _a=useState$2(getAllItems()),allItems=_a[0],setAllItems=_a[1];var allItemIdsString=allItems===null||allItems===void 0?void 0:allItems.map(function(i){return i.id;}).join(',');var _b=useItemLoaderWithPreFetch(pageSize,loadNextItems,[allItemIdsString]),items=_b.items,pagingProps=__rest(_b,["items"]);useEffect$1(function(){setAllItems(getAllItems());},__spreadArray([],deps||[]));var skeletonItems=getNextItems();var pageItems=pagingProps.isInitialLoading?skeletonItems:items;var hideNextButton=pagingProps.isInitialLoading?allItems.length<=pageSize:pagingProps.isLastPage;return {pageItems:pageItems,pagingProps:__assign(__assign({},pagingProps),{hideNextButton:hideNextButton})};function getAllItems(){var _a;var children=(_a=navigationContext===null||navigationContext===void 0?void 0:navigationContext.children)!==null&&_a!==void 0?_a:[];if(settings.showPages&&settings.showDocuments){return children;}var filteredChildren=children.filter(function(c){return c.pageType===(settings.showPages?PageType.Page:PageType.Document);});return filteredChildren;}function getNextItems(startIndex,paginationToken){if(startIndex===void 0){startIndex=0;}if(paginationToken===void 0){paginationToken=pageSize;}return allItems.slice(startIndex,paginationToken);}function loadNextItems(pageSize,paginationToken){return __awaiter(this,void 0,void 0,function(){var showSubpagesAndDocuments,pageType,result_1,fullAllItems,token,newPaginationToken;return __generator(this,function(_a){switch(_a.label){case 0:if(!!paginationToken)return [3/*break*/,2];showSubpagesAndDocuments=settings.showPages&&settings.showDocuments;pageType=settings.showPages?PageType.Page:PageType.Document;return [4/*yield*/,getAllItemsHandler(currentPageId,showSubpagesAndDocuments?undefined:pageType)];case 1:result_1=_a.sent();fullAllItems=allItems.map(function(i){return result_1.find(function(r){return r.id===i.id;});});setAllItems(fullAllItems);return [2/*return*/,{items:fullAllItems.slice(0,pageSize),paginationToken:pageSize,hasNextPage:!!fullAllItems[pageSize]}];case 2:token=parseInt(paginationToken);newPaginationToken=token+pageSize;return [2/*return*/,{items:getNextItems(token,newPaginationToken),paginationToken:newPaginationToken,hasNextPage:allItems[newPaginationToken]!==null}];}});});}}var InlinePageListSkeleton=function InlinePageListSkeleton(_a){var isDataLoaded=_a.isDataLoaded,_b=_a.pageSize,pageSize=_b===void 0?5:_b,children=_a.children;var items=Array.from(Array(pageSize).keys());var uniqueId=createId();var palette=useContext(ThemeContext$1).theme.palette;return jsx$1(Shimmer,__assign({isDataLoaded:isDataLoaded,shimmerColors:{shimmer:palette.neutralTertiaryAlt,shimmerWave:palette.neutralTertiary},customElementsGroup:jsx$1(Fragment,{children:items.map(function(i){return jsx$1(PageItemShimmer,{},uniqueId+"-"+i);})},void 0)},{children:children}),void 0);};var PageItemShimmer=function PageItemShimmer(){var palette=useContext(ThemeContext$1).theme.palette;return jsxs(Host$z,{children:[jsxs(Inner$2$1,{children:[jsx$1(ShimmerElementsGroup,{styles:{root:{backgroundColor:palette.accent,borderRadius:5}},width:'70px',shimmerElements:[{type:ShimmerElementType.line,height:70,width:70}]},void 0),jsx$1(ShimmerElementsGroup,{backgroundColor:palette.neutralLighter,width:"calc(100% - 70px)",flexWrap:true,shimmerElements:[{type:ShimmerElementType.gap,width:'100%',height:spacingS},{type:ShimmerElementType.gap,width:spacingM+"px",height:spacingS},{type:ShimmerElementType.line,width:"calc(20% - "+spacingM+"px)",height:spacingS},{type:ShimmerElementType.gap,width:'80%',height:spacingS},{type:ShimmerElementType.gap,width:'100%',height:spacingS},{type:ShimmerElementType.gap,width:spacingM+"px",height:spacingS},{type:ShimmerElementType.line,width:"calc(100% - "+2*spacingM+"px",height:spacingS},{type:ShimmerElementType.gap,width:spacingM+"px",height:spacingS},{type:ShimmerElementType.gap,width:'100%',height:spacingS},{type:ShimmerElementType.gap,width:spacingM+"px",height:spacingS},{type:ShimmerElementType.line,width:"calc(40% - "+spacingM+"px)",height:spacingS},{type:ShimmerElementType.gap,width:'60%',height:spacingS},{type:ShimmerElementType.gap,width:'100%',height:spacingS}]},void 0)]},void 0),jsx$1(ShimmerElementsGroup,{shimmerElements:[{type:ShimmerElementType.gap,width:'100%',height:spacingS}]},void 0)]},void 0);};var Host$z=_styled.div.withConfig({displayName:"InlinePageListSkeleton__Host",componentId:"sc-13wpgyn-0"})(templateObject_1$1v||(templateObject_1$1v=__makeTemplateObject([""],[""])));var Inner$2$1=_styled.div.withConfig({displayName:"InlinePageListSkeleton__Inner",componentId:"sc-13wpgyn-1"})(templateObject_2$R||(templateObject_2$R=__makeTemplateObject(["\n display: flex;\n"],["\n display: flex;\n"])));var templateObject_1$1v,templateObject_2$R;var InlineContact=function InlineContact(_a){var contact=__rest(_a.blockProps,[]);return jsx$1(InlineContactViewer,{contact:contact},void 0);};var InlineContactMapper={component:InlineContact,type:EntityType.Contact,getPropsFromHtml:function(nodeName,node){if(nodeName!=='div'){return null;}var contactId=node.getAttribute('data-contact-id');if(contactId==null){return null;}var properties={};Array.from(node.querySelectorAll('li')).forEach(function(childNode){var _a,_b;var propertyKey=childNode.getAttribute('data-contact-property');var shouldAutoLoad=(_a=childNode.getAttribute('data-auto-load'))!==null&&_a!==void 0?_a:childNode.getAttribute('data-from-directory');var propertyValue=(_b=childNode.getAttribute('data-contact-property-value'))!==null&&_b!==void 0?_b:childNode.innerText;properties[propertyKey]={value:propertyValue,shouldAutoLoad:shouldAutoLoad==='true'};});return {id:contactId,tenantId:node.getAttribute('data-contact-tenantid'),upn:node.getAttribute('data-contact-upn'),properties:properties};}};var InlineCodeViewer=function InlineCodeViewer(_a){var codeDetails=_a.codeDetails,showJsPlaceholder=_a.showJsPlaceholder,readOnly=_a.readOnly;var htmlContainerRef=useRef$1(null);var javascriptContainerRef=useRef$1(null);useEffect$1(function(){if(readOnly){return;}if(htmlContainerRef.current!=null){if(htmlContainerRef.current.innerHTML!==codeDetails.html){htmlContainerRef.current.innerHTML=codeDetails.html;refreshScripts(htmlContainerRef.current);}}if(javascriptContainerRef.current!=null){var oldScript=javascriptContainerRef.current.querySelector('script');var newScriptText=";\n (function() {\n try {\n "+codeDetails.javascript+";\n } catch (err) {\n console.error(err);\n }\n })();";if(!oldScript||oldScript.innerText!==newScriptText){oldScript===null||oldScript===void 0?void 0:oldScript.remove();var script=document.createElement('script');script.type='text/javascript';var scriptContent=document.createTextNode(newScriptText);script.appendChild(scriptContent);javascriptContainerRef.current.appendChild(script);}}// eslint-disable-next-line react-hooks/exhaustive-deps
122295
+ },[codeDetails.html,codeDetails.javascript]);if(readOnly){return jsxs(Host$y,{children:[jsx$1("div",{children:codeDetails.html&&JSON.stringify(codeDetails.html)},void 0),jsx$1("div",{children:codeDetails.javascript&&JSON.stringify(codeDetails.javascript)},void 0)]},void 0);}return jsxs(Host$y,{children:[codeDetails.html&&jsx$1("div",{ref:function(c){return htmlContainerRef.current=c;}},void 0),codeDetails.javascript&&jsx$1("div",__assign({ref:function(c){return javascriptContainerRef.current=c;}},{children:!codeDetails.html&&showJsPlaceholder&&jsx$1(JavascriptPlaceholder,{},void 0)}),void 0)]},void 0);};var Host$y=_styled.div.withConfig({displayName:"InlineCodeViewer__Host",componentId:"sc-q9v8du-0"})(templateObject_1$1u||(templateObject_1$1u=__makeTemplateObject(["\n /* Draft js is setting white-space: pre-wrap and it's causing extra spaces */\n /* fix: reset the white-space value (default one) */\n white-space: normal;\n"],["\n /* Draft js is setting white-space: pre-wrap and it's causing extra spaces */\n /* fix: reset the white-space value (default one) */\n white-space: normal;\n"])));var JavascriptPlaceholder=_styled.div.withConfig({displayName:"InlineCodeViewer__JavascriptPlaceholder",componentId:"sc-q9v8du-1"})(templateObject_2$Q||(templateObject_2$Q=__makeTemplateObject(["\n position: relative;\n height: 2em;\n\n &::before {\n position: absolute;\n content: '<!-- code -->';\n padding-top: 0.5em;\n padding-left: 1em;\n color: grey;\n }\n"],["\n position: relative;\n height: 2em;\n\n &::before {\n position: absolute;\n content: '<!-- code -->';\n padding-top: 0.5em;\n padding-left: 1em;\n color: grey;\n }\n"])));var templateObject_1$1u,templateObject_2$Q;var InlineCode=function InlineCode(_a){var _b=_a.blockProps,id=_b.id,html=_b.html,javascript=_b.javascript;var features=useFeatures();if(!features.editorInlineMarkup){return null;}return jsx$1(InlineCodeViewer,{codeDetails:{id:id,html:html,javascript:javascript}},void 0);};var InlineCodeMapper={component:InlineCode,type:EntityType.InlineCode,getPropsFromHtml:function(nodeName,node){var _a,_b,_c,_d;if(nodeName!=='div'){return null;}var codeId=node.getAttribute('data-code-id');if(codeId==null){return null;}var html=(_b=(_a=node.querySelector('[data-code-html]'))===null||_a===void 0?void 0:_a.innerHTML)!==null&&_b!==void 0?_b:node.getAttribute('data-code-html');var javascript=(_d=(_c=node.querySelector('script[type="text/javascript"][data-code-javascript]'))===null||_c===void 0?void 0:_c.innerHTML)!==null&&_d!==void 0?_d:node.getAttribute('data-code-javascript');return {id:codeId,html:html,javascript:javascript};},prepareRootNode:function(node){// detect if we a have new (draftJS) content. If not remove innerHTML
122299
122296
  // in order to ensure parsing old blocks
122300
- if(node.querySelector('[data-code-html]')==null){node.innerHTML='';}}};var HeaderFormat=css$2(templateObject_1$1v||(templateObject_1$1v=__makeTemplateObject(["\n tr:first-child {\n td {\n border: solid 1px ",";\n }\n\n td,\n textarea {\n font-weight: bold;\n color: ",";\n background-color: ",";\n }\n }\n"],["\n tr:first-child {\n td {\n border: solid 1px ",";\n }\n\n td,\n textarea {\n font-weight: bold;\n color: ",";\n background-color: ",";\n }\n }\n"])),function(p){return p.theme.palette.neutralLight;},function(p){return p.theme.palette.neutralSecondaryAlt;},function(p){return p.theme.palette.neutralLight;});var FooterFormat=css$2(templateObject_2$R||(templateObject_2$R=__makeTemplateObject(["\n tr:last-child {\n background-color: ",";\n > td {\n border-bottom: solid 2px ",";\n }\n }\n\n tr:nth-last-child(2) {\n > td {\n border-bottom: solid 1px ",";\n }\n }\n"],["\n tr:last-child {\n background-color: ",";\n > td {\n border-bottom: solid 2px ",";\n }\n }\n\n tr:nth-last-child(2) {\n > td {\n border-bottom: solid 1px ",";\n }\n }\n"])),function(p){return p.theme.palette.white;},function(p){return p.theme.palette.neutralPrimary;},function(p){return p.theme.palette.neutralPrimary;});var Grid=css$2(templateObject_3$B||(templateObject_3$B=__makeTemplateObject(["\n && {\n tr > td {\n border-color: ",";\n border-style: solid;\n }\n }\n"],["\n && {\n tr > td {\n border-color: ",";\n border-style: solid;\n }\n }\n"])),function(p){return p.theme.palette.neutralLight;});var AlternateLines=css$2(templateObject_4$p||(templateObject_4$p=__makeTemplateObject(["\n tr:nth-child(odd) {\n background-color: ",";\n td {\n background-color: ",";\n }\n\n td,\n textarea {\n background-color: ",";\n }\n }\n"],["\n tr:nth-child(odd) {\n background-color: ",";\n td {\n background-color: ",";\n }\n\n td,\n textarea {\n background-color: ",";\n }\n }\n"])),function(p){return p.theme.palette.neutralLighter;},function(p){return p.theme.palette.neutralLighter;},function(p){return p.theme.palette.neutralLighter;});var Table=_styled.table.withConfig({displayName:"InlineTableStyles__Table",componentId:"sc-10dcamf-0"})(templateObject_5$n||(templateObject_5$n=__makeTemplateObject(["\n border-collapse: collapse;\n table-layout: fixed;\n width: 51px;\n\n tr {\n height: 43px;\n > td {\n border: solid 1px transparent;\n font-size: ","px;\n padding: 5px;\n vertical-align: top;\n\n &[data-multiline=\"true\"] {\n white-space: pre-wrap;\n }\n }\n\n textarea {\n font-size: ","px;\n border: none;\n padding: 0;\n }\n }\n }\n\n ","\n ","\n ","\n ","\n"],["\n border-collapse: collapse;\n table-layout: fixed;\n width: 51px;\n\n tr {\n height: 43px;\n > td {\n border: solid 1px transparent;\n font-size: ","px;\n padding: 5px;\n vertical-align: top;\n\n &[data-multiline=\"true\"] {\n white-space: pre-wrap;\n }\n }\n\n textarea {\n font-size: ","px;\n border: none;\n padding: 0;\n }\n }\n }\n\n ","\n ","\n ","\n ","\n"])),fontSizeNormal,fontSizeNormal,function(_a){var showGrid=_a.format.showGrid;return showGrid&&Grid;},function(_a){var alternateLines=_a.format.alternateLines;return alternateLines&&AlternateLines;},function(_a){var hasHeaderRow=_a.format.hasHeaderRow;return hasHeaderRow&&HeaderFormat;},function(_a){var hasFooterRow=_a.format.hasFooterRow;return hasFooterRow&&FooterFormat;});var templateObject_1$1v,templateObject_2$R,templateObject_3$B,templateObject_4$p,templateObject_5$n;var TableViewer=function TableViewer(_a){var tableDefinition=_a.blockProps.tableDefinition;var lastRowIndex=tableDefinition.rows.length-1;return jsx$1(Host$z,{children:jsx$1(Table,__assign({format:tableDefinition.format},{children:jsx$1("tbody",{children:tableDefinition.rows.map(function(r,rowIndex){return jsx$1("tr",{children:r.cells.map(function(c,index){var _a,_b,_c;return jsx$1("td",__assign({style:__assign(__assign({},cellStyleToCssProps(c.style,tableDefinition.format.alternateLines||tableDefinition.format.hasHeaderRow&&rowIndex===0||tableDefinition.format.hasFooterRow&&rowIndex===lastRowIndex)),rowIndex===0&&{width:(_b=(_a=tableDefinition.columns)===null||_a===void 0?void 0:_a[index])===null||_b===void 0?void 0:_b.width}),title:c.value,"data-multiline":c.isMultiline},{children:c.url?jsx$1(TextLink,__assign({url:c.url,style:{color:(_c=c.style.fontColor)!==null&&_c!==void 0?_c:null}},{children:c.value}),void 0):c.value}),index);})},rowIndex);})},void 0)}),void 0)},void 0);};function cssPropsToCellStyle(style,alternateLines,isHeaderRow){if(style==null){return {};}return {isBold:style.fontWeight==='bold',isItalic:style.fontStyle==='italic',textAlign:style.textAlign==='left'||style.textAlign==='right'||style.textAlign==='center'?style.textAlign:null,fontColor:style.color,backgroundColor:!alternateLines&&!isHeaderRow?style.backgroundColor:null};}function cellStyleToCssProps(cellStyle,disableCustomColors){if(cellStyle==null){return {};}return __assign(__assign(__assign(__assign(__assign({},cellStyle.isBold&&{fontWeight:'bold'}),cellStyle.isItalic&&{fontStyle:'italic'}),cellStyle.textAlign&&{textAlign:cellStyle.textAlign}),cellStyle.fontColor&&!disableCustomColors&&{color:cellStyle.fontColor}),cellStyle.backgroundColor&&!disableCustomColors&&{backgroundColor:cellStyle.backgroundColor});}var InlineTable={component:TableViewer,getPropsFromHtml:function(nodeName,node){if(nodeName!=='div'){return null;}var tableId=node.getAttribute('data-table-id');if(tableId==null){return null;}var table=node.querySelector('table');var body=table===null||table===void 0?void 0:table.querySelector('tbody');if(body==null){return null;}var firstRow=body.querySelector('tr:first-child');return {tableId:tableId,tableDefinition:{columns:Array.from(firstRow.querySelectorAll('td')).map(function(c){var _a,_b;return {width:(_b=(_a=c.style)===null||_a===void 0?void 0:_a.width)!==null&&_b!==void 0?_b:null};}),rows:Array.from(body.querySelectorAll('tr')).map(function(row){return {rowId:createId(),cells:Array.from(row.querySelectorAll('td')).map(function(cell){var _a,_b;return {cellId:createId(),value:cell.innerText,style:cssPropsToCellStyle(cell.style,table.classList.contains('condense-table--alternateLines'),table.classList.contains('condense-table--hasHeader')&&row.rowIndex===0),isMultiline:cell.innerText.includes('\n'),url:(_b=(_a=cell.querySelector('a'))===null||_a===void 0?void 0:_a.getAttribute('href'))!==null&&_b!==void 0?_b:null};})};}),format:{showGrid:table.classList.contains('condense-table--showGrid'),alternateLines:table.classList.contains('condense-table--alternateLines'),hasHeaderRow:table.classList.contains('condense-table--hasHeader'),hasFooterRow:table.classList.contains('condense-table--hasFooter')}}};},type:EntityType.Table};var Host$z=_styled.div.withConfig({displayName:"InlineTable__Host",componentId:"sc-8db5xf-0"})(templateObject_1$1u||(templateObject_1$1u=__makeTemplateObject(["\n width: 100%;\n overflow-x: auto;\n"],["\n width: 100%;\n overflow-x: auto;\n"])));var templateObject_1$1u;var ItemBodyWrapper=function ItemBodyWrapper(_a){var className=_a.className,children=_a.children;return jsx$1(Host$y,__assign({className:className,"data-body-wrapper":true},{children:children}),void 0);};var Host$y=_styled.div.withConfig({displayName:"ItemBodyWrapper__Host",componentId:"sc-6adwhw-0"})(templateObject_1$1t||(templateObject_1$1t=__makeTemplateObject(["\n && {\n p,\n ul,\n ol,\n pre,\n blockquote,\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n -webkit-margin-before: 0;\n -webkit-margin-end: 0;\n -webkit-margin-after: 0;\n -webkit-margin-start: 0;\n\n -webkit-padding-before: 0;\n -webkit-padding-end: 0;\n -webkit-padding-after: 0;\n -webkit-padding-start: 0;\n }\n\n h1 {\n font-size: ","px;\n margin: ","px 0;\n }\n\n h2 {\n font-size: ","px;\n }\n\n h3 {\n font-size: ","px;\n }\n\n h2,\n h3,\n h4,\n h5,\n h6 {\n margin: ","px 0;\n }\n\n p,\n .paragraph,\n ul,\n ol {\n word-wrap: break-word;\n margin-bottom: 1em;\n line-height: 20px;\n }\n\n blockquote {\n line-height: 20px;\n }\n\n ul,\n ol {\n padding-left: 18px;\n }\n\n li {\n margin-bottom: 10px;\n }\n\n a {\n color: ",";\n text-decoration: underline;\n }\n\n .news-inline-file {\n position: relative;\n margin: 10px 3px;\n user-select: none;\n\n > a,\n button {\n max-width: 100%;\n display: inline-block;\n box-sizing: border-box;\n padding: 12px 20px;\n box-shadow: 0 2px 3px 2px #b7b7b7;\n width: auto;\n color: inherit;\n line-height: 1.5em;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n text-decoration: none;\n\n i {\n margin-right: 10px;\n font-size: 25px;\n vertical-align: bottom;\n }\n }\n }\n\n figure:not([data-inline-quote='true']) {\n margin: 0;\n }\n\n .news-inline-image {\n margin-bottom: 15px;\n\n figure {\n margin: 0;\n }\n\n figcaption {\n font-style: italic;\n }\n }\n\n /* news-inline-quote -\n required for backwards compatibility with old news */\n .news-inline-quote {\n max-width: 80%;\n\n figure {\n display: inline-block;\n\n blockquote {\n border-left: 0;\n font-size: 15px;\n }\n\n figcaption {\n text-align: right;\n margin-top: 10px;\n position: relative;\n\n > div {\n width: 40px;\n height: 40px;\n border-radius: 50%;\n overflow: hidden;\n position: absolute;\n top: 0;\n right: 0;\n transform: translate(50px, -15px);\n }\n }\n }\n }\n\n .video-view-container {\n margin-bottom: 15px;\n }\n\n @media (max-width: ","px) {\n figure[data-inline-quote='true'] {\n padding-left: 15px;\n }\n\n .news-inline-quote {\n max-width: 100%;\n\n figcaption {\n margin-right: 10px;\n }\n }\n\n h1 {\n font-size: ","px;\n }\n\n h2 {\n font-size: ","px;\n }\n\n h3 {\n font-size: ","px;\n }\n\n p,\n .paragraph,\n ul,\n ol,\n blockquote,\n figcaption,\n td {\n font-size: ","px;\n }\n\n ul {\n padding-left: 14px;\n }\n ol {\n padding-left: 20px;\n }\n }\n\n @media (min-width: ","px) {\n .news-inline-quote {\n figure {\n blockquote {\n font-size: 20px;\n }\n }\n }\n }\n }\n"],["\n && {\n p,\n ul,\n ol,\n pre,\n blockquote,\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n -webkit-margin-before: 0;\n -webkit-margin-end: 0;\n -webkit-margin-after: 0;\n -webkit-margin-start: 0;\n\n -webkit-padding-before: 0;\n -webkit-padding-end: 0;\n -webkit-padding-after: 0;\n -webkit-padding-start: 0;\n }\n\n h1 {\n font-size: ","px;\n margin: ","px 0;\n }\n\n h2 {\n font-size: ","px;\n }\n\n h3 {\n font-size: ","px;\n }\n\n h2,\n h3,\n h4,\n h5,\n h6 {\n margin: ","px 0;\n }\n\n p,\n .paragraph,\n ul,\n ol {\n word-wrap: break-word;\n margin-bottom: 1em;\n line-height: 20px;\n }\n\n blockquote {\n line-height: 20px;\n }\n\n ul,\n ol {\n padding-left: 18px;\n }\n\n li {\n margin-bottom: 10px;\n }\n\n a {\n color: ",";\n text-decoration: underline;\n }\n\n .news-inline-file {\n position: relative;\n margin: 10px 3px;\n user-select: none;\n\n > a,\n button {\n max-width: 100%;\n display: inline-block;\n box-sizing: border-box;\n padding: 12px 20px;\n box-shadow: 0 2px 3px 2px #b7b7b7;\n width: auto;\n color: inherit;\n line-height: 1.5em;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n text-decoration: none;\n\n i {\n margin-right: 10px;\n font-size: 25px;\n vertical-align: bottom;\n }\n }\n }\n\n figure:not([data-inline-quote='true']) {\n margin: 0;\n }\n\n .news-inline-image {\n margin-bottom: 15px;\n\n figure {\n margin: 0;\n }\n\n figcaption {\n font-style: italic;\n }\n }\n\n /* news-inline-quote -\n required for backwards compatibility with old news */\n .news-inline-quote {\n max-width: 80%;\n\n figure {\n display: inline-block;\n\n blockquote {\n border-left: 0;\n font-size: 15px;\n }\n\n figcaption {\n text-align: right;\n margin-top: 10px;\n position: relative;\n\n > div {\n width: 40px;\n height: 40px;\n border-radius: 50%;\n overflow: hidden;\n position: absolute;\n top: 0;\n right: 0;\n transform: translate(50px, -15px);\n }\n }\n }\n }\n\n .video-view-container {\n margin-bottom: 15px;\n }\n\n @media (max-width: ","px) {\n figure[data-inline-quote='true'] {\n padding-left: 15px;\n }\n\n .news-inline-quote {\n max-width: 100%;\n\n figcaption {\n margin-right: 10px;\n }\n }\n\n h1 {\n font-size: ","px;\n }\n\n h2 {\n font-size: ","px;\n }\n\n h3 {\n font-size: ","px;\n }\n\n p,\n .paragraph,\n ul,\n ol,\n blockquote,\n figcaption,\n td {\n font-size: ","px;\n }\n\n ul {\n padding-left: 14px;\n }\n ol {\n padding-left: 20px;\n }\n }\n\n @media (min-width: ","px) {\n .news-inline-quote {\n figure {\n blockquote {\n font-size: 20px;\n }\n }\n }\n }\n }\n"])),fontSizeLarge-1,spacingS+2,fontSizeLarge-3,fontSizeLarge-5,spacingS,function(p){return p.theme.palette.accent;},maxScreenSize.medium,fontSizeLarge-3,fontSizeLarge-5,fontSizeMedium,fontSizeSmall,minScreenSize.small);var templateObject_1$1t;var InlineFileList=function InlineFileList(_a){var fileBlock=_a.blockProps;var _b=useDetailViewContext(),item=_b.item,resourceType=_b.resourceType;var getFileUrlWithToken=useFileApi().getFileUrlWithToken;if(!fileBlock.files||fileBlock.files.length===0){return null;}var files=fileBlock.files.map(function(f){if(f.pageId){return __assign({},f);}var getFileUrl=function getFileUrl(token){var _a;return ((_a=f.getDownloadUrl)===null||_a===void 0?void 0:_a.call(f,token))||getFileUrlWithToken(token||item.fileAccessToken,item.id,undefined,f.fileId,f.fileName,resourceType);};return __assign(__assign({},f),{getDownloadUrl:getFileUrl,accessToken:item.fileAccessToken});});var audioFiles=files.filter(function(f){return isAudioFile(f.fileName);});var videoFiles=files.filter(function(f){return isVideoFile(f.fileName);});var otherFiles=files.filter(function(f){return !audioFiles.includes(f)&&!videoFiles.includes(f);});return jsxs(Fragment,{children:[videoFiles.length>0&&jsx$1(FileListHost,__assign({"data-preload-video":browserInfo.name==='safari'},{children:videoFiles.map(function(f){var _a;return jsx$1(FileListItem,{children:jsx$1(VideoFileHost,__assign({"data-preload-video":browserInfo.name==='safari'},{children:jsx$1(VideoFile,{fileName:(_a=f.title)!==null&&_a!==void 0?_a:f.fileName,url:f.getDownloadUrl()},void 0)}),void 0)},f.fileId);})}),void 0),audioFiles.length>0&&jsx$1(FileListHost,{children:audioFiles.map(function(f){var _a;return jsx$1(FileListItem,{children:jsx$1(AudioFile,{fileName:(_a=f.title)!==null&&_a!==void 0?_a:f.fileName,url:f.getDownloadUrl()},void 0)},f.fileId);})},void 0),otherFiles.length>0&&jsx$1(FileListHost,{children:otherFiles.map(function(f){return jsx$1(FileListItem,{children:f.pageId?jsx$1(InlinePageDocument,{file:f},void 0):jsx$1(InlineFileDownloadButton,{getFileUrl:f.getDownloadUrl,fileAccessToken:item.fileAccessToken,fileName:f.fileName,title:f.title},void 0)},f.fileId);})},void 0)]},void 0);};var InlinePageDocument=function InlinePageDocument(_a){var file=_a.file;var pageId=file.pageId;var loadPage=usePagesApi().loadPage;var page=usePromise$2(function(){return loadPage(pageId);},undefined,[pageId])[0];var _b=useInlinePageDocument(file,page),fileUrl=_b.fileUrl,iconName=_b.iconName,title=_b.title,fileName=_b.fileName,onPageDocumentDownloadClick=_b.onPageDocumentDownloadClick;return jsx$1(InlinePageDocumentDownloadButton,{fileUrl:fileUrl,fileName:fileName,title:title,fileIconName:iconName,onClick:onPageDocumentDownloadClick},void 0);};var InlineFileMapper={component:InlineFileList,type:EntityType.File,getPropsFromHtml:function(nodeName,node){if(nodeName!=='div'){return null;}var blockId=node.getAttribute('data-file-block');if(!blockId){var fileId=node.getAttribute('data-file-id')||node.getAttribute('data-file-fileid');if(fileId==null){return null;}var title=node.getAttribute('data-file-title');var fileName=node.getAttribute('data-file-name');var pageId=node.getAttribute('data-inline-page-document-id');var extension=node.getAttribute('data-file-extension');return {blockId:createId(),files:[{fileId:fileId,title:title,fileName:fileName,pageId:pageId,extension:extension}]};}return {blockId:blockId,files:Array.from(node.querySelectorAll('[data-file-id], [data-file-fileid]')).map(function(fileNode){var _a;return {fileId:(_a=fileNode.getAttribute('data-file-id'))!==null&&_a!==void 0?_a:fileNode.getAttribute('data-file-fileid'),fileName:fileNode.getAttribute('data-file-name'),title:fileNode.getAttribute('data-file-title'),pageId:fileNode.getAttribute('data-inline-page-document-id'),extension:fileNode.getAttribute('data-file-extension')};})};}};var VideoFileHost=_styled.div.withConfig({displayName:"InlineFileList__VideoFileHost",componentId:"sc-16i3l51-0"})(templateObject_1$1s||(templateObject_1$1s=__makeTemplateObject(["\n width: 100%;\n\n video {\n width: 100%;\n border-radius: ","px;\n overflow: hidden;\n }\n\n &[data-preload-video='true'] {\n video {\n box-shadow: inset 0 0 0 0.5px #707070, 0 0 0 0.5px #707070;\n background-color: #e4e4e4;\n }\n }\n"],["\n width: 100%;\n\n video {\n width: 100%;\n border-radius: ","px;\n overflow: hidden;\n }\n\n &[data-preload-video='true'] {\n video {\n box-shadow: inset 0 0 0 0.5px #707070, 0 0 0 0.5px #707070;\n background-color: #e4e4e4;\n }\n }\n"])),videoAttachmentRoundedCornerSize);var templateObject_1$1s;var InlineActionButton=_styled(TextLink).withConfig({displayName:"InlineActionButtonStyles__InlineActionButton",componentId:"sc-1m041aj-0"})(templateObject_2$Q||(templateObject_2$Q=__makeTemplateObject(["\n &&& {\n display: block;\n min-width: 200px;\n width: auto;\n height: ","px;\n line-height: ","px;\n padding: 0 15px;\n border: 1px solid;\n border-radius: 2px;\n box-shadow: 0px ","px ","px #00000033;\n text-decoration: none;\n box-sizing: border-box;\n text-align: center;\n\n ","\n\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n"],["\n &&& {\n display: block;\n min-width: 200px;\n width: auto;\n height: ","px;\n line-height: ","px;\n padding: 0 15px;\n border: 1px solid;\n border-radius: 2px;\n box-shadow: 0px ","px ","px #00000033;\n text-decoration: none;\n box-sizing: border-box;\n text-align: center;\n\n ","\n\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n"])),spacingX,spacingX,spacingXs,spacingXs*2,function(p){return p.isPrimary&&css$2(templateObject_1$1r||(templateObject_1$1r=__makeTemplateObject(["\n background-color: ",";\n border-color: ",";\n color: ",";\n "],["\n background-color: ",";\n border-color: ",";\n color: ",";\n "])),p.theme.palette.themePrimary,p.theme.palette.themePrimary,p.theme.textColors.onPrimary);});var InlineActionButtonListItem=_styled.li.withConfig({displayName:"InlineActionButtonStyles__InlineActionButtonListItem",componentId:"sc-1m041aj-1"})(templateObject_3$A||(templateObject_3$A=__makeTemplateObject(["\n &&& {\n margin-bottom: 0;\n display: flex;\n flex-wrap: nowrap;\n max-width: 100%;\n }\n"],["\n &&& {\n margin-bottom: 0;\n display: flex;\n flex-wrap: nowrap;\n max-width: 100%;\n }\n"])));var InlineActionButtonsHost=_styled.ul.withConfig({displayName:"InlineActionButtonStyles__InlineActionButtonsHost",componentId:"sc-1m041aj-2"})(templateObject_4$o||(templateObject_4$o=__makeTemplateObject(["\n display: flex;\n gap: ","px;\n justify-content: center;\n flex-wrap: wrap;\n\n &&& {\n margin: 0 0 ","px;\n padding: 0;\n list-style: none;\n }\n"],["\n display: flex;\n gap: ","px;\n justify-content: center;\n flex-wrap: wrap;\n\n &&& {\n margin: 0 0 ","px;\n padding: 0;\n list-style: none;\n }\n"])),spacingM,spacingM);var templateObject_1$1r,templateObject_2$Q,templateObject_3$A,templateObject_4$o;var InlineActionButtonList=function InlineActionButtonList(_a){var blockProps=_a.blockProps;var actionButtons=(blockProps||{}).actionButtons;if(!actionButtons||actionButtons.length===0){return null;}return jsx$1(InlineActionButtonsHost,__assign({"data-inline-actionbuttons":true},{children:actionButtons.map(function(ab){return jsx$1(InlineActionButtonListItem,{children:jsx$1(InlineActionButton,__assign({url:ab.url,isPrimary:ab.isPrimary},{children:ab.label}),void 0)},ab.id);})}),void 0);};var InlineActionButtonMapper={component:InlineActionButtonList,type:EntityType.ActionButton,getPropsFromHtml:function(nodeName,node){if(nodeName!=='div'){return null;}var blockId=node.getAttribute('data-action-buttons');return {blockId:blockId,actionButtons:Array.from(node.querySelectorAll('[data-action-button]')).map(function(actionButtonNode){return {id:actionButtonNode.getAttribute('data-action-button'),isPrimary:actionButtonNode.getAttribute('data-is-primary'),url:actionButtonNode.getAttribute('data-url'),label:actionButtonNode.innerHTML};})};}};var EventDetailViewPeopleInfo=function EventDetailViewPeopleInfo(){var item=useDetailViewContext().item;return jsx$1(StyledEventPeopleInfo,{item:item},void 0);};var StyledEventPeopleInfo=_styled(EventPeopleInfo).withConfig({displayName:"EventDetailViewPeopleInfo__StyledEventPeopleInfo",componentId:"sc-1d42bpm-0"})(templateObject_1$1q||(templateObject_1$1q=__makeTemplateObject(["\n margin: ","px 0;\n"],["\n margin: ","px 0;\n"])),spacingS);var templateObject_1$1q;var EventDetailViewLocationInfo=function EventDetailViewLocationInfo(){var item=useDetailViewContext().item;if(!item.locations||item.locations.length===0){return null;}return jsx$1(StyledEventLocationInfo,{locations:item.locations},void 0);};var StyledEventLocationInfo=_styled(EventLocationInfo).withConfig({displayName:"EventDetailViewLocationInfo__StyledEventLocationInfo",componentId:"sc-4kfe0w-0"})(templateObject_1$1p||(templateObject_1$1p=__makeTemplateObject(["\n margin: ","px 0;\n"],["\n margin: ","px 0;\n"])),spacingS);var templateObject_1$1p;var EventDetailViewMetaInfo=function EventDetailViewMetaInfo(_a){var allowFilterByChannels=_a.allowFilterByChannels;var _b=useDetailViewContext(),item=_b.item,userPreferredLanguage=_b.userPreferredLanguage;return jsxs(Fragment,{children:[jsx$1(EventDetailViewLocationInfo,{},void 0),jsx$1(EventDetailViewPeopleInfo,{},void 0),jsx$1(EventChannelsDisplay,{item:item,language:userPreferredLanguage,allowFilterByChannels:allowFilterByChannels},void 0)]},void 0);};var EventDetailViewDatesInfo=function EventDetailViewDatesInfo(_a){var className=_a.className;var item=useDetailViewContext().item;return jsx$1(Host$x,{children:jsx$1(DateTimeRange,{className:className,startDate:item.startDate,endDate:item.endDate},void 0)},void 0);};var Host$x=_styled.div.withConfig({displayName:"EventDetailViewDatesInfo__Host",componentId:"sc-3sblty-0"})(templateObject_1$1o||(templateObject_1$1o=__makeTemplateObject(["\n font-size: ","px;\n margin-bottom: ","px;\n font-weight: 500;\n"],["\n font-size: ","px;\n margin-bottom: ","px;\n font-weight: 500;\n"])),fontSizeSmall,spacingM);var templateObject_1$1o;var PollUserContext=/*#__PURE__*/createContext(null);var DetailViewPollsSubmitButton=function DetailViewPollsSubmitButton(_a){var isReadOnly=_a.isReadOnly;var formatMessage=useIntl().formatMessage;var _b=useContext(PollUserContext),submitPoll=_b.submitPoll,hasMissingUnsavedAnswer=_b.hasMissingUnsavedAnswer,hasMissingAnswers=_b.hasMissingAnswers,answers=_b.answers,resourceType=_b.resourceType,item=_b.item;var updatePollAnswers=useFeedbackApi().updatePollAnswers;if(!hasMissingUnsavedAnswer){return null;}return jsx$1("div",{children:jsx$1(PrimaryButton,{"data-poll-submit-button":true,onClick:function(){return submitPoll(function(){return updatePollAnswers(resourceType,item.id,answers);});},text:formatMessage({id:'Polls.display.submitButtonCaption'}),disabled:hasMissingAnswers||isReadOnly},void 0)},void 0);};var DetailViewCsvExportButton=function DetailViewCsvExportButton(_a){var path=_a.path,stringResource=_a.stringResource,className=_a.className;var user=useCurrentUser();var createApiUrl=useApiFactory().createApiUrl;var exchangeShortLivedToken=useFileAccessTokenApi().exchangeShortLivedToken;var _b=useDetailViewContext(),item=_b.item,resourceType=_b.resourceType;if(!hasMinRoleInSomeGroups(GroupRoles.Author,user,item)){return null;}return jsx$1(Host$w,__assign({className:className},{children:jsxs(DownloadButton$2,__assign({onClick:startDownload},{children:[jsx$1(LeftAlignedIcon,{iconName:"Download"},void 0),jsx$1(FormattedMessage$1,{id:stringResource},void 0)]}),void 0)}),void 0);function startDownload(){return __awaiter(this,void 0,void 0,function(){var token;return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,exchangeShortLivedToken(item.fileAccessToken)];case 1:token=_a.sent();window.open(getFileUrlWithToken(item.id,token||item.fileAccessToken));return [2/*return*/];}});});}function getFileUrlWithToken(itemId,fileDownloadToken){return createApiUrl("/"+resourceType+"/"+itemId+"/"+path,{access_token:fileDownloadToken});}};var Host$w=_styled.div.withConfig({displayName:"DetailViewCsvExportButton__Host",componentId:"sc-n02scx-0"})(templateObject_1$1n||(templateObject_1$1n=__makeTemplateObject(["\n display: flex;\n"],["\n display: flex;\n"])));var DownloadButton$2=_styled(DefaultButton).withConfig({displayName:"DetailViewCsvExportButton__DownloadButton",componentId:"sc-n02scx-1"})(templateObject_2$P||(templateObject_2$P=__makeTemplateObject(["\n display: flex;\n align-items: center;\n align-self: flex-start;\n color: ",";\n border: 0;\n padding: 0;\n margin: 0;\n\n &:hover {\n background-color: initial;\n color: ",";\n }\n\n @media (max-width: ","px) {\n font-size: ","px;\n }\n"],["\n display: flex;\n align-items: center;\n align-self: flex-start;\n color: ",";\n border: 0;\n padding: 0;\n margin: 0;\n\n &:hover {\n background-color: initial;\n color: ",";\n }\n\n @media (max-width: ","px) {\n font-size: ","px;\n }\n"])),function(p){return p.theme.textColors.default;},function(p){return p.theme.textColors.default;},maxScreenSize.medium,fontSizeSmall);var LeftAlignedIcon=_styled(Icon).withConfig({displayName:"DetailViewCsvExportButton__LeftAlignedIcon",componentId:"sc-n02scx-2"})(templateObject_3$z||(templateObject_3$z=__makeTemplateObject(["\n margin-left: -2px; // remove the 2px space this icon has on the left side\n margin-right: 5px;\n color: ",";\n"],["\n margin-left: -2px; // remove the 2px space this icon has on the left side\n margin-right: 5px;\n color: ",";\n"])),function(p){return p.theme.textColors.default;});var templateObject_1$1n,templateObject_2$P,templateObject_3$z;var DetailViewPollExportButton=function DetailViewPollExportButton(_a){var className=_a.className;var features=useFeatures();if(!features.polls){return null;}return jsx$1(DetailViewCsvExportButton,{className:className,path:"feedback/poll/result/export",stringResource:"Polls.display.exportAsCsv"},void 0);};var PollTranslationContext=/*#__PURE__*/createContext(null);var PollTranslationContextProvider=function PollTranslationContextProvider(_a){var contents=_a.contents,language=_a.language,additionalTranslations=_a.additionalTranslations,children=_a.children;var user=useCurrentUser();var activeContents=Object.values(contents||{}).filter(function(c){return c.active;});var allLanguages=activeContents.map(function(c){return c.language;});var allTranslations=additionalTranslations||[];for(var _i=0,_b=activeContents.filter(function(c){return c.poll&&c.poll.questions;});_i<_b.length;_i++){var content=_b[_i];var language_1=content.language;for(var _c=0,_d=content.poll.questions;_c<_d.length;_c++){var question=_d[_c];allTranslations.push({language:language_1,id:question.questionId,text:question.text});for(var _e=0,_f=question.choices;_e<_f.length;_e++){var choice=_f[_e];allTranslations.push({language:language_1,id:choice.choiceId,text:choice.text});}}}return jsx$1(PollTranslationContext.Provider,__assign({value:{getAllTranslations:getAllTranslations,getTranslation:getTranslation}},{children:jsx$1(Fragment,{children:children},void 0)}),void 0);function getAllTranslations(id){return allTranslations.filter(function(t){return t.id===id&&t.text;});}function getTranslation(id){var preferredLanguage=NewsService.getUserPreferredLanguage(allLanguages,user);var translationItems=getAllTranslations(id);var translation=translationItems.find(function(t){return t.language===language;})||translationItems.find(function(t){return t.language===preferredLanguage;})||translationItems[0];return translation?translation.text:null;}};var PollUserInput=function PollUserInput(){var _a=useContext(PollUserContext),questions=_a.questions,getQuestionResult=_a.getQuestionResult,addAnswer=_a.addAnswer;return jsx$1("div",{children:questions.map(function(q){return jsx$1(QuestionInputItem,{question:q,onChange:function(choiceIds){return handleQuestionChange(q,choiceIds);},result:getQuestionResult(q.questionId)},q.questionId);})},void 0);function handleQuestionChange(question,choiceIds){addAnswer(question.questionId,choiceIds);}};var QuestionInput=function QuestionInput(_a){var question=_a.question,onChange=_a.onChange,result=_a.result,className=_a.className;var getTranslation=useContext(PollTranslationContext).getTranslation;var questionText=getTranslation(question.questionId);return jsxs("div",__assign({className:className,"data-question-id":question.questionId,"data-question-text":questionText},{children:[jsx$1(QuestionText,{children:questionText},void 0),question.isMultiChoice&&jsx$1(MultiChoiceQuestionInput,{question:question,onChange:onChange,result:result},void 0),!question.isMultiChoice&&jsx$1(SingleChoiceQuestionInput,{question:question,onChange:function(choiceId){return onChange([choiceId]);},result:result},void 0)]}),void 0);};var MultiChoiceQuestionInput=function MultiChoiceQuestionInput(_a){var question=_a.question,result=_a.result,onChange=_a.onChange;var getTranslation=useContext(PollTranslationContext).getTranslation;return jsx$1("div",{children:question.choices.map(function(c){return jsx$1(StyledCheckbox$2,{isResultMode:result.showResults,disabled:result.showResults||c.disabled,checked:result.userSelectedChoices.some(function(sc){return sc===c.choiceId;}),onChange:function(_,isChecked){return handleMultipleChoiceChange(c.choiceId,isChecked);},label:getTranslation(c.choiceId),onRenderLabel:function(_){return jsx$1(MultiChoiceLabel,{choice:c,result:result},void 0);}},c.choiceId);})},void 0);function handleMultipleChoiceChange(choiceId,isSelected){var choiceIds=result.userSelectedChoices.filter(function(c){return c!==choiceId;});if(isSelected){choiceIds.push(choiceId);}onChange(choiceIds);}};var SingleChoiceQuestionInput=function SingleChoiceQuestionInput(_a){var question=_a.question,onChange=_a.onChange,result=_a.result;var getTranslation=useContext(PollTranslationContext).getTranslation;return jsx$1(ChoiceInput,{isResultMode:result.showResults,selectedKey:result.userSelectedChoices[0],onChange:function(_,option){return onChange(option.key);},options:question.choices.map(function(c){return {key:c.choiceId,choiceId:c.choiceId,text:getTranslation(c.choiceId),disabled:result.showResults||c.disabled,onRenderLabel:function(_){return jsx$1(SingleChoiceLabel,{choice:c,result:result},void 0);}};})},void 0);};var ChoiceLabel=function ChoiceLabel(_a){var choice=_a.choice,result=_a.result,className=_a.className;var getTranslation=useContext(PollTranslationContext).getTranslation;var choiceText=getTranslation(choice.choiceId);return jsxs(ChoiceLabelHost,__assign({isResultMode:result.showResults,className:className,"data-choice-id":choice.choiceId,"data-choice-text":choiceText},{children:[choiceText,choice.description&&jsx$1(ChoiceLabelSecondaryText,__assign({"data-choice-secondary-text":true},{children:choice.description}),void 0),result.showResults&&jsx$1(ChoiceResult,{result:result,choiceId:choice.choiceId},void 0)]}),void 0);};var ChoiceResult=function ChoiceResult(_a){var choiceId=_a.choiceId,result=_a.result;var numberResult=result.choiceResults[choiceId]||0;var percent=numberResult/result.totalFeedbackCount;var palette=useContext(ThemeContext$1).theme.palette;return jsxs(ChoiceResultHost,__assign({"data-choice-result":numberResult},{children:[jsx$1(Bar,{percentComplete:percent,barHeight:10,styles:{progressBar:{backgroundColor:palette.accent}}},void 0),jsx$1("span",{children:jsx$1(FormattedNumber,{value:numberResult},void 0)},void 0)]}),void 0);};var ChoiceResultHost=_styled.div.withConfig({displayName:"PollUserInput__ChoiceResultHost",componentId:"sc-eeg1mx-0"})(templateObject_1$1m||(templateObject_1$1m=__makeTemplateObject(["\n display: flex;\n align-items: center;\n\n > span {\n padding-left: 10px;\n min-width: 44px;\n text-align: right;\n box-sizing: border-box;\n }\n"],["\n display: flex;\n align-items: center;\n\n > span {\n padding-left: 10px;\n min-width: 44px;\n text-align: right;\n box-sizing: border-box;\n }\n"])));var Bar=_styled(ProgressIndicator).withConfig({displayName:"PollUserInput__Bar",componentId:"sc-eeg1mx-1"})(templateObject_2$O||(templateObject_2$O=__makeTemplateObject(["\n flex: 1 0 auto;\n"],["\n flex: 1 0 auto;\n"])));var QuestionText=_styled.div.withConfig({displayName:"PollUserInput__QuestionText",componentId:"sc-eeg1mx-2"})(templateObject_3$y||(templateObject_3$y=__makeTemplateObject(["\n font-weight: bold;\n"],["\n font-weight: bold;\n"])));var QuestionInputItem=_styled(QuestionInput).withConfig({displayName:"PollUserInput__QuestionInputItem",componentId:"sc-eeg1mx-3"})(templateObject_4$n||(templateObject_4$n=__makeTemplateObject(["\n margin-bottom: ","px;\n"],["\n margin-bottom: ","px;\n"])),spacingL);var ChoiceLabelHost=_styled.span.withConfig({displayName:"PollUserInput__ChoiceLabelHost",componentId:"sc-eeg1mx-4"})(templateObject_5$m||(templateObject_5$m=__makeTemplateObject(["\n display: inline-block;\n ","\n ","\n"],["\n display: inline-block;\n ","\n ","\n"])),function(p){return p.isResultMode&&'max-width: 400px;';},function(p){return p.isResultMode&&'width: 100%;';});var ChoiceLabelSecondaryText=_styled.div.withConfig({displayName:"PollUserInput__ChoiceLabelSecondaryText",componentId:"sc-eeg1mx-5"})(templateObject_6$e||(templateObject_6$e=__makeTemplateObject(["\n opacity: 0.75;\n"],["\n opacity: 0.75;\n"])));var SingleChoiceLabel=_styled(ChoiceLabel).withConfig({displayName:"PollUserInput__SingleChoiceLabel",componentId:"sc-eeg1mx-6"})(templateObject_7$9||(templateObject_7$9=__makeTemplateObject(["\n padding-left: 30px;\n"],["\n padding-left: 30px;\n"])));var MultiChoiceLabel=_styled(ChoiceLabel).withConfig({displayName:"PollUserInput__MultiChoiceLabel",componentId:"sc-eeg1mx-7"})(templateObject_8$8||(templateObject_8$8=__makeTemplateObject(["\n padding-left: 5px;\n"],["\n padding-left: 5px;\n"])));var ChoiceInput=_styled(ChoiceGroup).withConfig({displayName:"PollUserInput__ChoiceInput",componentId:"sc-eeg1mx-8"})(templateObject_9$6||(templateObject_9$6=__makeTemplateObject(["\n .ms-ChoiceField-field,\n .ms-ChoiceField-wrapper {\n position: relative;\n flex: 1 1 auto;\n display: flex;\n }\n"],["\n .ms-ChoiceField-field,\n .ms-ChoiceField-wrapper {\n position: relative;\n flex: 1 1 auto;\n display: flex;\n }\n"])));var StyledCheckbox$2=_styled(Checkbox).withConfig({displayName:"PollUserInput__StyledCheckbox",componentId:"sc-eeg1mx-9"})(templateObject_10$5||(templateObject_10$5=__makeTemplateObject(["\n margin-top: 15px;\n .ms-Checkbox-label {\n display: flex;\n align-items: ",";\n flex: 1 1 auto;\n }\n"],["\n margin-top: 15px;\n .ms-Checkbox-label {\n display: flex;\n align-items: ",";\n flex: 1 1 auto;\n }\n"])),function(p){return p.isResultMode?'flex-start':'center';});var templateObject_1$1m,templateObject_2$O,templateObject_3$y,templateObject_4$n,templateObject_5$m,templateObject_6$e,templateObject_7$9,templateObject_8$8,templateObject_9$6,templateObject_10$5;var PollDisplay=function PollDisplay(_a){var children=_a.children,className=_a.className;var formatMessage=useIntl().formatMessage;return jsxs("section",__assign({className:className,"aria-label":formatMessage({id:'Polls.sectionLabel'}),"data-consumer-poll":true},{children:[jsx$1(PollUserInput,{},void 0),children]}),void 0);};var PollUserContextProvider=function PollUserContextProvider(_a){var _b;var item=_a.item,onBehalfOfUpn=_a.onBehalfOfUpn,resourceType=_a.resourceType,language=_a.language,getAdditionalQuestions=_a.getAdditionalQuestions,getAdditionalUserAnswers=_a.getAdditionalUserAnswers,getPollResults=_a.getPollResults,showResult=_a.showResult,children=_a.children;var poll=item.poll,itemId=item.id;var getFeedback=useFeedbackApi().getFeedback;var _c=useState$2(getAdditionalQuestions===null||getAdditionalQuestions===void 0?void 0:getAdditionalQuestions(null)),additionalQuestions=_c[0],setAdditionalQuestions=_c[1];var showError=useNotificationContext().showError;var questionDefinitions=(_b=poll===null||poll===void 0?void 0:poll.questions)!==null&&_b!==void 0?_b:[];var _d=usePromise$2(loadUserAnswers),userAnswers=_d[0],isLoading=_d[1],setUserAnswers=_d[3];var _e=useState$2([]),unsavedQuestionsIds=_e[0],setUnsavedQuestionsIds=_e[1];var _f=usePromise$2(function(){return getPollResults(itemId);},{answers:[]},[itemId]),pollResult=_f[0],isLoadingPollResult=_f[1],fetchPollResults=_f[5];useEffect$1(function(){var _a;if(isLoadingPollResult||!((_a=pollResult===null||pollResult===void 0?void 0:pollResult.answers)===null||_a===void 0?void 0:_a.length)){return;}getAdditionalQuestions&&setAdditionalQuestions(getAdditionalQuestions(pollResult));// eslint-disable-next-line react-hooks/exhaustive-deps
122297
+ if(node.querySelector('[data-code-html]')==null){node.innerHTML='';}}};var HeaderFormat=css$2(templateObject_1$1t||(templateObject_1$1t=__makeTemplateObject(["\n tr:first-child {\n td {\n border: solid 1px ",";\n }\n\n td,\n textarea {\n font-weight: bold;\n color: ",";\n background-color: ",";\n }\n }\n"],["\n tr:first-child {\n td {\n border: solid 1px ",";\n }\n\n td,\n textarea {\n font-weight: bold;\n color: ",";\n background-color: ",";\n }\n }\n"])),function(p){return p.theme.palette.neutralLight;},function(p){return p.theme.palette.neutralSecondaryAlt;},function(p){return p.theme.palette.neutralLight;});var FooterFormat=css$2(templateObject_2$P||(templateObject_2$P=__makeTemplateObject(["\n tr:last-child {\n background-color: ",";\n > td {\n border-bottom: solid 2px ",";\n }\n }\n\n tr:nth-last-child(2) {\n > td {\n border-bottom: solid 1px ",";\n }\n }\n"],["\n tr:last-child {\n background-color: ",";\n > td {\n border-bottom: solid 2px ",";\n }\n }\n\n tr:nth-last-child(2) {\n > td {\n border-bottom: solid 1px ",";\n }\n }\n"])),function(p){return p.theme.palette.white;},function(p){return p.theme.palette.neutralPrimary;},function(p){return p.theme.palette.neutralPrimary;});var Grid=css$2(templateObject_3$z||(templateObject_3$z=__makeTemplateObject(["\n && {\n tr > td {\n border-color: ",";\n border-style: solid;\n }\n }\n"],["\n && {\n tr > td {\n border-color: ",";\n border-style: solid;\n }\n }\n"])),function(p){return p.theme.palette.neutralLight;});var AlternateLines=css$2(templateObject_4$n||(templateObject_4$n=__makeTemplateObject(["\n tr:nth-child(odd) {\n background-color: ",";\n td {\n background-color: ",";\n }\n\n td,\n textarea {\n background-color: ",";\n }\n }\n"],["\n tr:nth-child(odd) {\n background-color: ",";\n td {\n background-color: ",";\n }\n\n td,\n textarea {\n background-color: ",";\n }\n }\n"])),function(p){return p.theme.palette.neutralLighter;},function(p){return p.theme.palette.neutralLighter;},function(p){return p.theme.palette.neutralLighter;});var Table=_styled.table.withConfig({displayName:"InlineTableStyles__Table",componentId:"sc-10dcamf-0"})(templateObject_5$l||(templateObject_5$l=__makeTemplateObject(["\n border-collapse: collapse;\n table-layout: fixed;\n width: 51px;\n\n tr {\n height: 43px;\n > td {\n border: solid 1px transparent;\n font-size: ","px;\n padding: 5px;\n vertical-align: top;\n\n &[data-multiline=\"true\"] {\n white-space: pre-wrap;\n }\n }\n\n textarea {\n font-size: ","px;\n border: none;\n padding: 0;\n }\n }\n }\n\n ","\n ","\n ","\n ","\n"],["\n border-collapse: collapse;\n table-layout: fixed;\n width: 51px;\n\n tr {\n height: 43px;\n > td {\n border: solid 1px transparent;\n font-size: ","px;\n padding: 5px;\n vertical-align: top;\n\n &[data-multiline=\"true\"] {\n white-space: pre-wrap;\n }\n }\n\n textarea {\n font-size: ","px;\n border: none;\n padding: 0;\n }\n }\n }\n\n ","\n ","\n ","\n ","\n"])),fontSizeNormal,fontSizeNormal,function(_a){var showGrid=_a.format.showGrid;return showGrid&&Grid;},function(_a){var alternateLines=_a.format.alternateLines;return alternateLines&&AlternateLines;},function(_a){var hasHeaderRow=_a.format.hasHeaderRow;return hasHeaderRow&&HeaderFormat;},function(_a){var hasFooterRow=_a.format.hasFooterRow;return hasFooterRow&&FooterFormat;});var templateObject_1$1t,templateObject_2$P,templateObject_3$z,templateObject_4$n,templateObject_5$l;var TableViewer=function TableViewer(_a){var tableDefinition=_a.blockProps.tableDefinition;var lastRowIndex=tableDefinition.rows.length-1;return jsx$1(Host$x,{children:jsx$1(Table,__assign({format:tableDefinition.format},{children:jsx$1("tbody",{children:tableDefinition.rows.map(function(r,rowIndex){return jsx$1("tr",{children:r.cells.map(function(c,index){var _a,_b,_c;return jsx$1("td",__assign({style:__assign(__assign({},cellStyleToCssProps(c.style,tableDefinition.format.alternateLines||tableDefinition.format.hasHeaderRow&&rowIndex===0||tableDefinition.format.hasFooterRow&&rowIndex===lastRowIndex)),rowIndex===0&&{width:(_b=(_a=tableDefinition.columns)===null||_a===void 0?void 0:_a[index])===null||_b===void 0?void 0:_b.width}),title:c.value,"data-multiline":c.isMultiline},{children:c.url?jsx$1(TextLink,__assign({url:c.url,style:{color:(_c=c.style.fontColor)!==null&&_c!==void 0?_c:null}},{children:c.value}),void 0):c.value}),index);})},rowIndex);})},void 0)}),void 0)},void 0);};function cssPropsToCellStyle(style,alternateLines,isHeaderRow){if(style==null){return {};}return {isBold:style.fontWeight==='bold',isItalic:style.fontStyle==='italic',textAlign:style.textAlign==='left'||style.textAlign==='right'||style.textAlign==='center'?style.textAlign:null,fontColor:style.color,backgroundColor:!alternateLines&&!isHeaderRow?style.backgroundColor:null};}function cellStyleToCssProps(cellStyle,disableCustomColors){if(cellStyle==null){return {};}return __assign(__assign(__assign(__assign(__assign({},cellStyle.isBold&&{fontWeight:'bold'}),cellStyle.isItalic&&{fontStyle:'italic'}),cellStyle.textAlign&&{textAlign:cellStyle.textAlign}),cellStyle.fontColor&&!disableCustomColors&&{color:cellStyle.fontColor}),cellStyle.backgroundColor&&!disableCustomColors&&{backgroundColor:cellStyle.backgroundColor});}var InlineTable={component:TableViewer,getPropsFromHtml:function(nodeName,node){if(nodeName!=='div'){return null;}var tableId=node.getAttribute('data-table-id');if(tableId==null){return null;}var table=node.querySelector('table');var body=table===null||table===void 0?void 0:table.querySelector('tbody');if(body==null){return null;}var firstRow=body.querySelector('tr:first-child');return {tableId:tableId,tableDefinition:{columns:Array.from(firstRow.querySelectorAll('td')).map(function(c){var _a,_b;return {width:(_b=(_a=c.style)===null||_a===void 0?void 0:_a.width)!==null&&_b!==void 0?_b:null};}),rows:Array.from(body.querySelectorAll('tr')).map(function(row){return {rowId:createId(),cells:Array.from(row.querySelectorAll('td')).map(function(cell){var _a,_b;return {cellId:createId(),value:cell.innerText,style:cssPropsToCellStyle(cell.style,table.classList.contains('condense-table--alternateLines'),table.classList.contains('condense-table--hasHeader')&&row.rowIndex===0),isMultiline:cell.innerText.includes('\n'),url:(_b=(_a=cell.querySelector('a'))===null||_a===void 0?void 0:_a.getAttribute('href'))!==null&&_b!==void 0?_b:null};})};}),format:{showGrid:table.classList.contains('condense-table--showGrid'),alternateLines:table.classList.contains('condense-table--alternateLines'),hasHeaderRow:table.classList.contains('condense-table--hasHeader'),hasFooterRow:table.classList.contains('condense-table--hasFooter')}}};},type:EntityType.Table};var Host$x=_styled.div.withConfig({displayName:"InlineTable__Host",componentId:"sc-8db5xf-0"})(templateObject_1$1s||(templateObject_1$1s=__makeTemplateObject(["\n width: 100%;\n overflow-x: auto;\n"],["\n width: 100%;\n overflow-x: auto;\n"])));var templateObject_1$1s;var ItemBodyWrapper=function ItemBodyWrapper(_a){var className=_a.className,children=_a.children;return jsx$1(Host$w,__assign({className:className,"data-body-wrapper":true},{children:children}),void 0);};var Host$w=_styled.div.withConfig({displayName:"ItemBodyWrapper__Host",componentId:"sc-6adwhw-0"})(templateObject_1$1r||(templateObject_1$1r=__makeTemplateObject(["\n && {\n p,\n ul,\n ol,\n pre,\n blockquote,\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n -webkit-margin-before: 0;\n -webkit-margin-end: 0;\n -webkit-margin-after: 0;\n -webkit-margin-start: 0;\n\n -webkit-padding-before: 0;\n -webkit-padding-end: 0;\n -webkit-padding-after: 0;\n -webkit-padding-start: 0;\n }\n\n h1 {\n font-size: ","px;\n margin: ","px 0;\n }\n\n h2 {\n font-size: ","px;\n }\n\n h3 {\n font-size: ","px;\n }\n\n h2,\n h3,\n h4,\n h5,\n h6 {\n margin: ","px 0;\n }\n\n p,\n .paragraph,\n ul,\n ol {\n word-wrap: break-word;\n margin-bottom: 1em;\n line-height: 20px;\n }\n\n blockquote {\n line-height: 20px;\n }\n\n ul,\n ol {\n padding-left: 18px;\n }\n\n li {\n margin-bottom: 10px;\n }\n\n a {\n color: ",";\n text-decoration: underline;\n }\n\n .news-inline-file {\n position: relative;\n margin: 10px 3px;\n user-select: none;\n\n > a,\n button {\n max-width: 100%;\n display: inline-block;\n box-sizing: border-box;\n padding: 12px 20px;\n box-shadow: 0 2px 3px 2px #b7b7b7;\n width: auto;\n color: inherit;\n line-height: 1.5em;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n text-decoration: none;\n\n i {\n margin-right: 10px;\n font-size: 25px;\n vertical-align: bottom;\n }\n }\n }\n\n figure:not([data-inline-quote='true']) {\n margin: 0;\n }\n\n .news-inline-image {\n margin-bottom: 15px;\n\n figure {\n margin: 0;\n }\n\n figcaption {\n font-style: italic;\n }\n }\n\n /* news-inline-quote -\n required for backwards compatibility with old news */\n .news-inline-quote {\n max-width: 80%;\n\n figure {\n display: inline-block;\n\n blockquote {\n border-left: 0;\n font-size: 15px;\n }\n\n figcaption {\n text-align: right;\n margin-top: 10px;\n position: relative;\n\n > div {\n width: 40px;\n height: 40px;\n border-radius: 50%;\n overflow: hidden;\n position: absolute;\n top: 0;\n right: 0;\n transform: translate(50px, -15px);\n }\n }\n }\n }\n\n .video-view-container {\n margin-bottom: 15px;\n }\n\n @media (max-width: ","px) {\n figure[data-inline-quote='true'] {\n padding-left: 15px;\n }\n\n .news-inline-quote {\n max-width: 100%;\n\n figcaption {\n margin-right: 10px;\n }\n }\n\n h1 {\n font-size: ","px;\n }\n\n h2 {\n font-size: ","px;\n }\n\n h3 {\n font-size: ","px;\n }\n\n p,\n .paragraph,\n ul,\n ol,\n blockquote,\n figcaption,\n td {\n font-size: ","px;\n }\n\n ul {\n padding-left: 14px;\n }\n ol {\n padding-left: 20px;\n }\n }\n\n @media (min-width: ","px) {\n .news-inline-quote {\n figure {\n blockquote {\n font-size: 20px;\n }\n }\n }\n }\n }\n"],["\n && {\n p,\n ul,\n ol,\n pre,\n blockquote,\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n -webkit-margin-before: 0;\n -webkit-margin-end: 0;\n -webkit-margin-after: 0;\n -webkit-margin-start: 0;\n\n -webkit-padding-before: 0;\n -webkit-padding-end: 0;\n -webkit-padding-after: 0;\n -webkit-padding-start: 0;\n }\n\n h1 {\n font-size: ","px;\n margin: ","px 0;\n }\n\n h2 {\n font-size: ","px;\n }\n\n h3 {\n font-size: ","px;\n }\n\n h2,\n h3,\n h4,\n h5,\n h6 {\n margin: ","px 0;\n }\n\n p,\n .paragraph,\n ul,\n ol {\n word-wrap: break-word;\n margin-bottom: 1em;\n line-height: 20px;\n }\n\n blockquote {\n line-height: 20px;\n }\n\n ul,\n ol {\n padding-left: 18px;\n }\n\n li {\n margin-bottom: 10px;\n }\n\n a {\n color: ",";\n text-decoration: underline;\n }\n\n .news-inline-file {\n position: relative;\n margin: 10px 3px;\n user-select: none;\n\n > a,\n button {\n max-width: 100%;\n display: inline-block;\n box-sizing: border-box;\n padding: 12px 20px;\n box-shadow: 0 2px 3px 2px #b7b7b7;\n width: auto;\n color: inherit;\n line-height: 1.5em;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n text-decoration: none;\n\n i {\n margin-right: 10px;\n font-size: 25px;\n vertical-align: bottom;\n }\n }\n }\n\n figure:not([data-inline-quote='true']) {\n margin: 0;\n }\n\n .news-inline-image {\n margin-bottom: 15px;\n\n figure {\n margin: 0;\n }\n\n figcaption {\n font-style: italic;\n }\n }\n\n /* news-inline-quote -\n required for backwards compatibility with old news */\n .news-inline-quote {\n max-width: 80%;\n\n figure {\n display: inline-block;\n\n blockquote {\n border-left: 0;\n font-size: 15px;\n }\n\n figcaption {\n text-align: right;\n margin-top: 10px;\n position: relative;\n\n > div {\n width: 40px;\n height: 40px;\n border-radius: 50%;\n overflow: hidden;\n position: absolute;\n top: 0;\n right: 0;\n transform: translate(50px, -15px);\n }\n }\n }\n }\n\n .video-view-container {\n margin-bottom: 15px;\n }\n\n @media (max-width: ","px) {\n figure[data-inline-quote='true'] {\n padding-left: 15px;\n }\n\n .news-inline-quote {\n max-width: 100%;\n\n figcaption {\n margin-right: 10px;\n }\n }\n\n h1 {\n font-size: ","px;\n }\n\n h2 {\n font-size: ","px;\n }\n\n h3 {\n font-size: ","px;\n }\n\n p,\n .paragraph,\n ul,\n ol,\n blockquote,\n figcaption,\n td {\n font-size: ","px;\n }\n\n ul {\n padding-left: 14px;\n }\n ol {\n padding-left: 20px;\n }\n }\n\n @media (min-width: ","px) {\n .news-inline-quote {\n figure {\n blockquote {\n font-size: 20px;\n }\n }\n }\n }\n }\n"])),fontSizeLarge-1,spacingS+2,fontSizeLarge-3,fontSizeLarge-5,spacingS,function(p){return p.theme.palette.accent;},maxScreenSize.medium,fontSizeLarge-3,fontSizeLarge-5,fontSizeMedium,fontSizeSmall,minScreenSize.small);var templateObject_1$1r;var InlineFileList=function InlineFileList(_a){var fileBlock=_a.blockProps;var _b=useDetailViewContext(),item=_b.item,resourceType=_b.resourceType;var getFileUrlWithToken=useFileApi().getFileUrlWithToken;if(!fileBlock.files||fileBlock.files.length===0){return null;}var files=fileBlock.files.map(function(f){if(f.pageId){return __assign({},f);}var getFileUrl=function getFileUrl(token){var _a;return ((_a=f.getDownloadUrl)===null||_a===void 0?void 0:_a.call(f,token))||getFileUrlWithToken(token||item.fileAccessToken,item.id,undefined,f.fileId,f.fileName,resourceType);};return __assign(__assign({},f),{getDownloadUrl:getFileUrl,accessToken:item.fileAccessToken});});var audioFiles=files.filter(function(f){return isAudioFile(f.fileName);});var videoFiles=files.filter(function(f){return isVideoFile(f.fileName);});var otherFiles=files.filter(function(f){return !audioFiles.includes(f)&&!videoFiles.includes(f);});return jsxs(Fragment,{children:[videoFiles.length>0&&jsx$1(FileListHost,__assign({"data-preload-video":browserInfo.name==='safari'},{children:videoFiles.map(function(f){var _a;return jsx$1(FileListItem,{children:jsx$1(VideoFileHost,__assign({"data-preload-video":browserInfo.name==='safari'},{children:jsx$1(VideoFile,{fileName:(_a=f.title)!==null&&_a!==void 0?_a:f.fileName,url:f.getDownloadUrl()},void 0)}),void 0)},f.fileId);})}),void 0),audioFiles.length>0&&jsx$1(FileListHost,{children:audioFiles.map(function(f){var _a;return jsx$1(FileListItem,{children:jsx$1(AudioFile,{fileName:(_a=f.title)!==null&&_a!==void 0?_a:f.fileName,url:f.getDownloadUrl()},void 0)},f.fileId);})},void 0),otherFiles.length>0&&jsx$1(FileListHost,{children:otherFiles.map(function(f){return jsx$1(FileListItem,{children:f.pageId?jsx$1(InlinePageDocument,{file:f},void 0):jsx$1(InlineFileDownloadButton,{getFileUrl:f.getDownloadUrl,fileAccessToken:item.fileAccessToken,fileName:f.fileName,title:f.title},void 0)},f.fileId);})},void 0)]},void 0);};var InlinePageDocument=function InlinePageDocument(_a){var file=_a.file;var pageId=file.pageId;var loadPage=usePagesApi().loadPage;var page=usePromise$2(function(){return loadPage(pageId);},undefined,[pageId])[0];var _b=useInlinePageDocument(file,page),fileUrl=_b.fileUrl,iconName=_b.iconName,title=_b.title,fileName=_b.fileName,onPageDocumentDownloadClick=_b.onPageDocumentDownloadClick;return jsx$1(InlinePageDocumentDownloadButton,{fileUrl:fileUrl,fileName:fileName,title:title,fileIconName:iconName,onClick:onPageDocumentDownloadClick},void 0);};var InlineFileMapper={component:InlineFileList,type:EntityType.File,getPropsFromHtml:function(nodeName,node){if(nodeName!=='div'){return null;}var blockId=node.getAttribute('data-file-block');if(!blockId){var fileId=node.getAttribute('data-file-id')||node.getAttribute('data-file-fileid');if(fileId==null){return null;}var title=node.getAttribute('data-file-title');var fileName=node.getAttribute('data-file-name');var pageId=node.getAttribute('data-inline-page-document-id');var extension=node.getAttribute('data-file-extension');return {blockId:createId(),files:[{fileId:fileId,title:title,fileName:fileName,pageId:pageId,extension:extension}]};}return {blockId:blockId,files:Array.from(node.querySelectorAll('[data-file-id], [data-file-fileid]')).map(function(fileNode){var _a;return {fileId:(_a=fileNode.getAttribute('data-file-id'))!==null&&_a!==void 0?_a:fileNode.getAttribute('data-file-fileid'),fileName:fileNode.getAttribute('data-file-name'),title:fileNode.getAttribute('data-file-title'),pageId:fileNode.getAttribute('data-inline-page-document-id'),extension:fileNode.getAttribute('data-file-extension')};})};}};var VideoFileHost=_styled.div.withConfig({displayName:"InlineFileList__VideoFileHost",componentId:"sc-16i3l51-0"})(templateObject_1$1q||(templateObject_1$1q=__makeTemplateObject(["\n width: 100%;\n\n video {\n width: 100%;\n border-radius: ","px;\n overflow: hidden;\n }\n\n &[data-preload-video='true'] {\n video {\n box-shadow: inset 0 0 0 0.5px #707070, 0 0 0 0.5px #707070;\n background-color: #e4e4e4;\n }\n }\n"],["\n width: 100%;\n\n video {\n width: 100%;\n border-radius: ","px;\n overflow: hidden;\n }\n\n &[data-preload-video='true'] {\n video {\n box-shadow: inset 0 0 0 0.5px #707070, 0 0 0 0.5px #707070;\n background-color: #e4e4e4;\n }\n }\n"])),videoAttachmentRoundedCornerSize);var templateObject_1$1q;var InlineActionButton=_styled(TextLink).withConfig({displayName:"InlineActionButtonStyles__InlineActionButton",componentId:"sc-1m041aj-0"})(templateObject_2$O||(templateObject_2$O=__makeTemplateObject(["\n &&& {\n display: block;\n min-width: 200px;\n width: auto;\n height: ","px;\n line-height: ","px;\n padding: 0 15px;\n border: 1px solid;\n border-radius: 2px;\n box-shadow: 0px ","px ","px #00000033;\n text-decoration: none;\n box-sizing: border-box;\n text-align: center;\n\n ","\n\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n"],["\n &&& {\n display: block;\n min-width: 200px;\n width: auto;\n height: ","px;\n line-height: ","px;\n padding: 0 15px;\n border: 1px solid;\n border-radius: 2px;\n box-shadow: 0px ","px ","px #00000033;\n text-decoration: none;\n box-sizing: border-box;\n text-align: center;\n\n ","\n\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n"])),spacingX,spacingX,spacingXs,spacingXs*2,function(p){return p.isPrimary&&css$2(templateObject_1$1p||(templateObject_1$1p=__makeTemplateObject(["\n background-color: ",";\n border-color: ",";\n color: ",";\n "],["\n background-color: ",";\n border-color: ",";\n color: ",";\n "])),p.theme.palette.themePrimary,p.theme.palette.themePrimary,p.theme.textColors.onPrimary);});var InlineActionButtonListItem=_styled.li.withConfig({displayName:"InlineActionButtonStyles__InlineActionButtonListItem",componentId:"sc-1m041aj-1"})(templateObject_3$y||(templateObject_3$y=__makeTemplateObject(["\n &&& {\n margin-bottom: 0;\n display: flex;\n flex-wrap: nowrap;\n max-width: 100%;\n }\n"],["\n &&& {\n margin-bottom: 0;\n display: flex;\n flex-wrap: nowrap;\n max-width: 100%;\n }\n"])));var InlineActionButtonsHost=_styled.ul.withConfig({displayName:"InlineActionButtonStyles__InlineActionButtonsHost",componentId:"sc-1m041aj-2"})(templateObject_4$m||(templateObject_4$m=__makeTemplateObject(["\n display: flex;\n gap: ","px;\n justify-content: center;\n flex-wrap: wrap;\n\n &&& {\n margin: 0 0 ","px;\n padding: 0;\n list-style: none;\n }\n"],["\n display: flex;\n gap: ","px;\n justify-content: center;\n flex-wrap: wrap;\n\n &&& {\n margin: 0 0 ","px;\n padding: 0;\n list-style: none;\n }\n"])),spacingM,spacingM);var templateObject_1$1p,templateObject_2$O,templateObject_3$y,templateObject_4$m;var InlineActionButtonList=function InlineActionButtonList(_a){var blockProps=_a.blockProps;var actionButtons=(blockProps||{}).actionButtons;if(!actionButtons||actionButtons.length===0){return null;}return jsx$1(InlineActionButtonsHost,__assign({"data-inline-actionbuttons":true},{children:actionButtons.map(function(ab){return jsx$1(InlineActionButtonListItem,{children:jsx$1(InlineActionButton,__assign({url:ab.url,isPrimary:ab.isPrimary},{children:ab.label}),void 0)},ab.id);})}),void 0);};var InlineActionButtonMapper={component:InlineActionButtonList,type:EntityType.ActionButton,getPropsFromHtml:function(nodeName,node){if(nodeName!=='div'){return null;}var blockId=node.getAttribute('data-action-buttons');return {blockId:blockId,actionButtons:Array.from(node.querySelectorAll('[data-action-button]')).map(function(actionButtonNode){return {id:actionButtonNode.getAttribute('data-action-button'),isPrimary:actionButtonNode.getAttribute('data-is-primary'),url:actionButtonNode.getAttribute('data-url'),label:actionButtonNode.innerHTML};})};}};var EventDetailViewPeopleInfo=function EventDetailViewPeopleInfo(){var item=useDetailViewContext().item;return jsx$1(StyledEventPeopleInfo,{item:item},void 0);};var StyledEventPeopleInfo=_styled(EventPeopleInfo).withConfig({displayName:"EventDetailViewPeopleInfo__StyledEventPeopleInfo",componentId:"sc-1d42bpm-0"})(templateObject_1$1o||(templateObject_1$1o=__makeTemplateObject(["\n margin: ","px 0;\n"],["\n margin: ","px 0;\n"])),spacingS);var templateObject_1$1o;var EventDetailViewLocationInfo=function EventDetailViewLocationInfo(){var item=useDetailViewContext().item;if(!item.locations||item.locations.length===0){return null;}return jsx$1(StyledEventLocationInfo,{locations:item.locations},void 0);};var StyledEventLocationInfo=_styled(EventLocationInfo).withConfig({displayName:"EventDetailViewLocationInfo__StyledEventLocationInfo",componentId:"sc-4kfe0w-0"})(templateObject_1$1n||(templateObject_1$1n=__makeTemplateObject(["\n margin: ","px 0;\n"],["\n margin: ","px 0;\n"])),spacingS);var templateObject_1$1n;var EventDetailViewMetaInfo=function EventDetailViewMetaInfo(_a){var allowFilterByChannels=_a.allowFilterByChannels;var _b=useDetailViewContext(),item=_b.item,userPreferredLanguage=_b.userPreferredLanguage;return jsxs(Fragment,{children:[jsx$1(EventDetailViewLocationInfo,{},void 0),jsx$1(EventDetailViewPeopleInfo,{},void 0),jsx$1(EventChannelsDisplay,{item:item,language:userPreferredLanguage,allowFilterByChannels:allowFilterByChannels},void 0)]},void 0);};var EventDetailViewDatesInfo=function EventDetailViewDatesInfo(_a){var className=_a.className;var item=useDetailViewContext().item;return jsx$1(Host$v,{children:jsx$1(DateTimeRange,{className:className,startDate:item.startDate,endDate:item.endDate},void 0)},void 0);};var Host$v=_styled.div.withConfig({displayName:"EventDetailViewDatesInfo__Host",componentId:"sc-3sblty-0"})(templateObject_1$1m||(templateObject_1$1m=__makeTemplateObject(["\n font-size: ","px;\n margin-bottom: ","px;\n font-weight: 500;\n"],["\n font-size: ","px;\n margin-bottom: ","px;\n font-weight: 500;\n"])),fontSizeSmall,spacingM);var templateObject_1$1m;var PollUserContext=/*#__PURE__*/createContext(null);var DetailViewPollsSubmitButton=function DetailViewPollsSubmitButton(_a){var isReadOnly=_a.isReadOnly;var formatMessage=useIntl().formatMessage;var _b=useContext(PollUserContext),submitPoll=_b.submitPoll,hasMissingUnsavedAnswer=_b.hasMissingUnsavedAnswer,hasMissingAnswers=_b.hasMissingAnswers,answers=_b.answers,resourceType=_b.resourceType,item=_b.item;var updatePollAnswers=useFeedbackApi().updatePollAnswers;if(!hasMissingUnsavedAnswer){return null;}return jsx$1("div",{children:jsx$1(PrimaryButton,{"data-poll-submit-button":true,onClick:function(){return submitPoll(function(){return updatePollAnswers(resourceType,item.id,answers);});},text:formatMessage({id:'Polls.display.submitButtonCaption'}),disabled:hasMissingAnswers||isReadOnly},void 0)},void 0);};var DetailViewCsvExportButton=function DetailViewCsvExportButton(_a){var path=_a.path,stringResource=_a.stringResource,className=_a.className;var user=useCurrentUser();var createApiUrl=useApiFactory().createApiUrl;var exchangeShortLivedToken=useFileAccessTokenApi().exchangeShortLivedToken;var _b=useDetailViewContext(),item=_b.item,resourceType=_b.resourceType;if(!hasMinRoleInSomeGroups(GroupRoles.Author,user,item)){return null;}return jsx$1(Host$u,__assign({className:className},{children:jsxs(DownloadButton$2,__assign({onClick:startDownload},{children:[jsx$1(LeftAlignedIcon,{iconName:"Download"},void 0),jsx$1(FormattedMessage$1,{id:stringResource},void 0)]}),void 0)}),void 0);function startDownload(){return __awaiter(this,void 0,void 0,function(){var token;return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,exchangeShortLivedToken(item.fileAccessToken)];case 1:token=_a.sent();window.open(getFileUrlWithToken(item.id,token||item.fileAccessToken));return [2/*return*/];}});});}function getFileUrlWithToken(itemId,fileDownloadToken){return createApiUrl("/"+resourceType+"/"+itemId+"/"+path,{access_token:fileDownloadToken});}};var Host$u=_styled.div.withConfig({displayName:"DetailViewCsvExportButton__Host",componentId:"sc-n02scx-0"})(templateObject_1$1l||(templateObject_1$1l=__makeTemplateObject(["\n display: flex;\n"],["\n display: flex;\n"])));var DownloadButton$2=_styled(DefaultButton).withConfig({displayName:"DetailViewCsvExportButton__DownloadButton",componentId:"sc-n02scx-1"})(templateObject_2$N||(templateObject_2$N=__makeTemplateObject(["\n display: flex;\n align-items: center;\n align-self: flex-start;\n color: ",";\n border: 0;\n padding: 0;\n margin: 0;\n\n &:hover {\n background-color: initial;\n color: ",";\n }\n\n @media (max-width: ","px) {\n font-size: ","px;\n }\n"],["\n display: flex;\n align-items: center;\n align-self: flex-start;\n color: ",";\n border: 0;\n padding: 0;\n margin: 0;\n\n &:hover {\n background-color: initial;\n color: ",";\n }\n\n @media (max-width: ","px) {\n font-size: ","px;\n }\n"])),function(p){return p.theme.textColors.default;},function(p){return p.theme.textColors.default;},maxScreenSize.medium,fontSizeSmall);var LeftAlignedIcon=_styled(Icon).withConfig({displayName:"DetailViewCsvExportButton__LeftAlignedIcon",componentId:"sc-n02scx-2"})(templateObject_3$x||(templateObject_3$x=__makeTemplateObject(["\n margin-left: -2px; // remove the 2px space this icon has on the left side\n margin-right: 5px;\n color: ",";\n"],["\n margin-left: -2px; // remove the 2px space this icon has on the left side\n margin-right: 5px;\n color: ",";\n"])),function(p){return p.theme.textColors.default;});var templateObject_1$1l,templateObject_2$N,templateObject_3$x;var DetailViewPollExportButton=function DetailViewPollExportButton(_a){var className=_a.className;var features=useFeatures();if(!features.polls){return null;}return jsx$1(DetailViewCsvExportButton,{className:className,path:"feedback/poll/result/export",stringResource:"Polls.display.exportAsCsv"},void 0);};var PollTranslationContext=/*#__PURE__*/createContext(null);var PollTranslationContextProvider=function PollTranslationContextProvider(_a){var contents=_a.contents,language=_a.language,additionalTranslations=_a.additionalTranslations,children=_a.children;var user=useCurrentUser();var activeContents=Object.values(contents||{}).filter(function(c){return c.active;});var allLanguages=activeContents.map(function(c){return c.language;});var allTranslations=additionalTranslations||[];for(var _i=0,_b=activeContents.filter(function(c){return c.poll&&c.poll.questions;});_i<_b.length;_i++){var content=_b[_i];var language_1=content.language;for(var _c=0,_d=content.poll.questions;_c<_d.length;_c++){var question=_d[_c];allTranslations.push({language:language_1,id:question.questionId,text:question.text});for(var _e=0,_f=question.choices;_e<_f.length;_e++){var choice=_f[_e];allTranslations.push({language:language_1,id:choice.choiceId,text:choice.text});}}}return jsx$1(PollTranslationContext.Provider,__assign({value:{getAllTranslations:getAllTranslations,getTranslation:getTranslation}},{children:jsx$1(Fragment,{children:children},void 0)}),void 0);function getAllTranslations(id){return allTranslations.filter(function(t){return t.id===id&&t.text;});}function getTranslation(id){var preferredLanguage=NewsService.getUserPreferredLanguage(allLanguages,user);var translationItems=getAllTranslations(id);var translation=translationItems.find(function(t){return t.language===language;})||translationItems.find(function(t){return t.language===preferredLanguage;})||translationItems[0];return translation?translation.text:null;}};var PollUserInput=function PollUserInput(){var _a=useContext(PollUserContext),questions=_a.questions,getQuestionResult=_a.getQuestionResult,addAnswer=_a.addAnswer;return jsx$1("div",{children:questions.map(function(q){return jsx$1(QuestionInputItem,{question:q,onChange:function(choiceIds){return handleQuestionChange(q,choiceIds);},result:getQuestionResult(q.questionId)},q.questionId);})},void 0);function handleQuestionChange(question,choiceIds){addAnswer(question.questionId,choiceIds);}};var QuestionInput=function QuestionInput(_a){var question=_a.question,onChange=_a.onChange,result=_a.result,className=_a.className;var getTranslation=useContext(PollTranslationContext).getTranslation;var questionText=getTranslation(question.questionId);return jsxs("div",__assign({className:className,"data-question-id":question.questionId,"data-question-text":questionText},{children:[jsx$1(QuestionText,{children:questionText},void 0),question.isMultiChoice&&jsx$1(MultiChoiceQuestionInput,{question:question,onChange:onChange,result:result},void 0),!question.isMultiChoice&&jsx$1(SingleChoiceQuestionInput,{question:question,onChange:function(choiceId){return onChange([choiceId]);},result:result},void 0)]}),void 0);};var MultiChoiceQuestionInput=function MultiChoiceQuestionInput(_a){var question=_a.question,result=_a.result,onChange=_a.onChange;var getTranslation=useContext(PollTranslationContext).getTranslation;return jsx$1("div",{children:question.choices.map(function(c){return jsx$1(StyledCheckbox$2,{isResultMode:result.showResults,disabled:result.showResults||c.disabled,checked:result.userSelectedChoices.some(function(sc){return sc===c.choiceId;}),onChange:function(_,isChecked){return handleMultipleChoiceChange(c.choiceId,isChecked);},label:getTranslation(c.choiceId),onRenderLabel:function(_){return jsx$1(MultiChoiceLabel,{choice:c,result:result},void 0);}},c.choiceId);})},void 0);function handleMultipleChoiceChange(choiceId,isSelected){var choiceIds=result.userSelectedChoices.filter(function(c){return c!==choiceId;});if(isSelected){choiceIds.push(choiceId);}onChange(choiceIds);}};var SingleChoiceQuestionInput=function SingleChoiceQuestionInput(_a){var question=_a.question,onChange=_a.onChange,result=_a.result;var getTranslation=useContext(PollTranslationContext).getTranslation;return jsx$1(ChoiceInput,{isResultMode:result.showResults,selectedKey:result.userSelectedChoices[0],onChange:function(_,option){return onChange(option.key);},options:question.choices.map(function(c){return {key:c.choiceId,choiceId:c.choiceId,text:getTranslation(c.choiceId),disabled:result.showResults||c.disabled,onRenderLabel:function(_){return jsx$1(SingleChoiceLabel,{choice:c,result:result},void 0);}};})},void 0);};var ChoiceLabel=function ChoiceLabel(_a){var choice=_a.choice,result=_a.result,className=_a.className;var getTranslation=useContext(PollTranslationContext).getTranslation;var choiceText=getTranslation(choice.choiceId);return jsxs(ChoiceLabelHost,__assign({isResultMode:result.showResults,className:className,"data-choice-id":choice.choiceId,"data-choice-text":choiceText},{children:[choiceText,choice.description&&jsx$1(ChoiceLabelSecondaryText,__assign({"data-choice-secondary-text":true},{children:choice.description}),void 0),result.showResults&&jsx$1(ChoiceResult,{result:result,choiceId:choice.choiceId},void 0)]}),void 0);};var ChoiceResult=function ChoiceResult(_a){var choiceId=_a.choiceId,result=_a.result;var numberResult=result.choiceResults[choiceId]||0;var percent=numberResult/result.totalFeedbackCount;var palette=useContext(ThemeContext$1).theme.palette;return jsxs(ChoiceResultHost,__assign({"data-choice-result":numberResult},{children:[jsx$1(Bar,{percentComplete:percent,barHeight:10,styles:{progressBar:{backgroundColor:palette.accent}}},void 0),jsx$1("span",{children:jsx$1(FormattedNumber,{value:numberResult},void 0)},void 0)]}),void 0);};var ChoiceResultHost=_styled.div.withConfig({displayName:"PollUserInput__ChoiceResultHost",componentId:"sc-eeg1mx-0"})(templateObject_1$1k||(templateObject_1$1k=__makeTemplateObject(["\n display: flex;\n align-items: center;\n\n > span {\n padding-left: 10px;\n min-width: 44px;\n text-align: right;\n box-sizing: border-box;\n }\n"],["\n display: flex;\n align-items: center;\n\n > span {\n padding-left: 10px;\n min-width: 44px;\n text-align: right;\n box-sizing: border-box;\n }\n"])));var Bar=_styled(ProgressIndicator).withConfig({displayName:"PollUserInput__Bar",componentId:"sc-eeg1mx-1"})(templateObject_2$M||(templateObject_2$M=__makeTemplateObject(["\n flex: 1 0 auto;\n"],["\n flex: 1 0 auto;\n"])));var QuestionText=_styled.div.withConfig({displayName:"PollUserInput__QuestionText",componentId:"sc-eeg1mx-2"})(templateObject_3$w||(templateObject_3$w=__makeTemplateObject(["\n font-weight: bold;\n"],["\n font-weight: bold;\n"])));var QuestionInputItem=_styled(QuestionInput).withConfig({displayName:"PollUserInput__QuestionInputItem",componentId:"sc-eeg1mx-3"})(templateObject_4$l||(templateObject_4$l=__makeTemplateObject(["\n margin-bottom: ","px;\n"],["\n margin-bottom: ","px;\n"])),spacingL);var ChoiceLabelHost=_styled.span.withConfig({displayName:"PollUserInput__ChoiceLabelHost",componentId:"sc-eeg1mx-4"})(templateObject_5$k||(templateObject_5$k=__makeTemplateObject(["\n display: inline-block;\n ","\n ","\n"],["\n display: inline-block;\n ","\n ","\n"])),function(p){return p.isResultMode&&'max-width: 400px;';},function(p){return p.isResultMode&&'width: 100%;';});var ChoiceLabelSecondaryText=_styled.div.withConfig({displayName:"PollUserInput__ChoiceLabelSecondaryText",componentId:"sc-eeg1mx-5"})(templateObject_6$d||(templateObject_6$d=__makeTemplateObject(["\n opacity: 0.75;\n"],["\n opacity: 0.75;\n"])));var SingleChoiceLabel=_styled(ChoiceLabel).withConfig({displayName:"PollUserInput__SingleChoiceLabel",componentId:"sc-eeg1mx-6"})(templateObject_7$8||(templateObject_7$8=__makeTemplateObject(["\n padding-left: 30px;\n"],["\n padding-left: 30px;\n"])));var MultiChoiceLabel=_styled(ChoiceLabel).withConfig({displayName:"PollUserInput__MultiChoiceLabel",componentId:"sc-eeg1mx-7"})(templateObject_8$7||(templateObject_8$7=__makeTemplateObject(["\n padding-left: 5px;\n"],["\n padding-left: 5px;\n"])));var ChoiceInput=_styled(ChoiceGroup).withConfig({displayName:"PollUserInput__ChoiceInput",componentId:"sc-eeg1mx-8"})(templateObject_9$6||(templateObject_9$6=__makeTemplateObject(["\n .ms-ChoiceField-field,\n .ms-ChoiceField-wrapper {\n position: relative;\n flex: 1 1 auto;\n display: flex;\n }\n"],["\n .ms-ChoiceField-field,\n .ms-ChoiceField-wrapper {\n position: relative;\n flex: 1 1 auto;\n display: flex;\n }\n"])));var StyledCheckbox$2=_styled(Checkbox).withConfig({displayName:"PollUserInput__StyledCheckbox",componentId:"sc-eeg1mx-9"})(templateObject_10$5||(templateObject_10$5=__makeTemplateObject(["\n margin-top: 15px;\n .ms-Checkbox-label {\n display: flex;\n align-items: ",";\n flex: 1 1 auto;\n }\n"],["\n margin-top: 15px;\n .ms-Checkbox-label {\n display: flex;\n align-items: ",";\n flex: 1 1 auto;\n }\n"])),function(p){return p.isResultMode?'flex-start':'center';});var templateObject_1$1k,templateObject_2$M,templateObject_3$w,templateObject_4$l,templateObject_5$k,templateObject_6$d,templateObject_7$8,templateObject_8$7,templateObject_9$6,templateObject_10$5;var PollDisplay=function PollDisplay(_a){var children=_a.children,className=_a.className;var formatMessage=useIntl().formatMessage;return jsxs("section",__assign({className:className,"aria-label":formatMessage({id:'Polls.sectionLabel'}),"data-consumer-poll":true},{children:[jsx$1(PollUserInput,{},void 0),children]}),void 0);};var PollUserContextProvider=function PollUserContextProvider(_a){var _b;var item=_a.item,onBehalfOfUpn=_a.onBehalfOfUpn,resourceType=_a.resourceType,language=_a.language,getAdditionalQuestions=_a.getAdditionalQuestions,getAdditionalUserAnswers=_a.getAdditionalUserAnswers,getPollResults=_a.getPollResults,showResult=_a.showResult,children=_a.children;var poll=item.poll,itemId=item.id;var getFeedback=useFeedbackApi().getFeedback;var _c=useState$2(getAdditionalQuestions===null||getAdditionalQuestions===void 0?void 0:getAdditionalQuestions(null)),additionalQuestions=_c[0],setAdditionalQuestions=_c[1];var showError=useNotificationContext().showError;var questionDefinitions=(_b=poll===null||poll===void 0?void 0:poll.questions)!==null&&_b!==void 0?_b:[];var _d=usePromise$2(loadUserAnswers),userAnswers=_d[0],isLoading=_d[1],setUserAnswers=_d[3];var _e=useState$2([]),unsavedQuestionsIds=_e[0],setUnsavedQuestionsIds=_e[1];var _f=usePromise$2(function(){return getPollResults(itemId);},{answers:[]},[itemId]),pollResult=_f[0],isLoadingPollResult=_f[1],fetchPollResults=_f[5];useEffect$1(function(){var _a;if(isLoadingPollResult||!((_a=pollResult===null||pollResult===void 0?void 0:pollResult.answers)===null||_a===void 0?void 0:_a.length)){return;}getAdditionalQuestions&&setAdditionalQuestions(getAdditionalQuestions(pollResult));// eslint-disable-next-line react-hooks/exhaustive-deps
122301
122298
  },[pollResult,isLoadingPollResult]);// If the pollResult and the choice input is rendered with showResults
122302
122299
  // at the same time, we miss the animation of the bars when they fill up
122303
122300
  // Delay the pollResult a bit so the users sees the animation
122304
122301
  var delayedFetchPollResult=useDebouncedCallback(fetchPollResults,500)[0];if(isLoading){return null;}var actualQuestions=__spreadArray(__spreadArray([],questionDefinitions),(additionalQuestions===null||additionalQuestions===void 0?void 0:additionalQuestions.questions)||[]);var hasMissingAnswers=!!userAnswers.find(function(a){return a.choiceIds.length===0;});var hasMissingUnsavedAnswer=unsavedQuestionsIds.length>0||userAnswers.some(function(a){return !a.choiceIds.length;});showResult=(showResult||!hasMissingUnsavedAnswer)&&actualQuestions.length>0;return jsx$1(PollUserContext.Provider,__assign({value:{item:item,resourceType:resourceType,questions:actualQuestions,answers:userAnswers,addAnswer:handleAddAnswer,setAnswers:setUserAnswers,pollResult:pollResult,isLoadingPollResult:isLoadingPollResult,showResult:showResult,hasMissingAnswers:hasMissingAnswers,hasMissingUnsavedAnswer:hasMissingUnsavedAnswer,submitPoll:handleSubmitPoll,getQuestionResult:getQuestionResult,reset:reset,onBehalfOfUpn:onBehalfOfUpn,fetchPollResults:fetchPollResults}},{children:jsx$1(PollTranslationContextProvider,__assign({contents:item.contents,language:language,additionalTranslations:additionalQuestions===null||additionalQuestions===void 0?void 0:additionalQuestions.translations},{children:children}),void 0)}),void 0);function handleAddAnswer(questionId,selectedChoiceIds){setUnsavedQuestionsIds(function(a){return __spreadArray(__spreadArray([],a),[questionId]);});setUserAnswers(function(answers){return answers.map(function(a){return a.questionId===questionId?__assign(__assign({},a),{choiceIds:__spreadArray([],selectedChoiceIds)}):a;});});}function handleSubmitPoll(savePollAnswers){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:_a.trys.push([0,2,,3]);setUnsavedQuestionsIds([]);return [4/*yield*/,savePollAnswers()];case 1:_a.sent();delayedFetchPollResult();return [3/*break*/,3];case 2:_a.sent();showError('Generic.error');return [3/*break*/,3];case 3:return [2/*return*/];}});});}function reset(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){setUnsavedQuestionsIds([]);setUserAnswers(createUsersAnswersFromFeedback({records:[]}));fetchPollResults();return [2/*return*/];});});}function loadUserAnswers(){return __awaiter(this,void 0,void 0,function(){var feedback,error_2;return __generator(this,function(_a){switch(_a.label){case 0:_a.trys.push([0,2,,3]);return [4/*yield*/,getFeedback(resourceType,itemId,onBehalfOfUpn)];case 1:feedback=_a.sent();return [3/*break*/,3];case 2:error_2=_a.sent();// if we got a 404, the user doesn't exist, in this case we simply treat the feedback as it is not set yet
122305
- if((error_2===null||error_2===void 0?void 0:error_2.response.statusCode)!==404){throw error_2;}feedback={records:[]};return [3/*break*/,3];case 3:return [2/*return*/,createUsersAnswersFromFeedback(feedback)];}});});}function createUsersAnswersFromFeedback(feedback){var pollFeedback=feedback.records.find(function(r){return r.type==='poll';});var answers=pollFeedback?pollFeedback.answers:[];return questionDefinitions.map(function(q){return {questionId:q.questionId,choiceIds:answers.filter(function(a){return a.questionId===q.questionId;}).map(function(a){return a.choiceIds;})[0]||[]};}).concat(getAdditionalUserAnswers?getAdditionalUserAnswers(feedback.records)||[]:[]);}function getQuestionResult(questionId){var userSelectedChoices=userAnswers.filter(function(a){return a.questionId===questionId;}).map(function(a){return a.choiceIds;})[0]||[];return {showResults:showResult||unsavedQuestionsIds.every(function(id){return id!==questionId;})&&userSelectedChoices.length>0,userSelectedChoices:userSelectedChoices,totalFeedbackCount:pollResult.totalFeedbackCount,choiceResults:pollResult.answers.filter(function(a){return a.questionId===questionId;}).reduce(function(result,answer){return __spreadArray(__spreadArray([],result),answer.choices);},[]).reduce(function(result,next){var _a;return __assign(__assign({},result),(_a={},_a[next.choiceId]=next.count,_a));},{})};}};var DetailViewSectionPadding=css$2(templateObject_1$1l||(templateObject_1$1l=__makeTemplateObject(["\n padding: ","px ","px 0 ","px;\n\n @media (min-width: ","px) {\n padding: 0 ","px 0 ","px;\n }\n"],["\n padding: ","px ","px 0 ","px;\n\n @media (min-width: ","px) {\n padding: 0 ","px 0 ","px;\n }\n"])),spacingXs,spacingM,spacingM,minScreenSize.small,spacingXl,spacingXl);var templateObject_1$1l;var PollResultFeedbackCount=function PollResultFeedbackCount(){var _a=useContext(PollUserContext),showResult=_a.showResult,pollResult=_a.pollResult;if(!showResult){return null;}return jsx$1("div",__assign({className:"ms-fontColor-neutralTertiary","data-poll-result-total-count":pollResult.totalFeedbackCount},{children:jsx$1(FormattedMessage$1,{id:"Polls.editor.totalFeedbackCount",values:{count:pollResult.totalFeedbackCount},tagName:"span"},void 0)}),void 0);};var DetailViewPoll=function DetailViewPoll(){var _a=useDetailViewContext(),item=_a.item,contentLanguage=_a.contentLanguage,resourceType=_a.resourceType,isEditorPreview=_a.isEditorPreview;var features=useFeatures();var getPollResult=useFeedbackApi().getPollResult;if(!features.polls||item==null||item.poll==null||item.poll.questions==null||item.poll.questions.length===0){return null;}return jsx$1(PollUserContextProvider,__assign({item:item,resourceType:resourceType,language:contentLanguage,getPollResults:function(itemId){return getPollResult(resourceType,itemId);}},{children:jsxs(StyledPollDisplay$1,{children:[jsx$1(PollResultFeedbackCount,{},void 0),jsx$1(DetailViewPollsSubmitButton,{isReadOnly:isEditorPreview},void 0),jsx$1(StyledPollResultExport,{},void 0)]},void 0)}),void 0);};var StyledPollResultExport=_styled(DetailViewPollExportButton).withConfig({displayName:"DetailViewPoll__StyledPollResultExport",componentId:"sc-gvqgh8-0"})(templateObject_1$1k||(templateObject_1$1k=__makeTemplateObject(["\n margin-top: ","px;\n"],["\n margin-top: ","px;\n"])),spacingS);var StyledPollDisplay$1=_styled(PollDisplay).withConfig({displayName:"DetailViewPoll__StyledPollDisplay",componentId:"sc-gvqgh8-1"})(templateObject_2$N||(templateObject_2$N=__makeTemplateObject(["\n ",";\n margin-bottom: ","px;\n\n max-width: 500px;\n"],["\n ",";\n margin-bottom: ","px;\n\n max-width: 500px;\n"])),DetailViewSectionPadding,spacingL);var templateObject_1$1k,templateObject_2$N;var EventDetailViewResponseExportButton=function EventDetailViewResponseExportButton(_a){var className=_a.className;var features=useFeatures();if(!features.events){return null;}return jsx$1(DetailViewCsvExportButton,{className:className,path:"feedback/registration/result/export",stringResource:"Events.registration.exportResultsAsCsv"},void 0);};var FeedbackItemType;(function(FeedbackItemType){FeedbackItemType["comment"]="comment";FeedbackItemType["like"]="like";FeedbackItemType["confirm"]="confirm";FeedbackItemType["poll"]="poll";FeedbackItemType["eventRegistration"]="eventRegistration";})(FeedbackItemType||(FeedbackItemType={}));var EventRegistrationContextProvider=function EventRegistrationContextProvider(_a){var _b;var onBehalfOfUpn=_a.onBehalfOfUpn,children=_a.children;var formatMessage=useIntl().formatMessage;var features=useFeatures();var _c=useDetailViewContext(),item=_c.item,contentLanguage=_c.contentLanguage;var getEventRegistrationResults=useEventRegistrationApi().getEventRegistrationResults;if(!features.events||item==null){return null;}var locationQuestionId=getLocationQuestionId(item);var isCancelled=(_b=item.cancelInformation)===null||_b===void 0?void 0:_b.isCancelled;return jsx$1(PollUserContextProvider,__assign({item:item,onBehalfOfUpn:onBehalfOfUpn,resourceType:ItemResourceTypes.Events,language:contentLanguage,getAdditionalQuestions:function(result){return getAdditionalQuestions(result);},getAdditionalUserAnswers:extractLocationAnswers,getPollResults:getRegistrationResult,showResult:!!isCancelled},{children:children}),void 0);function getAdditionalQuestions(result){var _a=getLocationPollDefinitions(item,formatMessage,result,!!onBehalfOfUpn),question=_a.question,translations=_a.translations;return {questions:question?[question]:null,translations:translations};}function extractLocationAnswers(records){if(!item.locations||item.locations.length<2){return null;}var eventResponse=records.find(function(r){return r.type===FeedbackItemType.eventRegistration;});return [{questionId:locationQuestionId,choiceIds:eventResponse&&eventResponse.locationId?[eventResponse.locationId]:[]}];}function getRegistrationResult(itemId){return __awaiter(this,void 0,void 0,function(){var result;return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,getEventRegistrationResults(itemId)];case 1:result=_a.sent();return [2/*return*/,{totalFeedbackCount:result.totalFeedbackCount,answers:result.answers.concat([{questionId:locationQuestionId,choices:result.locationAnswers.map(function(l){return {choiceId:l.locationId,count:l.count};})}])}];}});});}};var EventDetailViewUserRegistration=function EventDetailViewUserRegistration(_a){var className=_a.className,hideInfoMessage=_a.hideInfoMessage;var pollUserContext=useContext(PollUserContext);var getFeedback=useFeedbackApi().getFeedback;var item=pollUserContext.item;var isLoadingPollResult=pollUserContext.isLoadingPollResult,pollResult=pollUserContext.pollResult,onBehalfOfUpn=pollUserContext.onBehalfOfUpn;var _b=usePromise$2(getEventResponse,item.userResponse,[item]),eventResponse=_b[0],isLoading=_b[1],setEventResponse=_b[3];// eslint-disable-next-line react-hooks/exhaustive-deps
122306
- var seatsResult=useMemo(getSeatsLeft,[isLoading,isLoadingPollResult,pollResult,item.id]);return jsx$1(EventUserRegistrationContext.Provider,__assign({value:__assign(__assign({},pollUserContext),{hasPollContext:true,eventResponse:eventResponse,setEventResponse:setEventResponse,isLoading:isLoadingPollResult||isLoading,seatsInfo:seatsResult})},{children:jsx$1(EventUserRegistration,{className:className,hideInfoMessage:hideInfoMessage},void 0)}),void 0);function getEventResponse(){return __awaiter(this,void 0,void 0,function(){var feedback,eventRecord;return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,getFeedback(ItemResourceTypes.Events,item.id,onBehalfOfUpn)];case 1:feedback=_a.sent();eventRecord=feedback&&feedback.records.find(function(r){return r.type==='eventRegistration';});return [2/*return*/,eventRecord?eventRecord.eventResponse:EventResponse.NotSet];}});});}function getSeatsLeft(){var _a,_b,_c,_d;if(isLoading||!item.registrationSettings||!item.registrationSettings.enabled||((_a=item.cancelInformation)===null||_a===void 0?void 0:_a.isCancelled)||!((_b=pollResult===null||pollResult===void 0?void 0:pollResult.answers)===null||_b===void 0?void 0:_b.length)||isLoadingPollResult){return {hasAnySeatsLeft:true};}var locationsWithSeats=item.locations.filter(function(l){return l.maxNumberOfSeats>0;});var hasLocationsWithoutSeats=locationsWithSeats.length!==item.locations.length;if(!locationsWithSeats.length||hasLocationsWithoutSeats){return {hasAnySeatsLeft:true};}var locationAnswers=(_d=(_c=pollResult.answers.find(function(a){return a.questionId===getLocationQuestionId(item);}))===null||_c===void 0?void 0:_c.choices)===null||_d===void 0?void 0:_d.reduce(function(prev,curr){prev[curr.choiceId]=curr.count;return prev;},{});var locationsWithSeatsLeft=locationsWithSeats.map(function(l){return __assign(__assign({},l),{seatsLeft:Math.max(l.maxNumberOfSeats-(locationAnswers[l.locationId]||0),0)});});return {hasAnySeatsLeft:locationsWithSeatsLeft.some(function(l){return l.seatsLeft>0;}),locations:locationsWithSeatsLeft};}};var EventRegistrationRegisterSomeoneElseDialog=function EventRegistrationRegisterSomeoneElseDialog(_a){var show=_a.show,onDismiss=_a.onDismiss,onUpdate=_a.onUpdate;var formatMessage=useIntl().formatMessage;var user=useCurrentUser();var features=useFeatures();var _b=useState$2(),onBehalfOfUser=_b[0],setOnBehalfOfUser=_b[1];var item=useDetailViewContext().item;var isGroupAdmin=hasMinRoleInAllGroups(GroupRoles.Admin,user,item);useListener(EventResponseTriggerAction.type,function(action){if(action.itemId!==item.id){return false;}onUpdate({upn:onBehalfOfUser.userPrincipalName,displayName:onBehalfOfUser.displayName,locationId:action.locationId},action.response);onDismiss();return true;},[item.id,onBehalfOfUser===null||onBehalfOfUser===void 0?void 0:onBehalfOfUser.userPrincipalName]);return jsx$1(MobileFullHeightDialog,__assign({hidden:!show,modalProps:{isBlocking:true,className:'dialog-register-user'},dialogContentProps:{type:DialogType.close,title:formatMessage({id:'Events.registration.registerSomeoneElse.title'})},onDismiss:onDismiss},{children:jsxs(Host$v,__assign({className:"dialog-content-host"},{children:[jsx$1(DialogGlobalStyle$2,{},void 0),jsx$1("label",__assign({htmlFor:"someoneElse-peoplePicker"},{children:jsx$1(FormattedMessage$1,{id:"Events.registration.registerSomeoneElse.peoplePickerLabel"},void 0)}),void 0),jsx$1(StyledPeoplePicker,{accountType:AccountType.User,allowMailItems:isGroupAdmin&&features.userInvitation,localOnly:!isGroupAdmin,includePendingInvitationUsers:true,includePendingRegistrationUsers:true,selectionMode:SelectionMode.single,selectedItems:onBehalfOfUser?[onBehalfOfUser]:[],onChange:function(accounts){return setOnBehalfOfUser(accounts[0]);},placeholderStringResourceKey:"Events.registration.registerSomeoneElse.peoplePickerPlaceholder",excludedItems:[user],inputId:"someoneElse-peoplePicker"},void 0),onBehalfOfUser&&jsxs(EventRegistrationContextProvider,__assign({onBehalfOfUpn:onBehalfOfUser.userPrincipalName},{children:[jsxs(DialogMainContent,__assign({isScrollable:!env.isAnyMobileApp},{children:[!(onBehalfOfUser===null||onBehalfOfUser===void 0?void 0:onBehalfOfUser.id)&&jsx$1(InvitationInfoMessage,{subscriptionName:getSubscriptionName(user.subscription)},void 0),jsx$1(StyledPollDisplay,{},void 0)]}),void 0),jsx$1(DialogFooter,{children:jsxs(Buttons,{children:[jsx$1(CancelButton,{onClick:onDismiss},void 0),jsx$1(EventDetailViewUserRegistration,{hideInfoMessage:true},void 0)]},void 0)},void 0)]}),onBehalfOfUser.userPrincipalName)]}),void 0)}),void 0);};var Host$v=_styled.div.withConfig({displayName:"EventRegistrationRegisterSomeoneElseDialog__Host",componentId:"sc-1rziepe-0"})(templateObject_1$1j||(templateObject_1$1j=__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n\n @media (min-width: ","px) {\n width: 400px;\n }\n\n .ms-Dialog-action {\n display: block;\n margin: 0;\n }\n"],["\n display: flex;\n flex-direction: column;\n\n @media (min-width: ","px) {\n width: 400px;\n }\n\n .ms-Dialog-action {\n display: block;\n margin: 0;\n }\n"])),minScreenSize.small);var Buttons=_styled.div.withConfig({displayName:"EventRegistrationRegisterSomeoneElseDialog__Buttons",componentId:"sc-1rziepe-1"})(templateObject_2$M||(templateObject_2$M=__makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n align-items: flex-end;\n margin-right: 4px; /* buttons alignment on the right */\n"],["\n display: flex;\n justify-content: space-between;\n align-items: flex-end;\n margin-right: 4px; /* buttons alignment on the right */\n"])));var StyledPeoplePicker=_styled(PeoplePicker).withConfig({displayName:"EventRegistrationRegisterSomeoneElseDialog__StyledPeoplePicker",componentId:"sc-1rziepe-2"})(templateObject_3$x||(templateObject_3$x=__makeTemplateObject(["\n margin: ","px 0 ","px 0;\n\n .ms-BasePicker-text {\n padding: 0 !important;\n }\n"],["\n margin: ","px 0 ","px 0;\n\n .ms-BasePicker-text {\n padding: 0 !important;\n }\n"])),spacingS,spacingM);var DialogMainContent=_styled.div.withConfig({displayName:"EventRegistrationRegisterSomeoneElseDialog__DialogMainContent",componentId:"sc-1rziepe-3"})(templateObject_5$l||(templateObject_5$l=__makeTemplateObject(["\n ","\n margin-bottom: auto;\n"],["\n ","\n margin-bottom: auto;\n"])),function(p){return p.isScrollable&&css$2(templateObject_4$m||(templateObject_4$m=__makeTemplateObject(["\n max-height: 300px;\n overflow: auto;\n "],["\n max-height: 300px;\n overflow: auto;\n "])));});var StyledPollDisplay=_styled(PollDisplay).withConfig({displayName:"EventRegistrationRegisterSomeoneElseDialog__StyledPollDisplay",componentId:"sc-1rziepe-4"})(templateObject_6$d||(templateObject_6$d=__makeTemplateObject(["\n max-width: calc(100% - 10px);\n padding-left: 4px; // needed for the focus indicator\n"],["\n max-width: calc(100% - 10px);\n padding-left: 4px; // needed for the focus indicator\n"])));var CancelButton=function CancelButton(_a){var onClick=_a.onClick;return jsx$1(StyledCancelButton,__assign({onClick:onClick},{children:jsx$1(FormattedMessage$1,{id:"Generic.Cancel"},void 0)}),void 0);};var InvitationInfoMessage=function InvitationInfoMessage(_a){var subscriptionName=_a.subscriptionName;return jsxs(InfoMessageHost,{children:[jsx$1(InfoIcon,{iconName:"info"},void 0),jsx$1(FormattedMessage$1,{id:"Events.registration.registerSomeoneElse.userWillBeInvited",values:{subscriptionName:subscriptionName}},void 0)]},void 0);};var InfoMessageHost=_styled.div.withConfig({displayName:"EventRegistrationRegisterSomeoneElseDialog__InfoMessageHost",componentId:"sc-1rziepe-5"})(templateObject_7$8||(templateObject_7$8=__makeTemplateObject(["\n display: flex;\n align-items: center;\n padding-bottom: ","px;\n"],["\n display: flex;\n align-items: center;\n padding-bottom: ","px;\n"])),spacingM);var InfoIcon=_styled(Icon).withConfig({displayName:"EventRegistrationRegisterSomeoneElseDialog__InfoIcon",componentId:"sc-1rziepe-6"})(templateObject_8$7||(templateObject_8$7=__makeTemplateObject(["\n padding-right: ","px;\n"],["\n padding-right: ","px;\n"])),spacingS);var StyledCancelButton=_styled(DefaultButton).withConfig({displayName:"EventRegistrationRegisterSomeoneElseDialog__StyledCancelButton",componentId:"sc-1rziepe-7"})(templateObject_9$5||(templateObject_9$5=__makeTemplateObject(["\n && {\n margin-right: ","px;\n }\n"],["\n && {\n margin-right: ","px;\n }\n"])),spacingM);var DialogGlobalStyle$2=createGlobalStyle(templateObject_10$4||(templateObject_10$4=__makeTemplateObject(["\n .dialog-register-user {\n .ms-Overlay {\n background-color: transparent !important;\n }\n\n .ms-Dialog-main {\n box-shadow: none !important;\n\n @media (max-width: ","px) {\n width: 100% !important;\n }\n }\n\n .dialog-content-host {\n min-height: 466px;\n }\n }\n"],["\n .dialog-register-user {\n .ms-Overlay {\n background-color: transparent !important;\n }\n\n .ms-Dialog-main {\n box-shadow: none !important;\n\n @media (max-width: ","px) {\n width: 100% !important;\n }\n }\n\n .dialog-content-host {\n min-height: 466px;\n }\n }\n"])),maxScreenSize.small);var templateObject_1$1j,templateObject_2$M,templateObject_3$x,templateObject_4$m,templateObject_5$l,templateObject_6$d,templateObject_7$8,templateObject_8$7,templateObject_9$5,templateObject_10$4;var EventRegistrationRegisterSomeoneElseButton=function EventRegistrationRegisterSomeoneElseButton(_a){var item=_a.item,onRegister=_a.onRegister,onDeregister=_a.onDeregister;var user=useCurrentUser();var _b=useState$2(false),showDialog=_b[0],setShowDialog=_b[1];if(!hasMinRoleInAllGroups(GroupRoles.Author,user,item)){return null;}return jsxs(Fragment,{children:[jsx$1(StyledButton$1,__assign({iconProps:{iconName:'AddFriend'},onClick:function(){return setShowDialog(true);}},{children:jsx$1(FormattedMessage$1,{id:"Events.registration.registerSomeoneElse.title"},void 0)}),void 0),showDialog&&jsx$1(EventRegistrationRegisterSomeoneElseDialog,{onDismiss:handleDismiss,onUpdate:handleUpdate,show:showDialog},void 0)]},void 0);function handleDismiss(){setShowDialog(false);}function handleUpdate(participant,response){if(response===EventResponse.Registered){onRegister===null||onRegister===void 0?void 0:onRegister(participant);}else {onDeregister===null||onDeregister===void 0?void 0:onDeregister(participant);}}};var StyledButton$1=_styled(ActionButton).withConfig({displayName:"EventRegistrationRegisterSomeoneElseButton__StyledButton",componentId:"sc-mgwolr-0"})(templateObject_1$1i||(templateObject_1$1i=__makeTemplateObject(["\n && {\n height: auto;\n padding: 0;\n margin-bottom: ","px;\n border: 0;\n }\n"],["\n && {\n height: auto;\n padding: 0;\n margin-bottom: ","px;\n border: 0;\n }\n"])),spacingS);var templateObject_1$1i;var EventRegistrationDeregisterPersonButton=function EventRegistrationDeregisterPersonButton(_a){var item=_a.item,participant=_a.participant,onDeregistered=_a.onDeregistered;var user=useCurrentUserContext().user;var refreshUserDetails=useRefreshUserDetails();var setEventRegistration=useEventRegistrationApi().setEventRegistration;var showToast=useNotificationContext().showToast;var formatMessage=useIntl().formatMessage;var _b=useState$2(false),showDialog=_b[0],setShowDialog=_b[1];if(!hasMinRoleInAllGroups(GroupRoles.Author,user,item)){return null;}return jsxs("div",{children:[jsx$1(Tooltip,__assign({resourceKey:"Events.registration.deRegisterSomeoneElse.title",values:{name:participant.displayName}},{children:jsx$1(IconButton,{iconProps:{iconName:'Delete'},onClick:function(){return setShowDialog(true);},ariaLabel:formatMessage({id:'Events.registration.deRegisterSomeoneElse.title'},{name:participant.displayName})},void 0)}),void 0),showDialog&&jsx$1(ConfirmDialog,{showDialog:showDialog,titleResourceKey:"Events.registration.deRegisterSomeoneElse.confirmTitle",titleResourceValues:{name:participant.displayName},onConfirm:deRegister,onClose:function(){return setShowDialog(false);}},void 0)]},void 0);function deRegister(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:onDeregistered();return [4/*yield*/,setEventRegistration(item.id,EventResponse.NotSet,null,null,participant.upn)];case 1:_a.sent();refreshUserDetails();showToast('Events.registration.onBehalfOfDeregistrationSuccess',{mail:participant.displayName});return [2/*return*/];}});});}};var EventRegistrationParticipantsDialog=function EventRegistrationParticipantsDialog(_a){var numberOfParticipants=_a.numberOfParticipants,show=_a.show,onDismiss=_a.onDismiss;var formatMessage=useIntl().formatMessage;return jsx$1(MobileFullHeightDialog,__assign({hidden:!show,modalProps:{isBlocking:false,className:'dialog-event-participants'},dialogContentProps:{type:DialogType.close,title:formatMessage({id:'Events.registration.participants'},{count:numberOfParticipants})},onDismiss:onDismiss},{children:jsxs(Host$u,__assign({className:"dialog-content-host"},{children:[jsx$1(DialogGlobalStyle$1,{},void 0),jsx$1(ParticipantsList,{},void 0)]}),void 0)}),void 0);};var Host$u=_styled.div.withConfig({displayName:"EventRegistrationParticipantsDialog__Host",componentId:"sc-1biaauh-0"})(templateObject_1$1h||(templateObject_1$1h=__makeTemplateObject(["\n @media (min-width: ","px) {\n width: 400px;\n }\n"],["\n @media (min-width: ","px) {\n width: 400px;\n }\n"])),minScreenSize.small);var DialogGlobalStyle$1=createGlobalStyle(templateObject_2$L||(templateObject_2$L=__makeTemplateObject(["\n .dialog-event-participants {\n .ms-Dialog-main {\n @media (max-width: ","px) {\n width: 100% !important;\n }\n }\n\n .dialog-content-host {\n height: 466px;\n }\n}\n"],["\n .dialog-event-participants {\n .ms-Dialog-main {\n @media (max-width: ","px) {\n width: 100% !important;\n }\n }\n\n .dialog-content-host {\n height: 466px;\n }\n}\n"])),maxScreenSize.small);var ParticipantsList=function ParticipantsList(){var formatMessage=useIntl().formatMessage;var user=useCurrentUser();var getParticipants=useEventRegistrationApi().getParticipants;var textColors=useContext(ThemeContext$1).theme.textColors;var _a=useContext(PollUserContext),fetchPollResults=_a.fetchPollResults,publishableItem=_a.item;var item=publishableItem;var _b=usePromise$2(getSortedParticipants,[],[item.id]),unfilteredParticipants=_b[0],isLoading=_b[1],setParticipants=_b[3];var handleSearchDebounced=useDebouncedCallback(handleSearch,300)[0];var _c=useState$2(),filteredParticipants=_c[0],setFilteredParticipants=_c[1];var participants=filteredParticipants||unfilteredParticipants;return jsxs(ListHost,{children:[jsx$1(EventRegistrationRegisterSomeoneElseButton,{item:item,onDeregister:handleDeregister,onRegister:handleRegister},void 0),jsx$1(SearchArea,{children:jsx$1(StyledSearchBox$1,{placeholder:formatMessage({id:'Events.registration.participants.search.placeholder'}),disabled:isLoading,onChange:function(_,value){return handleSearchDebounced(unfilteredParticipants,value);},iconProps:{style:{color:textColors.default}}},void 0)},void 0),isLoading&&jsx$1(Spinner,{},void 0),jsx$1(ListContainer,__assign({isScrollable:!env.isAnyMobileApp},{children:participants.map(function(p){var showDeregisterButton=p.upn!==user.userPrincipalName;return jsxs(ListRow,{children:[jsx$1(PersonaCardWrapper,__assign({showDeregisterButton:showDeregisterButton},{children:jsx$1(StyledPersonaCard$4,__assign({upn:p.upn},{children:jsx$1(StyledAvatar$3,{upn:p.upn,text:p.displayName,secondaryText:p.location&&formatMessage({id:'Events.registration.participants.location'},{location:p.location})},void 0)}),void 0)}),void 0),showDeregisterButton&&jsx$1(EventRegistrationDeregisterPersonButton,{item:item,participant:p,onDeregistered:function(){return handleDeregister(p);}},void 0)]},p.upn);})}),void 0),!isLoading&&!participants.length&&jsx$1(FormattedMessage$1,{id:"Generic.noResultsFound"},void 0)]},void 0);function getSortedParticipants(){return __awaiter(this,void 0,void 0,function(){var numberOfLocations,locationsMap,participants;return __generator(this,function(_a){switch(_a.label){case 0:numberOfLocations=item===null||item===void 0?void 0:item.locations.length;locationsMap=getLocations();return [4/*yield*/,getParticipants(item.id)];case 1:participants=_a.sent()||[];return [2/*return*/,participants.map(function(p){return __assign(__assign({},p),{location:numberOfLocations>1?locationsMap[p.locationId]||'':''});}).sort(function(a,b){var locationCompare=(locationsMap[a.locationId]||'').localeCompare(locationsMap[b.locationId]||'');if(locationCompare!==0){return locationCompare;}return a.displayName.localeCompare(b.displayName);})];}});});}function getLocations(){var _a;return ((_a=item.locations)===null||_a===void 0?void 0:_a.reduce(function(prev,curr){prev[curr.locationId]=curr.name;return prev;},{}))||{};}function handleSearch(unfilteredParticipants,searchValue){if(!searchValue){setFilteredParticipants(null);return;}var filter=new RegExp(searchValue,'i');setFilteredParticipants(unfilteredParticipants.filter(function(p){return (p.displayName+"|"+p.upn+"|"+p.location).search(filter)>-1;}));}function handleDeregister(participant){setParticipants(function(ps){return ps.filter(function(p){return p.upn!==participant.upn;});});fetchPollResults();setFilteredParticipants(null);}function handleRegister(participant){setParticipants(function(ps){return ps.concat([__assign(__assign({},participant),{location:getLocations()[participant.locationId]||''})]);});fetchPollResults();setFilteredParticipants(null);}};var ListContainer=_styled.div.withConfig({displayName:"EventRegistrationParticipantsDialog__ListContainer",componentId:"sc-1biaauh-1"})(templateObject_4$l||(templateObject_4$l=__makeTemplateObject(["\n padding: 4px;\n\n ","\n"],["\n padding: 4px;\n\n ","\n"])),function(p){return p.isScrollable&&css$2(templateObject_3$w||(templateObject_3$w=__makeTemplateObject(["\n max-height: 382px;\n overflow: auto;\n "],["\n max-height: 382px;\n overflow: auto;\n "])));});var SearchArea=_styled.div.withConfig({displayName:"EventRegistrationParticipantsDialog__SearchArea",componentId:"sc-1biaauh-2"})(templateObject_5$k||(templateObject_5$k=__makeTemplateObject(["\n margin-bottom: ","px;\n display: flex;\n"],["\n margin-bottom: ","px;\n display: flex;\n"])),spacingM);var StyledSearchBox$1=_styled(SearchBox$1).withConfig({displayName:"EventRegistrationParticipantsDialog__StyledSearchBox",componentId:"sc-1biaauh-3"})(templateObject_6$c||(templateObject_6$c=__makeTemplateObject(["\n flex-grow: 1;\n"],["\n flex-grow: 1;\n"])));var ListRow=_styled.div.withConfig({displayName:"EventRegistrationParticipantsDialog__ListRow",componentId:"sc-1biaauh-4"})(templateObject_7$7||(templateObject_7$7=__makeTemplateObject(["\n display: flex;\n align-items: center;\n margin-bottom: ","px;\n"],["\n display: flex;\n align-items: center;\n margin-bottom: ","px;\n"])),spacingS);var PersonaCardWrapper=_styled.div.withConfig({displayName:"EventRegistrationParticipantsDialog__PersonaCardWrapper",componentId:"sc-1biaauh-5"})(templateObject_8$6||(templateObject_8$6=__makeTemplateObject(["\n width: calc(100% - ","px);\n"],["\n width: calc(100% - ","px);\n"])),function(p){return p.showDeregisterButton?32:0;});var StyledPersonaCard$4=_styled(PersonaCard).withConfig({displayName:"EventRegistrationParticipantsDialog__StyledPersonaCard",componentId:"sc-1biaauh-6"})(templateObject_9$4||(templateObject_9$4=__makeTemplateObject(["\n width: 100%;\n\n & > * {\n width: 100%;\n }\n"],["\n width: 100%;\n\n & > * {\n width: 100%;\n }\n"])));var StyledAvatar$3=_styled(Avatar).withConfig({displayName:"EventRegistrationParticipantsDialog__StyledAvatar",componentId:"sc-1biaauh-7"})(templateObject_10$3||(templateObject_10$3=__makeTemplateObject(["\n .ms-Persona-secondaryText {\n white-space: initial;\n }\n\n height: auto;\n\n > div:first-child {\n align-self: flex-start;\n }\n"],["\n .ms-Persona-secondaryText {\n white-space: initial;\n }\n\n height: auto;\n\n > div:first-child {\n align-self: flex-start;\n }\n"])));var ListHost=_styled.div.withConfig({displayName:"EventRegistrationParticipantsDialog__ListHost",componentId:"sc-1biaauh-8"})(templateObject_11$2$1||(templateObject_11$2$1=__makeTemplateObject([""],[""])));var templateObject_1$1h,templateObject_2$L,templateObject_3$w,templateObject_4$l,templateObject_5$k,templateObject_6$c,templateObject_7$7,templateObject_8$6,templateObject_9$4,templateObject_10$3,templateObject_11$2$1;var EventRegistrationParticipantsLink=function EventRegistrationParticipantsLink(){var _a;var user=useCurrentUser();var _b=useContext(PollUserContext),pollResult=_b.pollResult,publishableItem=_b.item;var item=publishableItem;var _c=useState$2(false),showParticipants=_c[0],setShowParticipants=_c[1];var palette=useContext(ThemeContext$1).theme.palette;if(user.isPublicUser||(pollResult===null||pollResult===void 0?void 0:pollResult.totalFeedbackCount)==null){return null;}var isUserAuthor=hasMinRoleInAllGroups(GroupRoles.Author,user,item);var canOpenParticipantsDialog=isUserAuthor||pollResult.totalFeedbackCount>0&&((_a=item.registrationSettings)===null||_a===void 0?void 0:_a.showParticipantsToEverybody);return jsxs("div",__assign({"data-poll-result-total-count":pollResult.totalFeedbackCount},{children:[!canOpenParticipantsDialog?jsx$1(NoParticipantsContainer,{children:jsx$1(FormattedMessage$1,{id:"Events.registration.participants.count",values:{count:pollResult.totalFeedbackCount}},void 0)},void 0):jsx$1(ParticipantsButton,__assign({onClick:function(){return setShowParticipants(true);},color:palette.accent},{children:jsx$1(FormattedMessage$1,{id:isUserAuthor?'Events.registration.participants.viewAndManage':'Events.registration.participants.count',values:{count:pollResult.totalFeedbackCount}},void 0)}),void 0),jsx$1(EventRegistrationParticipantsDialog,{numberOfParticipants:pollResult.totalFeedbackCount,show:showParticipants,onDismiss:function(){return setShowParticipants(false);}},void 0)]}),void 0);};var NoParticipantsContainer=_styled.div.withConfig({displayName:"EventRegistrationParticipantsLink__NoParticipantsContainer",componentId:"sc-44nkgi-0"})(templateObject_1$1g||(templateObject_1$1g=__makeTemplateObject(["\n color: ",";\n font-size: ","px;\n"],["\n color: ",";\n font-size: ","px;\n"])),function(p){return p.theme.palette.neutralTertiary;},fontSizeSmall);var ParticipantsButton=_styled(ActionButton).withConfig({displayName:"EventRegistrationParticipantsLink__ParticipantsButton",componentId:"sc-44nkgi-1"})(templateObject_2$K||(templateObject_2$K=__makeTemplateObject(["\n && {\n height: auto;\n padding: 0;\n font-size: ","px;\n }\n"],["\n && {\n height: auto;\n padding: 0;\n font-size: ","px;\n }\n"])),fontSizeSmall);var templateObject_1$1g,templateObject_2$K;var EventDetailViewRegistrationPoll=function EventDetailViewRegistrationPoll(){return jsx$1(EventRegistrationContextProvider,{children:jsxs(StyledPollDisplay$1,{children:[jsx$1(EventRegistrationParticipantsLink,{},void 0),jsx$1(StyledEventUserRegistration,{},void 0),jsx$1(StyledResponseExportButton,{},void 0)]},void 0)},void 0);};var StyledEventUserRegistration=_styled(EventDetailViewUserRegistration).withConfig({displayName:"EventDetailViewRegistrationPoll__StyledEventUserRegistration",componentId:"sc-1kxjndz-0"})(templateObject_1$1f||(templateObject_1$1f=__makeTemplateObject(["\n && {\n margin-top: ","px;\n }\n"],["\n && {\n margin-top: ","px;\n }\n"])),spacingS);var StyledResponseExportButton=_styled(EventDetailViewResponseExportButton).withConfig({displayName:"EventDetailViewRegistrationPoll__StyledResponseExportButton",componentId:"sc-1kxjndz-1"})(templateObject_2$J||(templateObject_2$J=__makeTemplateObject(["\n margin-top: ","px;\n"],["\n margin-top: ","px;\n"])),spacingS);var templateObject_1$1f,templateObject_2$J;var EventDetailViewRegistration=function EventDetailViewRegistration(){var item=useDetailViewContext().item;var isRegistrationEnabled=item.registrationSettings&&item.registrationSettings.enabled;if(isRegistrationEnabled){return jsx$1(EventDetailViewRegistrationPoll,{},void 0);}return jsx$1(DetailViewPoll,{},void 0);};var EventDetailViewCancelInformation=function EventDetailViewCancelInformation(){var _a=useDetailViewContext(),item=_a.item,contentLanguage=_a.contentLanguage;return jsx$1(EventCancelInformation,{item:item,language:contentLanguage},void 0);};var $$1$1=_export;var isArray$4=isArray$3;var nativeReverse$1=[].reverse;var test$3=[1,2];// `Array.prototype.reverse` method
122302
+ if((error_2===null||error_2===void 0?void 0:error_2.response.statusCode)!==404){throw error_2;}feedback={records:[]};return [3/*break*/,3];case 3:return [2/*return*/,createUsersAnswersFromFeedback(feedback)];}});});}function createUsersAnswersFromFeedback(feedback){var pollFeedback=feedback.records.find(function(r){return r.type==='poll';});var answers=pollFeedback?pollFeedback.answers:[];return questionDefinitions.map(function(q){return {questionId:q.questionId,choiceIds:answers.filter(function(a){return a.questionId===q.questionId;}).map(function(a){return a.choiceIds;})[0]||[]};}).concat(getAdditionalUserAnswers?getAdditionalUserAnswers(feedback.records)||[]:[]);}function getQuestionResult(questionId){var userSelectedChoices=userAnswers.filter(function(a){return a.questionId===questionId;}).map(function(a){return a.choiceIds;})[0]||[];return {showResults:showResult||unsavedQuestionsIds.every(function(id){return id!==questionId;})&&userSelectedChoices.length>0,userSelectedChoices:userSelectedChoices,totalFeedbackCount:pollResult.totalFeedbackCount,choiceResults:pollResult.answers.filter(function(a){return a.questionId===questionId;}).reduce(function(result,answer){return __spreadArray(__spreadArray([],result),answer.choices);},[]).reduce(function(result,next){var _a;return __assign(__assign({},result),(_a={},_a[next.choiceId]=next.count,_a));},{})};}};var DetailViewSectionPadding=css$2(templateObject_1$1j||(templateObject_1$1j=__makeTemplateObject(["\n padding: ","px ","px 0 ","px;\n\n @media (min-width: ","px) {\n padding: 0 ","px 0 ","px;\n }\n"],["\n padding: ","px ","px 0 ","px;\n\n @media (min-width: ","px) {\n padding: 0 ","px 0 ","px;\n }\n"])),spacingXs,spacingM,spacingM,minScreenSize.small,spacingXl,spacingXl);var templateObject_1$1j;var PollResultFeedbackCount=function PollResultFeedbackCount(){var _a=useContext(PollUserContext),showResult=_a.showResult,pollResult=_a.pollResult;if(!showResult){return null;}return jsx$1("div",__assign({className:"ms-fontColor-neutralTertiary","data-poll-result-total-count":pollResult.totalFeedbackCount},{children:jsx$1(FormattedMessage$1,{id:"Polls.editor.totalFeedbackCount",values:{count:pollResult.totalFeedbackCount},tagName:"span"},void 0)}),void 0);};var DetailViewPoll=function DetailViewPoll(){var _a=useDetailViewContext(),item=_a.item,contentLanguage=_a.contentLanguage,resourceType=_a.resourceType,isEditorPreview=_a.isEditorPreview;var features=useFeatures();var getPollResult=useFeedbackApi().getPollResult;if(!features.polls||item==null||item.poll==null||item.poll.questions==null||item.poll.questions.length===0){return null;}return jsx$1(PollUserContextProvider,__assign({item:item,resourceType:resourceType,language:contentLanguage,getPollResults:function(itemId){return getPollResult(resourceType,itemId);}},{children:jsxs(StyledPollDisplay$1,{children:[jsx$1(PollResultFeedbackCount,{},void 0),jsx$1(DetailViewPollsSubmitButton,{isReadOnly:isEditorPreview},void 0),jsx$1(StyledPollResultExport,{},void 0)]},void 0)}),void 0);};var StyledPollResultExport=_styled(DetailViewPollExportButton).withConfig({displayName:"DetailViewPoll__StyledPollResultExport",componentId:"sc-gvqgh8-0"})(templateObject_1$1i||(templateObject_1$1i=__makeTemplateObject(["\n margin-top: ","px;\n"],["\n margin-top: ","px;\n"])),spacingS);var StyledPollDisplay$1=_styled(PollDisplay).withConfig({displayName:"DetailViewPoll__StyledPollDisplay",componentId:"sc-gvqgh8-1"})(templateObject_2$L||(templateObject_2$L=__makeTemplateObject(["\n ",";\n margin-bottom: ","px;\n\n max-width: 500px;\n"],["\n ",";\n margin-bottom: ","px;\n\n max-width: 500px;\n"])),DetailViewSectionPadding,spacingL);var templateObject_1$1i,templateObject_2$L;var EventDetailViewResponseExportButton=function EventDetailViewResponseExportButton(_a){var className=_a.className;var features=useFeatures();if(!features.events){return null;}return jsx$1(DetailViewCsvExportButton,{className:className,path:"feedback/registration/result/export",stringResource:"Events.registration.exportResultsAsCsv"},void 0);};var FeedbackItemType;(function(FeedbackItemType){FeedbackItemType["comment"]="comment";FeedbackItemType["like"]="like";FeedbackItemType["confirm"]="confirm";FeedbackItemType["poll"]="poll";FeedbackItemType["eventRegistration"]="eventRegistration";})(FeedbackItemType||(FeedbackItemType={}));var EventRegistrationContextProvider=function EventRegistrationContextProvider(_a){var _b;var onBehalfOfUpn=_a.onBehalfOfUpn,children=_a.children;var formatMessage=useIntl().formatMessage;var features=useFeatures();var _c=useDetailViewContext(),item=_c.item,contentLanguage=_c.contentLanguage;var getEventRegistrationResults=useEventRegistrationApi().getEventRegistrationResults;if(!features.events||item==null){return null;}var locationQuestionId=getLocationQuestionId(item);var isCancelled=(_b=item.cancelInformation)===null||_b===void 0?void 0:_b.isCancelled;return jsx$1(PollUserContextProvider,__assign({item:item,onBehalfOfUpn:onBehalfOfUpn,resourceType:ItemResourceTypes.Events,language:contentLanguage,getAdditionalQuestions:function(result){return getAdditionalQuestions(result);},getAdditionalUserAnswers:extractLocationAnswers,getPollResults:getRegistrationResult,showResult:!!isCancelled},{children:children}),void 0);function getAdditionalQuestions(result){var _a=getLocationPollDefinitions(item,formatMessage,result,!!onBehalfOfUpn),question=_a.question,translations=_a.translations;return {questions:question?[question]:null,translations:translations};}function extractLocationAnswers(records){if(!item.locations||item.locations.length<2){return null;}var eventResponse=records.find(function(r){return r.type===FeedbackItemType.eventRegistration;});return [{questionId:locationQuestionId,choiceIds:eventResponse&&eventResponse.locationId?[eventResponse.locationId]:[]}];}function getRegistrationResult(itemId){return __awaiter(this,void 0,void 0,function(){var result;return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,getEventRegistrationResults(itemId)];case 1:result=_a.sent();return [2/*return*/,{totalFeedbackCount:result.totalFeedbackCount,answers:result.answers.concat([{questionId:locationQuestionId,choices:result.locationAnswers.map(function(l){return {choiceId:l.locationId,count:l.count};})}])}];}});});}};var EventDetailViewUserRegistration=function EventDetailViewUserRegistration(_a){var className=_a.className,hideInfoMessage=_a.hideInfoMessage;var pollUserContext=useContext(PollUserContext);var getFeedback=useFeedbackApi().getFeedback;var item=pollUserContext.item;var isLoadingPollResult=pollUserContext.isLoadingPollResult,pollResult=pollUserContext.pollResult,onBehalfOfUpn=pollUserContext.onBehalfOfUpn;var _b=usePromise$2(getEventResponse,item.userResponse,[item]),eventResponse=_b[0],isLoading=_b[1],setEventResponse=_b[3];// eslint-disable-next-line react-hooks/exhaustive-deps
122303
+ var seatsResult=useMemo(getSeatsLeft,[isLoading,isLoadingPollResult,pollResult,item.id]);return jsx$1(EventUserRegistrationContext.Provider,__assign({value:__assign(__assign({},pollUserContext),{hasPollContext:true,eventResponse:eventResponse,setEventResponse:setEventResponse,isLoading:isLoadingPollResult||isLoading,seatsInfo:seatsResult})},{children:jsx$1(EventUserRegistration,{className:className,hideInfoMessage:hideInfoMessage},void 0)}),void 0);function getEventResponse(){return __awaiter(this,void 0,void 0,function(){var feedback,eventRecord;return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,getFeedback(ItemResourceTypes.Events,item.id,onBehalfOfUpn)];case 1:feedback=_a.sent();eventRecord=feedback&&feedback.records.find(function(r){return r.type==='eventRegistration';});return [2/*return*/,eventRecord?eventRecord.eventResponse:EventResponse.NotSet];}});});}function getSeatsLeft(){var _a,_b,_c,_d;if(isLoading||!item.registrationSettings||!item.registrationSettings.enabled||((_a=item.cancelInformation)===null||_a===void 0?void 0:_a.isCancelled)||!((_b=pollResult===null||pollResult===void 0?void 0:pollResult.answers)===null||_b===void 0?void 0:_b.length)||isLoadingPollResult){return {hasAnySeatsLeft:true};}var locationsWithSeats=item.locations.filter(function(l){return l.maxNumberOfSeats>0;});var hasLocationsWithoutSeats=locationsWithSeats.length!==item.locations.length;if(!locationsWithSeats.length||hasLocationsWithoutSeats){return {hasAnySeatsLeft:true};}var locationAnswers=(_d=(_c=pollResult.answers.find(function(a){return a.questionId===getLocationQuestionId(item);}))===null||_c===void 0?void 0:_c.choices)===null||_d===void 0?void 0:_d.reduce(function(prev,curr){prev[curr.choiceId]=curr.count;return prev;},{});var locationsWithSeatsLeft=locationsWithSeats.map(function(l){return __assign(__assign({},l),{seatsLeft:Math.max(l.maxNumberOfSeats-(locationAnswers[l.locationId]||0),0)});});return {hasAnySeatsLeft:locationsWithSeatsLeft.some(function(l){return l.seatsLeft>0;}),locations:locationsWithSeatsLeft};}};var EventRegistrationRegisterSomeoneElseDialog=function EventRegistrationRegisterSomeoneElseDialog(_a){var show=_a.show,onDismiss=_a.onDismiss,onUpdate=_a.onUpdate;var formatMessage=useIntl().formatMessage;var user=useCurrentUser();var features=useFeatures();var _b=useState$2(),onBehalfOfUser=_b[0],setOnBehalfOfUser=_b[1];var item=useDetailViewContext().item;var isGroupAdmin=hasMinRoleInAllGroups(GroupRoles.Admin,user,item);useListener(EventResponseTriggerAction.type,function(action){if(action.itemId!==item.id){return false;}onUpdate({upn:onBehalfOfUser.userPrincipalName,displayName:onBehalfOfUser.displayName,locationId:action.locationId},action.response);onDismiss();return true;},[item.id,onBehalfOfUser===null||onBehalfOfUser===void 0?void 0:onBehalfOfUser.userPrincipalName]);return jsx$1(MobileFullHeightDialog,__assign({hidden:!show,modalProps:{isBlocking:true,className:'dialog-register-user'},dialogContentProps:{type:DialogType.close,title:formatMessage({id:'Events.registration.registerSomeoneElse.title'})},onDismiss:onDismiss},{children:jsxs(Host$t,__assign({className:"dialog-content-host"},{children:[jsx$1(DialogGlobalStyle$2,{},void 0),jsx$1("label",__assign({htmlFor:"someoneElse-peoplePicker"},{children:jsx$1(FormattedMessage$1,{id:"Events.registration.registerSomeoneElse.peoplePickerLabel"},void 0)}),void 0),jsx$1(StyledPeoplePicker,{accountType:AccountType.User,allowMailItems:isGroupAdmin&&features.userInvitation,localOnly:!isGroupAdmin,includePendingInvitationUsers:true,includePendingRegistrationUsers:true,selectionMode:SelectionMode.single,selectedItems:onBehalfOfUser?[onBehalfOfUser]:[],onChange:function(accounts){return setOnBehalfOfUser(accounts[0]);},placeholderStringResourceKey:"Events.registration.registerSomeoneElse.peoplePickerPlaceholder",excludedItems:[user],inputId:"someoneElse-peoplePicker"},void 0),onBehalfOfUser&&jsxs(EventRegistrationContextProvider,__assign({onBehalfOfUpn:onBehalfOfUser.userPrincipalName},{children:[jsxs(DialogMainContent,__assign({isScrollable:!env.isAnyMobileApp},{children:[!(onBehalfOfUser===null||onBehalfOfUser===void 0?void 0:onBehalfOfUser.id)&&jsx$1(InvitationInfoMessage,{subscriptionName:getSubscriptionName(user.subscription)},void 0),jsx$1(StyledPollDisplay,{},void 0)]}),void 0),jsx$1(DialogFooter,{children:jsxs(Buttons,{children:[jsx$1(CancelButton,{onClick:onDismiss},void 0),jsx$1(EventDetailViewUserRegistration,{hideInfoMessage:true},void 0)]},void 0)},void 0)]}),onBehalfOfUser.userPrincipalName)]}),void 0)}),void 0);};var Host$t=_styled.div.withConfig({displayName:"EventRegistrationRegisterSomeoneElseDialog__Host",componentId:"sc-1rziepe-0"})(templateObject_1$1h||(templateObject_1$1h=__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n\n @media (min-width: ","px) {\n width: 400px;\n }\n\n .ms-Dialog-action {\n display: block;\n margin: 0;\n }\n"],["\n display: flex;\n flex-direction: column;\n\n @media (min-width: ","px) {\n width: 400px;\n }\n\n .ms-Dialog-action {\n display: block;\n margin: 0;\n }\n"])),minScreenSize.small);var Buttons=_styled.div.withConfig({displayName:"EventRegistrationRegisterSomeoneElseDialog__Buttons",componentId:"sc-1rziepe-1"})(templateObject_2$K||(templateObject_2$K=__makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n align-items: flex-end;\n margin-right: 4px; /* buttons alignment on the right */\n"],["\n display: flex;\n justify-content: space-between;\n align-items: flex-end;\n margin-right: 4px; /* buttons alignment on the right */\n"])));var StyledPeoplePicker=_styled(PeoplePicker).withConfig({displayName:"EventRegistrationRegisterSomeoneElseDialog__StyledPeoplePicker",componentId:"sc-1rziepe-2"})(templateObject_3$v||(templateObject_3$v=__makeTemplateObject(["\n margin: ","px 0 ","px 0;\n\n .ms-BasePicker-text {\n padding: 0 !important;\n }\n"],["\n margin: ","px 0 ","px 0;\n\n .ms-BasePicker-text {\n padding: 0 !important;\n }\n"])),spacingS,spacingM);var DialogMainContent=_styled.div.withConfig({displayName:"EventRegistrationRegisterSomeoneElseDialog__DialogMainContent",componentId:"sc-1rziepe-3"})(templateObject_5$j||(templateObject_5$j=__makeTemplateObject(["\n ","\n margin-bottom: auto;\n"],["\n ","\n margin-bottom: auto;\n"])),function(p){return p.isScrollable&&css$2(templateObject_4$k||(templateObject_4$k=__makeTemplateObject(["\n max-height: 300px;\n overflow: auto;\n "],["\n max-height: 300px;\n overflow: auto;\n "])));});var StyledPollDisplay=_styled(PollDisplay).withConfig({displayName:"EventRegistrationRegisterSomeoneElseDialog__StyledPollDisplay",componentId:"sc-1rziepe-4"})(templateObject_6$c||(templateObject_6$c=__makeTemplateObject(["\n max-width: calc(100% - 10px);\n padding-left: 4px; // needed for the focus indicator\n"],["\n max-width: calc(100% - 10px);\n padding-left: 4px; // needed for the focus indicator\n"])));var CancelButton=function CancelButton(_a){var onClick=_a.onClick;return jsx$1(StyledCancelButton,__assign({onClick:onClick},{children:jsx$1(FormattedMessage$1,{id:"Generic.Cancel"},void 0)}),void 0);};var InvitationInfoMessage=function InvitationInfoMessage(_a){var subscriptionName=_a.subscriptionName;return jsxs(InfoMessageHost,{children:[jsx$1(InfoIcon,{iconName:"info"},void 0),jsx$1(FormattedMessage$1,{id:"Events.registration.registerSomeoneElse.userWillBeInvited",values:{subscriptionName:subscriptionName}},void 0)]},void 0);};var InfoMessageHost=_styled.div.withConfig({displayName:"EventRegistrationRegisterSomeoneElseDialog__InfoMessageHost",componentId:"sc-1rziepe-5"})(templateObject_7$7||(templateObject_7$7=__makeTemplateObject(["\n display: flex;\n align-items: center;\n padding-bottom: ","px;\n"],["\n display: flex;\n align-items: center;\n padding-bottom: ","px;\n"])),spacingM);var InfoIcon=_styled(Icon).withConfig({displayName:"EventRegistrationRegisterSomeoneElseDialog__InfoIcon",componentId:"sc-1rziepe-6"})(templateObject_8$6||(templateObject_8$6=__makeTemplateObject(["\n padding-right: ","px;\n"],["\n padding-right: ","px;\n"])),spacingS);var StyledCancelButton=_styled(DefaultButton).withConfig({displayName:"EventRegistrationRegisterSomeoneElseDialog__StyledCancelButton",componentId:"sc-1rziepe-7"})(templateObject_9$5||(templateObject_9$5=__makeTemplateObject(["\n && {\n margin-right: ","px;\n }\n"],["\n && {\n margin-right: ","px;\n }\n"])),spacingM);var DialogGlobalStyle$2=createGlobalStyle(templateObject_10$4||(templateObject_10$4=__makeTemplateObject(["\n .dialog-register-user {\n .ms-Overlay {\n background-color: transparent !important;\n }\n\n .ms-Dialog-main {\n box-shadow: none !important;\n\n @media (max-width: ","px) {\n width: 100% !important;\n }\n }\n\n .dialog-content-host {\n min-height: 466px;\n }\n }\n"],["\n .dialog-register-user {\n .ms-Overlay {\n background-color: transparent !important;\n }\n\n .ms-Dialog-main {\n box-shadow: none !important;\n\n @media (max-width: ","px) {\n width: 100% !important;\n }\n }\n\n .dialog-content-host {\n min-height: 466px;\n }\n }\n"])),maxScreenSize.small);var templateObject_1$1h,templateObject_2$K,templateObject_3$v,templateObject_4$k,templateObject_5$j,templateObject_6$c,templateObject_7$7,templateObject_8$6,templateObject_9$5,templateObject_10$4;var EventRegistrationRegisterSomeoneElseButton=function EventRegistrationRegisterSomeoneElseButton(_a){var item=_a.item,onRegister=_a.onRegister,onDeregister=_a.onDeregister;var user=useCurrentUser();var _b=useState$2(false),showDialog=_b[0],setShowDialog=_b[1];if(!hasMinRoleInAllGroups(GroupRoles.Author,user,item)){return null;}return jsxs(Fragment,{children:[jsx$1(StyledButton$1,__assign({iconProps:{iconName:'AddFriend'},onClick:function(){return setShowDialog(true);}},{children:jsx$1(FormattedMessage$1,{id:"Events.registration.registerSomeoneElse.title"},void 0)}),void 0),showDialog&&jsx$1(EventRegistrationRegisterSomeoneElseDialog,{onDismiss:handleDismiss,onUpdate:handleUpdate,show:showDialog},void 0)]},void 0);function handleDismiss(){setShowDialog(false);}function handleUpdate(participant,response){if(response===EventResponse.Registered){onRegister===null||onRegister===void 0?void 0:onRegister(participant);}else {onDeregister===null||onDeregister===void 0?void 0:onDeregister(participant);}}};var StyledButton$1=_styled(ActionButton).withConfig({displayName:"EventRegistrationRegisterSomeoneElseButton__StyledButton",componentId:"sc-mgwolr-0"})(templateObject_1$1g||(templateObject_1$1g=__makeTemplateObject(["\n && {\n height: auto;\n padding: 0;\n margin-bottom: ","px;\n border: 0;\n }\n"],["\n && {\n height: auto;\n padding: 0;\n margin-bottom: ","px;\n border: 0;\n }\n"])),spacingS);var templateObject_1$1g;var EventRegistrationDeregisterPersonButton=function EventRegistrationDeregisterPersonButton(_a){var item=_a.item,participant=_a.participant,onDeregistered=_a.onDeregistered;var user=useCurrentUserContext().user;var refreshUserDetails=useRefreshUserDetails();var setEventRegistration=useEventRegistrationApi().setEventRegistration;var showToast=useNotificationContext().showToast;var formatMessage=useIntl().formatMessage;var _b=useState$2(false),showDialog=_b[0],setShowDialog=_b[1];if(!hasMinRoleInAllGroups(GroupRoles.Author,user,item)){return null;}return jsxs("div",{children:[jsx$1(Tooltip,__assign({resourceKey:"Events.registration.deRegisterSomeoneElse.title",values:{name:participant.displayName}},{children:jsx$1(IconButton,{iconProps:{iconName:'Delete'},onClick:function(){return setShowDialog(true);},ariaLabel:formatMessage({id:'Events.registration.deRegisterSomeoneElse.title'},{name:participant.displayName})},void 0)}),void 0),showDialog&&jsx$1(ConfirmDialog,{showDialog:showDialog,titleResourceKey:"Events.registration.deRegisterSomeoneElse.confirmTitle",titleResourceValues:{name:participant.displayName},onConfirm:deRegister,onClose:function(){return setShowDialog(false);}},void 0)]},void 0);function deRegister(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:onDeregistered();return [4/*yield*/,setEventRegistration(item.id,EventResponse.NotSet,null,null,participant.upn)];case 1:_a.sent();refreshUserDetails();showToast('Events.registration.onBehalfOfDeregistrationSuccess',{mail:participant.displayName});return [2/*return*/];}});});}};var EventRegistrationParticipantsDialog=function EventRegistrationParticipantsDialog(_a){var numberOfParticipants=_a.numberOfParticipants,show=_a.show,onDismiss=_a.onDismiss;var formatMessage=useIntl().formatMessage;return jsx$1(MobileFullHeightDialog,__assign({hidden:!show,modalProps:{isBlocking:false,className:'dialog-event-participants'},dialogContentProps:{type:DialogType.close,title:formatMessage({id:'Events.registration.participants'},{count:numberOfParticipants})},onDismiss:onDismiss},{children:jsxs(Host$s,__assign({className:"dialog-content-host"},{children:[jsx$1(DialogGlobalStyle$1,{},void 0),jsx$1(ParticipantsList,{},void 0)]}),void 0)}),void 0);};var Host$s=_styled.div.withConfig({displayName:"EventRegistrationParticipantsDialog__Host",componentId:"sc-1biaauh-0"})(templateObject_1$1f||(templateObject_1$1f=__makeTemplateObject(["\n @media (min-width: ","px) {\n width: 400px;\n }\n"],["\n @media (min-width: ","px) {\n width: 400px;\n }\n"])),minScreenSize.small);var DialogGlobalStyle$1=createGlobalStyle(templateObject_2$J||(templateObject_2$J=__makeTemplateObject(["\n .dialog-event-participants {\n .ms-Dialog-main {\n @media (max-width: ","px) {\n width: 100% !important;\n }\n }\n\n .dialog-content-host {\n height: 466px;\n }\n}\n"],["\n .dialog-event-participants {\n .ms-Dialog-main {\n @media (max-width: ","px) {\n width: 100% !important;\n }\n }\n\n .dialog-content-host {\n height: 466px;\n }\n}\n"])),maxScreenSize.small);var ParticipantsList=function ParticipantsList(){var formatMessage=useIntl().formatMessage;var user=useCurrentUser();var getParticipants=useEventRegistrationApi().getParticipants;var textColors=useContext(ThemeContext$1).theme.textColors;var _a=useContext(PollUserContext),fetchPollResults=_a.fetchPollResults,publishableItem=_a.item;var item=publishableItem;var _b=usePromise$2(getSortedParticipants,[],[item.id]),unfilteredParticipants=_b[0],isLoading=_b[1],setParticipants=_b[3];var handleSearchDebounced=useDebouncedCallback(handleSearch,300)[0];var _c=useState$2(),filteredParticipants=_c[0],setFilteredParticipants=_c[1];var participants=filteredParticipants||unfilteredParticipants;return jsxs(ListHost,{children:[jsx$1(EventRegistrationRegisterSomeoneElseButton,{item:item,onDeregister:handleDeregister,onRegister:handleRegister},void 0),jsx$1(SearchArea,{children:jsx$1(StyledSearchBox$1,{placeholder:formatMessage({id:'Events.registration.participants.search.placeholder'}),disabled:isLoading,onChange:function(_,value){return handleSearchDebounced(unfilteredParticipants,value);},iconProps:{style:{color:textColors.default}}},void 0)},void 0),isLoading&&jsx$1(Spinner,{},void 0),jsx$1(ListContainer,__assign({isScrollable:!env.isAnyMobileApp},{children:participants.map(function(p){var showDeregisterButton=p.upn!==user.userPrincipalName;return jsxs(ListRow,{children:[jsx$1(PersonaCardWrapper,__assign({showDeregisterButton:showDeregisterButton},{children:jsx$1(StyledPersonaCard$4,__assign({upn:p.upn},{children:jsx$1(StyledAvatar$3,{upn:p.upn,text:p.displayName,secondaryText:p.location&&formatMessage({id:'Events.registration.participants.location'},{location:p.location})},void 0)}),void 0)}),void 0),showDeregisterButton&&jsx$1(EventRegistrationDeregisterPersonButton,{item:item,participant:p,onDeregistered:function(){return handleDeregister(p);}},void 0)]},p.upn);})}),void 0),!isLoading&&!participants.length&&jsx$1(FormattedMessage$1,{id:"Generic.noResultsFound"},void 0)]},void 0);function getSortedParticipants(){return __awaiter(this,void 0,void 0,function(){var numberOfLocations,locationsMap,participants;return __generator(this,function(_a){switch(_a.label){case 0:numberOfLocations=item===null||item===void 0?void 0:item.locations.length;locationsMap=getLocations();return [4/*yield*/,getParticipants(item.id)];case 1:participants=_a.sent()||[];return [2/*return*/,participants.map(function(p){return __assign(__assign({},p),{location:numberOfLocations>1?locationsMap[p.locationId]||'':''});}).sort(function(a,b){var locationCompare=(locationsMap[a.locationId]||'').localeCompare(locationsMap[b.locationId]||'');if(locationCompare!==0){return locationCompare;}return a.displayName.localeCompare(b.displayName);})];}});});}function getLocations(){var _a;return ((_a=item.locations)===null||_a===void 0?void 0:_a.reduce(function(prev,curr){prev[curr.locationId]=curr.name;return prev;},{}))||{};}function handleSearch(unfilteredParticipants,searchValue){if(!searchValue){setFilteredParticipants(null);return;}var filter=new RegExp(searchValue,'i');setFilteredParticipants(unfilteredParticipants.filter(function(p){return (p.displayName+"|"+p.upn+"|"+p.location).search(filter)>-1;}));}function handleDeregister(participant){setParticipants(function(ps){return ps.filter(function(p){return p.upn!==participant.upn;});});fetchPollResults();setFilteredParticipants(null);}function handleRegister(participant){setParticipants(function(ps){return ps.concat([__assign(__assign({},participant),{location:getLocations()[participant.locationId]||''})]);});fetchPollResults();setFilteredParticipants(null);}};var ListContainer=_styled.div.withConfig({displayName:"EventRegistrationParticipantsDialog__ListContainer",componentId:"sc-1biaauh-1"})(templateObject_4$j||(templateObject_4$j=__makeTemplateObject(["\n padding: 4px;\n\n ","\n"],["\n padding: 4px;\n\n ","\n"])),function(p){return p.isScrollable&&css$2(templateObject_3$u||(templateObject_3$u=__makeTemplateObject(["\n max-height: 382px;\n overflow: auto;\n "],["\n max-height: 382px;\n overflow: auto;\n "])));});var SearchArea=_styled.div.withConfig({displayName:"EventRegistrationParticipantsDialog__SearchArea",componentId:"sc-1biaauh-2"})(templateObject_5$i||(templateObject_5$i=__makeTemplateObject(["\n margin-bottom: ","px;\n display: flex;\n"],["\n margin-bottom: ","px;\n display: flex;\n"])),spacingM);var StyledSearchBox$1=_styled(SearchBox$1).withConfig({displayName:"EventRegistrationParticipantsDialog__StyledSearchBox",componentId:"sc-1biaauh-3"})(templateObject_6$b||(templateObject_6$b=__makeTemplateObject(["\n flex-grow: 1;\n"],["\n flex-grow: 1;\n"])));var ListRow=_styled.div.withConfig({displayName:"EventRegistrationParticipantsDialog__ListRow",componentId:"sc-1biaauh-4"})(templateObject_7$6$1||(templateObject_7$6$1=__makeTemplateObject(["\n display: flex;\n align-items: center;\n margin-bottom: ","px;\n"],["\n display: flex;\n align-items: center;\n margin-bottom: ","px;\n"])),spacingS);var PersonaCardWrapper=_styled.div.withConfig({displayName:"EventRegistrationParticipantsDialog__PersonaCardWrapper",componentId:"sc-1biaauh-5"})(templateObject_8$5$1||(templateObject_8$5$1=__makeTemplateObject(["\n width: calc(100% - ","px);\n"],["\n width: calc(100% - ","px);\n"])),function(p){return p.showDeregisterButton?32:0;});var StyledPersonaCard$4=_styled(PersonaCard).withConfig({displayName:"EventRegistrationParticipantsDialog__StyledPersonaCard",componentId:"sc-1biaauh-6"})(templateObject_9$4||(templateObject_9$4=__makeTemplateObject(["\n width: 100%;\n\n & > * {\n width: 100%;\n }\n"],["\n width: 100%;\n\n & > * {\n width: 100%;\n }\n"])));var StyledAvatar$3=_styled(Avatar).withConfig({displayName:"EventRegistrationParticipantsDialog__StyledAvatar",componentId:"sc-1biaauh-7"})(templateObject_10$3||(templateObject_10$3=__makeTemplateObject(["\n .ms-Persona-secondaryText {\n white-space: initial;\n }\n\n height: auto;\n\n > div:first-child {\n align-self: flex-start;\n }\n"],["\n .ms-Persona-secondaryText {\n white-space: initial;\n }\n\n height: auto;\n\n > div:first-child {\n align-self: flex-start;\n }\n"])));var ListHost=_styled.div.withConfig({displayName:"EventRegistrationParticipantsDialog__ListHost",componentId:"sc-1biaauh-8"})(templateObject_11$2$1||(templateObject_11$2$1=__makeTemplateObject([""],[""])));var templateObject_1$1f,templateObject_2$J,templateObject_3$u,templateObject_4$j,templateObject_5$i,templateObject_6$b,templateObject_7$6$1,templateObject_8$5$1,templateObject_9$4,templateObject_10$3,templateObject_11$2$1;var EventRegistrationParticipantsLink=function EventRegistrationParticipantsLink(){var _a;var user=useCurrentUser();var _b=useContext(PollUserContext),pollResult=_b.pollResult,publishableItem=_b.item;var item=publishableItem;var _c=useState$2(false),showParticipants=_c[0],setShowParticipants=_c[1];var palette=useContext(ThemeContext$1).theme.palette;if(user.isPublicUser||(pollResult===null||pollResult===void 0?void 0:pollResult.totalFeedbackCount)==null){return null;}var isUserAuthor=hasMinRoleInAllGroups(GroupRoles.Author,user,item);var canOpenParticipantsDialog=isUserAuthor||pollResult.totalFeedbackCount>0&&((_a=item.registrationSettings)===null||_a===void 0?void 0:_a.showParticipantsToEverybody);return jsxs("div",__assign({"data-poll-result-total-count":pollResult.totalFeedbackCount},{children:[!canOpenParticipantsDialog?jsx$1(NoParticipantsContainer,{children:jsx$1(FormattedMessage$1,{id:"Events.registration.participants.count",values:{count:pollResult.totalFeedbackCount}},void 0)},void 0):jsx$1(ParticipantsButton,__assign({onClick:function(){return setShowParticipants(true);},color:palette.accent},{children:jsx$1(FormattedMessage$1,{id:isUserAuthor?'Events.registration.participants.viewAndManage':'Events.registration.participants.count',values:{count:pollResult.totalFeedbackCount}},void 0)}),void 0),jsx$1(EventRegistrationParticipantsDialog,{numberOfParticipants:pollResult.totalFeedbackCount,show:showParticipants,onDismiss:function(){return setShowParticipants(false);}},void 0)]}),void 0);};var NoParticipantsContainer=_styled.div.withConfig({displayName:"EventRegistrationParticipantsLink__NoParticipantsContainer",componentId:"sc-44nkgi-0"})(templateObject_1$1e||(templateObject_1$1e=__makeTemplateObject(["\n color: ",";\n font-size: ","px;\n"],["\n color: ",";\n font-size: ","px;\n"])),function(p){return p.theme.palette.neutralTertiary;},fontSizeSmall);var ParticipantsButton=_styled(ActionButton).withConfig({displayName:"EventRegistrationParticipantsLink__ParticipantsButton",componentId:"sc-44nkgi-1"})(templateObject_2$I||(templateObject_2$I=__makeTemplateObject(["\n && {\n height: auto;\n padding: 0;\n font-size: ","px;\n }\n"],["\n && {\n height: auto;\n padding: 0;\n font-size: ","px;\n }\n"])),fontSizeSmall);var templateObject_1$1e,templateObject_2$I;var EventDetailViewRegistrationPoll=function EventDetailViewRegistrationPoll(){return jsx$1(EventRegistrationContextProvider,{children:jsxs(StyledPollDisplay$1,{children:[jsx$1(EventRegistrationParticipantsLink,{},void 0),jsx$1(StyledEventUserRegistration,{},void 0),jsx$1(StyledResponseExportButton,{},void 0)]},void 0)},void 0);};var StyledEventUserRegistration=_styled(EventDetailViewUserRegistration).withConfig({displayName:"EventDetailViewRegistrationPoll__StyledEventUserRegistration",componentId:"sc-1kxjndz-0"})(templateObject_1$1d||(templateObject_1$1d=__makeTemplateObject(["\n && {\n margin-top: ","px;\n }\n"],["\n && {\n margin-top: ","px;\n }\n"])),spacingS);var StyledResponseExportButton=_styled(EventDetailViewResponseExportButton).withConfig({displayName:"EventDetailViewRegistrationPoll__StyledResponseExportButton",componentId:"sc-1kxjndz-1"})(templateObject_2$H||(templateObject_2$H=__makeTemplateObject(["\n margin-top: ","px;\n"],["\n margin-top: ","px;\n"])),spacingS);var templateObject_1$1d,templateObject_2$H;var EventDetailViewRegistration=function EventDetailViewRegistration(){var item=useDetailViewContext().item;var isRegistrationEnabled=item.registrationSettings&&item.registrationSettings.enabled;if(isRegistrationEnabled){return jsx$1(EventDetailViewRegistrationPoll,{},void 0);}return jsx$1(DetailViewPoll,{},void 0);};var EventDetailViewCancelInformation=function EventDetailViewCancelInformation(){var _a=useDetailViewContext(),item=_a.item,contentLanguage=_a.contentLanguage;return jsx$1(EventCancelInformation,{item:item,language:contentLanguage},void 0);};var $$1$1=_export;var isArray$4=isArray$3;var nativeReverse$1=[].reverse;var test$3=[1,2];// `Array.prototype.reverse` method
122307
122304
  // https://tc39.github.io/ecma262/#sec-array.prototype.reverse
122308
122305
  // fix for Safari 12.0 bug
122309
122306
  // https://bugs.webkit.org/show_bug.cgi?id=188794
@@ -122311,23 +122308,23 @@ $$1$1({target:'Array',proto:true,forced:String(test$3)===String(test$3.reverse()
122311
122308
  if(isArray$4(this))this.length=this.length;return nativeReverse$1.call(this);}});var CommentList=function CommentList(_a){var type=_a.type,baseAttachmentPath=_a.baseAttachmentPath,items=_a.items,groupIds=_a.groupIds,isLoading=_a.isLoading,onCommentDeleted=_a.onCommentDeleted,scope=_a.scope,mentionSearchHandler=_a.mentionSearchHandler,noItemsYetStringResourceKey=_a.noItemsYetStringResourceKey,getHashtagFilterRoute=_a.getHashtagFilterRoute,onReply=_a.onReply,readOnly=_a.readOnly,className=_a.className;var user=useCurrentUser();var _b=useState$2(true),isDialogHidden=_b[0],setIsDialogHidden=_b[1];var commentRef=useRef$1(null);var deleteComment=useCommentApi().deleteComment;var showError=useNotificationContext().showError;return jsxs("div",__assign({className:classNames(className,'comment-list'),"data-list":"comments"},{children:[jsx$1(ConfirmDialog,{onClose:function(){return setIsDialogHidden(true);},onConfirm:handleDelete,showDialog:!isDialogHidden,titleResourceKey:"Comment.delete.title",infoResourceKey:"Comment.delete.description"},void 0),jsx$1(OpacityAnimation,__assign({leaveDuration:500},{children:items!=null&&items.map(function(comment){var _a;var showAutoTranslate=comment.sender.id!==user.id;return jsx$1(CommentDisplay,{readOnly:readOnly,scope:scope,message:comment,showDelete:canDelete(comment),showEdit:canEdit(comment),onDelete:showDialog,showAutoTranslate:showAutoTranslate,mentionSearchHandler:mentionSearchHandler,type:type,baseAttachmentPath:baseAttachmentPath,getHashtagFilterRoute:getHashtagFilterRoute,highlight:comment.isUnread,isInitialLiked:comment.isLiked,onReply:onReply,replyCount:comment.threadId==null?(_a=comment.statistics)===null||_a===void 0?void 0:_a.replyCount:null},comment.receivedDateTime+comment.sender.id);})}),void 0),items!=null&&items.length===0&&!isLoading&&jsx$1("p",__assign({className:"ms-font-m ms-fontColor-neutralSecondary"},{children:jsx$1(FormattedMessage$1,{id:noItemsYetStringResourceKey},void 0)}),void 0)]}),void 0);function handleDelete(){return __awaiter(this,void 0,void 0,function(){var error_1;return __generator(this,function(_a){switch(_a.label){case 0:if(commentRef.current==null){return [2/*return*/];}onCommentDeleted&&onCommentDeleted(commentRef.current);_a.label=1;case 1:_a.trys.push([1,3,,4]);return [4/*yield*/,deleteComment(type,commentRef.current.conversationScope,commentRef.current.parentItemId,commentRef.current.id)];case 2:_a.sent();return [3/*break*/,4];case 3:error_1=_a.sent();logger.error(error_1);showError('Generic.error');return [3/*break*/,4];case 4:return [2/*return*/];}});});}function showDialog(comment){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){commentRef.current=comment;setIsDialogHidden(false);return [2/*return*/];});});}function canDelete(comment){return canEdit(comment)||hasMinRoleInAllGroups(GroupRoles.Admin,user,groupIds);}function canEdit(comment){return comment.sender&&comment.sender.id===user.id;}};var CreateCommentWithAttachments=function CreateCommentWithAttachments(props){var ignoreRef=useRef$1(false);useEffect$1(function(){return function(){ignoreRef.current=true;};},[]);var _a=useState$2(createId()),attachmentContainerId=_a[0],setAttachmentContainerId=_a[1];var _b=useAttachmentUploader([],attachmentContainerId,props.baseAttachmentPath),attachments=_b[0],handleAttachmentsAdded=_b[1],clearAttachments=_b[2],deletedAttachmentUrls=_b[3],onDeleteAttachment=_b[4];return jsx$1(CreateComment,__assign({},props,{onPost:handlePost,onAttachmentsChanged:handleAttachmentsAdded,attachments:attachments,deletedAttachmentUrls:deletedAttachmentUrls,onDeleteAttachment:onDeleteAttachment,allowAttachments:!!props.baseAttachmentPath,allowKeywords:props.allowKeywords,placeHolderStringResourceKey:props.placeHolderStringResourceKey,placeHolderStringResourceValues:props.placeHolderStringResourceValues}),void 0);function handlePost(message,keywords){return __awaiter(this,void 0,void 0,function(){var newAttachments;return __generator(this,function(_a){switch(_a.label){case 0:newAttachments=__spreadArray([],attachments);clearAttachments();return [4/*yield*/,props.onPost(message,attachmentContainerId,newAttachments,keywords)];case 1:_a.sent();if(!ignoreRef.current){setAttachmentContainerId(createId());}return [2/*return*/];}});});}};var SortOrder;(function(SortOrder){SortOrder[SortOrder["Asc"]=0]="Asc";SortOrder[SortOrder["Desc"]=1]="Desc";})(SortOrder||(SortOrder={}));var PagedCommentsSection=function PagedCommentsSection(_a){var type=_a.type,baseAttachmentPath=_a.baseAttachmentPath,itemId=_a.itemId,groupIds=_a.groupIds,readOnly=_a.readOnly,loadInReadOnlyMode=_a.loadInReadOnlyMode,scope=_a.scope,_b=_a.initialPageSize,initialPageSize=_b===void 0?2:_b,_c=_a.pageSize,pageSize=_c===void 0?5:_c,mentionSearchHandler=_a.mentionSearchHandler,initialComments=_a.initialComments,onCommentAdded=_a.onCommentAdded,onCommentDeleted=_a.onCommentDeleted,noItemsYetStringResourceKey=_a.noItemsYetStringResourceKey,autoFocusReplyField=_a.autoFocusReplyField,getHashtagFilterRoute=_a.getHashtagFilterRoute,buttons=_a.buttons,threadId=_a.threadId,placeHolderStringResourceKey=_a.placeHolderStringResourceKey,placeHolderStringResourceValues=_a.placeHolderStringResourceValues,showReplyBox=_a.showReplyBox,title=_a.title,onThreadReply=_a.onThreadReply,className=_a.className;var refreshStatistics=useNewsApi().refreshStatistics;var createComment=useCommentApi().createComment;var user=useCurrentUser();var features=useFeatures();var history=useHistory();var location=useLocation$1();var formatMessage=useIntl().formatMessage;var showError=useNotificationContext().showError;var _d=useState$2((initialComments===null||initialComments===void 0?void 0:initialComments.items.length)===0||type!==ItemResourceTypes.Posts||showReplyBox),showNewComment=_d[0],setShowNewComment=_d[1];var _e=useState$2(),commentToReplyTo=_e[0],setCommentToReplyTo=_e[1];var _f=useState$2(autoFocusReplyField),autoFocusNewCommentInput=_f[0],setAutoFocusNewCommentInput=_f[1];var preventLoading=readOnly&&!loadInReadOnlyMode;var _g=usePageLoader(type,scope,itemId,pageSize,initialPageSize,initialComments,preventLoading,threadId),comments=_g[0],isLoading=_g[1],hasNextPage=_g[2],loadNextPage=_g[3],setComments=_g[4],hasMoreUnreadComments=_g[5];var commentIdsString=(comments!==null&&comments!==void 0?comments:[]).map(function(c){return c.id;}).join(',');useEffect$1(function(){var _a;if(commentIdsString.length>0&&((_a=location.state)===null||_a===void 0?void 0:_a.parentCommentId)){if(autoFocusNewCommentInput){return;}var commentContainer=document.getElementById(location.state.parentCommentId);commentContainer===null||commentContainer===void 0?void 0:commentContainer.scrollIntoView(true);history.replace(__assign(__assign({},location),{state:__assign(__assign({},location.state),{parentCommentId:null})}));}// comments changes implicitly 'validates' location state changes
122312
122309
  // eslint-disable-next-line react-hooks/exhaustive-deps
122313
122310
  },[commentIdsString]);var showSpinner=!preventLoading&&isLoading;var showLoadMore=!preventLoading&&hasNextPage&&!isLoading;var showComments=!preventLoading&&(comments===null||comments===void 0?void 0:comments.length)>0;return jsxs("div",__assign({className:className},{children:[jsxs(TitleAndSpinner,{children:[title,showSpinner&&jsx$1(StyledSpinner$1,{},void 0)]},void 0),showLoadMore&&jsx$1(LoadMoreContainer,__assign({"data-load-more-comments-container":true,"data-show-highlight":hasMoreUnreadComments,highlight:hasMoreUnreadComments},{children:jsx$1(LoadMore,{text:formatMessage({id:type===ItemResourceTypes.Posts||threadId!=null?'Post.comments.loadMore':'Comment.loadMore'}),onClick:function(){return loadNextPage();},iconProps:{iconName:'ScrollUpDown'},"data-load-more-comments":true},void 0)}),void 0),showComments&&jsx$1(CommentList,{scope:ConversationScope.Public,items:comments,groupIds:groupIds,isLoading:isLoading,onCommentDeleted:handleCommentDeleted,mentionSearchHandler:mentionSearchHandler,type:type,baseAttachmentPath:baseAttachmentPath,noItemsYetStringResourceKey:noItemsYetStringResourceKey,getHashtagFilterRoute:getHashtagFilterRoute,onReply:handleOnReply,readOnly:readOnly},void 0),!showNewComment&&jsx$1(ReplyButton,{iconProps:{iconName:'Reply'},text:formatMessage({id:'Post.comments.addReply'}),onClick:showNewCommentInput,"data-add-comment":true},void 0),showNewComment&&jsxs(Fragment,{children:[jsx$1(NewComment// the key is required to autofocus the reply field when replying to comments
122314
- ,{readOnly:readOnly,onPost:handleCommentCreated,mentionSearchHandler:mentionSearchHandler,autoFocus:autoFocusNewCommentInput,focusAfterPost:!env.isNativeMobileApp,baseAttachmentPath:baseAttachmentPath,placeHolderStringResourceKey:placeHolderStringResourceKey,placeHolderStringResourceValues:placeHolderStringResourceValues,content:getContent(),allowSaveWithoutContent:true,saveOnCtrlEnter:true},commentToReplyTo===null||commentToReplyTo===void 0?void 0:commentToReplyTo.commentId),!readOnly&&buttons]},void 0)]}),void 0);function getContent(){var _a;return ((_a=commentToReplyTo===null||commentToReplyTo===void 0?void 0:commentToReplyTo.commentSender)===null||_a===void 0?void 0:_a.id)&&commentToReplyTo.commentSender.id!==user.id?constructUserMention(commentToReplyTo.commentSender):null;}function handleOnReply(commentId,commentSender){if(features.replyToComments){history.replace(__assign(__assign({},location),{state:{parentCommentId:"Comment-"+commentId}}));onThreadReply===null||onThreadReply===void 0?void 0:onThreadReply(commentId);setCommentToReplyTo({commentId:commentId,commentSender:commentSender});return;}showNewCommentInput();setCommentToReplyTo({commentId:commentId,commentSender:commentSender});setAutoFocusNewCommentInput(true);}function showNewCommentInput(){if(user.isPublicUser){triggerEvent(PromptPublicUserLoginAction.create());return;}setShowNewComment(true);}function handleCommentDeleted(comment){return __awaiter(this,void 0,void 0,function(){var _a;return __generator(this,function(_b){switch(_b.label){case 0:setComments(function(stateComments){return stateComments.filter(function(c){return c.id!==comment.id;});});onCommentDeleted===null||onCommentDeleted===void 0?void 0:onCommentDeleted(comment);_a=!threadId;if(!_a)return [3/*break*/,2];return [4/*yield*/,refreshStatistics(itemId,{commentCount:-1})];case 1:_a=_b.sent();_b.label=2;case 2:return [2/*return*/];}});});}function handleCommentCreated(commentDelta,attachmentContainerId,attachments){return __awaiter(this,void 0,void 0,function(){var newComment,comment_1,_a,error_1;return __generator(this,function(_b){switch(_b.label){case 0:newComment={id:null,parentItemId:itemId,content:commentDelta.content,conversationScope:scope,sender:user,receivedDateTime:moment.utc().toISOString(),attachmentContainerId:attachmentContainerId,attachments:attachments,threadId:threadId,isUnread:false};setComments(function(stateComments){return __spreadArray(__spreadArray([],stateComments),[newComment]);});onCommentAdded===null||onCommentAdded===void 0?void 0:onCommentAdded();_b.label=1;case 1:_b.trys.push([1,5,6,7]);return [4/*yield*/,createComment(type,scope,itemId,__assign(__assign({},commentDelta),{attachmentContainerId:attachmentContainerId,attachments:attachments,threadId:threadId}))];case 2:comment_1=_b.sent();_a=!threadId;if(!_a)return [3/*break*/,4];return [4/*yield*/,refreshStatistics(itemId,{commentCount:1})];case 3:_a=_b.sent();_b.label=4;case 4:setComments(function(stateComments){var _a;return update$2(stateComments,(_a={},_a[stateComments.length-1]={$merge:{id:comment_1.id,fileAccessToken:comment_1.fileAccessToken}},_a));});return [3/*break*/,7];case 5:error_1=_b.sent();logger.error(error_1);showError('Comment.errorMessage');return [3/*break*/,7];case 6:setAutoFocusNewCommentInput(false);setCommentToReplyTo(null);return [7/*endfinally*/];case 7:return [2/*return*/];}});});}};var TitleAndSpinner=_styled.div.withConfig({displayName:"PagedCommentsSection__TitleAndSpinner",componentId:"sc-1f3hft1-0"})(templateObject_1$1e||(templateObject_1$1e=__makeTemplateObject(["\n display: flex;\n"],["\n display: flex;\n"])));var ReplyButton=_styled(ActionButton).withConfig({displayName:"PagedCommentsSection__ReplyButton",componentId:"sc-1f3hft1-1"})(templateObject_2$I||(templateObject_2$I=__makeTemplateObject(["\n && {\n padding: 0;\n height: auto;\n min-height: 20px;\n border: none;\n color: ",";\n align-self: flex-start;\n }\n"],["\n && {\n padding: 0;\n height: auto;\n min-height: 20px;\n border: none;\n color: ",";\n align-self: flex-start;\n }\n"])),function(p){return p.theme.palette.accent;});var NewComment=_styled(CreateCommentWithAttachments).withConfig({displayName:"PagedCommentsSection__NewComment",componentId:"sc-1f3hft1-2"})(templateObject_3$v||(templateObject_3$v=__makeTemplateObject(["\n margin: 10px 0;\n position: relative;\n\n .comment-input__host {\n border: none;\n }\n"],["\n margin: 10px 0;\n position: relative;\n\n .comment-input__host {\n border: none;\n }\n"])));var LoadMoreContainer=_styled.div.withConfig({displayName:"PagedCommentsSection__LoadMoreContainer",componentId:"sc-1f3hft1-3"})(templateObject_5$j||(templateObject_5$j=__makeTemplateObject(["\n & ~ .comment-list {\n margin-top: 15px;\n }\n\n ","\n"],["\n & ~ .comment-list {\n margin-top: 15px;\n }\n\n ","\n"])),function(p){return p.highlight&&css$2(templateObject_4$k||(templateObject_4$k=__makeTemplateObject(["\n position: relative;\n\n &::after {\n content: '';\n position: absolute;\n top: -","px;\n bottom: 0;\n right: -","px;\n width: ","px;\n display: block;\n background-color: ",";\n }\n "],["\n position: relative;\n\n &::after {\n content: '';\n position: absolute;\n top: -","px;\n bottom: 0;\n right: -","px;\n width: ","px;\n display: block;\n background-color: ",";\n }\n "])),postsSectionPadding,postsSectionPadding,spacingXs,function(p){return p.theme.palette.accent;});});var LoadMore=_styled(ActionButton).withConfig({displayName:"PagedCommentsSection__LoadMore",componentId:"sc-1f3hft1-4"})(templateObject_6$b||(templateObject_6$b=__makeTemplateObject(["\n && {\n text-align: left;\n }\n"],["\n && {\n text-align: left;\n }\n"])));var StyledSpinner$1=_styled(Spinner).withConfig({displayName:"PagedCommentsSection__StyledSpinner",componentId:"sc-1f3hft1-5"})(templateObject_7$6$1||(templateObject_7$6$1=__makeTemplateObject(["\n margin: 0 auto;\n padding: 15px 0;\n"],["\n margin: 0 auto;\n padding: 15px 0;\n"])));function usePageLoader(type,scope,itemId,pageSize,initialPageSize,initialComments,preventLoading,threadId){var _a=useState$2(function(){return __spreadArray([],(initialComments===null||initialComments===void 0?void 0:initialComments.items)||[]).reverse();}),comments=_a[0],setComments=_a[1];var _b=useState$2({token:initialComments===null||initialComments===void 0?void 0:initialComments.paginationToken,hasMoreUnreadComments:initialComments===null||initialComments===void 0?void 0:initialComments.hasMoreUnreadComments}),nextPageInfos=_b[0],setNextPageInfos=_b[1];var _c=useState$2(!initialComments),isLoading=_c[0],setIsLoading=_c[1];var pullToRefreshContext=useContext(PullToRefreshContext);var _d=useCommentApi(),listComments=_d.listComments,getCommentReplies=_d.getCommentReplies;// the context can be null, in case we are in the editor
122311
+ ,{readOnly:readOnly,onPost:handleCommentCreated,mentionSearchHandler:mentionSearchHandler,autoFocus:autoFocusNewCommentInput,focusAfterPost:!env.isNativeMobileApp,baseAttachmentPath:baseAttachmentPath,placeHolderStringResourceKey:placeHolderStringResourceKey,placeHolderStringResourceValues:placeHolderStringResourceValues,content:getContent(),allowSaveWithoutContent:true,saveOnCtrlEnter:true,disableBoxShadow:true,ariaLabel:formatMessage({id:'AriaLabel.commentInput'})},commentToReplyTo===null||commentToReplyTo===void 0?void 0:commentToReplyTo.commentId),!readOnly&&buttons]},void 0)]}),void 0);function getContent(){var _a;return ((_a=commentToReplyTo===null||commentToReplyTo===void 0?void 0:commentToReplyTo.commentSender)===null||_a===void 0?void 0:_a.id)&&commentToReplyTo.commentSender.id!==user.id?constructUserMention(commentToReplyTo.commentSender):null;}function handleOnReply(commentId,commentSender){if(features.replyToComments){history.replace(__assign(__assign({},location),{state:{parentCommentId:"Comment-"+commentId}}));onThreadReply===null||onThreadReply===void 0?void 0:onThreadReply(commentId);setCommentToReplyTo({commentId:commentId,commentSender:commentSender});return;}showNewCommentInput();setCommentToReplyTo({commentId:commentId,commentSender:commentSender});setAutoFocusNewCommentInput(true);}function showNewCommentInput(){if(user.isPublicUser){triggerEvent(PromptPublicUserLoginAction.create());return;}setShowNewComment(true);}function handleCommentDeleted(comment){return __awaiter(this,void 0,void 0,function(){var _a;return __generator(this,function(_b){switch(_b.label){case 0:setComments(function(stateComments){return stateComments.filter(function(c){return c.id!==comment.id;});});onCommentDeleted===null||onCommentDeleted===void 0?void 0:onCommentDeleted(comment);_a=!threadId;if(!_a)return [3/*break*/,2];return [4/*yield*/,refreshStatistics(itemId,{commentCount:-1})];case 1:_a=_b.sent();_b.label=2;case 2:return [2/*return*/];}});});}function handleCommentCreated(commentDelta,attachmentContainerId,attachments){return __awaiter(this,void 0,void 0,function(){var newComment,comment_1,_a,error_1;return __generator(this,function(_b){switch(_b.label){case 0:newComment={id:null,parentItemId:itemId,content:commentDelta.content,conversationScope:scope,sender:user,receivedDateTime:moment.utc().toISOString(),attachmentContainerId:attachmentContainerId,attachments:attachments,threadId:threadId,isUnread:false};setComments(function(stateComments){return __spreadArray(__spreadArray([],stateComments),[newComment]);});onCommentAdded===null||onCommentAdded===void 0?void 0:onCommentAdded();_b.label=1;case 1:_b.trys.push([1,5,6,7]);return [4/*yield*/,createComment(type,scope,itemId,__assign(__assign({},commentDelta),{attachmentContainerId:attachmentContainerId,attachments:attachments,threadId:threadId}))];case 2:comment_1=_b.sent();_a=!threadId;if(!_a)return [3/*break*/,4];return [4/*yield*/,refreshStatistics(itemId,{commentCount:1})];case 3:_a=_b.sent();_b.label=4;case 4:setComments(function(stateComments){var _a;return update$2(stateComments,(_a={},_a[stateComments.length-1]={$merge:{id:comment_1.id,fileAccessToken:comment_1.fileAccessToken}},_a));});return [3/*break*/,7];case 5:error_1=_b.sent();logger.error(error_1);showError('Comment.errorMessage');return [3/*break*/,7];case 6:setAutoFocusNewCommentInput(false);setCommentToReplyTo(null);return [7/*endfinally*/];case 7:return [2/*return*/];}});});}};var TitleAndSpinner=_styled.div.withConfig({displayName:"PagedCommentsSection__TitleAndSpinner",componentId:"sc-1f3hft1-0"})(templateObject_1$1c||(templateObject_1$1c=__makeTemplateObject(["\n display: flex;\n"],["\n display: flex;\n"])));var ReplyButton=_styled(ActionButton).withConfig({displayName:"PagedCommentsSection__ReplyButton",componentId:"sc-1f3hft1-1"})(templateObject_2$G||(templateObject_2$G=__makeTemplateObject(["\n && {\n padding: 0;\n height: auto;\n min-height: 20px;\n border: none;\n color: ",";\n align-self: flex-start;\n }\n"],["\n && {\n padding: 0;\n height: auto;\n min-height: 20px;\n border: none;\n color: ",";\n align-self: flex-start;\n }\n"])),function(p){return p.theme.palette.accent;});var NewComment=_styled(CreateCommentWithAttachments).withConfig({displayName:"PagedCommentsSection__NewComment",componentId:"sc-1f3hft1-2"})(templateObject_3$t||(templateObject_3$t=__makeTemplateObject(["\n margin: 10px 0;\n position: relative;\n"],["\n margin: 10px 0;\n position: relative;\n"])));var LoadMoreContainer=_styled.div.withConfig({displayName:"PagedCommentsSection__LoadMoreContainer",componentId:"sc-1f3hft1-3"})(templateObject_5$h||(templateObject_5$h=__makeTemplateObject(["\n & ~ .comment-list {\n margin-top: 15px;\n }\n\n ","\n"],["\n & ~ .comment-list {\n margin-top: 15px;\n }\n\n ","\n"])),function(p){return p.highlight&&css$2(templateObject_4$i||(templateObject_4$i=__makeTemplateObject(["\n position: relative;\n\n &::after {\n content: '';\n position: absolute;\n top: -","px;\n bottom: 0;\n right: -","px;\n width: ","px;\n display: block;\n background-color: ",";\n }\n "],["\n position: relative;\n\n &::after {\n content: '';\n position: absolute;\n top: -","px;\n bottom: 0;\n right: -","px;\n width: ","px;\n display: block;\n background-color: ",";\n }\n "])),postsSectionPadding,postsSectionPadding,spacingXs,function(p){return p.theme.palette.accent;});});var LoadMore=_styled(ActionButton).withConfig({displayName:"PagedCommentsSection__LoadMore",componentId:"sc-1f3hft1-4"})(templateObject_6$a||(templateObject_6$a=__makeTemplateObject(["\n && {\n text-align: left;\n }\n"],["\n && {\n text-align: left;\n }\n"])));var StyledSpinner$1=_styled(Spinner).withConfig({displayName:"PagedCommentsSection__StyledSpinner",componentId:"sc-1f3hft1-5"})(templateObject_7$5$1||(templateObject_7$5$1=__makeTemplateObject(["\n margin: 0 auto;\n padding: 15px 0;\n"],["\n margin: 0 auto;\n padding: 15px 0;\n"])));function usePageLoader(type,scope,itemId,pageSize,initialPageSize,initialComments,preventLoading,threadId){var _a=useState$2(function(){return __spreadArray([],(initialComments===null||initialComments===void 0?void 0:initialComments.items)||[]).reverse();}),comments=_a[0],setComments=_a[1];var _b=useState$2({token:initialComments===null||initialComments===void 0?void 0:initialComments.paginationToken,hasMoreUnreadComments:initialComments===null||initialComments===void 0?void 0:initialComments.hasMoreUnreadComments}),nextPageInfos=_b[0],setNextPageInfos=_b[1];var _c=useState$2(!initialComments),isLoading=_c[0],setIsLoading=_c[1];var pullToRefreshContext=useContext(PullToRefreshContext);var _d=useCommentApi(),listComments=_d.listComments,getCommentReplies=_d.getCommentReplies;// the context can be null, in case we are in the editor
122315
122312
  var refreshToken=pullToRefreshContext===null||pullToRefreshContext===void 0?void 0:pullToRefreshContext.refreshToken;var refreshUserDetails=useRefreshUserDetails();var isValid=true;useEffect$1(function(){if(!isValid||preventLoading){return undefined;}if(!initialComments||refreshToken){// pass the pageToken explicitly since it's possible that the nextPageTokenState has not been updated yet
122316
122313
  loadNextPage(null,initialPageSize,!!initialComments).then(function(){return null;},logger.error);}// eslint-disable-next-line react-hooks/exhaustive-deps
122317
122314
  return function(){isValid=false;};// eslint-disable-next-line react-hooks/exhaustive-deps
122318
122315
  },[initialComments,itemId,refreshToken]);return [comments,isLoading,!!(nextPageInfos===null||nextPageInfos===void 0?void 0:nextPageInfos.token),loadNextPage,setComments,nextPageInfos.hasMoreUnreadComments];function loadNextPage(nextPageTokenOverride,pageSizeOverride,doNotSetIsLoading){return __awaiter(this,void 0,void 0,function(){var token,nextPage,_a;return __generator(this,function(_b){switch(_b.label){case 0:if(!isValid){return [2/*return*/];}if(!doNotSetIsLoading){setIsLoading(true);}token=nextPageTokenOverride!==undefined?nextPageTokenOverride:nextPageInfos===null||nextPageInfos===void 0?void 0:nextPageInfos.token;if(!(threadId!=null))return [3/*break*/,2];return [4/*yield*/,getCommentReplies(type,scope,itemId,threadId,{sortOrder:SortOrder.Desc,pageSize:pageSizeOverride!==null&&pageSizeOverride!==void 0?pageSizeOverride:pageSize,token:token})];case 1:_a=_b.sent();return [3/*break*/,4];case 2:return [4/*yield*/,listComments(type,scope,itemId,{sortOrder:SortOrder.Desc,pageSize:pageSizeOverride!==null&&pageSizeOverride!==void 0?pageSizeOverride:pageSize,token:token})];case 3:_a=_b.sent();_b.label=4;case 4:nextPage=_a;if(isValid){setIsLoading(false);setComments(function(stateComments){return token!=null?__spreadArray(__spreadArray([],__spreadArray([],nextPage.items).reverse()),stateComments):nextPage.items.reverse();});// refresh the unread count every time we load a new page of comments
122319
- refreshUserDetails();setNextPageInfos({token:nextPage.paginationToken,hasMoreUnreadComments:nextPage.hasMoreUnreadComments});}return [2/*return*/];}});});}}var templateObject_1$1e,templateObject_2$I,templateObject_3$v,templateObject_4$k,templateObject_5$j,templateObject_6$b,templateObject_7$6$1;var PublicUserFullAccessButton=function PublicUserFullAccessButton(_a){var user=_a.user,onClick=_a.onClick,descriptionResourceKeyPrefix=_a.descriptionResourceKeyPrefix,descriptionValues=_a.descriptionValues,className=_a.className;var formatMessage=useIntl().formatMessage;var history=useHistory();var location=useLocation$1();var buildPath=useSubscriptionHandlePathBuilder().buildPath;var shouldRegister=user.subscription.allowSelfRegistration&&user.authenticationType!==AuthenticationType.public;return jsxs("div",__assign({className:className},{children:[jsx$1(PublicUserButtonFocusStyle,{},void 0),descriptionResourceKeyPrefix&&jsx$1(Description$1,{id:descriptionResourceKeyPrefix+"."+(shouldRegister?'register':'login'),values:descriptionValues,tagName:"p"},void 0),jsx$1(PrimaryButton,{"data-public-access-button":true,text:formatMessage({id:shouldRegister?'SelfRegistration.register':'Subscription.login.caption'}),onClick:handleOnClick},void 0)]}),void 0);function handleOnClick(){onClick===null||onClick===void 0?void 0:onClick();if(shouldRegister){history.push({pathname:buildPath('/register')});}else {history.push({pathname:'/logout',search:queryString.stringify({source:getAppUrl()+buildPath("/login?"+queryString.stringify({source:location.pathname}))})});}}};var PublicUserButtonFocusStyle=createGlobalStyle(templateObject_1$1d||(templateObject_1$1d=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),function(p){return applyFocusStyle("\n button[data-public-access-button]:focus::after {\n outline-color: "+p.theme.palette.accent+" !important;\n outline-offset: 2px;\n }\n ");});var Description$1=_styled(FormattedMessageWithStyle).withConfig({displayName:"PublicUserFullAccessButton__Description",componentId:"sc-tjhzmp-0"})(templateObject_2$H||(templateObject_2$H=__makeTemplateObject(["\n margin-top: 0;\n color: ",";\n"],["\n margin-top: 0;\n color: ",";\n"])),function(p){return p.theme.textColors.default;});var templateObject_1$1d,templateObject_2$H;var PublishableItemComments=function PublishableItemComments(_a){var item=_a.item,readOnly=_a.readOnly,loadInReadOnlyMode=_a.loadInReadOnlyMode,type=_a.type,onThreadReply=_a.onThreadReply,hideProfileUrl=_a.hideProfileUrl,disableLoginForPublicUser=_a.disableLoginForPublicUser;var container=useRef$1();var location=useLocation$1();var searchAccountsByItemId=useAccountApi().searchAccountsByItemId;var user=useCurrentUser();useEffect$1(function(){// scroll comments container into view if there is the corresponding hash in the path.
122316
+ refreshUserDetails();setNextPageInfos({token:nextPage.paginationToken,hasMoreUnreadComments:nextPage.hasMoreUnreadComments});}return [2/*return*/];}});});}}var templateObject_1$1c,templateObject_2$G,templateObject_3$t,templateObject_4$i,templateObject_5$h,templateObject_6$a,templateObject_7$5$1;var PublicUserFullAccessButton=function PublicUserFullAccessButton(_a){var user=_a.user,onClick=_a.onClick,descriptionResourceKeyPrefix=_a.descriptionResourceKeyPrefix,descriptionValues=_a.descriptionValues,className=_a.className;var formatMessage=useIntl().formatMessage;var history=useHistory();var location=useLocation$1();var buildPath=useSubscriptionHandlePathBuilder().buildPath;var shouldRegister=user.subscription.allowSelfRegistration&&user.authenticationType!==AuthenticationType.public;return jsxs("div",__assign({className:className},{children:[jsx$1(PublicUserButtonFocusStyle,{},void 0),descriptionResourceKeyPrefix&&jsx$1(Description$1,{id:descriptionResourceKeyPrefix+"."+(shouldRegister?'register':'login'),values:descriptionValues,tagName:"p"},void 0),jsx$1(PrimaryButton,{"data-public-access-button":true,text:formatMessage({id:shouldRegister?'SelfRegistration.register':'Subscription.login.caption'}),onClick:handleOnClick},void 0)]}),void 0);function handleOnClick(){onClick===null||onClick===void 0?void 0:onClick();if(shouldRegister){history.push({pathname:buildPath('/register')});}else {history.push({pathname:'/logout',search:queryString.stringify({source:getAppUrl()+buildPath("/login?"+queryString.stringify({source:location.pathname}))})});}}};var PublicUserButtonFocusStyle=createGlobalStyle(templateObject_1$1b||(templateObject_1$1b=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),function(p){return applyFocusStyle("\n button[data-public-access-button]:focus::after {\n outline-color: "+p.theme.palette.accent+" !important;\n outline-offset: 2px;\n }\n ");});var Description$1=_styled(FormattedMessageWithStyle).withConfig({displayName:"PublicUserFullAccessButton__Description",componentId:"sc-tjhzmp-0"})(templateObject_2$F||(templateObject_2$F=__makeTemplateObject(["\n margin-top: 0;\n color: ",";\n"],["\n margin-top: 0;\n color: ",";\n"])),function(p){return p.theme.textColors.default;});var templateObject_1$1b,templateObject_2$F;var PublishableItemComments=function PublishableItemComments(_a){var item=_a.item,readOnly=_a.readOnly,loadInReadOnlyMode=_a.loadInReadOnlyMode,type=_a.type,onThreadReply=_a.onThreadReply,hideProfileUrl=_a.hideProfileUrl,disableLoginForPublicUser=_a.disableLoginForPublicUser;var container=useRef$1();var location=useLocation$1();var searchAccountsByItemId=useAccountApi().searchAccountsByItemId;var user=useCurrentUser();useEffect$1(function(){// scroll comments container into view if there is the corresponding hash in the path.
122320
122317
  // HACK: a regular anchor does not work, because content is rendered
122321
122318
  // dynamically and the comments might not be in DOM at the right time.
122322
122319
  // TODO: Try to avoid this.
122323
122320
  // It might be a little better, once the lazy loaded feedback & statistics buttons are all in one row
122324
- if(container.current&&location.hash==='#comments'){setTimeout(function(){return container.current.scrollIntoView(true);},500);}},[location.hash]);return jsxs(Container,__assign({ref:container,id:"comments"},{children:[!user.isPublicUser&&jsx$1(StyledPagedCommentsSection$1,{mentionSearchHandler:getMentionsSearchHandler,readOnly:readOnly,loadInReadOnlyMode:loadInReadOnlyMode,itemId:item.id,groupIds:item.groupIds,type:type,initialPageSize:5,scope:ConversationScope.Public,noItemsYetStringResourceKey:"NewsArticle.comments.empty",baseAttachmentPath:"/"+type+"/"+item.id+"/comments",buttons:jsx$1(FollowButton,{type:type,itemId:item.id,scope:ConversationScope.Public,hideProfileUrl:hideProfileUrl},void 0),title:jsx$1(CommentsHeading,__assign({className:"comments-title"},{children:jsx$1(FormattedMessage$1,{id:"NewsArticle.comments"},void 0)}),void 0),onThreadReply:onThreadReply},item.id),user.isPublicUser&&jsxs(PublicUserButtonContainer,{children:[jsx$1(FormattedMessage$1,{id:"NewsArticle.comments.publicAccessMessage"},void 0),!disableLoginForPublicUser&&jsx$1(StyledPublicUserFullAccessButton,{user:{authenticationType:user.authenticationType,subscription:{subscriptionId:user.subscription.id,allowSelfRegistration:user.subscription.allowSelfRegistration}}},void 0)]},void 0)]}),void 0);function getMentionsSearchHandler(searchText){return searchAccountsByItemId(GroupRoles.Reader,item.id,searchText);}};var Container=_styled.div.withConfig({displayName:"PublishableItemComments__Container",componentId:"sc-5vaunf-0"})(templateObject_1$1c||(templateObject_1$1c=__makeTemplateObject(["\n padding-top: 0.5em;\n padding-bottom: 1.5em;\n"],["\n padding-top: 0.5em;\n padding-bottom: 1.5em;\n"])));var FollowButton=_styled(FollowComments).withConfig({displayName:"PublishableItemComments__FollowButton",componentId:"sc-5vaunf-1"})(templateObject_2$G||(templateObject_2$G=__makeTemplateObject(["\n margin-bottom: ","px;\n"],["\n margin-bottom: ","px;\n"])),spacingXs);var StyledPublicUserFullAccessButton=_styled(PublicUserFullAccessButton).withConfig({displayName:"PublishableItemComments__StyledPublicUserFullAccessButton",componentId:"sc-5vaunf-2"})(templateObject_3$u||(templateObject_3$u=__makeTemplateObject(["\n margin-top: ","px;\n"],["\n margin-top: ","px;\n"])),spacingM);var StyledPagedCommentsSection$1=_styled(PagedCommentsSection).withConfig({displayName:"PublishableItemComments__StyledPagedCommentsSection",componentId:"sc-5vaunf-3"})(templateObject_4$j||(templateObject_4$j=__makeTemplateObject(["\n /* This matches the Load More button and comments that have a highlight */\n [data-show-highlight='true'] {\n &::after {\n @media (min-width: ","px) {\n right: -","px;\n }\n\n right: -","px;\n }\n }\n"],["\n /* This matches the Load More button and comments that have a highlight */\n [data-show-highlight='true'] {\n &::after {\n @media (min-width: ","px) {\n right: -","px;\n }\n\n right: -","px;\n }\n }\n"])),minScreenSize.small,detailViewSectionPaddingLarge,detailViewSectionPadding);var PublicUserButtonContainer=_styled.div.withConfig({displayName:"PublishableItemComments__PublicUserButtonContainer",componentId:"sc-5vaunf-4"})(templateObject_5$i||(templateObject_5$i=__makeTemplateObject(["\n margin-top: ","px;\n"],["\n margin-top: ","px;\n"])),spacingM);var CommentsHeading=_styled.h2.withConfig({displayName:"PublishableItemComments__CommentsHeading",componentId:"sc-5vaunf-5"})(templateObject_6$a||(templateObject_6$a=__makeTemplateObject(["\n font-size: 1.17rem; // equivalent of h3\n"],["\n font-size: 1.17rem; // equivalent of h3\n"])));var templateObject_1$1c,templateObject_2$G,templateObject_3$u,templateObject_4$j,templateObject_5$i,templateObject_6$a;var FeedbackButtonContext=/*#__PURE__*/createContext(null);var FeedbackButtons=function FeedbackButtons(_a){var resourceType=_a.resourceType,item=_a.item,hasFeedbackEnabled=_a.hasFeedbackEnabled,language=_a.language,className=_a.className,children=_a.children;var getStatistics=useNewsApi().getStatistics;var _b=useState$2(null),statistics=_b[0],setStatistics=_b[1];var showError=useNotificationContext().showError;useEffect$1(function(){var updateStatisticsSubscription=onStatisticsUpdated.subscribe(setStatistics);return function(){return updateStatisticsSubscription.unsubscribe();};// eslint-disable-next-line react-hooks/exhaustive-deps
122321
+ if(container.current&&location.hash==='#comments'){setTimeout(function(){return container.current.scrollIntoView(true);},500);}},[location.hash]);return jsxs(Container,__assign({ref:container,id:"comments"},{children:[!user.isPublicUser&&jsx$1(StyledPagedCommentsSection$1,{mentionSearchHandler:getMentionsSearchHandler,readOnly:readOnly,loadInReadOnlyMode:loadInReadOnlyMode,itemId:item.id,groupIds:item.groupIds,type:type,initialPageSize:5,scope:ConversationScope.Public,noItemsYetStringResourceKey:"NewsArticle.comments.empty",baseAttachmentPath:"/"+type+"/"+item.id+"/comments",buttons:jsx$1(FollowButton,{type:type,itemId:item.id,scope:ConversationScope.Public,hideProfileUrl:hideProfileUrl},void 0),title:jsx$1(CommentsHeading,__assign({className:"comments-title"},{children:jsx$1(FormattedMessage$1,{id:"NewsArticle.comments"},void 0)}),void 0),onThreadReply:onThreadReply},item.id),user.isPublicUser&&jsxs(PublicUserButtonContainer,{children:[jsx$1(FormattedMessage$1,{id:"NewsArticle.comments.publicAccessMessage"},void 0),!disableLoginForPublicUser&&jsx$1(StyledPublicUserFullAccessButton,{user:{authenticationType:user.authenticationType,subscription:{subscriptionId:user.subscription.id,allowSelfRegistration:user.subscription.allowSelfRegistration}}},void 0)]},void 0)]}),void 0);function getMentionsSearchHandler(searchText){return searchAccountsByItemId(GroupRoles.Reader,item.id,searchText);}};var Container=_styled.div.withConfig({displayName:"PublishableItemComments__Container",componentId:"sc-5vaunf-0"})(templateObject_1$1a||(templateObject_1$1a=__makeTemplateObject(["\n padding-top: 0.5em;\n padding-bottom: 1.5em;\n"],["\n padding-top: 0.5em;\n padding-bottom: 1.5em;\n"])));var FollowButton=_styled(FollowComments).withConfig({displayName:"PublishableItemComments__FollowButton",componentId:"sc-5vaunf-1"})(templateObject_2$E||(templateObject_2$E=__makeTemplateObject(["\n margin-bottom: ","px;\n"],["\n margin-bottom: ","px;\n"])),spacingXs);var StyledPublicUserFullAccessButton=_styled(PublicUserFullAccessButton).withConfig({displayName:"PublishableItemComments__StyledPublicUserFullAccessButton",componentId:"sc-5vaunf-2"})(templateObject_3$s||(templateObject_3$s=__makeTemplateObject(["\n margin-top: ","px;\n"],["\n margin-top: ","px;\n"])),spacingM);var StyledPagedCommentsSection$1=_styled(PagedCommentsSection).withConfig({displayName:"PublishableItemComments__StyledPagedCommentsSection",componentId:"sc-5vaunf-3"})(templateObject_4$h||(templateObject_4$h=__makeTemplateObject(["\n /* This matches the Load More button and comments that have a highlight */\n [data-show-highlight='true'] {\n &::after {\n @media (min-width: ","px) {\n right: -","px;\n }\n\n right: -","px;\n }\n }\n"],["\n /* This matches the Load More button and comments that have a highlight */\n [data-show-highlight='true'] {\n &::after {\n @media (min-width: ","px) {\n right: -","px;\n }\n\n right: -","px;\n }\n }\n"])),minScreenSize.small,detailViewSectionPaddingLarge,detailViewSectionPadding);var PublicUserButtonContainer=_styled.div.withConfig({displayName:"PublishableItemComments__PublicUserButtonContainer",componentId:"sc-5vaunf-4"})(templateObject_5$g||(templateObject_5$g=__makeTemplateObject(["\n margin-top: ","px;\n"],["\n margin-top: ","px;\n"])),spacingM);var CommentsHeading=_styled.h2.withConfig({displayName:"PublishableItemComments__CommentsHeading",componentId:"sc-5vaunf-5"})(templateObject_6$9||(templateObject_6$9=__makeTemplateObject(["\n font-size: 1.17rem; // equivalent of h3\n"],["\n font-size: 1.17rem; // equivalent of h3\n"])));var templateObject_1$1a,templateObject_2$E,templateObject_3$s,templateObject_4$h,templateObject_5$g,templateObject_6$9;var FeedbackButtonContext=/*#__PURE__*/createContext(null);var FeedbackButtons=function FeedbackButtons(_a){var resourceType=_a.resourceType,item=_a.item,hasFeedbackEnabled=_a.hasFeedbackEnabled,language=_a.language,className=_a.className,children=_a.children;var getStatistics=useNewsApi().getStatistics;var _b=useState$2(null),statistics=_b[0],setStatistics=_b[1];var showError=useNotificationContext().showError;useEffect$1(function(){var updateStatisticsSubscription=onStatisticsUpdated.subscribe(setStatistics);return function(){return updateStatisticsSubscription.unsubscribe();};// eslint-disable-next-line react-hooks/exhaustive-deps
122325
122322
  },[]);var comparableStatistics=JSON.stringify(item.statistics);useEffect$1(function(){loadStatistics(item).then(function(){return null;});// eslint-disable-next-line react-hooks/exhaustive-deps
122326
- },[item.id,comparableStatistics]);if(!statistics){return null;}return jsx$1(FeedbackButtonContext.Provider,__assign({value:{statistics:statistics,language:language,item:item,resourceType:resourceType,hasFeedbackEnabled:hasFeedbackEnabled}},{children:jsx$1(FeedbackButtonsContainer,__assign({className:className},{children:Children.map(children,function(child){return jsx$1("li",{children:child},void 0);})}),void 0)}),void 0);function loadStatistics(item){return __awaiter(this,void 0,void 0,function(){var newStatistics,error_1;return __generator(this,function(_a){switch(_a.label){case 0:if(item.statistics){setStatistics(item.statistics);return [2/*return*/];}_a.label=1;case 1:_a.trys.push([1,3,,4]);return [4/*yield*/,getStatistics(item.id)];case 2:newStatistics=_a.sent();setStatistics(newStatistics);return [3/*break*/,4];case 3:error_1=_a.sent();logger.error(error_1);showError('NewsArticle.loadStatistics_error');return [3/*break*/,4];case 4:return [2/*return*/];}});});}};var FeedbackButtonsContainer=_styled.ul.withConfig({displayName:"FeedbackButtons__FeedbackButtonsContainer",componentId:"sc-1vjmzsz-0"})(templateObject_1$1b||(templateObject_1$1b=__makeTemplateObject(["\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n margin: 0;\n padding: 0;\n list-style: none;\n\n > * {\n margin-bottom: 15px;\n }\n"],["\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n margin: 0;\n padding: 0;\n list-style: none;\n\n > * {\n margin-bottom: 15px;\n }\n"])));var templateObject_1$1b;var ThreadView=function ThreadView(_a){var _b;var parentComment=_a.parentComment,commentReplies=_a.commentReplies,scope=_a.scope,mentionSearchHandler=_a.mentionSearchHandler,type=_a.type,groupIds=_a.groupIds,baseAttachmentPath=_a.baseAttachmentPath,getHashtagFilterRoute=_a.getHashtagFilterRoute,onThreadCommentDelete=_a.onThreadCommentDelete,onShowAllComments=_a.onShowAllComments,className=_a.className;var user=useCurrentUser();var deleteComment=useCommentApi().deleteComment;var showError=useNotificationContext().showError;var history=useHistory();var location=useLocation$1();var showAutoTranslate=(parentComment===null||parentComment===void 0?void 0:parentComment.sender.id)!==user.id;var screenSize=useWindowSize$2();var placeHolderStringResourceKey=screenSize.width>maxScreenSize.medium?'Comment.threads.replyTo':'Comment.threads.replyTo.mobile';var _c=useState$2(commentReplies),replies=_c[0],setReplies=_c[1];var _d=useState$2(true),isDialogHidden=_d[0],setIsDialogHidden=_d[1];var _e=useState$2(((_b=parentComment.statistics)===null||_b===void 0?void 0:_b.replyCount)||0),replyCount=_e[0],setReplyCount=_e[1];usePageViewTracker(type+"/"+parentComment.parentItemId+"/comments",parentComment.id);return jsxs("div",__assign({className:className},{children:[jsx$1(ConfirmDialog,{onClose:function(){return setIsDialogHidden(true);},onConfirm:handleDeleteThread,showDialog:!isDialogHidden,titleResourceKey:"Comment.delete.title",infoResourceKey:"Comment.delete.description"},void 0),jsx$1(CommentDisplay,{scope:scope,message:parentComment,showDelete:canDelete(parentComment),showEdit:canEdit(parentComment),showAutoTranslate:showAutoTranslate,type:type,highlight:parentComment.isUnread,isInitialLiked:parentComment.isLiked,mentionSearchHandler:mentionSearchHandler,baseAttachmentPath:baseAttachmentPath,onDelete:function(){return setIsDialogHidden(false);},getHashtagFilterRoute:getHashtagFilterRoute,replyCount:replyCount,onReplyIconClick:handleShowAllComments},parentComment.receivedDateTime),jsx$1(CommentReplies,{threadId:parentComment.id,initialPageSize:5,pageSize:5,type:type,baseAttachmentPath:baseAttachmentPath+"/"+parentComment.id+"/replies",mentionSearchHandler:mentionSearchHandler,groupIds:groupIds,getHashtagFilterRoute:getHashtagFilterRoute,readOnly:false,scope:scope,itemId:parentComment.parentItemId,autoFocusReplyField:!env.isTouchDevice,initialComments:replies,onCommentDeleted:deleteReply,onCommentAdded:function(){return setReplyCount(function(count){return count+1;});},showReplyBox:true,placeHolderStringResourceKey:placeHolderStringResourceKey,placeHolderStringResourceValues:{name:parentComment===null||parentComment===void 0?void 0:parentComment.sender.displayName}},parentComment.parentItemId),jsx$1(ShowAllCommentsButton,__assign({iconProps:{iconName:'ReturnKey'},onClick:handleShowAllComments,"data-show-all-comments":true},{children:jsx$1(FormattedMessage$1,{id:"Comment.showAllComments"},void 0)}),void 0)]}),void 0);function canDelete(comment){return canEdit(comment)||hasMinRoleInAllGroups(GroupRoles.Admin,user,groupIds);}function canEdit(comment){return comment.sender&&comment.sender.id===user.id;}function deleteReply(reply){setReplies(__assign(__assign({},replies),{items:replies.items.filter(function(c){return c.id!==reply.id;})}));setReplyCount(function(count){return count-1;});}function handleDeleteThread(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_b){switch(_b.label){case 0:_b.trys.push([0,2,,3]);return [4/*yield*/,deleteComment(type,scope,parentComment.parentItemId,parentComment.id)];case 1:_b.sent();onThreadCommentDelete();return [3/*break*/,3];case 2:_b.sent();showError('Generic.error');return [3/*break*/,3];case 3:return [2/*return*/];}});});}function handleShowAllComments(){history.replace(__assign(__assign({},location),{state:{parentCommentId:"Comment-"+parentComment.id}}));onShowAllComments===null||onShowAllComments===void 0?void 0:onShowAllComments();}};var CommentReplies=_styled(PagedCommentsSection).withConfig({displayName:"ThreadView__CommentReplies",componentId:"sc-1c4y6ek-0"})(templateObject_1$1a||(templateObject_1$1a=__makeTemplateObject(["\n padding-left: ","px;\n"],["\n padding-left: ","px;\n"])),spacingL);var ShowAllCommentsButton=_styled(ActionButton).withConfig({displayName:"ThreadView__ShowAllCommentsButton",componentId:"sc-1c4y6ek-1"})(templateObject_2$F||(templateObject_2$F=__makeTemplateObject(["\n margin: ","px 0 0 ","px;\n"],["\n margin: ","px 0 0 ","px;\n"])),spacingS,spacingL);var templateObject_1$1a,templateObject_2$F;var PublishableItemThreadView=function PublishableItemThreadView(_a){var item=_a.item,type=_a.type,threadId=_a.threadId,onShowAllComments=_a.onShowAllComments,onThreadCommentDelete=_a.onThreadCommentDelete;var searchAccountsByItemId=useAccountApi().searchAccountsByItemId;var getCommentThread=useCommentApi().getCommentThread;var _b=usePromise$2(function(){return getCommentThread(type,item.id,threadId);},null),comments=_b[0],isLoading=_b[1];if(isLoading){return jsx$1(StyledSpinner,{},void 0);}var parentComment=comments===null||comments===void 0?void 0:comments.items.find(function(c){return c.id===threadId;});if(!parentComment||parentComment.threadId!=null){return jsx$1(Host$t,{children:jsx$1(FormattedMessage$1,{id:'NewsArticle.thread.empty'},void 0)},void 0);}return jsx$1(Host$t,{children:jsx$1(StyledThreadView$1,{parentComment:parentComment,commentReplies:{items:comments===null||comments===void 0?void 0:comments.items.filter(function(c){return c!==parentComment&&c.threadId===parentComment.id;}),paginationToken:comments===null||comments===void 0?void 0:comments.paginationToken,nextItem:comments===null||comments===void 0?void 0:comments.nextItem,hasMoreUnreadComments:comments===null||comments===void 0?void 0:comments.hasMoreUnreadComments},scope:ConversationScope.Public,groupIds:item.groupIds,baseAttachmentPath:"/"+type+"/"+item.id+"/comments",mentionSearchHandler:getMentionsSearchHandler,type:type,onThreadCommentDelete:onThreadCommentDelete,onShowAllComments:onShowAllComments},void 0)},void 0);function getMentionsSearchHandler(searchText){return searchAccountsByItemId(GroupRoles.Reader,item.id,searchText);}};var Host$t=_styled.div.withConfig({displayName:"PublishableItemThreadView__Host",componentId:"sc-1yiyuzb-0"})(templateObject_1$19||(templateObject_1$19=__makeTemplateObject(["\n padding: 1.5em ","px;\n background-color: ",";\n\n @media (min-width: ","px) {\n padding: 1.5em ","px;\n }\n"],["\n padding: 1.5em ","px;\n background-color: ",";\n\n @media (min-width: ","px) {\n padding: 1.5em ","px;\n }\n"])),detailViewSectionPadding,function(p){return p.theme.palette.neutralLight;},minScreenSize.small,detailViewSectionPaddingLarge);var StyledSpinner=_styled(Spinner).withConfig({displayName:"PublishableItemThreadView__StyledSpinner",componentId:"sc-1yiyuzb-1"})(templateObject_2$E||(templateObject_2$E=__makeTemplateObject(["\n margin: 5% 0;\n"],["\n margin: 5% 0;\n"])));var StyledThreadView$1=_styled(ThreadView).withConfig({displayName:"PublishableItemThreadView__StyledThreadView",componentId:"sc-1yiyuzb-2"})(templateObject_3$t||(templateObject_3$t=__makeTemplateObject(["\n /* This matches the Load More button and comments that have a highlight */\n [data-show-highlight='true'] {\n &::after {\n @media (min-width: ","px) {\n right: -","px;\n }\n\n right: -","px;\n }\n }\n"],["\n /* This matches the Load More button and comments that have a highlight */\n [data-show-highlight='true'] {\n &::after {\n @media (min-width: ","px) {\n right: -","px;\n }\n\n right: -","px;\n }\n }\n"])),minScreenSize.small,detailViewSectionPaddingLarge,detailViewSectionPadding);var templateObject_1$19,templateObject_2$E,templateObject_3$t;var FeedbackSection=function FeedbackSection(_a){var _b,_c;var type=_a.type,item=_a.item,language=_a.language,feedbackSettings=_a.feedbackSettings,hideComments=_a.hideComments,hideProfileUrl=_a.hideProfileUrl,disableLoginForPublicUser=_a.disableLoginForPublicUser,isReadOnly=_a.isReadOnly,children=_a.children,className=_a.className;var features=useFeatures();var formatMessage=useIntl().formatMessage;var match=useRouteMatch();var history=useHistory();var location=useLocation$1();var buildPath=useSubscriptionHandlePathBuilder().buildPath;var _d=useState$2((_c=(_b=match.params)===null||_b===void 0?void 0:_b.threadId)!==null&&_c!==void 0?_c:null),threadId=_d[0],setThreadId=_d[1];var showComments=features.comments&&hasFeedbackEnabled('comment')&&!hideComments;var showThreadView=features.replyToComments&&threadId!=null;var hasPublishedVersion=item.publishedVersionId!=null||item.isCurrentPublishedVersion;return jsxs(Fragment,{children:[jsx$1("section",__assign({className:className,"aria-label":formatMessage({id:'Generic.feedbackButtons'})},{children:jsx$1(StyledFeedbackButtons,__assign({resourceType:type,item:item,language:language,hasFeedbackEnabled:hasFeedbackEnabled},{children:children}),void 0)}),void 0),showComments&&(!showThreadView?jsx$1("section",__assign({id:"comments","data-comment-section":true,className:classNames('ms-bgColor-neutralLight',className),"aria-label":formatMessage({id:'AriaLabel.section.comments'})},{children:jsx$1(PublishableItemComments,{item:item,type:type,onThreadReply:features.replyToComments?setThreadId:null,hideProfileUrl:hideProfileUrl,disableLoginForPublicUser:disableLoginForPublicUser,readOnly:isReadOnly,loadInReadOnlyMode:isReadOnly&&hasPublishedVersion},void 0)}),void 0):jsx$1("section",__assign({"aria-label":formatMessage({id:'AriaLabel.section.comments'})},{children:jsx$1(PublishableItemThreadView,{item:item,type:type,threadId:threadId,onShowAllComments:handleOnShowAllComments,onThreadCommentDelete:handleThreadCommentDelete},void 0)}),void 0))]},void 0);function handleThreadCommentDelete(){var _a;// not using threadId here since we can still have a non thread path but be inline with the thread view
122327
- if((_a=match.params)===null||_a===void 0?void 0:_a.threadId){history.push(__assign(__assign({},location),{pathname:buildPath("/"+type+"/"+item.id)}));}setThreadId(null);}function hasFeedbackEnabled(feedbackType){return hasFeedbackType(feedbackSettings||{},feedbackType);}function handleOnShowAllComments(){var _a;setThreadId(null);if((_a=match.params)===null||_a===void 0?void 0:_a.threadId){history.push(__assign(__assign({},location),{pathname:buildPath(type+"/"+item.id)}));}}};var StyledFeedbackButtons=_styled(FeedbackButtons).withConfig({displayName:"FeedbackSection__StyledFeedbackButtons",componentId:"sc-3bzj8d-0"})(templateObject_1$18||(templateObject_1$18=__makeTemplateObject(["\n padding-bottom: ",";\n @media (max-width: 500px) {\n margin-bottom: 15px;\n }\n"],["\n padding-bottom: ",";\n @media (max-width: 500px) {\n margin-bottom: 15px;\n }\n"])),function(p){return p.showComments?'15px':'30px';});var templateObject_1$18;var FeedbackButtonLike=function FeedbackButtonLike(_a){var isReadOnly=_a.isReadOnly;var refreshStatistics=useNewsApi().refreshStatistics;var features=useFeatures();var _b=useContext(FeedbackButtonContext),item=_b.item,likeCount=_b.statistics.likeCount,resourceType=_b.resourceType,hasFeedbackEnabled=_b.hasFeedbackEnabled;var _c=useFeedbackApi(),getFeedback=_c.getFeedback,setFeedback=_c.setFeedback,unsetFeedback=_c.unsetFeedback;var showError=useNotificationContext().showError;var _d=usePromise$2(getLikeState,false,[item.id]),isLiked=_d[0],isLoading=_d[1],setIsLiked=_d[3];var _e=useState$2(false),isSaving=_e[0],setIsSaving=_e[1];if(!features.likes||!hasFeedbackEnabled('like')){return null;}return jsx$1(LikeButton,{itemType:resourceType,itemId:item.id,isActive:isLiked,readOnly:isLoading||isSaving||isReadOnly,count:likeCount,onClick:function(){return handleLikeChanged(!isLiked);},isDemoContent:item.isDemoContent},void 0);function getLikeState(){var _a;return __awaiter(this,void 0,void 0,function(){var hasPublishedVersion,feedbackSummary;return __generator(this,function(_b){switch(_b.label){case 0:hasPublishedVersion=item.publishedVersionId!=null||item.isCurrentPublishedVersion;if(isReadOnly&&!hasPublishedVersion){return [2/*return*/,false];}if(!features.likes||!hasFeedbackEnabled('like')){return [2/*return*/,false];}return [4/*yield*/,getFeedback(resourceType,item.id)];case 1:feedbackSummary=_b.sent();return [2/*return*/,((_a=feedbackSummary.records)===null||_a===void 0?void 0:_a.findIndex(function(r){return r.type==='like';}))>-1];}});});}function handleLikeChanged(isNowLiked){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_b){switch(_b.label){case 0:if(isSaving||isLoading){return [2/*return*/];}setIsSaving(true);setIsLiked(isNowLiked);return [4/*yield*/,refreshStatistics(item.id,{likeCount:isNowLiked?1:-1})];case 1:_b.sent();_b.label=2;case 2:_b.trys.push([2,7,9,10]);if(!isNowLiked)return [3/*break*/,4];return [4/*yield*/,setFeedback(resourceType,item.id,'like')];case 3:_b.sent();return [3/*break*/,6];case 4:return [4/*yield*/,unsetFeedback(resourceType,item.id,'like')];case 5:_b.sent();_b.label=6;case 6:return [3/*break*/,10];case 7:_b.sent();setIsLiked(!isNowLiked);return [4/*yield*/,refreshStatistics(item.id,{likeCount:isNowLiked?-1:1})];case 8:_b.sent();showError('NewsArticle.setFeedback_error');return [3/*break*/,10];case 9:setIsSaving(false);return [7/*endfinally*/];case 10:return [2/*return*/];}});});}};var FeedbackButtonComments=function FeedbackButtonComments(){var features=useFeatures();var formatMessage=useIntl().formatMessage;var _a=useContext(FeedbackButtonContext),commentCount=_a.statistics.commentCount,resourceType=_a.resourceType,hasFeedbackEnabled=_a.hasFeedbackEnabled;if(!features.comments||!hasFeedbackEnabled('comment')){return null;}return jsx$1(FeedbackCountButton,{count:commentCount,iconName:"Chat",readOnly:true,tooltipResourceKey:resourceType===ItemResourceTypes.Pages?'Page.numberOfComments':'NewsArticle.numberOfComments',tooltipResourceKeyValues:{count:commentCount},ariaLabel:formatMessage({id:'AriaLabel.commentsButton'}),feedbackType:"comment"},void 0);};var FeedbackButtonViews=function FeedbackButtonViews(){var _a=useContext(FeedbackButtonContext),readCount=_a.statistics.readCount,resourceType=_a.resourceType;var formatMessage=useIntl().formatMessage;var resourceKey=getResourceKey();return jsx$1(FeedbackCountButton,{count:readCount,iconName:"View",readOnly:true,tooltipResourceKey:resourceKey,tooltipResourceKeyValues:{count:readCount},ariaLabel:formatMessage({id:resourceKey},{count:readCount}),feedbackType:"view"},void 0);function getResourceKey(){if(resourceType===ItemResourceTypes.Pages){return 'Page.readersTooltip';}if(resourceType===ItemResourceTypes.News){return 'NewsArticle.readersTooltip';}return 'Events.readersTooltip';}};var EventDownloadCalendarFileButton=function EventDownloadCalendarFileButton(_a){var item=_a.item,className=_a.className;var user=useCurrentUser();var createApiUrl=useApiFactory().createApiUrl;var formatMessage=useIntl().formatMessage;return jsx$1(Host$s,__assign({className:className},{children:jsx$1(Tooltip,__assign({resourceKey:"Events.downloadCalendarFile"},{children:jsx$1(DownloadLink,__assign({href:getDownloadUrl(),"aria-label":formatMessage({id:'Events.downloadCalendarFile'})},{children:jsx$1(Icon,{iconName:"AddEvent"},void 0)}),void 0)}),void 0)}),void 0);function getDownloadUrl(){return createApiUrl("/events/"+encodeURI(item.id)+"/export",{access_token:item.fileAccessToken,subscriptionId:user.subscription.id});}};var Host$s=_styled.div.withConfig({displayName:"EventDownloadCalendarFileButton__Host",componentId:"sc-1hjuosf-0"})(templateObject_1$17||(templateObject_1$17=__makeTemplateObject(["\n && {\n > div {\n display: inline-block;\n }\n\n i {\n font-size: 22px;\n }\n }\n"],["\n && {\n > div {\n display: inline-block;\n }\n\n i {\n font-size: 22px;\n }\n }\n"])));var DownloadLink=_styled.a.withConfig({displayName:"EventDownloadCalendarFileButton__DownloadLink",componentId:"sc-1hjuosf-1"})(templateObject_2$D||(templateObject_2$D=__makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n height: ","px;\n width: ","px;\n color: ",";\n"],["\n display: flex;\n align-items: center;\n justify-content: center;\n height: ","px;\n width: ","px;\n color: ",";\n"])),feedbackButtonHeight,feedbackButtonHeight,function(p){return p.theme.textColors.default;});var templateObject_1$17,templateObject_2$D;var EventFeedbackButtonDownloadCalendarFile=function EventFeedbackButtonDownloadCalendarFile(){var item=useContext(FeedbackButtonContext).item;return jsx$1(StyledEventDownloadCalendarFileButton,{item:item},void 0);};var StyledEventDownloadCalendarFileButton=_styled(EventDownloadCalendarFileButton).withConfig({displayName:"EventFeedbackButtonDownloadCalendarFile__StyledEventDownloadCalendarFileButton",componentId:"sc-dsznxm-0"})(templateObject_1$16||(templateObject_1$16=__makeTemplateObject(["\n min-width: 60px;\n margin-right: 9px;\n"],["\n min-width: 60px;\n margin-right: 9px;\n"])));var templateObject_1$16;var ShareButton=function ShareButton(_a){var url=_a.url,isReadOnly=_a.isReadOnly,className=_a.className;var copyContainerRef=useRef$1();var _b=useState$2(false),didCopy=_b[0],setDidCopy=_b[1];var onShare=useContext(LinkContext).onShare;var formatMessage=useIntl().formatMessage;return jsx$1(Host$r,__assign({className:className},{children:jsx$1(Tooltip,__assign({resourceKey:"ShareButton.ActionDescription"},{children:jsxs(StyledIconWithCallout,__assign({icon:"Share",onIconClick:function(){return __awaiter(void 0,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,onShare(url)];case 1:return [2/*return*/,_a.sent()];}});});},onCalloutDismissed:function(){return setDidCopy(false);},directionalHint:DirectionalHint.topAutoEdge,ariaLabel:formatMessage({id:'ShareButton.ActionDescription'}),disabled:isReadOnly},{children:[jsx$1(FormattedMessage$1,{id:"ShareButton.ActionDescription"},void 0),jsxs(CopyContainer,__assign({ref:copyContainerRef},{children:[jsx$1(CopyField,{value:url,readOnly:true,onFocus:handleTextFieldFocus,onMouseUp:function(e){return e.preventDefault();},ariaLabel:formatMessage({id:'AriaLabel.shareButton.copyField'})},void 0),jsx$1(CopyIconButton,{iconProps:{iconName:'Copy'},onClick:copyToClipBoard,ariaLabel:formatMessage({id:'AriaLabel.copyText'})},void 0)]}),void 0),didCopy&&jsx$1(FormattedMessage$1,{id:"ShareButton.CopySuccess"},void 0)]}),void 0)}),void 0)}),void 0);function copyToClipBoard(){var tempTextField=document.createElement('textarea');tempTextField.innerText=url;copyContainerRef.current.appendChild(tempTextField);tempTextField.select();document.execCommand('copy');copyContainerRef.current.removeChild(tempTextField);setDidCopy(true);}function handleTextFieldFocus(event){event.target.select();}};var Host$r=_styled.div.withConfig({displayName:"ShareButton__Host",componentId:"sc-6avyh0-0"})(templateObject_1$15||(templateObject_1$15=__makeTemplateObject(["\n display: flex;\n align-items: center;\n"],["\n display: flex;\n align-items: center;\n"])));var StyledIconWithCallout=_styled(IconWithCallout).withConfig({displayName:"ShareButton__StyledIconWithCallout",componentId:"sc-6avyh0-1"})(templateObject_2$C||(templateObject_2$C=__makeTemplateObject(["\n button {\n height: ","px;\n }\n\n i {\n font-size: ","px;\n }\n"],["\n button {\n height: ","px;\n }\n\n i {\n font-size: ","px;\n }\n"])),feedbackButtonHeight,fontSizeMedium+4);var CopyContainer=_styled.div.withConfig({displayName:"ShareButton__CopyContainer",componentId:"sc-6avyh0-2"})(templateObject_3$s||(templateObject_3$s=__makeTemplateObject(["\n display: flex;\n align-items: center;\n padding: 15px 0;\n"],["\n display: flex;\n align-items: center;\n padding: 15px 0;\n"])));var CopyField=_styled(TextField).withConfig({displayName:"ShareButton__CopyField",componentId:"sc-6avyh0-3"})(templateObject_4$i||(templateObject_4$i=__makeTemplateObject(["\n padding-right: ","px;\n width: 400px;\n"],["\n padding-right: ","px;\n width: 400px;\n"])),spacingS);var CopyIconButton=_styled(IconButton).withConfig({displayName:"ShareButton__CopyIconButton",componentId:"sc-6avyh0-4"})(templateObject_5$h||(templateObject_5$h=__makeTemplateObject(["\n i {\n font-size: ","px;\n }\n"],["\n i {\n font-size: ","px;\n }\n"])),fontSizeMedium+4);var templateObject_1$15,templateObject_2$C,templateObject_3$s,templateObject_4$i,templateObject_5$h;var FeedbackButtonShare=function FeedbackButtonShare(_a){var isReadOnly=_a.isReadOnly;var item=useContext(FeedbackButtonContext).item;return jsx$1(ShareButton,{url:item.permalink,isReadOnly:isReadOnly},void 0);};var ConfirmationStatistics=function ConfirmationStatistics(_a){var count=_a.count;return jsxs(Host$q,{children:[jsx$1(Icon,{iconName:"Accept"},void 0),jsx$1(FormattedMessage$1,{id:'NewsArticle.feedback.statistic.label',values:{count:count}},void 0)]},void 0);};var Host$q=_styled.div.withConfig({displayName:"ConfirmationStatistics__Host",componentId:"sc-1wprhw1-0"})(templateObject_1$14||(templateObject_1$14=__makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n\n i {\n margin-right: ","px;\n }\n\n @media (max-width: ","px) {\n font-size: ","px;\n }\n"],["\n display: inline-flex;\n align-items: center;\n\n i {\n margin-right: ","px;\n }\n\n @media (max-width: ","px) {\n font-size: ","px;\n }\n"])),spacingXs-1,maxScreenSize.medium,fontSizeSmall);var templateObject_1$14;var ConfirmationStatisticsExport=function ConfirmationStatisticsExport(_a){var item=_a.item;var createApiUrl=useApiFactory().createApiUrl;var formatMessage=useIntl().formatMessage;var exchangeShortLivedToken=useFileAccessTokenApi().exchangeShortLivedToken;return jsx$1(Host$p,__assign({resourceKey:"DownloadButton.downloadTooltip"},{children:jsx$1(DownloadButton$1,{onClick:startDownload,iconProps:{iconName:'Download'},"aria-label":formatMessage({id:'AriaLabel.confirmationStatisticsExportButton'})},void 0)}),void 0);function startDownload(){return __awaiter(this,void 0,void 0,function(){var token;return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,exchangeShortLivedToken(item.fileAccessToken)];case 1:token=_a.sent();window.open(getFileUrlWithToken(item.id,token||item.fileAccessToken));return [2/*return*/];}});});}function getFileUrlWithToken(newsId,fileDownloadToken){return createApiUrl("/news/"+newsId+"/statistics/confirmations",{access_token:fileDownloadToken});}};var DownloadButton$1=_styled(IconButton$1).withConfig({displayName:"ConfirmationStatisticsExport__DownloadButton",componentId:"sc-1gesr6p-0"})(templateObject_1$13||(templateObject_1$13=__makeTemplateObject(["\n color: ",";\n"],["\n color: ",";\n"])),function(p){return p.theme.textColors.default;});var Host$p=_styled(Tooltip).withConfig({displayName:"ConfirmationStatisticsExport__Host",componentId:"sc-1gesr6p-1"})(templateObject_2$B||(templateObject_2$B=__makeTemplateObject(["\n && {\n display: inline-flex;\n align-items: center;\n }\n"],["\n && {\n display: inline-flex;\n align-items: center;\n }\n"])));var templateObject_1$13,templateObject_2$B;var FeedbackButtonConfirmations=function FeedbackButtonConfirmations(){var features=useFeatures();var user=useCurrentUser();var _a=useContext(FeedbackButtonContext),item=_a.item,confirmationCount=_a.statistics.confirmationCount,hasFeedbackEnabled=_a.hasFeedbackEnabled;if(!features.confirmation||!hasFeedbackEnabled('confirm')||!hasMinRoleInSomeGroups(GroupRoles.Author,user,item)){return null;}return jsxs(Host$o,{children:[jsx$1(ConfirmationStatistics,{count:confirmationCount},void 0),jsx$1(ConfirmationStatisticsExport,{item:item},void 0)]},void 0);};var Host$o=_styled.span.withConfig({displayName:"FeedbackButtonConfirmations__Host",componentId:"sc-sgky21-0"})(templateObject_1$12||(templateObject_1$12=__makeTemplateObject(["\n margin-left: 30px;\n\n @media all and (max-width: ","px) {\n margin-left: 0;\n width: 100%;\n }\n"],["\n margin-left: 30px;\n\n @media all and (max-width: ","px) {\n margin-left: 0;\n width: 100%;\n }\n"])),maxScreenSize.medium);var templateObject_1$12;var EventDetailViewFeedbackSection=function EventDetailViewFeedbackSection(_a){var _b;var hideLikes=_a.hideLikes,hideComments=_a.hideComments,hideProfileUrl=_a.hideProfileUrl,disableLoginForPublicUser=_a.disableLoginForPublicUser;var _c=useDetailViewContext(),item=_c.item,resourceType=_c.resourceType,contentLanguage=_c.contentLanguage;// Info: We need this check so that in Teams on mobile we don't show the
122328
- return jsxs(StyledFeedbackSection$2,__assign({item:item,language:contentLanguage,type:resourceType,feedbackSettings:(_b=item.metadata)===null||_b===void 0?void 0:_b.feedbackSettings,hideComments:hideComments,hideProfileUrl:hideProfileUrl,disableLoginForPublicUser:disableLoginForPublicUser},{children:[!hideLikes&&jsx$1(FeedbackButtonLike,{},void 0),!hideComments&&jsx$1(FeedbackButtonComments,{},void 0),jsx$1(FeedbackButtonViews,{},void 0),jsx$1(EventFeedbackButtonDownloadCalendarFile,{},void 0),jsx$1(FeedbackButtonShare,{},void 0),jsx$1(FeedbackButtonConfirmations,{},void 0)]}),void 0);};var StyledFeedbackSection$2=_styled(FeedbackSection).withConfig({displayName:"EventDetailViewFeedbackSection__StyledFeedbackSection",componentId:"sc-1m82rje-0"})(templateObject_1$11||(templateObject_1$11=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),DetailViewSectionPadding);var templateObject_1$11;var EventDetailViewPlugins=function EventDetailViewPlugins(_a){var eventItem=_a.eventItem;return jsx$1(Host$n,{area:ExtensionArea.eventDetailViewSection,eventItem:eventItem},void 0);};var Host$n=_styled(Plugins)(templateObject_1$10||(templateObject_1$10=__makeTemplateObject(["\n margin: auto -","px;\n padding: 0 ","px;\n\n @media (min-width: ","px) {\n margin: auto -","px;\n padding: 0 ","px;\n }\n"],["\n margin: auto -","px;\n padding: 0 ","px;\n\n @media (min-width: ","px) {\n margin: auto -","px;\n padding: 0 ","px;\n }\n"])),spacingM,spacingM,minScreenSize.small,spacingXl,spacingXl);var templateObject_1$10;var DateMode;(function(DateMode){DateMode[DateMode["Published"]=0]="Published";DateMode[DateMode["Modified"]=1]="Modified";})(DateMode||(DateMode={}));var DateInfo$1=function DateInfo(_a){var item=_a.item,dateMode=_a.dateMode,expiryDate=_a.expiryDate,className=_a.className;var features=useFeatures();return jsxs("span",__assign({className:className},{children:[dateMode===DateMode.Modified&&getModifiedInfo(),dateMode===DateMode.Published&&getPublishInfo(),expiryDate&&features.expiryDate&&getArchiveInfo()]}),void 0);function getPublishInfo(){var format=isSameDay(item.publishingDate)?'relative':'absolute';if(!item.publishingDate){if(item.status!==WorkflowStatus.approved){return jsx$1(FormattedMessage$1,{id:"DateInfo.publishWhenApproved"},void 0);}return jsx$1(FormattedMessage$1,{id:"DateInfo.published"},void 0);}var values={start:jsx$1(DateTime,{value:item.publishingDate},void 0)};if(new Date(item.publishingDate)>=new Date()){return jsx$1(FormattedMessage$1,{id:item.status!==WorkflowStatus.approved?"DateInfo.publishOnIfApproved."+format:"DateInfo.publishOn."+format,values:values},void 0);}if(item.status===WorkflowStatus.approved){return jsx$1(FormattedMessage$1,{id:"DateInfo.publishedOn."+format,values:values},void 0);}if(!!item.publishedVersionId){return jsx$1(FormattedMessage$1,{id:"DateInfo.publishedWithPendingEdits."+format,values:values},void 0);}return jsx$1(FormattedMessage$1,{id:"DateInfo.missingApproval."+format,values:values},void 0);}function getArchiveInfo(){var format=isSameDay(expiryDate)?'relative':'absolute';var values={end:jsx$1(DateTime,{value:expiryDate},void 0)};if(new Date(expiryDate)<new Date()){// if already expired
122323
+ },[item.id,comparableStatistics]);if(!statistics){return null;}return jsx$1(FeedbackButtonContext.Provider,__assign({value:{statistics:statistics,language:language,item:item,resourceType:resourceType,hasFeedbackEnabled:hasFeedbackEnabled}},{children:jsx$1(FeedbackButtonsContainer,__assign({className:className},{children:Children.map(children,function(child){return jsx$1("li",{children:child},void 0);})}),void 0)}),void 0);function loadStatistics(item){return __awaiter(this,void 0,void 0,function(){var newStatistics,error_1;return __generator(this,function(_a){switch(_a.label){case 0:if(item.statistics){setStatistics(item.statistics);return [2/*return*/];}_a.label=1;case 1:_a.trys.push([1,3,,4]);return [4/*yield*/,getStatistics(item.id)];case 2:newStatistics=_a.sent();setStatistics(newStatistics);return [3/*break*/,4];case 3:error_1=_a.sent();logger.error(error_1);showError('NewsArticle.loadStatistics_error');return [3/*break*/,4];case 4:return [2/*return*/];}});});}};var FeedbackButtonsContainer=_styled.ul.withConfig({displayName:"FeedbackButtons__FeedbackButtonsContainer",componentId:"sc-1vjmzsz-0"})(templateObject_1$19||(templateObject_1$19=__makeTemplateObject(["\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n margin: 0;\n padding: 0;\n list-style: none;\n\n > * {\n margin-bottom: 15px;\n }\n"],["\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n margin: 0;\n padding: 0;\n list-style: none;\n\n > * {\n margin-bottom: 15px;\n }\n"])));var templateObject_1$19;var ThreadView=function ThreadView(_a){var _b;var parentComment=_a.parentComment,commentReplies=_a.commentReplies,scope=_a.scope,mentionSearchHandler=_a.mentionSearchHandler,type=_a.type,groupIds=_a.groupIds,baseAttachmentPath=_a.baseAttachmentPath,getHashtagFilterRoute=_a.getHashtagFilterRoute,onThreadCommentDelete=_a.onThreadCommentDelete,onShowAllComments=_a.onShowAllComments,className=_a.className;var user=useCurrentUser();var deleteComment=useCommentApi().deleteComment;var showError=useNotificationContext().showError;var history=useHistory();var location=useLocation$1();var showAutoTranslate=(parentComment===null||parentComment===void 0?void 0:parentComment.sender.id)!==user.id;var screenSize=useWindowSize$2();var placeHolderStringResourceKey=screenSize.width>maxScreenSize.medium?'Comment.threads.replyTo':'Comment.threads.replyTo.mobile';var _c=useState$2(commentReplies),replies=_c[0],setReplies=_c[1];var _d=useState$2(true),isDialogHidden=_d[0],setIsDialogHidden=_d[1];var _e=useState$2(((_b=parentComment.statistics)===null||_b===void 0?void 0:_b.replyCount)||0),replyCount=_e[0],setReplyCount=_e[1];usePageViewTracker(type+"/"+parentComment.parentItemId+"/comments",parentComment.id);return jsxs("div",__assign({className:className},{children:[jsx$1(ConfirmDialog,{onClose:function(){return setIsDialogHidden(true);},onConfirm:handleDeleteThread,showDialog:!isDialogHidden,titleResourceKey:"Comment.delete.title",infoResourceKey:"Comment.delete.description"},void 0),jsx$1(CommentDisplay,{scope:scope,message:parentComment,showDelete:canDelete(parentComment),showEdit:canEdit(parentComment),showAutoTranslate:showAutoTranslate,type:type,highlight:parentComment.isUnread,isInitialLiked:parentComment.isLiked,mentionSearchHandler:mentionSearchHandler,baseAttachmentPath:baseAttachmentPath,onDelete:function(){return setIsDialogHidden(false);},getHashtagFilterRoute:getHashtagFilterRoute,replyCount:replyCount,onReplyIconClick:handleShowAllComments},parentComment.receivedDateTime),jsx$1(CommentReplies,{threadId:parentComment.id,initialPageSize:5,pageSize:5,type:type,baseAttachmentPath:baseAttachmentPath+"/"+parentComment.id+"/replies",mentionSearchHandler:mentionSearchHandler,groupIds:groupIds,getHashtagFilterRoute:getHashtagFilterRoute,readOnly:false,scope:scope,itemId:parentComment.parentItemId,autoFocusReplyField:!env.isTouchDevice,initialComments:replies,onCommentDeleted:deleteReply,onCommentAdded:function(){return setReplyCount(function(count){return count+1;});},showReplyBox:true,placeHolderStringResourceKey:placeHolderStringResourceKey,placeHolderStringResourceValues:{name:parentComment===null||parentComment===void 0?void 0:parentComment.sender.displayName}},parentComment.parentItemId),jsx$1(ShowAllCommentsButton,__assign({iconProps:{iconName:'ReturnKey'},onClick:handleShowAllComments,"data-show-all-comments":true},{children:jsx$1(FormattedMessage$1,{id:"Comment.showAllComments"},void 0)}),void 0)]}),void 0);function canDelete(comment){return canEdit(comment)||hasMinRoleInAllGroups(GroupRoles.Admin,user,groupIds);}function canEdit(comment){return comment.sender&&comment.sender.id===user.id;}function deleteReply(reply){setReplies(__assign(__assign({},replies),{items:replies.items.filter(function(c){return c.id!==reply.id;})}));setReplyCount(function(count){return count-1;});}function handleDeleteThread(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_b){switch(_b.label){case 0:_b.trys.push([0,2,,3]);return [4/*yield*/,deleteComment(type,scope,parentComment.parentItemId,parentComment.id)];case 1:_b.sent();onThreadCommentDelete();return [3/*break*/,3];case 2:_b.sent();showError('Generic.error');return [3/*break*/,3];case 3:return [2/*return*/];}});});}function handleShowAllComments(){history.replace(__assign(__assign({},location),{state:{parentCommentId:"Comment-"+parentComment.id}}));onShowAllComments===null||onShowAllComments===void 0?void 0:onShowAllComments();}};var CommentReplies=_styled(PagedCommentsSection).withConfig({displayName:"ThreadView__CommentReplies",componentId:"sc-1c4y6ek-0"})(templateObject_1$18||(templateObject_1$18=__makeTemplateObject(["\n @media (max-width: ","px) {\n .comment-list {\n padding-left: ","px;\n }\n }\n\n @media (min-width: ","px) {\n padding-left: ","px;\n }\n"],["\n @media (max-width: ","px) {\n .comment-list {\n padding-left: ","px;\n }\n }\n\n @media (min-width: ","px) {\n padding-left: ","px;\n }\n"])),maxScreenSize.medium,spacingL,minScreenSize.medium,spacingL);var ShowAllCommentsButton=_styled(ActionButton).withConfig({displayName:"ThreadView__ShowAllCommentsButton",componentId:"sc-1c4y6ek-1"})(templateObject_2$D||(templateObject_2$D=__makeTemplateObject(["\n margin: ","px 0 0 0;\n padding: 0;\n border: 0;\n\n @media (min-width: ","px) {\n margin-left: ","px;\n }\n"],["\n margin: ","px 0 0 0;\n padding: 0;\n border: 0;\n\n @media (min-width: ","px) {\n margin-left: ","px;\n }\n"])),spacingS,minScreenSize.medium,spacingL);var templateObject_1$18,templateObject_2$D;var PublishableItemThreadView=function PublishableItemThreadView(_a){var item=_a.item,type=_a.type,threadId=_a.threadId,onShowAllComments=_a.onShowAllComments,onThreadCommentDelete=_a.onThreadCommentDelete;var searchAccountsByItemId=useAccountApi().searchAccountsByItemId;var getCommentThread=useCommentApi().getCommentThread;var _b=usePromise$2(function(){return getCommentThread(type,item.id,threadId);},null),comments=_b[0],isLoading=_b[1];if(isLoading){return jsx$1(StyledSpinner,{},void 0);}var parentComment=comments===null||comments===void 0?void 0:comments.items.find(function(c){return c.id===threadId;});if(!parentComment||parentComment.threadId!=null){return jsx$1(Host$r,{children:jsx$1(FormattedMessage$1,{id:'NewsArticle.thread.empty'},void 0)},void 0);}return jsx$1(Host$r,{children:jsx$1(StyledThreadView$1,{parentComment:parentComment,commentReplies:{items:comments===null||comments===void 0?void 0:comments.items.filter(function(c){return c!==parentComment&&c.threadId===parentComment.id;}),paginationToken:comments===null||comments===void 0?void 0:comments.paginationToken,nextItem:comments===null||comments===void 0?void 0:comments.nextItem,hasMoreUnreadComments:comments===null||comments===void 0?void 0:comments.hasMoreUnreadComments},scope:ConversationScope.Public,groupIds:item.groupIds,baseAttachmentPath:"/"+type+"/"+item.id+"/comments",mentionSearchHandler:getMentionsSearchHandler,type:type,onThreadCommentDelete:onThreadCommentDelete,onShowAllComments:onShowAllComments},void 0)},void 0);function getMentionsSearchHandler(searchText){return searchAccountsByItemId(GroupRoles.Reader,item.id,searchText);}};var Host$r=_styled.div.withConfig({displayName:"PublishableItemThreadView__Host",componentId:"sc-1yiyuzb-0"})(templateObject_1$17||(templateObject_1$17=__makeTemplateObject(["\n padding: 1.5em ","px;\n background-color: ",";\n\n @media (min-width: ","px) {\n padding: 1.5em ","px;\n }\n"],["\n padding: 1.5em ","px;\n background-color: ",";\n\n @media (min-width: ","px) {\n padding: 1.5em ","px;\n }\n"])),detailViewSectionPadding,function(p){return p.theme.palette.neutralLight;},minScreenSize.small,detailViewSectionPaddingLarge);var StyledSpinner=_styled(Spinner).withConfig({displayName:"PublishableItemThreadView__StyledSpinner",componentId:"sc-1yiyuzb-1"})(templateObject_2$C||(templateObject_2$C=__makeTemplateObject(["\n margin: 5% 0;\n"],["\n margin: 5% 0;\n"])));var StyledThreadView$1=_styled(ThreadView).withConfig({displayName:"PublishableItemThreadView__StyledThreadView",componentId:"sc-1yiyuzb-2"})(templateObject_3$r||(templateObject_3$r=__makeTemplateObject(["\n /* This matches the Load More button and comments that have a highlight */\n [data-show-highlight='true'] {\n &::after {\n @media (min-width: ","px) {\n right: -","px;\n }\n\n right: -","px;\n }\n }\n"],["\n /* This matches the Load More button and comments that have a highlight */\n [data-show-highlight='true'] {\n &::after {\n @media (min-width: ","px) {\n right: -","px;\n }\n\n right: -","px;\n }\n }\n"])),minScreenSize.small,detailViewSectionPaddingLarge,detailViewSectionPadding);var templateObject_1$17,templateObject_2$C,templateObject_3$r;var FeedbackSection=function FeedbackSection(_a){var _b,_c;var type=_a.type,item=_a.item,language=_a.language,feedbackSettings=_a.feedbackSettings,hideComments=_a.hideComments,hideProfileUrl=_a.hideProfileUrl,disableLoginForPublicUser=_a.disableLoginForPublicUser,isReadOnly=_a.isReadOnly,children=_a.children,className=_a.className;var features=useFeatures();var formatMessage=useIntl().formatMessage;var match=useRouteMatch();var history=useHistory();var location=useLocation$1();var buildPath=useSubscriptionHandlePathBuilder().buildPath;var _d=useState$2((_c=(_b=match.params)===null||_b===void 0?void 0:_b.threadId)!==null&&_c!==void 0?_c:null),threadId=_d[0],setThreadId=_d[1];var showComments=features.comments&&hasFeedbackEnabled('comment')&&!hideComments;var showThreadView=features.replyToComments&&threadId!=null;var hasPublishedVersion=item.publishedVersionId!=null||item.isCurrentPublishedVersion;return jsxs(Fragment,{children:[jsx$1("section",__assign({className:className,"aria-label":formatMessage({id:'Generic.feedbackButtons'})},{children:jsx$1(StyledFeedbackButtons,__assign({resourceType:type,item:item,language:language,hasFeedbackEnabled:hasFeedbackEnabled},{children:children}),void 0)}),void 0),showComments&&(!showThreadView?jsx$1("section",__assign({id:"comments","data-comment-section":true,className:classNames('ms-bgColor-neutralLight',className),"aria-label":formatMessage({id:'AriaLabel.section.comments'})},{children:jsx$1(PublishableItemComments,{item:item,type:type,onThreadReply:features.replyToComments?setThreadId:null,hideProfileUrl:hideProfileUrl,disableLoginForPublicUser:disableLoginForPublicUser,readOnly:isReadOnly,loadInReadOnlyMode:isReadOnly&&hasPublishedVersion},void 0)}),void 0):jsx$1("section",__assign({"aria-label":formatMessage({id:'AriaLabel.section.comments'})},{children:jsx$1(PublishableItemThreadView,{item:item,type:type,threadId:threadId,onShowAllComments:handleOnShowAllComments,onThreadCommentDelete:handleThreadCommentDelete},void 0)}),void 0))]},void 0);function handleThreadCommentDelete(){var _a;// not using threadId here since we can still have a non thread path but be inline with the thread view
122324
+ if((_a=match.params)===null||_a===void 0?void 0:_a.threadId){history.push(__assign(__assign({},location),{pathname:buildPath("/"+type+"/"+item.id)}));}setThreadId(null);}function hasFeedbackEnabled(feedbackType){return hasFeedbackType(feedbackSettings||{},feedbackType);}function handleOnShowAllComments(){var _a;setThreadId(null);if((_a=match.params)===null||_a===void 0?void 0:_a.threadId){history.push(__assign(__assign({},location),{pathname:buildPath(type+"/"+item.id)}));}}};var StyledFeedbackButtons=_styled(FeedbackButtons).withConfig({displayName:"FeedbackSection__StyledFeedbackButtons",componentId:"sc-3bzj8d-0"})(templateObject_1$16||(templateObject_1$16=__makeTemplateObject(["\n padding-bottom: ",";\n @media (max-width: 500px) {\n margin-bottom: 15px;\n }\n"],["\n padding-bottom: ",";\n @media (max-width: 500px) {\n margin-bottom: 15px;\n }\n"])),function(p){return p.showComments?'15px':'30px';});var templateObject_1$16;var FeedbackButtonLike=function FeedbackButtonLike(_a){var isReadOnly=_a.isReadOnly;var refreshStatistics=useNewsApi().refreshStatistics;var features=useFeatures();var _b=useContext(FeedbackButtonContext),item=_b.item,likeCount=_b.statistics.likeCount,resourceType=_b.resourceType,hasFeedbackEnabled=_b.hasFeedbackEnabled;var _c=useFeedbackApi(),getFeedback=_c.getFeedback,setFeedback=_c.setFeedback,unsetFeedback=_c.unsetFeedback;var showError=useNotificationContext().showError;var _d=usePromise$2(getLikeState,false,[item.id]),isLiked=_d[0],isLoading=_d[1],setIsLiked=_d[3];var _e=useState$2(false),isSaving=_e[0],setIsSaving=_e[1];if(!features.likes||!hasFeedbackEnabled('like')){return null;}return jsx$1(LikeButton,{itemType:resourceType,itemId:item.id,isActive:isLiked,readOnly:isLoading||isSaving||isReadOnly,count:likeCount,onClick:function(){return handleLikeChanged(!isLiked);},isDemoContent:item.isDemoContent},void 0);function getLikeState(){var _a;return __awaiter(this,void 0,void 0,function(){var hasPublishedVersion,feedbackSummary;return __generator(this,function(_b){switch(_b.label){case 0:hasPublishedVersion=item.publishedVersionId!=null||item.isCurrentPublishedVersion;if(isReadOnly&&!hasPublishedVersion){return [2/*return*/,false];}if(!features.likes||!hasFeedbackEnabled('like')){return [2/*return*/,false];}return [4/*yield*/,getFeedback(resourceType,item.id)];case 1:feedbackSummary=_b.sent();return [2/*return*/,((_a=feedbackSummary.records)===null||_a===void 0?void 0:_a.findIndex(function(r){return r.type==='like';}))>-1];}});});}function handleLikeChanged(isNowLiked){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_b){switch(_b.label){case 0:if(isSaving||isLoading){return [2/*return*/];}setIsSaving(true);setIsLiked(isNowLiked);return [4/*yield*/,refreshStatistics(item.id,{likeCount:isNowLiked?1:-1})];case 1:_b.sent();_b.label=2;case 2:_b.trys.push([2,7,9,10]);if(!isNowLiked)return [3/*break*/,4];return [4/*yield*/,setFeedback(resourceType,item.id,'like')];case 3:_b.sent();return [3/*break*/,6];case 4:return [4/*yield*/,unsetFeedback(resourceType,item.id,'like')];case 5:_b.sent();_b.label=6;case 6:return [3/*break*/,10];case 7:_b.sent();setIsLiked(!isNowLiked);return [4/*yield*/,refreshStatistics(item.id,{likeCount:isNowLiked?-1:1})];case 8:_b.sent();showError('NewsArticle.setFeedback_error');return [3/*break*/,10];case 9:setIsSaving(false);return [7/*endfinally*/];case 10:return [2/*return*/];}});});}};var FeedbackButtonComments=function FeedbackButtonComments(){var features=useFeatures();var formatMessage=useIntl().formatMessage;var _a=useContext(FeedbackButtonContext),commentCount=_a.statistics.commentCount,resourceType=_a.resourceType,hasFeedbackEnabled=_a.hasFeedbackEnabled;if(!features.comments||!hasFeedbackEnabled('comment')){return null;}return jsx$1(FeedbackCountButton,{count:commentCount,iconName:"Chat",readOnly:true,tooltipResourceKey:resourceType===ItemResourceTypes.Pages?'Page.numberOfComments':'NewsArticle.numberOfComments',tooltipResourceKeyValues:{count:commentCount},ariaLabel:formatMessage({id:'AriaLabel.commentsButton'}),feedbackType:"comment"},void 0);};var FeedbackButtonViews=function FeedbackButtonViews(){var _a=useContext(FeedbackButtonContext),readCount=_a.statistics.readCount,resourceType=_a.resourceType;var formatMessage=useIntl().formatMessage;var resourceKey=getResourceKey();return jsx$1(FeedbackCountButton,{count:readCount,iconName:"View",readOnly:true,tooltipResourceKey:resourceKey,tooltipResourceKeyValues:{count:readCount},ariaLabel:formatMessage({id:resourceKey},{count:readCount}),feedbackType:"view"},void 0);function getResourceKey(){if(resourceType===ItemResourceTypes.Pages){return 'Page.readersTooltip';}if(resourceType===ItemResourceTypes.News){return 'NewsArticle.readersTooltip';}return 'Events.readersTooltip';}};var EventDownloadCalendarFileButton=function EventDownloadCalendarFileButton(_a){var item=_a.item,className=_a.className;var user=useCurrentUser();var createApiUrl=useApiFactory().createApiUrl;var formatMessage=useIntl().formatMessage;return jsx$1(Host$q,__assign({className:className},{children:jsx$1(Tooltip,__assign({resourceKey:"Events.downloadCalendarFile"},{children:jsx$1(DownloadLink,__assign({href:getDownloadUrl(),"aria-label":formatMessage({id:'Events.downloadCalendarFile'})},{children:jsx$1(Icon,{iconName:"AddEvent"},void 0)}),void 0)}),void 0)}),void 0);function getDownloadUrl(){return createApiUrl("/events/"+encodeURI(item.id)+"/export",{access_token:item.fileAccessToken,subscriptionId:user.subscription.id});}};var Host$q=_styled.div.withConfig({displayName:"EventDownloadCalendarFileButton__Host",componentId:"sc-1hjuosf-0"})(templateObject_1$15||(templateObject_1$15=__makeTemplateObject(["\n && {\n > div {\n display: inline-block;\n }\n\n i {\n font-size: 22px;\n }\n }\n"],["\n && {\n > div {\n display: inline-block;\n }\n\n i {\n font-size: 22px;\n }\n }\n"])));var DownloadLink=_styled.a.withConfig({displayName:"EventDownloadCalendarFileButton__DownloadLink",componentId:"sc-1hjuosf-1"})(templateObject_2$B||(templateObject_2$B=__makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n height: ","px;\n width: ","px;\n color: ",";\n"],["\n display: flex;\n align-items: center;\n justify-content: center;\n height: ","px;\n width: ","px;\n color: ",";\n"])),feedbackButtonHeight,feedbackButtonHeight,function(p){return p.theme.textColors.default;});var templateObject_1$15,templateObject_2$B;var EventFeedbackButtonDownloadCalendarFile=function EventFeedbackButtonDownloadCalendarFile(){var item=useContext(FeedbackButtonContext).item;return jsx$1(StyledEventDownloadCalendarFileButton,{item:item},void 0);};var StyledEventDownloadCalendarFileButton=_styled(EventDownloadCalendarFileButton).withConfig({displayName:"EventFeedbackButtonDownloadCalendarFile__StyledEventDownloadCalendarFileButton",componentId:"sc-dsznxm-0"})(templateObject_1$14||(templateObject_1$14=__makeTemplateObject(["\n min-width: 60px;\n margin-right: 9px;\n"],["\n min-width: 60px;\n margin-right: 9px;\n"])));var templateObject_1$14;var ShareButton=function ShareButton(_a){var url=_a.url,isReadOnly=_a.isReadOnly,className=_a.className;var copyContainerRef=useRef$1();var _b=useState$2(false),didCopy=_b[0],setDidCopy=_b[1];var onShare=useContext(LinkContext).onShare;var formatMessage=useIntl().formatMessage;return jsx$1(Host$p,__assign({className:className},{children:jsx$1(Tooltip,__assign({resourceKey:"ShareButton.ActionDescription"},{children:jsxs(StyledIconWithCallout,__assign({icon:"Share",onIconClick:function(){return __awaiter(void 0,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,onShare(url)];case 1:return [2/*return*/,_a.sent()];}});});},onCalloutDismissed:function(){return setDidCopy(false);},directionalHint:DirectionalHint.topAutoEdge,ariaLabel:formatMessage({id:'ShareButton.ActionDescription'}),disabled:isReadOnly},{children:[jsx$1(FormattedMessage$1,{id:"ShareButton.ActionDescription"},void 0),jsxs(CopyContainer,__assign({ref:copyContainerRef},{children:[jsx$1(CopyField,{value:url,readOnly:true,onFocus:handleTextFieldFocus,onMouseUp:function(e){return e.preventDefault();},ariaLabel:formatMessage({id:'AriaLabel.shareButton.copyField'})},void 0),jsx$1(CopyIconButton,{iconProps:{iconName:'Copy'},onClick:copyToClipBoard,ariaLabel:formatMessage({id:'AriaLabel.copyText'})},void 0)]}),void 0),didCopy&&jsx$1(FormattedMessage$1,{id:"ShareButton.CopySuccess"},void 0)]}),void 0)}),void 0)}),void 0);function copyToClipBoard(){var tempTextField=document.createElement('textarea');tempTextField.innerText=url;copyContainerRef.current.appendChild(tempTextField);tempTextField.select();document.execCommand('copy');copyContainerRef.current.removeChild(tempTextField);setDidCopy(true);}function handleTextFieldFocus(event){event.target.select();}};var Host$p=_styled.div.withConfig({displayName:"ShareButton__Host",componentId:"sc-6avyh0-0"})(templateObject_1$13||(templateObject_1$13=__makeTemplateObject(["\n display: flex;\n align-items: center;\n"],["\n display: flex;\n align-items: center;\n"])));var StyledIconWithCallout=_styled(IconWithCallout).withConfig({displayName:"ShareButton__StyledIconWithCallout",componentId:"sc-6avyh0-1"})(templateObject_2$A||(templateObject_2$A=__makeTemplateObject(["\n button {\n height: ","px;\n }\n\n i {\n font-size: ","px;\n }\n"],["\n button {\n height: ","px;\n }\n\n i {\n font-size: ","px;\n }\n"])),feedbackButtonHeight,fontSizeMedium+4);var CopyContainer=_styled.div.withConfig({displayName:"ShareButton__CopyContainer",componentId:"sc-6avyh0-2"})(templateObject_3$q||(templateObject_3$q=__makeTemplateObject(["\n display: flex;\n align-items: center;\n padding: 15px 0;\n"],["\n display: flex;\n align-items: center;\n padding: 15px 0;\n"])));var CopyField=_styled(TextField).withConfig({displayName:"ShareButton__CopyField",componentId:"sc-6avyh0-3"})(templateObject_4$g||(templateObject_4$g=__makeTemplateObject(["\n padding-right: ","px;\n width: 400px;\n"],["\n padding-right: ","px;\n width: 400px;\n"])),spacingS);var CopyIconButton=_styled(IconButton).withConfig({displayName:"ShareButton__CopyIconButton",componentId:"sc-6avyh0-4"})(templateObject_5$f||(templateObject_5$f=__makeTemplateObject(["\n i {\n font-size: ","px;\n }\n"],["\n i {\n font-size: ","px;\n }\n"])),fontSizeMedium+4);var templateObject_1$13,templateObject_2$A,templateObject_3$q,templateObject_4$g,templateObject_5$f;var FeedbackButtonShare=function FeedbackButtonShare(_a){var isReadOnly=_a.isReadOnly;var item=useContext(FeedbackButtonContext).item;return jsx$1(ShareButton,{url:item.permalink,isReadOnly:isReadOnly},void 0);};var ConfirmationStatistics=function ConfirmationStatistics(_a){var count=_a.count;return jsxs(Host$o,{children:[jsx$1(Icon,{iconName:"Accept"},void 0),jsx$1(FormattedMessage$1,{id:'NewsArticle.feedback.statistic.label',values:{count:count}},void 0)]},void 0);};var Host$o=_styled.div.withConfig({displayName:"ConfirmationStatistics__Host",componentId:"sc-1wprhw1-0"})(templateObject_1$12||(templateObject_1$12=__makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n\n i {\n margin-right: ","px;\n }\n\n @media (max-width: ","px) {\n font-size: ","px;\n }\n"],["\n display: inline-flex;\n align-items: center;\n\n i {\n margin-right: ","px;\n }\n\n @media (max-width: ","px) {\n font-size: ","px;\n }\n"])),spacingXs-1,maxScreenSize.medium,fontSizeSmall);var templateObject_1$12;var ConfirmationStatisticsExport=function ConfirmationStatisticsExport(_a){var item=_a.item;var createApiUrl=useApiFactory().createApiUrl;var formatMessage=useIntl().formatMessage;var exchangeShortLivedToken=useFileAccessTokenApi().exchangeShortLivedToken;return jsx$1(Host$n,__assign({resourceKey:"DownloadButton.downloadTooltip"},{children:jsx$1(DownloadButton$1,{onClick:startDownload,iconProps:{iconName:'Download'},"aria-label":formatMessage({id:'AriaLabel.confirmationStatisticsExportButton'})},void 0)}),void 0);function startDownload(){return __awaiter(this,void 0,void 0,function(){var token;return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,exchangeShortLivedToken(item.fileAccessToken)];case 1:token=_a.sent();window.open(getFileUrlWithToken(item.id,token||item.fileAccessToken));return [2/*return*/];}});});}function getFileUrlWithToken(newsId,fileDownloadToken){return createApiUrl("/news/"+newsId+"/statistics/confirmations",{access_token:fileDownloadToken});}};var DownloadButton$1=_styled(IconButton$1).withConfig({displayName:"ConfirmationStatisticsExport__DownloadButton",componentId:"sc-1gesr6p-0"})(templateObject_1$11||(templateObject_1$11=__makeTemplateObject(["\n color: ",";\n"],["\n color: ",";\n"])),function(p){return p.theme.textColors.default;});var Host$n=_styled(Tooltip).withConfig({displayName:"ConfirmationStatisticsExport__Host",componentId:"sc-1gesr6p-1"})(templateObject_2$z||(templateObject_2$z=__makeTemplateObject(["\n && {\n display: inline-flex;\n align-items: center;\n }\n"],["\n && {\n display: inline-flex;\n align-items: center;\n }\n"])));var templateObject_1$11,templateObject_2$z;var FeedbackButtonConfirmations=function FeedbackButtonConfirmations(){var features=useFeatures();var user=useCurrentUser();var _a=useContext(FeedbackButtonContext),item=_a.item,confirmationCount=_a.statistics.confirmationCount,hasFeedbackEnabled=_a.hasFeedbackEnabled;if(!features.confirmation||!hasFeedbackEnabled('confirm')||!hasMinRoleInSomeGroups(GroupRoles.Author,user,item)){return null;}return jsxs(Host$m,{children:[jsx$1(ConfirmationStatistics,{count:confirmationCount},void 0),jsx$1(ConfirmationStatisticsExport,{item:item},void 0)]},void 0);};var Host$m=_styled.span.withConfig({displayName:"FeedbackButtonConfirmations__Host",componentId:"sc-sgky21-0"})(templateObject_1$10||(templateObject_1$10=__makeTemplateObject(["\n margin-left: 30px;\n\n @media all and (max-width: ","px) {\n margin-left: 0;\n width: 100%;\n }\n"],["\n margin-left: 30px;\n\n @media all and (max-width: ","px) {\n margin-left: 0;\n width: 100%;\n }\n"])),maxScreenSize.medium);var templateObject_1$10;var EventDetailViewFeedbackSection=function EventDetailViewFeedbackSection(_a){var _b;var hideLikes=_a.hideLikes,hideComments=_a.hideComments,hideProfileUrl=_a.hideProfileUrl,disableLoginForPublicUser=_a.disableLoginForPublicUser;var _c=useDetailViewContext(),item=_c.item,resourceType=_c.resourceType,contentLanguage=_c.contentLanguage;// Info: We need this check so that in Teams on mobile we don't show the
122325
+ return jsxs(StyledFeedbackSection$2,__assign({item:item,language:contentLanguage,type:resourceType,feedbackSettings:(_b=item.metadata)===null||_b===void 0?void 0:_b.feedbackSettings,hideComments:hideComments,hideProfileUrl:hideProfileUrl,disableLoginForPublicUser:disableLoginForPublicUser},{children:[!hideLikes&&jsx$1(FeedbackButtonLike,{},void 0),!hideComments&&jsx$1(FeedbackButtonComments,{},void 0),jsx$1(FeedbackButtonViews,{},void 0),jsx$1(EventFeedbackButtonDownloadCalendarFile,{},void 0),jsx$1(FeedbackButtonShare,{},void 0),jsx$1(FeedbackButtonConfirmations,{},void 0)]}),void 0);};var StyledFeedbackSection$2=_styled(FeedbackSection).withConfig({displayName:"EventDetailViewFeedbackSection__StyledFeedbackSection",componentId:"sc-1m82rje-0"})(templateObject_1$$||(templateObject_1$$=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),DetailViewSectionPadding);var templateObject_1$$;var EventDetailViewPlugins=function EventDetailViewPlugins(_a){var eventItem=_a.eventItem;return jsx$1(Host$l,{area:ExtensionArea.eventDetailViewSection,eventItem:eventItem},void 0);};var Host$l=_styled(Plugins)(templateObject_1$_||(templateObject_1$_=__makeTemplateObject(["\n margin: auto -","px;\n padding: 0 ","px;\n\n @media (min-width: ","px) {\n margin: auto -","px;\n padding: 0 ","px;\n }\n"],["\n margin: auto -","px;\n padding: 0 ","px;\n\n @media (min-width: ","px) {\n margin: auto -","px;\n padding: 0 ","px;\n }\n"])),spacingM,spacingM,minScreenSize.small,spacingXl,spacingXl);var templateObject_1$_;var DateMode;(function(DateMode){DateMode[DateMode["Published"]=0]="Published";DateMode[DateMode["Modified"]=1]="Modified";})(DateMode||(DateMode={}));var DateInfo$1=function DateInfo(_a){var item=_a.item,dateMode=_a.dateMode,expiryDate=_a.expiryDate,className=_a.className;var features=useFeatures();return jsxs("span",__assign({className:className},{children:[dateMode===DateMode.Modified&&getModifiedInfo(),dateMode===DateMode.Published&&getPublishInfo(),expiryDate&&features.expiryDate&&getArchiveInfo()]}),void 0);function getPublishInfo(){var format=isSameDay(item.publishingDate)?'relative':'absolute';if(!item.publishingDate){if(item.status!==WorkflowStatus.approved){return jsx$1(FormattedMessage$1,{id:"DateInfo.publishWhenApproved"},void 0);}return jsx$1(FormattedMessage$1,{id:"DateInfo.published"},void 0);}var values={start:jsx$1(DateTime,{value:item.publishingDate},void 0)};if(new Date(item.publishingDate)>=new Date()){return jsx$1(FormattedMessage$1,{id:item.status!==WorkflowStatus.approved?"DateInfo.publishOnIfApproved."+format:"DateInfo.publishOn."+format,values:values},void 0);}if(item.status===WorkflowStatus.approved){return jsx$1(FormattedMessage$1,{id:"DateInfo.publishedOn."+format,values:values},void 0);}if(!!item.publishedVersionId){return jsx$1(FormattedMessage$1,{id:"DateInfo.publishedWithPendingEdits."+format,values:values},void 0);}return jsx$1(FormattedMessage$1,{id:"DateInfo.missingApproval."+format,values:values},void 0);}function getArchiveInfo(){var format=isSameDay(expiryDate)?'relative':'absolute';var values={end:jsx$1(DateTime,{value:expiryDate},void 0)};if(new Date(expiryDate)<new Date()){// if already expired
122329
122326
  return jsxs("span",{children:[",\u00A0",jsx$1(FormattedMessage$1,{id:"DateInfo.archivedOn."+format,values:values},void 0)]},void 0);}else {// not yet expired
122330
- return jsxs("span",{children:[",",' ',jsx$1(FormattedMessage$1,{id:"DateInfo.archiveOn."+format,values:values},void 0)]},void 0);}}function getModifiedInfo(){var date=item.modified||item.created||new Date();var format=isSameDay(date)?'relative':'absolute';return jsx$1("span",{children:jsx$1(FormattedMessage$1,{id:"DateInfo.modifiedOn."+format,values:{modified:jsx$1(ModifiedDateTime,{value:date},void 0)}},void 0)},void 0);}};var ModifiedDateTime=_styled(DateTime).withConfig({displayName:"DateInfo__ModifiedDateTime",componentId:"sc-xnzpy3-0"})(templateObject_1$$||(templateObject_1$$=__makeTemplateObject(["\n &&& {\n text-decoration: none;\n }\n"],["\n &&& {\n text-decoration: none;\n }\n"])));var templateObject_1$$;var getAuthor=function getAuthor(item){return item.onBehalfOf||item.owner||item.author||{};};var getRealAuthor=function getRealAuthor(item){return item.owner||item.author||{};};var ItemMetaInfo=function ItemMetaInfo(_a){var item=_a.item,className=_a.className,expiryDate=_a.expiryDate,showChannels=_a.showChannels,dateMode=_a.dateMode,channels=_a.channels,_b=_a.readOnly,readOnly=_b===void 0?true:_b,_c=_a.hideAvatar,hideAvatar=_c===void 0?false:_c,hideDisplayName=_a.hideDisplayName,language=_a.language,buildChannelFilterUrl=_a.buildChannelFilterUrl,_d=_a.clickableAvatar,clickableAvatar=_d===void 0?true:_d;var hasChannels=channels&&channels.length>0;var onBehalfAuthor=getAuthor(item);var realAuthor=getRealAuthor(item);return jsxs(Host$m,__assign({className:className,"data-item-metadata":true},{children:[!hideAvatar&&jsx$1(PersonaCard,__assign({upn:onBehalfAuthor.userPrincipalName,readOnly:!clickableAvatar,domIdentifier:"avatar"},{children:jsx$1(Avatar,{upn:onBehalfAuthor.userPrincipalName,text:onBehalfAuthor.displayName,secondaryText:onBehalfAuthor.userPrincipalName,hidePersonaDetails:true,coinSize:55},void 0)}),void 0),jsxs(InfoDetailsHost,__assign({"data-meta-info-details":true},{children:[!hideDisplayName&&jsx$1(AuthorContainer,{children:jsx$1(AuthorName$1,{author:onBehalfAuthor,readOnly:readOnly},void 0)},void 0),jsxs(DateAndChannels,{children:[jsx$1(DateInfo$1,{item:item,dateMode:dateMode,expiryDate:expiryDate},void 0),"\u00A0",showChannels&&jsx$1(Fragment,{children:hasChannels?jsx$1(FormattedMessage$1,{id:"NewsMetaInfo.channels",values:{channels:jsxs(Fragment,{children:["\u00A0",jsx$1(Channels$1,{channels:channels.map(function(c){return c.name;}),language:language,buildChannelFilterUrl:buildChannelFilterUrl},void 0)]},void 0)}},void 0):jsx$1(FormattedMessage$1,{id:"NewsMetaInfo.noChannels"},void 0)},void 0)]},void 0),!hideDisplayName&&realAuthor&&realAuthor.userPrincipalName!==onBehalfAuthor.userPrincipalName&&jsx$1(AuthorContainer,{children:jsx$1(FormattedMessage$1,{id:"MetaInfo.writtenBy",values:{author:jsx$1(AuthorName$1,{author:realAuthor,readOnly:readOnly},void 0)}},void 0)},void 0)]}),void 0)]}),void 0);};var Host$m=_styled.div.withConfig({displayName:"ItemMetaInfo__Host",componentId:"sc-1d6drj8-0"})(templateObject_1$_||(templateObject_1$_=__makeTemplateObject(["\n display: flex;\n"],["\n display: flex;\n"])));var InfoDetailsHost=_styled.div.withConfig({displayName:"ItemMetaInfo__InfoDetailsHost",componentId:"sc-1d6drj8-1"})(templateObject_2$A||(templateObject_2$A=__makeTemplateObject(["\n padding-left: 8px;\n display: flex;\n flex-flow: column;\n justify-content: center;\n word-wrap: break-word;\n text-align: left;\n"],["\n padding-left: 8px;\n display: flex;\n flex-flow: column;\n justify-content: center;\n word-wrap: break-word;\n text-align: left;\n"])));var AuthorContainer=_styled.div.withConfig({displayName:"ItemMetaInfo__AuthorContainer",componentId:"sc-1d6drj8-2"})(templateObject_3$r||(templateObject_3$r=__makeTemplateObject(["\n font-style: normal;\n display: inline-block;\n"],["\n font-style: normal;\n display: inline-block;\n"])));var DateAndChannels=_styled.div.withConfig({displayName:"ItemMetaInfo__DateAndChannels",componentId:"sc-1d6drj8-3"})(templateObject_4$h||(templateObject_4$h=__makeTemplateObject(["\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n"],["\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n"])));var AuthorName$1=function AuthorName(_a){var author=_a.author,readOnly=_a.readOnly;if(!readOnly){return jsx$1(Fragment,{children:author.displayName},void 0);}return jsx$1(PrimaryPersonaCard,__assign({upn:author.userPrincipalName},{children:author.displayName}),void 0);};var PrimaryPersonaCard=_styled(PersonaCard).withConfig({displayName:"ItemMetaInfo__PrimaryPersonaCard",componentId:"sc-1d6drj8-4"})(templateObject_5$g||(templateObject_5$g=__makeTemplateObject(["\n color: ",";\n text-decoration: underline;\n"],["\n color: ",";\n text-decoration: underline;\n"])),function(p){return p.theme.palette.accent;});var Channels$1=_styled(ClickableChannelTitles).withConfig({displayName:"ItemMetaInfo__Channels",componentId:"sc-1d6drj8-5"})(templateObject_6$9||(templateObject_6$9=__makeTemplateObject(["\n display: contents;\n"],["\n display: contents;\n"])));var templateObject_1$_,templateObject_2$A,templateObject_3$r,templateObject_4$h,templateObject_5$g,templateObject_6$9;var PageDetailViewMetaInfo=function PageDetailViewMetaInfo(){var _a=useDetailViewContext(),item=_a.item,userPreferredLanguage=_a.userPreferredLanguage;return jsx$1(DetailMetaInfo$1,{item:item,dateMode:DateMode.Modified,language:userPreferredLanguage},void 0);};var DetailMetaInfo$1=_styled(ItemMetaInfo).withConfig({displayName:"PageDetailViewMetaInfo__DetailMetaInfo",componentId:"sc-1yz7bl7-0"})(templateObject_1$Z||(templateObject_1$Z=__makeTemplateObject(["\n display: flex;\n font-size: 12px;\n margin-top: 12px;\n\n @media (min-width: ","px) {\n font-size: 14px;\n }\n"],["\n display: flex;\n font-size: 12px;\n margin-top: 12px;\n\n @media (min-width: ","px) {\n font-size: 14px;\n }\n"])),minScreenSize.small);var templateObject_1$Z;var PageDetailViewFeedbackSection=function PageDetailViewFeedbackSection(_a){var hideLikes=_a.hideLikes,hideComments=_a.hideComments,hideProfileUrl=_a.hideProfileUrl,disableLoginForPublicUser=_a.disableLoginForPublicUser;var _b=useDetailViewContext(),item=_b.item,resourceType=_b.resourceType,contentLanguage=_b.contentLanguage;return jsxs(StyledFeedbackSection$1,__assign({item:item,language:contentLanguage,type:resourceType,feedbackSettings:item.feedbackSettings,hideComments:hideComments,hideProfileUrl:hideProfileUrl,disableLoginForPublicUser:disableLoginForPublicUser},{children:[!hideLikes&&jsx$1(FeedbackButtonLike,{},void 0),!hideComments&&jsx$1(FeedbackButtonComments,{},void 0),jsx$1(FeedbackButtonViews,{},void 0),jsx$1(FeedbackButtonShare,{},void 0)]}),void 0);};var StyledFeedbackSection$1=_styled(FeedbackSection).withConfig({displayName:"PageDetailViewFeedbackSection__StyledFeedbackSection",componentId:"sc-12s3v5d-0"})(templateObject_1$Y||(templateObject_1$Y=__makeTemplateObject(["\n ",";\n &[data-comment-section] {\n padding-bottom: ","px;\n\n @media (min-width: ","px) {\n padding-bottom: 0;\n }\n }\n"],["\n ",";\n &[data-comment-section] {\n padding-bottom: ","px;\n\n @media (min-width: ","px) {\n padding-bottom: 0;\n }\n }\n"])),DetailViewSectionPadding,spacingXl+10,minScreenSize.small);var templateObject_1$Y;var PageTocSearch=function PageTocSearch(_a){var onSearch=_a.onSearch,onSearchResultChange=_a.onSearchResultChange;var formatMessage=useIntl().formatMessage;var onDebouncedSearch=useDebouncedCallback(handleSearch,300)[0];var textColors=useContext(ThemeContext$1).theme.textColors;return jsx$1(StyledSearchBox,{"data-toc-search-box":true,onChange:function(_,v){return onDebouncedSearch(v);},placeholder:formatMessage({id:'Pages.pagesTableOfContents.searchFieldPlaceholder'}),onKeyPress:handleKeyPress,iconProps:{style:{color:textColors.default}}},void 0);function handleKeyPress(event){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:if(!(event.key==='Enter'))return [3/*break*/,2];return [4/*yield*/,handleSearch(event.currentTarget.value,true)];case 1:_a.sent();_a.label=2;case 2:return [2/*return*/];}});});}function handleSearch(value,ignoreSearchTextLength){return __awaiter(this,void 0,void 0,function(){var result,allNodesById;return __generator(this,function(_a){switch(_a.label){case 0:if(!value||!ignoreSearchTextLength&&value.trim().length<3){onSearchResultChange(null);return [2/*return*/];}return [4/*yield*/,onSearch(value)];case 1:result=_a.sent();allNodesById={};// the search returns us a flat result of pages, we now have to build up
122327
+ return jsxs("span",{children:[",",' ',jsx$1(FormattedMessage$1,{id:"DateInfo.archiveOn."+format,values:values},void 0)]},void 0);}}function getModifiedInfo(){var date=item.modified||item.created||new Date();var format=isSameDay(date)?'relative':'absolute';return jsx$1("span",{children:jsx$1(FormattedMessage$1,{id:"DateInfo.modifiedOn."+format,values:{modified:jsx$1(ModifiedDateTime,{value:date},void 0)}},void 0)},void 0);}};var ModifiedDateTime=_styled(DateTime).withConfig({displayName:"DateInfo__ModifiedDateTime",componentId:"sc-xnzpy3-0"})(templateObject_1$Z||(templateObject_1$Z=__makeTemplateObject(["\n &&& {\n text-decoration: none;\n }\n"],["\n &&& {\n text-decoration: none;\n }\n"])));var templateObject_1$Z;var getAuthor=function getAuthor(item){return item.onBehalfOf||item.owner||item.author||{};};var getRealAuthor=function getRealAuthor(item){return item.owner||item.author||{};};var ItemMetaInfo=function ItemMetaInfo(_a){var item=_a.item,className=_a.className,expiryDate=_a.expiryDate,showChannels=_a.showChannels,dateMode=_a.dateMode,channels=_a.channels,_b=_a.readOnly,readOnly=_b===void 0?true:_b,_c=_a.hideAvatar,hideAvatar=_c===void 0?false:_c,hideDisplayName=_a.hideDisplayName,language=_a.language,buildChannelFilterUrl=_a.buildChannelFilterUrl,_d=_a.clickableAvatar,clickableAvatar=_d===void 0?true:_d;var hasChannels=channels&&channels.length>0;var onBehalfAuthor=getAuthor(item);var realAuthor=getRealAuthor(item);return jsxs(Host$k,__assign({className:className,"data-item-metadata":true},{children:[!hideAvatar&&jsx$1(PersonaCard,__assign({upn:onBehalfAuthor.userPrincipalName,readOnly:!clickableAvatar,domIdentifier:"avatar"},{children:jsx$1(Avatar,{upn:onBehalfAuthor.userPrincipalName,text:onBehalfAuthor.displayName,secondaryText:onBehalfAuthor.userPrincipalName,hidePersonaDetails:true,coinSize:55},void 0)}),void 0),jsxs(InfoDetailsHost,__assign({"data-meta-info-details":true},{children:[!hideDisplayName&&jsx$1(AuthorContainer,{children:jsx$1(AuthorName$1,{author:onBehalfAuthor,readOnly:readOnly},void 0)},void 0),jsxs(DateAndChannels,{children:[jsx$1(DateInfo$1,{item:item,dateMode:dateMode,expiryDate:expiryDate},void 0),"\u00A0",showChannels&&jsx$1(Fragment,{children:hasChannels?jsx$1(FormattedMessage$1,{id:"NewsMetaInfo.channels",values:{channels:jsxs(Fragment,{children:["\u00A0",jsx$1(Channels$1,{channels:channels.map(function(c){return c.name;}),language:language,buildChannelFilterUrl:buildChannelFilterUrl},void 0)]},void 0)}},void 0):jsx$1(FormattedMessage$1,{id:"NewsMetaInfo.noChannels"},void 0)},void 0)]},void 0),!hideDisplayName&&realAuthor&&realAuthor.userPrincipalName!==onBehalfAuthor.userPrincipalName&&jsx$1(AuthorContainer,{children:jsx$1(FormattedMessage$1,{id:"MetaInfo.writtenBy",values:{author:jsx$1(AuthorName$1,{author:realAuthor,readOnly:readOnly},void 0)}},void 0)},void 0)]}),void 0)]}),void 0);};var Host$k=_styled.div.withConfig({displayName:"ItemMetaInfo__Host",componentId:"sc-1d6drj8-0"})(templateObject_1$Y||(templateObject_1$Y=__makeTemplateObject(["\n display: flex;\n"],["\n display: flex;\n"])));var InfoDetailsHost=_styled.div.withConfig({displayName:"ItemMetaInfo__InfoDetailsHost",componentId:"sc-1d6drj8-1"})(templateObject_2$y||(templateObject_2$y=__makeTemplateObject(["\n padding-left: 8px;\n display: flex;\n flex-flow: column;\n justify-content: center;\n word-wrap: break-word;\n text-align: left;\n"],["\n padding-left: 8px;\n display: flex;\n flex-flow: column;\n justify-content: center;\n word-wrap: break-word;\n text-align: left;\n"])));var AuthorContainer=_styled.div.withConfig({displayName:"ItemMetaInfo__AuthorContainer",componentId:"sc-1d6drj8-2"})(templateObject_3$p||(templateObject_3$p=__makeTemplateObject(["\n font-style: normal;\n display: inline-block;\n"],["\n font-style: normal;\n display: inline-block;\n"])));var DateAndChannels=_styled.div.withConfig({displayName:"ItemMetaInfo__DateAndChannels",componentId:"sc-1d6drj8-3"})(templateObject_4$f||(templateObject_4$f=__makeTemplateObject(["\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n"],["\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n"])));var AuthorName$1=function AuthorName(_a){var author=_a.author,readOnly=_a.readOnly;if(!readOnly){return jsx$1(Fragment,{children:author.displayName},void 0);}return jsx$1(PrimaryPersonaCard,__assign({upn:author.userPrincipalName},{children:author.displayName}),void 0);};var PrimaryPersonaCard=_styled(PersonaCard).withConfig({displayName:"ItemMetaInfo__PrimaryPersonaCard",componentId:"sc-1d6drj8-4"})(templateObject_5$e||(templateObject_5$e=__makeTemplateObject(["\n color: ",";\n text-decoration: underline;\n"],["\n color: ",";\n text-decoration: underline;\n"])),function(p){return p.theme.palette.accent;});var Channels$1=_styled(ClickableChannelTitles).withConfig({displayName:"ItemMetaInfo__Channels",componentId:"sc-1d6drj8-5"})(templateObject_6$8$1||(templateObject_6$8$1=__makeTemplateObject(["\n display: contents;\n"],["\n display: contents;\n"])));var templateObject_1$Y,templateObject_2$y,templateObject_3$p,templateObject_4$f,templateObject_5$e,templateObject_6$8$1;var PageDetailViewMetaInfo=function PageDetailViewMetaInfo(){var _a=useDetailViewContext(),item=_a.item,userPreferredLanguage=_a.userPreferredLanguage;return jsx$1(DetailMetaInfo$1,{item:item,dateMode:DateMode.Modified,language:userPreferredLanguage},void 0);};var DetailMetaInfo$1=_styled(ItemMetaInfo).withConfig({displayName:"PageDetailViewMetaInfo__DetailMetaInfo",componentId:"sc-1yz7bl7-0"})(templateObject_1$X||(templateObject_1$X=__makeTemplateObject(["\n display: flex;\n font-size: 12px;\n margin-top: 12px;\n\n @media (min-width: ","px) {\n font-size: 14px;\n }\n"],["\n display: flex;\n font-size: 12px;\n margin-top: 12px;\n\n @media (min-width: ","px) {\n font-size: 14px;\n }\n"])),minScreenSize.small);var templateObject_1$X;var PageDetailViewFeedbackSection=function PageDetailViewFeedbackSection(_a){var hideLikes=_a.hideLikes,hideComments=_a.hideComments,hideProfileUrl=_a.hideProfileUrl,disableLoginForPublicUser=_a.disableLoginForPublicUser;var _b=useDetailViewContext(),item=_b.item,resourceType=_b.resourceType,contentLanguage=_b.contentLanguage;return jsxs(StyledFeedbackSection$1,__assign({item:item,language:contentLanguage,type:resourceType,feedbackSettings:item.feedbackSettings,hideComments:hideComments,hideProfileUrl:hideProfileUrl,disableLoginForPublicUser:disableLoginForPublicUser},{children:[!hideLikes&&jsx$1(FeedbackButtonLike,{},void 0),!hideComments&&jsx$1(FeedbackButtonComments,{},void 0),jsx$1(FeedbackButtonViews,{},void 0),jsx$1(FeedbackButtonShare,{},void 0)]}),void 0);};var StyledFeedbackSection$1=_styled(FeedbackSection).withConfig({displayName:"PageDetailViewFeedbackSection__StyledFeedbackSection",componentId:"sc-12s3v5d-0"})(templateObject_1$W||(templateObject_1$W=__makeTemplateObject(["\n ",";\n &[data-comment-section] {\n padding-bottom: ","px;\n\n @media (min-width: ","px) {\n padding-bottom: 0;\n }\n }\n"],["\n ",";\n &[data-comment-section] {\n padding-bottom: ","px;\n\n @media (min-width: ","px) {\n padding-bottom: 0;\n }\n }\n"])),DetailViewSectionPadding,spacingXl+10,minScreenSize.small);var templateObject_1$W;var PageTocSearch=function PageTocSearch(_a){var onSearch=_a.onSearch,onSearchResultChange=_a.onSearchResultChange;var formatMessage=useIntl().formatMessage;var onDebouncedSearch=useDebouncedCallback(handleSearch,300)[0];var textColors=useContext(ThemeContext$1).theme.textColors;return jsx$1(StyledSearchBox,{"data-toc-search-box":true,onChange:function(_,v){return onDebouncedSearch(v);},placeholder:formatMessage({id:'Pages.pagesTableOfContents.searchFieldPlaceholder'}),onKeyPress:handleKeyPress,iconProps:{style:{color:textColors.default}}},void 0);function handleKeyPress(event){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:if(!(event.key==='Enter'))return [3/*break*/,2];return [4/*yield*/,handleSearch(event.currentTarget.value,true)];case 1:_a.sent();_a.label=2;case 2:return [2/*return*/];}});});}function handleSearch(value,ignoreSearchTextLength){return __awaiter(this,void 0,void 0,function(){var result,allNodesById;return __generator(this,function(_a){switch(_a.label){case 0:if(!value||!ignoreSearchTextLength&&value.trim().length<3){onSearchResultChange(null);return [2/*return*/];}return [4/*yield*/,onSearch(value)];case 1:result=_a.sent();allNodesById={};// the search returns us a flat result of pages, we now have to build up
122331
122328
  // an hierarchical tree, with the roots node at the very top
122332
122329
  // so we can then pass this in to the actual ToC
122333
122330
  result.items.forEach(function(page){var _a;var node=convertToNavigationNode(page);node.isSearchMatch=true;while(true){// if we already have the current node collected
@@ -122335,12 +122332,12 @@ result.items.forEach(function(page){var _a;var node=convertToNavigationNode(page
122335
122332
  // we don't want to add the same node again, instead we just need to
122336
122333
  // append the children of the node
122337
122334
  // we also know then that we don't have to traverse the tree further up and can stop
122338
- var existingNode=allNodesById[node.id];if(existingNode){if(existingNode.id===page.id){existingNode.isSearchMatch=true;}ensureChildren.apply(void 0,__spreadArray([existingNode],node.children||[]));break;}allNodesById[node.id]=node;if(!((_a=node.parent)===null||_a===void 0?void 0:_a.id)){break;}ensureChildren(node.parent,node);node=node.parent;}});onSearchResultChange(Object.values(allNodesById).filter(function(n){var _a;return !((_a=n.parent)===null||_a===void 0?void 0:_a.id);}));return [2/*return*/];}});});}function ensureChildren(parent){var _a;var children=[];for(var _i=1;_i<arguments.length;_i++){children[_i-1]=arguments[_i];}if(!parent.children){parent.children=[];}parent.children=parent.children.concat(children).sort(function(a,b){return a.position-b.position;});parent.firstChildId=(_a=parent.children[0])===null||_a===void 0?void 0:_a.id;}};var StyledSearchBox=_styled(SearchBox$1).withConfig({displayName:"PageTocSearch__StyledSearchBox",componentId:"sc-1enxv6b-0"})(templateObject_1$X||(templateObject_1$X=__makeTemplateObject(["\n margin-bottom: ","px;\n"],["\n margin-bottom: ","px;\n"])),spacingM);var templateObject_1$X;function filterChildren(page,activePage){if(!activePage){return true;}if(activePage.status===WorkflowStatus.deleted){return page.status===WorkflowStatus.deleted;}return page.status!==WorkflowStatus.deleted&&activePage.isUnlinked===page.isUnlinked;}var ExternalPagesLinkButton=function ExternalPagesLinkButton(_a){var item=_a.item,disabled=_a.disabled,onClick=_a.onClick,className=_a.className;var user=useCurrentUser();var preferredContentLanguage=getPreferredContentLanguage(user);var url=getExternalContentUrl(item,preferredContentLanguage);var formatMessage=useIntl().formatMessage;var createPageClickHandler=usePagesClickHandler().createPageClickHandler;if(!item.useExternalContent){return null;}var resourceKey="ExternalLinkButton.pages"+(!url?'.noUrl':'')+".navigateTo";return jsx$1(Tooltip,__assign({className:className,resourceKey:resourceKey,values:url?{url:url}:undefined,width:url?400:undefined},{children:jsx$1(StyledIconButton$4,{iconProps:{iconName:'NavigateExternalInline',styles:{root:{fontSize:fontSizeMedium+4+"px",height:fontSizeMedium+4+"px"}}},onClick:handleClick,disabled:disabled,"aria-label":formatMessage({id:resourceKey},url?{url:url}:undefined)},void 0)}),void 0);function handleClick(e){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){if(onClick){onClick(e);return [2/*return*/];}createPageClickHandler(item)(e);return [2/*return*/];});});}};var StyledIconButton$4=_styled(IconButton).withConfig({displayName:"ExternalPagesLinkButton__StyledIconButton",componentId:"sc-1n1ybv7-0"})(templateObject_1$W||(templateObject_1$W=__makeTemplateObject(["\n && {\n padding-left: 0;\n padding-right: 0;\n margin: 0;\n\n &[disabled] {\n background-color: transparent;\n }\n }\n"],["\n && {\n padding-left: 0;\n padding-right: 0;\n margin: 0;\n\n &[disabled] {\n background-color: transparent;\n }\n }\n"])));var templateObject_1$W;var PageNode=function PageNode(_a){var node=_a.node,activePage=_a.activePage,navigationContext=_a.navigationContext,loadChildren=_a.loadChildren,basePath=_a.basePath,path=_a.path,className=_a.className,isRootNode=_a.isRootNode,hide=_a.hide,onPageSelected=_a.onPageSelected,selectedPageId=_a.selectedPageId;var user=useCurrentUser();var formatMessage=useIntl().formatMessage;var createPageClickHandler=usePagesClickHandler().createPageClickHandler;var buildPath=useSubscriptionHandlePathBuilder().buildPath;var nodesContainNavigation=navigationContext==null;var _b=useState$2(null),lazyLoadedChildren=_b[0],setLazyLoadedChildren=_b[1];var children=lazyLoadedChildren||getChildren(node.id).filter(function(n){return filterChildren(n,activePage);});var _c=useState$2(undefined),forceShowChildren=_c[0],setForceShowChildren=_c[1];var showChildren=forceShowChildren||children&&forceShowChildren!==false&&(nodesContainNavigation||path.some(function(p){return p===node.id;})||(activePage===null||activePage===void 0?void 0:activePage.id)===node.id);var title=getTitle(node,user,formatMessage);var isSelectedPageNode=(activePage===null||activePage===void 0?void 0:activePage.id)===node.id||selectedPageId===node.id;var iconName=getIconName();var isExpanded=iconName==='ChevronDown';var isHighlighted=isSelectedPageNode||path.some(function(p){return p===node.id;});var appBasePath=basePath?buildPath(basePath):null;var isSearchMatch=node.isSearchMatch?'true':null;var isDocument=node.pageType===PageType.Document;var detailViewUrl=""+NewsService.getNewsRoute(appBasePath,node.id,title)+(node.useExternalContent?"?"+queryString.stringify({noRedirect:true}):'');return jsxs(Fragment,{children:[jsxs(NodeWrapper,__assign({isFirstLevel:isRootNode,hide:hide,className:className,isActive:isSelectedPageNode,"data-page-toc-node":true,"data-is-active":isSelectedPageNode},{children:[!!iconName?jsx$1(StyledIconButton$3,{iconProps:{iconName:iconName},onClick:function(){return __awaiter(void 0,void 0,void 0,function(){var _a;return __generator(this,function(_b){switch(_b.label){case 0:if(!!(children===null||children===void 0?void 0:children.length))return [3/*break*/,2];_a=setLazyLoadedChildren;return [4/*yield*/,loadChildren(node.id)];case 1:_a.apply(void 0,[_b.sent()]);_b.label=2;case 2:setForceShowChildren(!showChildren);return [2/*return*/];}});});},isHighlighted:isHighlighted,isExpanded:isExpanded,ariaLabel:formatMessage({id:isExpanded?'AriaLabel.hideChildren':'AriaLabel.seeChildren'}),"data-toc-node-toggle-children":node.id},void 0):jsx$1(StyledIcon$3$1,{isHighlighted:isHighlighted},void 0),basePath?jsx$1(NodeTitleLink,__assign({onClick:createPageClickHandler(node,basePath,function(){return onPageSelected===null||onPageSelected===void 0?void 0:onPageSelected(node.id);},true),to:detailViewUrl,bold:isSearchMatch,"data-toc-node-title":node.id},{children:title}),void 0):onPageSelected?jsx$1(NodeTitleButton,__assign({onClick:function(){return onPageSelected(node.id);},disabled:isDocument,bold:isSearchMatch,"data-toc-node-title":node.id},{children:title}),void 0):jsx$1(NodeTitle,__assign({bold:isSearchMatch,"data-toc-node-title":node.id},{children:title}),void 0),jsx$1(StyledExternalLinkButton,{item:node},void 0),jsx$1(StyledDocumentDownloadButton$1,{page:node,basePath:basePath},void 0)]}),void 0),children.length>0&&jsx$1(ChildrenList,__assign({hide:hide},{children:children.map(function(c){return jsx$1("li",{children:jsx$1(PageNode,{hide:!showChildren,basePath:basePath,node:c,activePage:activePage,navigationContext:navigationContext,loadChildren:loadChildren,path:path,isRootNode:false,onPageSelected:onPageSelected,selectedPageId:selectedPageId},void 0)},c.id);})}),void 0)]},void 0);function getIconName(){var _a;if(!nodesContainNavigation&&!node.firstChildId||nodesContainNavigation&&!((_a=node.children)===null||_a===void 0?void 0:_a.length)){return null;}if(showChildren){return 'ChevronDown';}return 'ChevronRight';}function getChildren(nodeId){if(nodesContainNavigation){return node.children||[];}if((activePage===null||activePage===void 0?void 0:activePage.id)===nodeId){return navigationContext.children||[];}var result=navigationContext.parent;while(result!=null&&result.id!==nodeId){result=result.parent;}return result?result.children:[];}};var NodeWrapper=_styled.div.withConfig({displayName:"PageTocNode__NodeWrapper",componentId:"sc-1ftr1ym-0"})(templateObject_3$q||(templateObject_3$q=__makeTemplateObject(["\n display: inline-flex;\n min-width: 240px; /* this value is very important for the ToC in Panel: icon + title + external page icon */\n margin-right: 4px;\n\n ","\n ",";\n\n ","\n\n padding: ","px;\n\n @media (min-width: ","px) {\n padding: 0;\n }\n"],["\n display: inline-flex;\n min-width: 240px; /* this value is very important for the ToC in Panel: icon + title + external page icon */\n margin-right: 4px;\n\n ","\n ",";\n\n ","\n\n padding: ","px;\n\n @media (min-width: ","px) {\n padding: 0;\n }\n"])),function(p){return p.hide&&'display: none;';},function(p){return !p.isFirstLevel&&css$2(templateObject_1$V||(templateObject_1$V=__makeTemplateObject(["\n padding-left: ","px;\n margin-top: ","px;\n "],["\n padding-left: ","px;\n margin-top: ","px;\n "])),spacingS,spacingS+5);},function(p){return p.isActive&&css$2(templateObject_2$z||(templateObject_2$z=__makeTemplateObject(["\n position: relative;\n font-weight: bold;\n\n &::before {\n content: '';\n position: absolute;\n left: -9999px;\n right: -9999px;\n top: -3px;\n bottom: -3px;\n display: block;\n background-color: ",";\n }\n "],["\n position: relative;\n font-weight: bold;\n\n &::before {\n content: '';\n position: absolute;\n left: -9999px;\n right: -9999px;\n top: -3px;\n bottom: -3px;\n display: block;\n background-color: ",";\n }\n "])),function(p){return p.theme.palette.neutralQuaternaryAlt;});},spacingXs,minScreenSize.small);var IconNormalSize=20;var IconLargeSize=26;var IconBubbleStyle=function IconBubbleStyle(isHighlighted){return css$2(templateObject_6$8$1||(templateObject_6$8$1=__makeTemplateObject(["\n ",";\n "],["\n ",";\n "])),isHighlighted?css$2(templateObject_4$g||(templateObject_4$g=__makeTemplateObject(["\n background: ",";\n color: ",";\n "],["\n background: ",";\n color: ",";\n "])),function(p){return p.theme.palette.accent;},function(p){return p.theme.palette.white;}):css$2(templateObject_5$f||(templateObject_5$f=__makeTemplateObject(["\n background: ",";\n color: ",";\n "],["\n background: ",";\n color: ",";\n "])),function(p){return p.theme.palette.neutralQuaternary;},function(p){return p.theme.palette.black;}));};var StyledIconButton$3=_styled(IconButton$1).withConfig({displayName:"PageTocNode__StyledIconButton",componentId:"sc-1ftr1ym-1"})(templateObject_8$5$1||(templateObject_8$5$1=__makeTemplateObject(["\n && {\n margin: 0;\n padding: 0;\n flex-shrink: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n\n &,\n i {\n width: ","px;\n height: ","px;\n }\n\n i {\n margin: 0;\n font-size: 14px;\n line-height: ","px;\n }\n\n &&,\n &&:hover,\n &&:active,\n &&:focus {\n ","\n\n ","\n }\n\n @media (min-width: ","px) {\n &,\n i {\n width: ","px;\n height: ","px;\n }\n\n i {\n font-size: 10px;\n line-height: ","px;\n }\n }\n }\n"],["\n && {\n margin: 0;\n padding: 0;\n flex-shrink: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n\n &,\n i {\n width: ","px;\n height: ","px;\n }\n\n i {\n margin: 0;\n font-size: 14px;\n line-height: ","px;\n }\n\n &&,\n &&:hover,\n &&:active,\n &&:focus {\n ","\n\n ","\n }\n\n @media (min-width: ","px) {\n &,\n i {\n width: ","px;\n height: ","px;\n }\n\n i {\n font-size: 10px;\n line-height: ","px;\n }\n }\n }\n"])),IconLargeSize,IconLargeSize,IconLargeSize,function(p){return p.isExpanded&&css$2(templateObject_7$5$1||(templateObject_7$5$1=__makeTemplateObject(["\n i {\n transform: translate(0, 1px);\n }\n "],["\n i {\n transform: translate(0, 1px);\n }\n "])));},function(p){return IconBubbleStyle(p.isHighlighted);},minScreenSize.small,IconNormalSize,IconNormalSize,IconNormalSize);var StyledIcon$3$1=_styled(Icon).withConfig({displayName:"PageTocNode__StyledIcon",componentId:"sc-1ftr1ym-2"})(templateObject_9$3$1||(templateObject_9$3$1=__makeTemplateObject(["\n width: ","px;\n min-width: ","px;\n height: ","px;\n border-radius: 50%;\n z-index: 1;\n\n @media (min-width: ","px) {\n & {\n width: ","px;\n min-width: ","px;\n height: ","px;\n }\n }\n\n ","\n"],["\n width: ","px;\n min-width: ","px;\n height: ","px;\n border-radius: 50%;\n z-index: 1;\n\n @media (min-width: ","px) {\n & {\n width: ","px;\n min-width: ","px;\n height: ","px;\n }\n }\n\n ","\n"])),IconLargeSize,IconLargeSize,IconLargeSize,minScreenSize.small,IconNormalSize,IconNormalSize,IconNormalSize,function(p){return IconBubbleStyle(p.isHighlighted);});var NodeTitleStyle=css$2(templateObject_11$1$1||(templateObject_11$1$1=__makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n box-sizing: border-box;\n margin-left: ","px;\n z-index: 1;\n && {\n font-size: ","px;\n color: ",";\n\n ","\n }\n\n @media (min-width: ","px) {\n && {\n font-size: ","px;\n }\n }\n"],["\n display: inline-flex;\n align-items: center;\n box-sizing: border-box;\n margin-left: ","px;\n z-index: 1;\n && {\n font-size: ","px;\n color: ",";\n\n ","\n }\n\n @media (min-width: ","px) {\n && {\n font-size: ","px;\n }\n }\n"])),spacingM,fontSizeNormal,function(p){return p.theme.textColors.default;},function(p){return p.bold&&css$2(templateObject_10$2$1||(templateObject_10$2$1=__makeTemplateObject(["\n font-weight: bold;\n "],["\n font-weight: bold;\n "])));},minScreenSize.small,fontSizeSmall);var NodeTitleLink=_styled(NavLink).withConfig({displayName:"PageTocNode__NodeTitleLink",componentId:"sc-1ftr1ym-3"})(templateObject_12$1$1||(templateObject_12$1$1=__makeTemplateObject(["\n ",";\n\n && {\n color: ",";\n }\n"],["\n ",";\n\n && {\n color: ",";\n }\n"])),NodeTitleStyle,function(p){return p.theme.textColors.default;});var NodeTitleButton=_styled(ActionButton).withConfig({displayName:"PageTocNode__NodeTitleButton",componentId:"sc-1ftr1ym-4"})(templateObject_13$1$1||(templateObject_13$1$1=__makeTemplateObject(["\n padding: 0;\n height: auto;\n text-align: left;\n ",";\n\n &[disabled] {\n color: ",";\n }\n"],["\n padding: 0;\n height: auto;\n text-align: left;\n ",";\n\n &[disabled] {\n color: ",";\n }\n"])),NodeTitleStyle,function(p){return p.theme.palette.neutralQuaternary;});var NodeTitle=_styled.div.withConfig({displayName:"PageTocNode__NodeTitle",componentId:"sc-1ftr1ym-5"})(templateObject_14$1$1||(templateObject_14$1$1=__makeTemplateObject(["\n ",";\n"],["\n ",";\n"])),NodeTitleStyle);var ChildrenList=_styled.ul.withConfig({displayName:"PageTocNode__ChildrenList",componentId:"sc-1ftr1ym-6"})(templateObject_15$1$1||(templateObject_15$1$1=__makeTemplateObject(["\n list-style: none;\n margin: 0;\n padding: 0;\n\n ",";\n\n > li {\n padding-left: ","px;\n }\n"],["\n list-style: none;\n margin: 0;\n padding: 0;\n\n ",";\n\n > li {\n padding-left: ","px;\n }\n"])),function(p){return p.hide&&'display: none;';},spacingS);var StyledExternalLinkButton=_styled(ExternalPagesLinkButton).withConfig({displayName:"PageTocNode__StyledExternalLinkButton",componentId:"sc-1ftr1ym-7"})(templateObject_16$1$1||(templateObject_16$1$1=__makeTemplateObject(["\n display: flex;\n margin-left: ","px;\n height: ","px;\n\n @media (min-width: ","px) {\n height: ","px;\n }\n\n > button {\n height: auto;\n\n i {\n font-size: ","px;\n height: ","px;\n }\n }\n"],["\n display: flex;\n margin-left: ","px;\n height: ","px;\n\n @media (min-width: ","px) {\n height: ","px;\n }\n\n > button {\n height: auto;\n\n i {\n font-size: ","px;\n height: ","px;\n }\n }\n"])),spacingS,IconLargeSize,minScreenSize.small,IconNormalSize,IconNormalSize,IconNormalSize);var StyledDocumentDownloadButton$1=_styled(DocumentDownloadButton).withConfig({displayName:"PageTocNode__StyledDocumentDownloadButton",componentId:"sc-1ftr1ym-8"})(templateObject_17$1||(templateObject_17$1=__makeTemplateObject(["\n display: flex;\n height: ","px;\n margin-left: ","px;\n\n @media (min-width: ","px) {\n height: ","px;\n }\n\n > button {\n height: auto;\n\n i {\n line-height: ","px;\n height: ","px;\n }\n }\n"],["\n display: flex;\n height: ","px;\n margin-left: ","px;\n\n @media (min-width: ","px) {\n height: ","px;\n }\n\n > button {\n height: auto;\n\n i {\n line-height: ","px;\n height: ","px;\n }\n }\n"])),IconLargeSize,spacingS-5,minScreenSize.small,IconNormalSize,IconNormalSize,IconNormalSize);var templateObject_1$V,templateObject_2$z,templateObject_3$q,templateObject_4$g,templateObject_5$f,templateObject_6$8$1,templateObject_7$5$1,templateObject_8$5$1,templateObject_9$3$1,templateObject_10$2$1,templateObject_11$1$1,templateObject_12$1$1,templateObject_13$1$1,templateObject_14$1$1,templateObject_15$1$1,templateObject_16$1$1,templateObject_17$1;var PageTableOfContents$1=function PageTableOfContents(_a){var basePath=_a.basePath,navigationContext=_a.navigationContext,activePageId=_a.activePageId,loadChildren=_a.loadChildren,onSearch=_a.onSearch,onPageSelected=_a.onPageSelected,className=_a.className,selectedPageId=_a.selectedPageId,isLoading=_a.isLoading,disableScrollableList=_a.disableScrollableList;var user=useCurrentUser();var _b=getRootNodes(),rootNodes=_b.rootNodes,path=_b.path;var _c=useState$2(),searchResult=_c[0],setSearchResult=_c[1];if(isLoading){return jsx$1(Spinner,{},void 0);}if(!rootNodes||(rootNodes===null||rootNodes===void 0?void 0:rootNodes.length)===0){return jsx$1(FormattedMessageWithStyle,{id:"ContentEditor.parentPage.emptyToc",tagName:"div",className:className},void 0);}var activePage=activePageId&&navigationContext.siblings.find(function(p){return p.id===activePageId;});var nodesToDisplay=sortPageNodesByGroupAndPosition(user.groups,(searchResult||rootNodes).filter(function(p){return filterChildren(p,activePage);}));return jsx$1(Fragment,{children:jsxs("div",__assign({className:className},{children:[jsx$1("div",__assign({"data-toc-search-container":true},{children:jsx$1(PageTocSearch,{onSearch:onSearch,onSearchResultChange:setSearchResult},void 0)}),void 0),searchResult&&!searchResult.length&&jsx$1(TocEmptyList,{icon:"Search",emptyMessageResources:['EmptySearchResult.info']},void 0),nodesToDisplay&&jsx$1(TocListContainer,__assign({"data-toc-scrollable-container":true,isScrollable:!disableScrollableList},{children:jsx$1(TocList,{children:nodesToDisplay.map(function(c){return jsx$1(ToCItem,{children:jsx$1(PageNode,{basePath:basePath,node:c,activePage:activePage,navigationContext:searchResult?null:navigationContext,loadChildren:loadChildren,path:path,isRootNode:true,onPageSelected:onPageSelected,selectedPageId:selectedPageId},void 0)},c.id+!!searchResult);})},void 0)}),void 0)]}),void 0)},void 0);function getRootNodes(){if(!(navigationContext===null||navigationContext===void 0?void 0:navigationContext.parent)){return {rootNodes:(navigationContext===null||navigationContext===void 0?void 0:navigationContext.siblings)||[],path:[]};}var path=[];var currentParent=navigationContext.parent;while(currentParent!=null&&currentParent.parent!=null){path.push(currentParent.id);currentParent=currentParent.parent;}return {rootNodes:(currentParent===null||currentParent===void 0?void 0:currentParent.children)||[],path:path};}};var TocEmptyList=_styled(EmptyList).withConfig({displayName:"PageTableOfContents__TocEmptyList",componentId:"sc-3llzkd-0"})(templateObject_1$U||(templateObject_1$U=__makeTemplateObject(["\n i {\n padding-top: 0;\n font-size: ","px;\n }\n"],["\n i {\n padding-top: 0;\n font-size: ","px;\n }\n"])),fontSizeLarger+10);var TocListContainer=_styled.div.withConfig({displayName:"PageTableOfContents__TocListContainer",componentId:"sc-3llzkd-1"})(templateObject_3$p||(templateObject_3$p=__makeTemplateObject(["\n margin-top: ","px;\n\n ","\n"],["\n margin-top: ","px;\n\n ","\n"])),spacingXs,function(p){return p.isScrollable&&css$2(templateObject_2$y||(templateObject_2$y=__makeTemplateObject(["\n overflow-y: auto;\n overflow-x: hidden;\n height: calc(100% - 52px); /* full height - search box height */\n "],["\n overflow-y: auto;\n overflow-x: hidden;\n height: calc(100% - 52px); /* full height - search box height */\n "])));});var TocList=_styled.ul.withConfig({displayName:"PageTableOfContents__TocList",componentId:"sc-3llzkd-2"})(templateObject_4$f||(templateObject_4$f=__makeTemplateObject(["\n list-style: none;\n padding: 0;\n margin: 0;\n"],["\n list-style: none;\n padding: 0;\n margin: 0;\n"])));var ToCItem=_styled.li.withConfig({displayName:"PageTableOfContents__ToCItem",componentId:"sc-3llzkd-3"})(templateObject_5$e||(templateObject_5$e=__makeTemplateObject(["\n margin-bottom: ","px;\n"],["\n margin-bottom: ","px;\n"])),spacingM);_styled(PageTableOfContents$1).withConfig({displayName:"PageTableOfContents__StyledPageToC",componentId:"sc-3llzkd-4"})(templateObject_6$7$1||(templateObject_6$7$1=__makeTemplateObject(["\n height: 100%;\n\n [data-toc-scrollable-container] {\n overflow-x: auto;\n padding-left: ","px;\n /* ensure node titles are aligned with SearchBox input & Close button */\n /* if the title is too long, horizontal scrollbar is shown */\n margin-right: ","px;\n }\n\n [data-nothing-found],\n [data-toc-search-container] {\n padding: 0 ","px;\n box-sizing: border-box;\n }\n\n [data-page-toc-node] {\n &[data-is-active='true'] {\n &::before {\n left: -10px;\n right: -10px;\n }\n }\n }\n"],["\n height: 100%;\n\n [data-toc-scrollable-container] {\n overflow-x: auto;\n padding-left: ","px;\n /* ensure node titles are aligned with SearchBox input & Close button */\n /* if the title is too long, horizontal scrollbar is shown */\n margin-right: ","px;\n }\n\n [data-nothing-found],\n [data-toc-search-container] {\n padding: 0 ","px;\n box-sizing: border-box;\n }\n\n [data-page-toc-node] {\n &[data-is-active='true'] {\n &::before {\n left: -10px;\n right: -10px;\n }\n }\n }\n"])),spacingM,spacingM,spacingM);var templateObject_1$U,templateObject_2$y,templateObject_3$p,templateObject_4$f,templateObject_5$e,templateObject_6$7$1;var PageTableOfContentsDialog=function PageTableOfContentsDialog(_a){var isOpen=_a.isOpen,navigationContext=_a.navigationContext,activePageId=_a.activePageId,loadChildren=_a.loadChildren,onSearch=_a.onSearch,onDismiss=_a.onDismiss,basePath=_a.basePath;var formatMessage=useIntl().formatMessage;if(!navigationContext){return null;}return jsx$1(MobileFullHeightDialog,__assign({hidden:!isOpen,modalProps:{className:'dialog-toc'},dialogContentProps:{type:DialogType.close},onDismiss:onDismiss,title:formatMessage({id:'Pages.pagesTableOfContents'})},{children:jsxs(DialogContent,__assign({className:"dialog-content-host","data-toc-dialog":true},{children:[jsx$1(DialogGlobalStyle,{},void 0),jsx$1(PageTableOfContents$1,{basePath:basePath,activePageId:activePageId,navigationContext:navigationContext,loadChildren:loadChildren,onSearch:onSearch,onPageSelected:onDismiss,disableScrollableList:true},void 0)]}),void 0)}),void 0);};var DialogContent=_styled.div.withConfig({displayName:"PageTableOfContentsDialog__DialogContent",componentId:"sc-z2sdu7-0"})(templateObject_1$T||(templateObject_1$T=__makeTemplateObject(["\n margin-top: 5px;\n\n @media (min-width: ","px) {\n width: 450px;\n }\n"],["\n margin-top: 5px;\n\n @media (min-width: ","px) {\n width: 450px;\n }\n"])),minScreenSize.small);var DialogGlobalStyle=createGlobalStyle(templateObject_2$x||(templateObject_2$x=__makeTemplateObject(["\n .dialog-toc {\n a {\n text-decoration: none;\n }\n\n .ms-Dialog-main {\n @media (max-width: ","px) {\n width: 100% !important;\n }\n }\n\n .ms-Dialog-inner {\n overflow-x: hidden;\n }\n }\n"],["\n .dialog-toc {\n a {\n text-decoration: none;\n }\n\n .ms-Dialog-main {\n @media (max-width: ","px) {\n width: 100% !important;\n }\n }\n\n .ms-Dialog-inner {\n overflow-x: hidden;\n }\n }\n"])),maxScreenSize.small);var templateObject_1$T,templateObject_2$x;function useLoadPublishedItemsByKeywords(keywords,showPagesAndDocuments,pageType){var _this=this;var searchPublishedPages=usePagesApi().searchPublishedPages;return function(pageSize,token){return __awaiter(_this,void 0,void 0,function(){var result;return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,searchPublishedPages({keywords:{items:keywords},token:token,pageSize:pageSize,pageType:showPagesAndDocuments?undefined:pageType})];case 1:result=_a.sent();return [2/*return*/,{items:result===null||result===void 0?void 0:result.items,paginationToken:result===null||result===void 0?void 0:result.paginationToken,hasNextPage:(result===null||result===void 0?void 0:result.nextItem)!==null}];}});});};}var InlinePageListByKeywords=function InlinePageListByKeywords(_a){var keywords=_a.keywords,showDocuments=_a.showDocuments,showPages=_a.showPages;var buildPath=useSubscriptionHandlePathBuilder().buildPath;var showPagesAndDocuments=showPages&&showDocuments;var pageType=showPages?PageType.Page:PageType.Document;var defaultPageSize=10;var keywordsAsString=keywords===null||keywords===void 0?void 0:keywords.join('-');var _b=useItemLoaderWithPreFetch(defaultPageSize,useLoadPublishedItemsByKeywords(keywords,showPagesAndDocuments,pageType),[keywordsAsString]),items=_b.items,pagingProps=__rest(_b,["items"]);return jsx$1(InlinePageListSkeleton,__assign({isDataLoaded:!pagingProps.isInitialLoading},{children:jsx$1(InlinePageListWithPaging,{pages:items,pagingProps:__assign(__assign({},pagingProps),{hideNextButton:pagingProps.isLastPage}),baseRoute:buildPath('pages'),filterBaseUrl:buildPath('/pages/search')},void 0)}),void 0);};function useLoadPublishedItemsByPageId(pageId,showPagesAndDocuments,pageType){var _this=this;var getSubpages=usePagesApi().getSubpages;try{return function(pageSize,token){return __awaiter(_this,void 0,void 0,function(){var result;return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,getSubpages(pageId,{pageType:showPagesAndDocuments?undefined:pageType,token:token,pageSize:pageSize})];case 1:result=_a.sent();return [2/*return*/,{items:result.items,paginationToken:result.paginationToken,hasNextPage:result.nextItem!==null}];}});});};}catch(error){logger.error(error);return null;}}var defaultPageSize$1=10;var InlinePageListByPageId=function InlinePageListByPageId(_a){var pageId=_a.pageId,showPages=_a.showPages,showDocuments=_a.showDocuments;var buildPath=useSubscriptionHandlePathBuilder().buildPath;var showSubpagesAndDocuments=showPages&&showDocuments;var pageType=showPages?PageType.Page:PageType.Document;var _b=useItemLoaderWithPreFetch(defaultPageSize$1,useLoadPublishedItemsByPageId(pageId,showSubpagesAndDocuments,pageType),[pageId]),items=_b.items,pagingProps=__rest(_b,["items"]);return jsx$1(InlinePageListSkeleton,__assign({isDataLoaded:!pagingProps.isInitialLoading},{children:jsx$1(InlinePageListWithPaging,{pages:items,pagingProps:__assign(__assign({},pagingProps),{hideNextButton:pagingProps.isLastPage}),baseRoute:buildPath('pages'),filterBaseUrl:buildPath('/pages/search')},void 0)}),void 0);};var defaultPageSize=10;// the inline page list should be auto-added on a page with no content
122335
+ var existingNode=allNodesById[node.id];if(existingNode){if(existingNode.id===page.id){existingNode.isSearchMatch=true;}ensureChildren.apply(void 0,__spreadArray([existingNode],node.children||[]));break;}allNodesById[node.id]=node;if(!((_a=node.parent)===null||_a===void 0?void 0:_a.id)){break;}ensureChildren(node.parent,node);node=node.parent;}});onSearchResultChange(Object.values(allNodesById).filter(function(n){var _a;return !((_a=n.parent)===null||_a===void 0?void 0:_a.id);}));return [2/*return*/];}});});}function ensureChildren(parent){var _a;var children=[];for(var _i=1;_i<arguments.length;_i++){children[_i-1]=arguments[_i];}if(!parent.children){parent.children=[];}parent.children=parent.children.concat(children).sort(function(a,b){return a.position-b.position;});parent.firstChildId=(_a=parent.children[0])===null||_a===void 0?void 0:_a.id;}};var StyledSearchBox=_styled(SearchBox$1).withConfig({displayName:"PageTocSearch__StyledSearchBox",componentId:"sc-1enxv6b-0"})(templateObject_1$V||(templateObject_1$V=__makeTemplateObject(["\n margin-bottom: ","px;\n"],["\n margin-bottom: ","px;\n"])),spacingM);var templateObject_1$V;function filterChildren(page,activePage){if(!activePage){return true;}if(activePage.status===WorkflowStatus.deleted){return page.status===WorkflowStatus.deleted;}return page.status!==WorkflowStatus.deleted&&activePage.isUnlinked===page.isUnlinked;}var ExternalPagesLinkButton=function ExternalPagesLinkButton(_a){var item=_a.item,disabled=_a.disabled,onClick=_a.onClick,className=_a.className;var user=useCurrentUser();var preferredContentLanguage=getPreferredContentLanguage(user);var url=getExternalContentUrl(item,preferredContentLanguage);var formatMessage=useIntl().formatMessage;var createPageClickHandler=usePagesClickHandler().createPageClickHandler;if(!item.useExternalContent){return null;}var resourceKey="ExternalLinkButton.pages"+(!url?'.noUrl':'')+".navigateTo";return jsx$1(Tooltip,__assign({className:className,resourceKey:resourceKey,values:url?{url:url}:undefined,width:url?400:undefined},{children:jsx$1(StyledIconButton$4,{iconProps:{iconName:'NavigateExternalInline',styles:{root:{fontSize:fontSizeMedium+4+"px",height:fontSizeMedium+4+"px"}}},onClick:handleClick,disabled:disabled,"aria-label":formatMessage({id:resourceKey},url?{url:url}:undefined)},void 0)}),void 0);function handleClick(e){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){if(onClick){onClick(e);return [2/*return*/];}createPageClickHandler(item)(e);return [2/*return*/];});});}};var StyledIconButton$4=_styled(IconButton).withConfig({displayName:"ExternalPagesLinkButton__StyledIconButton",componentId:"sc-1n1ybv7-0"})(templateObject_1$U||(templateObject_1$U=__makeTemplateObject(["\n && {\n padding-left: 0;\n padding-right: 0;\n margin: 0;\n\n &[disabled] {\n background-color: transparent;\n }\n }\n"],["\n && {\n padding-left: 0;\n padding-right: 0;\n margin: 0;\n\n &[disabled] {\n background-color: transparent;\n }\n }\n"])));var templateObject_1$U;var PageNode=function PageNode(_a){var node=_a.node,activePage=_a.activePage,navigationContext=_a.navigationContext,loadChildren=_a.loadChildren,basePath=_a.basePath,path=_a.path,className=_a.className,isRootNode=_a.isRootNode,hide=_a.hide,onPageSelected=_a.onPageSelected,selectedPageId=_a.selectedPageId;var user=useCurrentUser();var formatMessage=useIntl().formatMessage;var createPageClickHandler=usePagesClickHandler().createPageClickHandler;var buildPath=useSubscriptionHandlePathBuilder().buildPath;var nodesContainNavigation=navigationContext==null;var _b=useState$2(null),lazyLoadedChildren=_b[0],setLazyLoadedChildren=_b[1];var children=lazyLoadedChildren||getChildren(node.id).filter(function(n){return filterChildren(n,activePage);});var _c=useState$2(undefined),forceShowChildren=_c[0],setForceShowChildren=_c[1];var showChildren=forceShowChildren||children&&forceShowChildren!==false&&(nodesContainNavigation||path.some(function(p){return p===node.id;})||(activePage===null||activePage===void 0?void 0:activePage.id)===node.id);var title=getTitle(node,user,formatMessage);var isSelectedPageNode=(activePage===null||activePage===void 0?void 0:activePage.id)===node.id||selectedPageId===node.id;var iconName=getIconName();var isExpanded=iconName==='ChevronDown';var isHighlighted=isSelectedPageNode||path.some(function(p){return p===node.id;});var appBasePath=basePath?buildPath(basePath):null;var isSearchMatch=node.isSearchMatch?'true':null;var isDocument=node.pageType===PageType.Document;var detailViewUrl=""+NewsService.getNewsRoute(appBasePath,node.id,title)+(node.useExternalContent?"?"+queryString.stringify({noRedirect:true}):'');return jsxs(Fragment,{children:[jsxs(NodeWrapper,__assign({isFirstLevel:isRootNode,hide:hide,className:className,isActive:isSelectedPageNode,"data-page-toc-node":true,"data-is-active":isSelectedPageNode},{children:[!!iconName?jsx$1(StyledIconButton$3,{iconProps:{iconName:iconName},onClick:function(){return __awaiter(void 0,void 0,void 0,function(){var _a;return __generator(this,function(_b){switch(_b.label){case 0:if(!!(children===null||children===void 0?void 0:children.length))return [3/*break*/,2];_a=setLazyLoadedChildren;return [4/*yield*/,loadChildren(node.id)];case 1:_a.apply(void 0,[_b.sent()]);_b.label=2;case 2:setForceShowChildren(!showChildren);return [2/*return*/];}});});},isHighlighted:isHighlighted,isExpanded:isExpanded,ariaLabel:formatMessage({id:isExpanded?'AriaLabel.hideChildren':'AriaLabel.seeChildren'}),"data-toc-node-toggle-children":node.id},void 0):jsx$1(StyledIcon$3$1,{isHighlighted:isHighlighted},void 0),basePath?jsx$1(NodeTitleLink,__assign({onClick:createPageClickHandler(node,basePath,function(){return onPageSelected===null||onPageSelected===void 0?void 0:onPageSelected(node.id);},true),to:detailViewUrl,bold:isSearchMatch,"data-toc-node-title":node.id},{children:title}),void 0):onPageSelected?jsx$1(NodeTitleButton,__assign({onClick:function(){return onPageSelected(node.id);},disabled:isDocument,bold:isSearchMatch,"data-toc-node-title":node.id},{children:title}),void 0):jsx$1(NodeTitle,__assign({bold:isSearchMatch,"data-toc-node-title":node.id},{children:title}),void 0),jsx$1(StyledExternalLinkButton,{item:node},void 0),jsx$1(StyledDocumentDownloadButton$1,{page:node,basePath:basePath},void 0)]}),void 0),children.length>0&&jsx$1(ChildrenList,__assign({hide:hide},{children:children.map(function(c){return jsx$1("li",{children:jsx$1(PageNode,{hide:!showChildren,basePath:basePath,node:c,activePage:activePage,navigationContext:navigationContext,loadChildren:loadChildren,path:path,isRootNode:false,onPageSelected:onPageSelected,selectedPageId:selectedPageId},void 0)},c.id);})}),void 0)]},void 0);function getIconName(){var _a;if(!nodesContainNavigation&&!node.firstChildId||nodesContainNavigation&&!((_a=node.children)===null||_a===void 0?void 0:_a.length)){return null;}if(showChildren){return 'ChevronDown';}return 'ChevronRight';}function getChildren(nodeId){if(nodesContainNavigation){return node.children||[];}if((activePage===null||activePage===void 0?void 0:activePage.id)===nodeId){return navigationContext.children||[];}var result=navigationContext.parent;while(result!=null&&result.id!==nodeId){result=result.parent;}return result?result.children:[];}};var NodeWrapper=_styled.div.withConfig({displayName:"PageTocNode__NodeWrapper",componentId:"sc-1ftr1ym-0"})(templateObject_3$o||(templateObject_3$o=__makeTemplateObject(["\n display: inline-flex;\n min-width: 240px; /* this value is very important for the ToC in Panel: icon + title + external page icon */\n margin-right: 4px;\n\n ","\n ",";\n\n ","\n\n padding: ","px;\n\n @media (min-width: ","px) {\n padding: 0;\n }\n"],["\n display: inline-flex;\n min-width: 240px; /* this value is very important for the ToC in Panel: icon + title + external page icon */\n margin-right: 4px;\n\n ","\n ",";\n\n ","\n\n padding: ","px;\n\n @media (min-width: ","px) {\n padding: 0;\n }\n"])),function(p){return p.hide&&'display: none;';},function(p){return !p.isFirstLevel&&css$2(templateObject_1$T||(templateObject_1$T=__makeTemplateObject(["\n padding-left: ","px;\n margin-top: ","px;\n "],["\n padding-left: ","px;\n margin-top: ","px;\n "])),spacingS,spacingS+5);},function(p){return p.isActive&&css$2(templateObject_2$x||(templateObject_2$x=__makeTemplateObject(["\n position: relative;\n font-weight: bold;\n\n &::before {\n content: '';\n position: absolute;\n left: -9999px;\n right: -9999px;\n top: -3px;\n bottom: -3px;\n display: block;\n background-color: ",";\n }\n "],["\n position: relative;\n font-weight: bold;\n\n &::before {\n content: '';\n position: absolute;\n left: -9999px;\n right: -9999px;\n top: -3px;\n bottom: -3px;\n display: block;\n background-color: ",";\n }\n "])),function(p){return p.theme.palette.neutralQuaternaryAlt;});},spacingXs,minScreenSize.small);var IconNormalSize=20;var IconLargeSize=26;var IconBubbleStyle=function IconBubbleStyle(isHighlighted){return css$2(templateObject_6$7$1||(templateObject_6$7$1=__makeTemplateObject(["\n ",";\n "],["\n ",";\n "])),isHighlighted?css$2(templateObject_4$e||(templateObject_4$e=__makeTemplateObject(["\n background: ",";\n color: ",";\n "],["\n background: ",";\n color: ",";\n "])),function(p){return p.theme.palette.accent;},function(p){return p.theme.palette.white;}):css$2(templateObject_5$d||(templateObject_5$d=__makeTemplateObject(["\n background: ",";\n color: ",";\n "],["\n background: ",";\n color: ",";\n "])),function(p){return p.theme.palette.neutralQuaternary;},function(p){return p.theme.palette.black;}));};var StyledIconButton$3=_styled(IconButton$1).withConfig({displayName:"PageTocNode__StyledIconButton",componentId:"sc-1ftr1ym-1"})(templateObject_8$4$1||(templateObject_8$4$1=__makeTemplateObject(["\n && {\n margin: 0;\n padding: 0;\n flex-shrink: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n\n &,\n i {\n width: ","px;\n height: ","px;\n }\n\n i {\n margin: 0;\n font-size: 14px;\n line-height: ","px;\n }\n\n &&,\n &&:hover,\n &&:active,\n &&:focus {\n ","\n\n ","\n }\n\n @media (min-width: ","px) {\n &,\n i {\n width: ","px;\n height: ","px;\n }\n\n i {\n font-size: 10px;\n line-height: ","px;\n }\n }\n }\n"],["\n && {\n margin: 0;\n padding: 0;\n flex-shrink: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n\n &,\n i {\n width: ","px;\n height: ","px;\n }\n\n i {\n margin: 0;\n font-size: 14px;\n line-height: ","px;\n }\n\n &&,\n &&:hover,\n &&:active,\n &&:focus {\n ","\n\n ","\n }\n\n @media (min-width: ","px) {\n &,\n i {\n width: ","px;\n height: ","px;\n }\n\n i {\n font-size: 10px;\n line-height: ","px;\n }\n }\n }\n"])),IconLargeSize,IconLargeSize,IconLargeSize,function(p){return p.isExpanded&&css$2(templateObject_7$4$1||(templateObject_7$4$1=__makeTemplateObject(["\n i {\n transform: translate(0, 1px);\n }\n "],["\n i {\n transform: translate(0, 1px);\n }\n "])));},function(p){return IconBubbleStyle(p.isHighlighted);},minScreenSize.small,IconNormalSize,IconNormalSize,IconNormalSize);var StyledIcon$3$1=_styled(Icon).withConfig({displayName:"PageTocNode__StyledIcon",componentId:"sc-1ftr1ym-2"})(templateObject_9$3$1||(templateObject_9$3$1=__makeTemplateObject(["\n width: ","px;\n min-width: ","px;\n height: ","px;\n border-radius: 50%;\n z-index: 1;\n\n @media (min-width: ","px) {\n & {\n width: ","px;\n min-width: ","px;\n height: ","px;\n }\n }\n\n ","\n"],["\n width: ","px;\n min-width: ","px;\n height: ","px;\n border-radius: 50%;\n z-index: 1;\n\n @media (min-width: ","px) {\n & {\n width: ","px;\n min-width: ","px;\n height: ","px;\n }\n }\n\n ","\n"])),IconLargeSize,IconLargeSize,IconLargeSize,minScreenSize.small,IconNormalSize,IconNormalSize,IconNormalSize,function(p){return IconBubbleStyle(p.isHighlighted);});var NodeTitleStyle=css$2(templateObject_11$1$1||(templateObject_11$1$1=__makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n box-sizing: border-box;\n margin-left: ","px;\n z-index: 1;\n && {\n font-size: ","px;\n color: ",";\n\n ","\n }\n\n @media (min-width: ","px) {\n && {\n font-size: ","px;\n }\n }\n"],["\n display: inline-flex;\n align-items: center;\n box-sizing: border-box;\n margin-left: ","px;\n z-index: 1;\n && {\n font-size: ","px;\n color: ",";\n\n ","\n }\n\n @media (min-width: ","px) {\n && {\n font-size: ","px;\n }\n }\n"])),spacingM,fontSizeNormal,function(p){return p.theme.textColors.default;},function(p){return p.bold&&css$2(templateObject_10$2$1||(templateObject_10$2$1=__makeTemplateObject(["\n font-weight: bold;\n "],["\n font-weight: bold;\n "])));},minScreenSize.small,fontSizeSmall);var NodeTitleLink=_styled(NavLink).withConfig({displayName:"PageTocNode__NodeTitleLink",componentId:"sc-1ftr1ym-3"})(templateObject_12$1$1||(templateObject_12$1$1=__makeTemplateObject(["\n ",";\n\n && {\n color: ",";\n }\n"],["\n ",";\n\n && {\n color: ",";\n }\n"])),NodeTitleStyle,function(p){return p.theme.textColors.default;});var NodeTitleButton=_styled(ActionButton).withConfig({displayName:"PageTocNode__NodeTitleButton",componentId:"sc-1ftr1ym-4"})(templateObject_13$1$1||(templateObject_13$1$1=__makeTemplateObject(["\n padding: 0;\n height: auto;\n text-align: left;\n ",";\n\n &[disabled] {\n color: ",";\n }\n"],["\n padding: 0;\n height: auto;\n text-align: left;\n ",";\n\n &[disabled] {\n color: ",";\n }\n"])),NodeTitleStyle,function(p){return p.theme.palette.neutralQuaternary;});var NodeTitle=_styled.div.withConfig({displayName:"PageTocNode__NodeTitle",componentId:"sc-1ftr1ym-5"})(templateObject_14$1$1||(templateObject_14$1$1=__makeTemplateObject(["\n ",";\n"],["\n ",";\n"])),NodeTitleStyle);var ChildrenList=_styled.ul.withConfig({displayName:"PageTocNode__ChildrenList",componentId:"sc-1ftr1ym-6"})(templateObject_15$1$1||(templateObject_15$1$1=__makeTemplateObject(["\n list-style: none;\n margin: 0;\n padding: 0;\n\n ",";\n\n > li {\n padding-left: ","px;\n }\n"],["\n list-style: none;\n margin: 0;\n padding: 0;\n\n ",";\n\n > li {\n padding-left: ","px;\n }\n"])),function(p){return p.hide&&'display: none;';},spacingS);var StyledExternalLinkButton=_styled(ExternalPagesLinkButton).withConfig({displayName:"PageTocNode__StyledExternalLinkButton",componentId:"sc-1ftr1ym-7"})(templateObject_16$1$1||(templateObject_16$1$1=__makeTemplateObject(["\n display: flex;\n margin-left: ","px;\n height: ","px;\n\n @media (min-width: ","px) {\n height: ","px;\n }\n\n > button {\n height: auto;\n\n i {\n font-size: ","px;\n height: ","px;\n }\n }\n"],["\n display: flex;\n margin-left: ","px;\n height: ","px;\n\n @media (min-width: ","px) {\n height: ","px;\n }\n\n > button {\n height: auto;\n\n i {\n font-size: ","px;\n height: ","px;\n }\n }\n"])),spacingS,IconLargeSize,minScreenSize.small,IconNormalSize,IconNormalSize,IconNormalSize);var StyledDocumentDownloadButton$1=_styled(DocumentDownloadButton).withConfig({displayName:"PageTocNode__StyledDocumentDownloadButton",componentId:"sc-1ftr1ym-8"})(templateObject_17$1||(templateObject_17$1=__makeTemplateObject(["\n display: flex;\n height: ","px;\n margin-left: ","px;\n\n @media (min-width: ","px) {\n height: ","px;\n }\n\n > button {\n height: auto;\n\n i {\n line-height: ","px;\n height: ","px;\n }\n }\n"],["\n display: flex;\n height: ","px;\n margin-left: ","px;\n\n @media (min-width: ","px) {\n height: ","px;\n }\n\n > button {\n height: auto;\n\n i {\n line-height: ","px;\n height: ","px;\n }\n }\n"])),IconLargeSize,spacingS-5,minScreenSize.small,IconNormalSize,IconNormalSize,IconNormalSize);var templateObject_1$T,templateObject_2$x,templateObject_3$o,templateObject_4$e,templateObject_5$d,templateObject_6$7$1,templateObject_7$4$1,templateObject_8$4$1,templateObject_9$3$1,templateObject_10$2$1,templateObject_11$1$1,templateObject_12$1$1,templateObject_13$1$1,templateObject_14$1$1,templateObject_15$1$1,templateObject_16$1$1,templateObject_17$1;var PageTableOfContents$1=function PageTableOfContents(_a){var basePath=_a.basePath,navigationContext=_a.navigationContext,activePageId=_a.activePageId,loadChildren=_a.loadChildren,onSearch=_a.onSearch,onPageSelected=_a.onPageSelected,className=_a.className,selectedPageId=_a.selectedPageId,isLoading=_a.isLoading,disableScrollableList=_a.disableScrollableList;var user=useCurrentUser();var _b=getRootNodes(),rootNodes=_b.rootNodes,path=_b.path;var _c=useState$2(),searchResult=_c[0],setSearchResult=_c[1];if(isLoading){return jsx$1(Spinner,{},void 0);}if(!rootNodes||(rootNodes===null||rootNodes===void 0?void 0:rootNodes.length)===0){return jsx$1(FormattedMessageWithStyle,{id:"ContentEditor.parentPage.emptyToc",tagName:"div",className:className},void 0);}var activePage=activePageId&&navigationContext.siblings.find(function(p){return p.id===activePageId;});var nodesToDisplay=sortPageNodesByGroupAndPosition(user.groups,(searchResult||rootNodes).filter(function(p){return filterChildren(p,activePage);}));return jsx$1(Fragment,{children:jsxs("div",__assign({className:className},{children:[jsx$1("div",__assign({"data-toc-search-container":true},{children:jsx$1(PageTocSearch,{onSearch:onSearch,onSearchResultChange:setSearchResult},void 0)}),void 0),searchResult&&!searchResult.length&&jsx$1(TocEmptyList,{icon:"Search",emptyMessageResources:['EmptySearchResult.info']},void 0),nodesToDisplay&&jsx$1(TocListContainer,__assign({"data-toc-scrollable-container":true,isScrollable:!disableScrollableList},{children:jsx$1(TocList,{children:nodesToDisplay.map(function(c){return jsx$1(ToCItem,{children:jsx$1(PageNode,{basePath:basePath,node:c,activePage:activePage,navigationContext:searchResult?null:navigationContext,loadChildren:loadChildren,path:path,isRootNode:true,onPageSelected:onPageSelected,selectedPageId:selectedPageId},void 0)},c.id+!!searchResult);})},void 0)}),void 0)]}),void 0)},void 0);function getRootNodes(){if(!(navigationContext===null||navigationContext===void 0?void 0:navigationContext.parent)){return {rootNodes:(navigationContext===null||navigationContext===void 0?void 0:navigationContext.siblings)||[],path:[]};}var path=[];var currentParent=navigationContext.parent;while(currentParent!=null&&currentParent.parent!=null){path.push(currentParent.id);currentParent=currentParent.parent;}return {rootNodes:(currentParent===null||currentParent===void 0?void 0:currentParent.children)||[],path:path};}};var TocEmptyList=_styled(EmptyList).withConfig({displayName:"PageTableOfContents__TocEmptyList",componentId:"sc-3llzkd-0"})(templateObject_1$S||(templateObject_1$S=__makeTemplateObject(["\n i {\n padding-top: 0;\n font-size: ","px;\n }\n"],["\n i {\n padding-top: 0;\n font-size: ","px;\n }\n"])),fontSizeLarger+10);var TocListContainer=_styled.div.withConfig({displayName:"PageTableOfContents__TocListContainer",componentId:"sc-3llzkd-1"})(templateObject_3$n||(templateObject_3$n=__makeTemplateObject(["\n margin-top: ","px;\n\n ","\n"],["\n margin-top: ","px;\n\n ","\n"])),spacingXs,function(p){return p.isScrollable&&css$2(templateObject_2$w||(templateObject_2$w=__makeTemplateObject(["\n overflow-y: auto;\n overflow-x: hidden;\n height: calc(100% - 52px); /* full height - search box height */\n "],["\n overflow-y: auto;\n overflow-x: hidden;\n height: calc(100% - 52px); /* full height - search box height */\n "])));});var TocList=_styled.ul.withConfig({displayName:"PageTableOfContents__TocList",componentId:"sc-3llzkd-2"})(templateObject_4$d$1||(templateObject_4$d$1=__makeTemplateObject(["\n list-style: none;\n padding: 0;\n margin: 0;\n"],["\n list-style: none;\n padding: 0;\n margin: 0;\n"])));var ToCItem=_styled.li.withConfig({displayName:"PageTableOfContents__ToCItem",componentId:"sc-3llzkd-3"})(templateObject_5$c||(templateObject_5$c=__makeTemplateObject(["\n margin-bottom: ","px;\n"],["\n margin-bottom: ","px;\n"])),spacingM);_styled(PageTableOfContents$1).withConfig({displayName:"PageTableOfContents__StyledPageToC",componentId:"sc-3llzkd-4"})(templateObject_6$6$1||(templateObject_6$6$1=__makeTemplateObject(["\n height: 100%;\n\n [data-toc-scrollable-container] {\n overflow-x: auto;\n padding-left: ","px;\n /* ensure node titles are aligned with SearchBox input & Close button */\n /* if the title is too long, horizontal scrollbar is shown */\n margin-right: ","px;\n }\n\n [data-nothing-found],\n [data-toc-search-container] {\n padding: 0 ","px;\n box-sizing: border-box;\n }\n\n [data-page-toc-node] {\n &[data-is-active='true'] {\n &::before {\n left: -10px;\n right: -10px;\n }\n }\n }\n"],["\n height: 100%;\n\n [data-toc-scrollable-container] {\n overflow-x: auto;\n padding-left: ","px;\n /* ensure node titles are aligned with SearchBox input & Close button */\n /* if the title is too long, horizontal scrollbar is shown */\n margin-right: ","px;\n }\n\n [data-nothing-found],\n [data-toc-search-container] {\n padding: 0 ","px;\n box-sizing: border-box;\n }\n\n [data-page-toc-node] {\n &[data-is-active='true'] {\n &::before {\n left: -10px;\n right: -10px;\n }\n }\n }\n"])),spacingM,spacingM,spacingM);var templateObject_1$S,templateObject_2$w,templateObject_3$n,templateObject_4$d$1,templateObject_5$c,templateObject_6$6$1;var PageTableOfContentsDialog=function PageTableOfContentsDialog(_a){var isOpen=_a.isOpen,navigationContext=_a.navigationContext,activePageId=_a.activePageId,loadChildren=_a.loadChildren,onSearch=_a.onSearch,onDismiss=_a.onDismiss,basePath=_a.basePath;var formatMessage=useIntl().formatMessage;if(!navigationContext){return null;}return jsx$1(MobileFullHeightDialog,__assign({hidden:!isOpen,modalProps:{className:'dialog-toc'},dialogContentProps:{type:DialogType.close},onDismiss:onDismiss,title:formatMessage({id:'Pages.pagesTableOfContents'})},{children:jsxs(DialogContent,__assign({className:"dialog-content-host","data-toc-dialog":true},{children:[jsx$1(DialogGlobalStyle,{},void 0),jsx$1(PageTableOfContents$1,{basePath:basePath,activePageId:activePageId,navigationContext:navigationContext,loadChildren:loadChildren,onSearch:onSearch,onPageSelected:onDismiss,disableScrollableList:true},void 0)]}),void 0)}),void 0);};var DialogContent=_styled.div.withConfig({displayName:"PageTableOfContentsDialog__DialogContent",componentId:"sc-z2sdu7-0"})(templateObject_1$R||(templateObject_1$R=__makeTemplateObject(["\n margin-top: 5px;\n\n @media (min-width: ","px) {\n width: 450px;\n }\n"],["\n margin-top: 5px;\n\n @media (min-width: ","px) {\n width: 450px;\n }\n"])),minScreenSize.small);var DialogGlobalStyle=createGlobalStyle(templateObject_2$v||(templateObject_2$v=__makeTemplateObject(["\n .dialog-toc {\n a {\n text-decoration: none;\n }\n\n .ms-Dialog-main {\n @media (max-width: ","px) {\n width: 100% !important;\n }\n }\n\n .ms-Dialog-inner {\n overflow-x: hidden;\n }\n }\n"],["\n .dialog-toc {\n a {\n text-decoration: none;\n }\n\n .ms-Dialog-main {\n @media (max-width: ","px) {\n width: 100% !important;\n }\n }\n\n .ms-Dialog-inner {\n overflow-x: hidden;\n }\n }\n"])),maxScreenSize.small);var templateObject_1$R,templateObject_2$v;function useLoadPublishedItemsByKeywords(keywords,showPagesAndDocuments,pageType){var _this=this;var searchPublishedPages=usePagesApi().searchPublishedPages;return function(pageSize,token){return __awaiter(_this,void 0,void 0,function(){var result;return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,searchPublishedPages({keywords:{items:keywords},token:token,pageSize:pageSize,pageType:showPagesAndDocuments?undefined:pageType})];case 1:result=_a.sent();return [2/*return*/,{items:result===null||result===void 0?void 0:result.items,paginationToken:result===null||result===void 0?void 0:result.paginationToken,hasNextPage:(result===null||result===void 0?void 0:result.nextItem)!==null}];}});});};}var InlinePageListByKeywords=function InlinePageListByKeywords(_a){var keywords=_a.keywords,showDocuments=_a.showDocuments,showPages=_a.showPages;var buildPath=useSubscriptionHandlePathBuilder().buildPath;var showPagesAndDocuments=showPages&&showDocuments;var pageType=showPages?PageType.Page:PageType.Document;var defaultPageSize=10;var keywordsAsString=keywords===null||keywords===void 0?void 0:keywords.join('-');var _b=useItemLoaderWithPreFetch(defaultPageSize,useLoadPublishedItemsByKeywords(keywords,showPagesAndDocuments,pageType),[keywordsAsString]),items=_b.items,pagingProps=__rest(_b,["items"]);return jsx$1(InlinePageListSkeleton,__assign({isDataLoaded:!pagingProps.isInitialLoading},{children:jsx$1(InlinePageListWithPaging,{pages:items,pagingProps:__assign(__assign({},pagingProps),{hideNextButton:pagingProps.isLastPage}),baseRoute:buildPath('pages'),filterBaseUrl:buildPath('/pages/search')},void 0)}),void 0);};function useLoadPublishedItemsByPageId(pageId,showPagesAndDocuments,pageType){var _this=this;var getSubpages=usePagesApi().getSubpages;try{return function(pageSize,token){return __awaiter(_this,void 0,void 0,function(){var result;return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,getSubpages(pageId,{pageType:showPagesAndDocuments?undefined:pageType,token:token,pageSize:pageSize})];case 1:result=_a.sent();return [2/*return*/,{items:result.items,paginationToken:result.paginationToken,hasNextPage:result.nextItem!==null}];}});});};}catch(error){logger.error(error);return null;}}var defaultPageSize$1=10;var InlinePageListByPageId=function InlinePageListByPageId(_a){var pageId=_a.pageId,showPages=_a.showPages,showDocuments=_a.showDocuments;var buildPath=useSubscriptionHandlePathBuilder().buildPath;var showSubpagesAndDocuments=showPages&&showDocuments;var pageType=showPages?PageType.Page:PageType.Document;var _b=useItemLoaderWithPreFetch(defaultPageSize$1,useLoadPublishedItemsByPageId(pageId,showSubpagesAndDocuments,pageType),[pageId]),items=_b.items,pagingProps=__rest(_b,["items"]);return jsx$1(InlinePageListSkeleton,__assign({isDataLoaded:!pagingProps.isInitialLoading},{children:jsx$1(InlinePageListWithPaging,{pages:items,pagingProps:__assign(__assign({},pagingProps),{hideNextButton:pagingProps.isLastPage}),baseRoute:buildPath('pages'),filterBaseUrl:buildPath('/pages/search')},void 0)}),void 0);};var defaultPageSize=10;// the inline page list should be auto-added on a page with no content
122339
122336
  // by default pages and documents should be shown
122340
122337
  // for this case the blockProps would be an empty object and
122341
122338
  // we need to set the showPages and showDocuments to true
122342
122339
  var InlinePageListByCurrentPage=function InlinePageListByCurrentPage(_a){var _b=_a.blockProps,props=_b===void 0?{showDocuments:true,showPages:true}:_b;var item=useDetailViewContext().item;var getSubpages=usePagesApi().getSubpages;var buildPath=useSubscriptionHandlePathBuilder().buildPath;var _c=useItemLoaderByCurrentPage(item.id,defaultPageSize,item.navigationContext,{showPages:props.showPages,showDocuments:props.showDocuments},getAllSubItems,[item===null||item===void 0?void 0:item.id]),items=_c.pageItems,pagingProps=_c.pagingProps;if(items.length===0){return null;}return jsx$1(InlinePageListWithPaging,{pages:items,pagingProps:pagingProps,baseRoute:buildPath('pages'),filterBaseUrl:buildPath('/pages/search')},void 0);function getAllSubItems(id,pageType){return __awaiter(this,void 0,void 0,function(){var result;return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,getSubpages(id,{pageType:pageType})];case 1:result=_a.sent();return [2/*return*/,result.items];}});});}};var InlinePageList=function InlinePageList(_a){var blockProps=_a.blockProps;if(blockProps===null||blockProps===void 0?void 0:blockProps.keywords){return jsx$1(InlinePageListByKeywords,{keywords:blockProps.keywords.split(','),showPages:blockProps.showPages,showDocuments:blockProps.showDocuments},void 0);}if(blockProps===null||blockProps===void 0?void 0:blockProps.pageId){return jsx$1(InlinePageListByPageId,{pageId:blockProps.pageId,showPages:blockProps.showPages,showDocuments:blockProps.showDocuments},void 0);}return jsx$1(InlinePageListByCurrentPage,{blockProps:blockProps},void 0);};var InlinePageListMapper={component:InlinePageList,type:EntityType.InlinePageList,getPropsFromHtml:function(nodeName,node){if(nodeName!=='div'){return null;}var pageListId=node.getAttribute('data-page-list-id');if(pageListId==null){return null;}var showChildren=node.getAttribute('data-show-children')==='true';var showDocumentsAttribute=node.getAttribute('data-show-documents');var showPagesAttribute=node.getAttribute('data-show-pages');var pageId=node.getAttribute('data-page-id');var keywords=node.getAttribute('data-keywords');if(!showDocumentsAttribute&&!showPagesAttribute){// ensure backwards compatibility
122343
- return {id:pageListId,showChildren:showChildren,showPages:true,showDocuments:false,pageId:pageId,keywords:keywords};}var showDocuments=showDocumentsAttribute==='true';var showPages=showPagesAttribute==='true';return {id:pageListId,showChildren:showChildren,showDocuments:showDocuments,showPages:showPages,pageId:pageId,keywords:keywords};}};var PageBreadcrumb=function PageBreadcrumb(_a){var page=_a.page,target=_a.target,languageOverride=_a.language,hideCurrentPageNode=_a.hideCurrentPageNode,className=_a.className;var user=useCurrentUser();var formatMessage=useIntl().formatMessage;var history=useHistory();if(!page||!page.navigationContext){return null;}var _b=getBreadcrumbsItems(page,target,handleOnClick,function(page){return getTitle(page,user,formatMessage,languageOverride);},formatMessage,hideCurrentPageNode),parentNode=_b.parentNode,breadcrumbItems=_b.breadcrumbItems;return jsxs("div",__assign({className:className},{children:[jsx$1(LargeScreenBreadcrumb,{items:breadcrumbItems,onRenderItem:renderBreadcrumbItem,overflowIndex:breadcrumbItems.length>1?1:undefined,"data-breadcrumb":true,overflowAriaLabel:formatMessage({id:'AriaLabel.otherPages'}),focusZoneProps:{handleTabKey:1}},void 0),jsx$1(MobileBreadcrumb,{target:target,parentNode:parentNode},void 0)]}),void 0);function renderBreadcrumbItem(item){if(item.key==='home'){return jsx$1(BreadcrumbHomeItem,__assign({to:item.href,"aria-label":item.text,"data-pages-home-icon":true},{children:jsx$1(HomeIcon,{iconName:"HomeSolid"},void 0)}),void 0);}if(item.isCurrentItem){return jsx$1(BreadcrumbCurrentItem,__assign({"aria-current":"page"},{children:item.text}),void 0);}return jsx$1(BreadcrumbItem,__assign({to:item.href,"data-page-breadcrumb-node":item.key},{children:item.text}),void 0);}function handleOnClick(e,item){e.stopPropagation();e.preventDefault();history.push({pathname:item.href});}};var MobileBreadcrumb=function MobileBreadcrumb(_a){var target=_a.target,parentNode=_a.parentNode;var formatMessage=useIntl().formatMessage;return jsxs(MobileBreadcrumbHost,__assign({"data-mobile-breadcrumb":true},{children:[jsx$1("li",{children:jsx$1(BreadcrumbHomeItem,__assign({to:target,"aria-label":formatMessage({id:'Generic.home'}),"data-pages-home-icon":true},{children:jsx$1(HomeIcon,{iconName:"HomeSolid"},void 0)}),void 0)},void 0),parentNode&&jsxs(ParentNode,{children:[jsx$1(LeftChevronIcon,{iconName:"ChevronLeft"},void 0),jsx$1(BreadcrumbItem,__assign({to:NewsService.getNewsRoute(target,parentNode.id,parentNode.title),"data-page-breadcrumb-parent-node":parentNode.id},{children:parentNode.title}),void 0)]},void 0)]}),void 0);};var MobileBreadcrumbHost=_styled.ul.withConfig({displayName:"PageBreadcrumb__MobileBreadcrumbHost",componentId:"sc-1m4qq1d-0"})(templateObject_1$S||(templateObject_1$S=__makeTemplateObject(["\n display: none;\n align-items: center;\n padding: 0;\n margin: 0;\n list-style: none;\n font-size: ","px;\n\n @media (max-width: ","px) {\n display: flex;\n }\n"],["\n display: none;\n align-items: center;\n padding: 0;\n margin: 0;\n list-style: none;\n font-size: ","px;\n\n @media (max-width: ","px) {\n display: flex;\n }\n"])),fontSizeSmall,maxScreenSize.medium);var ParentNode=_styled.li.withConfig({displayName:"PageBreadcrumb__ParentNode",componentId:"sc-1m4qq1d-1"})(templateObject_2$w||(templateObject_2$w=__makeTemplateObject(["\n margin: 0 ","px;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n color: ",";\n"],["\n margin: 0 ","px;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n color: ",";\n"])),spacingM,function(p){return p.theme.palette.accent;});var LeftChevronIcon=_styled(Icon).withConfig({displayName:"PageBreadcrumb__LeftChevronIcon",componentId:"sc-1m4qq1d-2"})(templateObject_3$o||(templateObject_3$o=__makeTemplateObject(["\n font-size: 10px;\n font-weight: bold;\n color: ",";\n"],["\n font-size: 10px;\n font-weight: bold;\n color: ",";\n"])),function(p){return p.theme.palette.accent;});var LargeScreenBreadcrumb=_styled(Breadcrumb).withConfig({displayName:"PageBreadcrumb__LargeScreenBreadcrumb",componentId:"sc-1m4qq1d-3"})(templateObject_4$e||(templateObject_4$e=__makeTemplateObject(["\n && {\n margin: 0;\n }\n\n .ms-Breadcrumb-chevron {\n font-weight: bold;\n }\n\n @media (max-width: ","px) {\n display: none;\n }\n"],["\n && {\n margin: 0;\n }\n\n .ms-Breadcrumb-chevron {\n font-weight: bold;\n }\n\n @media (max-width: ","px) {\n display: none;\n }\n"])),maxScreenSize.medium);var HomeIcon=_styled(Icon).withConfig({displayName:"PageBreadcrumb__HomeIcon",componentId:"sc-1m4qq1d-4"})(templateObject_5$d||(templateObject_5$d=__makeTemplateObject(["\n padding-top: 1px;\n"],["\n padding-top: 1px;\n"])));var BreadcrumbItem=_styled(NavLink).withConfig({displayName:"PageBreadcrumb__BreadcrumbItem",componentId:"sc-1m4qq1d-5"})(templateObject_6$6$1||(templateObject_6$6$1=__makeTemplateObject(["\n padding: 0 ","px;\n color: ",";\n"],["\n padding: 0 ","px;\n color: ",";\n"])),spacingS,function(p){return p.theme.palette.accent;});var BreadcrumbHomeItem=_styled(NavLink).withConfig({displayName:"PageBreadcrumb__BreadcrumbHomeItem",componentId:"sc-1m4qq1d-6"})(templateObject_7$4$1||(templateObject_7$4$1=__makeTemplateObject(["\n color: ",";\n\n + i {\n padding-left: ","px;\n }\n"],["\n color: ",";\n\n + i {\n padding-left: ","px;\n }\n"])),function(p){return p.theme.palette.accent;},spacingS);var BreadcrumbCurrentItem=_styled.div.withConfig({displayName:"PageBreadcrumb__BreadcrumbCurrentItem",componentId:"sc-1m4qq1d-7"})(templateObject_8$4$1||(templateObject_8$4$1=__makeTemplateObject(["\n padding-left: ","px;\n color: ",";\n"],["\n padding-left: ","px;\n color: ",";\n"])),spacingS,function(p){return p.theme.palette.neutralSecondaryAlt;});var templateObject_1$S,templateObject_2$w,templateObject_3$o,templateObject_4$e,templateObject_5$d,templateObject_6$6$1,templateObject_7$4$1,templateObject_8$4$1;var DetailViewPageDocumentDownload=function DetailViewPageDocumentDownload(){var user=useCurrentUser();var _a=useDetailViewContext(),item=_a.item,preferredContent=_a.content;if(!item){return null;}var content=(preferredContent===null||preferredContent===void 0?void 0:preferredContent.fileInfo)?preferredContent:getContentForPage(item,user).content;if(!(content===null||content===void 0?void 0:content.fileInfo)){return null;}return jsx$1(PageDocumentDownloadButton,{item:item,content:content},void 0);};var PageDocumentDownloadButton=function PageDocumentDownloadButton(_a){var item=_a.item,content=_a.content,basePath=_a.basePath;var _b=useInlinePageDocument({pageId:item.id,fileId:content.fileInfo.fileId,extension:content.fileInfo.extension,title:content.title,fileName:content.fileInfo.fileName},item,basePath),fileUrl=_b.fileUrl,iconName=_b.iconName,title=_b.title,fileName=_b.fileName,onPageDocumentDownloadClick=_b.onPageDocumentDownloadClick;return jsxs(Host$l,{children:[jsx$1(FormattedMessage$1,{id:"Pages.documents.buttonDownloadInfo"},void 0),jsx$1(DownloadButton,{fileUrl:fileUrl,fileName:fileName,title:title,fileIconName:iconName,onClick:onPageDocumentDownloadClick},void 0)]},void 0);};var Host$l=_styled.div.withConfig({displayName:"DetailViewPageDocumentDownload__Host",componentId:"sc-1gtkslm-0"})(templateObject_1$R||(templateObject_1$R=__makeTemplateObject(["\n margin-top: ","px;\n"],["\n margin-top: ","px;\n"])),spacingM);var DownloadButton=_styled(InlinePageDocumentDownloadButton).withConfig({displayName:"DetailViewPageDocumentDownload__DownloadButton",componentId:"sc-1gtkslm-1"})(templateObject_2$v||(templateObject_2$v=__makeTemplateObject(["\n margin-top: ","px;\n @media (min-width: ","px) {\n width: 50%;\n }\n"],["\n margin-top: ","px;\n @media (min-width: ","px) {\n width: 50%;\n }\n"])),spacingS,minScreenSize.medium);var templateObject_1$R,templateObject_2$v;_styled(PublishableItemBanner).withConfig({displayName:"CardBanner__StyledBanner",componentId:"sc-mqzdnh-0"})(templateObject_1$Q||(templateObject_1$Q=__makeTemplateObject(["\n &.video-view-container {\n height: 100%; /* this is needed for not overlapping the card title */\n }\n"],["\n &.video-view-container {\n height: 100%; /* this is needed for not overlapping the card title */\n }\n"])));var templateObject_1$Q;_styled.div.withConfig({displayName:"Card__Host",componentId:"sc-1m8ygh-0"})(templateObject_1$P||(templateObject_1$P=__makeTemplateObject(["\n &.card {\n display: flex;\n background-color: white;\n box-shadow: 1px 1px 4px grey;\n box-sizing: border-box;\n\n width: 100%;\n\n margin-bottom: 10px;\n\n &[data-packed] {\n opacity: 1;\n }\n\n &.card-enter,\n &.card-appear {\n opacity: 0.01;\n }\n\n &.card-enter.card-enter-active,\n &.card-appear.card-appear-active {\n opacity: 1;\n transition: opacity 0.75s ease-in;\n }\n\n @media all and (min-width: ","px) {\n transition: opacity 0.75s ease-in;\n opacity: 0;\n width: ","px;\n }\n\n @media all and (min-width: ","px) {\n width: ","px;\n }\n\n @media all and (min-width: ","px) {\n width: ","px;\n }\n\n @media all and (min-width: ","px) {\n width: ","px;\n }\n }\n"],["\n &.card {\n display: flex;\n background-color: white;\n box-shadow: 1px 1px 4px grey;\n box-sizing: border-box;\n\n width: 100%;\n\n margin-bottom: 10px;\n\n &[data-packed] {\n opacity: 1;\n }\n\n &.card-enter,\n &.card-appear {\n opacity: 0.01;\n }\n\n &.card-enter.card-enter-active,\n &.card-appear.card-appear-active {\n opacity: 1;\n transition: opacity 0.75s ease-in;\n }\n\n @media all and (min-width: ","px) {\n transition: opacity 0.75s ease-in;\n opacity: 0;\n width: ","px;\n }\n\n @media all and (min-width: ","px) {\n width: ","px;\n }\n\n @media all and (min-width: ","px) {\n width: ","px;\n }\n\n @media all and (min-width: ","px) {\n width: ","px;\n }\n }\n"])),minScreenSize.small,cardWidthS,minScreenSize.medium,cardWidthM,minScreenSize.large,cardWidthL,minScreenSize.xLarge,cardWidthXL);_styled.article.withConfig({displayName:"Card__Article",componentId:"sc-1m8ygh-1"})(templateObject_3$n||(templateObject_3$n=__makeTemplateObject(["\n position: relative;\n display: flex;\n flex-direction: column;\n width: 100%;\n\n ","\n\n > .card-banner {\n height: calc(((100vw - ","px) * (1 / ",")));\n flex: 0 1 auto;\n }\n\n .card-title {\n margin-top: 7px;\n margin-bottom: 0;\n font-size: 1.1em;\n }\n\n .card-metaInfo {\n font-size: 0.9em;\n }\n\n .card-metaInfo {\n padding-top: ","px;\n color: #666;\n }\n\n @media all and (min-width: ","px) {\n > .card-banner {\n height: calc(","px * (1 / ","));\n }\n\n .card-title {\n margin-top: 7px;\n font-size: 1.3em;\n }\n\n .card-metaInfo {\n font-size: 0.9em;\n }\n }\n\n @media all and (min-width: ","px) {\n > .card-banner {\n height: calc(","px * (1 / ","));\n }\n\n @media all and (min-width: ","px) {\n > .card-banner {\n height: calc(","px * (1 / ","));\n }\n }\n\n @media all and (min-width: ","px) {\n > .card-banner {\n height: calc(","px * (1 / ","));\n }\n }\n }\n"],["\n position: relative;\n display: flex;\n flex-direction: column;\n width: 100%;\n\n ","\n\n > .card-banner {\n height: calc(((100vw - ","px) * (1 / ",")));\n flex: 0 1 auto;\n }\n\n .card-title {\n margin-top: 7px;\n margin-bottom: 0;\n font-size: 1.1em;\n }\n\n .card-metaInfo {\n font-size: 0.9em;\n }\n\n .card-metaInfo {\n padding-top: ","px;\n color: #666;\n }\n\n @media all and (min-width: ","px) {\n > .card-banner {\n height: calc(","px * (1 / ","));\n }\n\n .card-title {\n margin-top: 7px;\n font-size: 1.3em;\n }\n\n .card-metaInfo {\n font-size: 0.9em;\n }\n }\n\n @media all and (min-width: ","px) {\n > .card-banner {\n height: calc(","px * (1 / ","));\n }\n\n @media all and (min-width: ","px) {\n > .card-banner {\n height: calc(","px * (1 / ","));\n }\n }\n\n @media all and (min-width: ","px) {\n > .card-banner {\n height: calc(","px * (1 / ","));\n }\n }\n }\n"])),function(p){return p.highlight&&css$2(templateObject_2$u||(templateObject_2$u=__makeTemplateObject(["\n &::after {\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n width: ","px;\n display: block;\n background-color: ",";\n }\n "],["\n &::after {\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n width: ","px;\n display: block;\n background-color: ",";\n }\n "])),spacingXs,function(p){return p.theme.palette.accent;});},spacingM,bannerAspectRatio,spacingM,minScreenSize.small,cardWidthS,bannerAspectRatio,minScreenSize.medium,cardWidthM,bannerAspectRatio,minScreenSize.large,cardWidthL,bannerAspectRatio,minScreenSize.xLarge,cardWidthXL,bannerAspectRatio);var templateObject_1$P,templateObject_2$u,templateObject_3$n;var LanguageSelector=function LanguageSelector(props){var history=useHistory();var currentUser=useCurrentUser();var buildPath=useSubscriptionHandlePathBuilder().buildPath;var getAllLanguagesLocalized=useLanguageApi().getAllLanguagesLocalized;var intl=useIntl();var formatMessage=intl.formatMessage;var languageDefinitions=usePromise$2(function(){return getAllLanguagesLocalized(intl);})[0];var features=useFeatures();if(languageDefinitions==null){return null;}if(props.chromeless)return jsx$1(ActionButton,__assign({iconProps:{iconName:'World'},menuProps:{items:getContextualMenuItems(),className:'lt-reach-callout'},className:classNames(props.className,'header-button')},{children:formatMessage({id:"Generic.languages."+props.selectedLanguage})}),void 0);return jsx$1(Tooltip,__assign({resourceKey:"Generic.translate"},{children:jsx$1(LanguageSelectorButton,{menuIconProps:{iconName:'World'},menuProps:{items:getContextualMenuItems(),className:'lt-reach-callout',isBeakVisible:props.showBeak},className:classNames(props.className,'header-button'),"data-language-selector-button":true,ariaLabel:formatMessage({id:'AriaLabel.autoTranslation'})},void 0)}),void 0);function getContextualMenuItems(){if(props.languages==null){return [];}var menuItems=[];var preferredLanguageItem=getPreferredLanguageItem();if(preferredLanguageItem){menuItems.push(preferredLanguageItem);}var activeLanguagesItems=getActiveLanguagesItems();activeLanguagesItems.sort(function(a,b){return a.text.localeCompare(b.text);});menuItems=menuItems.concat(activeLanguagesItems);if(!props.hideEditLanguagePreferences){var editLanguagePreferencesItem={key:'edit',text:formatMessage({id:'Generic.editLanguagePreferences'}),iconProps:{iconName:'PlayerSettings'},onClick:handleEditLanguagePreferences,className:'lt-reach-languageselector-menu-item'};menuItems.push(editLanguagePreferencesItem);}return menuItems;}function handleEditLanguagePreferences(){if(props.onEditLanguagePreferencesClick){props.onEditLanguagePreferencesClick();}else {history.push(buildPath('/user'));}}function getActiveLanguagesItems(){return props.languages.map(function(l){var fullLanguage=languageDefinitions.find(function(ld){return ld.code===l;});return {key:l,text:fullLanguage.localizedName,iconProps:{iconName:'World'},onClick:function(){return props.onLanguageChange(l.toString());},className:classNames('lt-reach-languageselector-menu-item',l===props.selectedLanguage&&'selected')};});}function getPreferredLanguageItem(){if(!features.automaticTranslation){return null;}if(!props.onTranslateClick){return null;}var preferredContentLanguage=getPreferredContentLanguage(currentUser);var shouldAddPreferredContentLanguage=preferredContentLanguage!=null&&!contentLanguagesWithoutAutomaticTranslation.includes(preferredContentLanguage)&&allAvailableContentLanguages.includes(preferredContentLanguage)&&props.languages.indexOf(preferredContentLanguage)<0;if(!shouldAddPreferredContentLanguage){return null;}return {key:preferredContentLanguage,text:formatMessage({id:'Generic.automaticTranslation'},{language:formatMessage({id:"Generic.languages."+preferredContentLanguage})}),iconProps:{iconName:'Robot'},onClick:function(){return props.onTranslateClick(preferredContentLanguage);},className:classNames('lt-reach-languageselector-menu-item',preferredContentLanguage===props.selectedLanguage&&'selected')};}};var LanguageSelectorButton=_styled(IconButton).withConfig({displayName:"LanguageSelector__LanguageSelectorButton",componentId:"sc-48zwek-0"})(templateObject_1$O||(templateObject_1$O=__makeTemplateObject(["\n && {\n height: 100%;\n margin: 0;\n background-color: transparent;\n }\n"],["\n && {\n height: 100%;\n margin: 0;\n background-color: transparent;\n }\n"])));var templateObject_1$O;_styled.article.withConfig({displayName:"DetailViewArticle__Host",componentId:"sc-we2q7z-0"})(templateObject_1$N||(templateObject_1$N=__makeTemplateObject(["\n min-width: 300px;\n width: 100%;\n\n flex: 1 0 auto;\n display: flex;\n flex-flow: column nowrap;\n\n @media (min-width: ","px) {\n box-shadow: 1px 1px 4px grey;\n max-width: ","px;\n }\n"],["\n min-width: 300px;\n width: 100%;\n\n flex: 1 0 auto;\n display: flex;\n flex-flow: column nowrap;\n\n @media (min-width: ","px) {\n box-shadow: 1px 1px 4px grey;\n max-width: ","px;\n }\n"])),minScreenSize.large+1,maxContentWidth);var templateObject_1$N;var DetailViewBanner=function DetailViewBanner(){var _a=useDetailViewContext(),item=_a.item,resourceType=_a.resourceType,isEditorPreview=_a.isEditorPreview;if(!item.bannerInfo){return null;}return jsx$1(Banner$3,{itemId:item.id,token:item.fileAccessToken,bannerInfo:item.bannerInfo,useEditorRoutes:isEditorPreview,width:getMaxImageWidth(),canOpenImage:true,resourceType:resourceType},void 0);};var Banner$3=_styled(PublishableItemBanner).withConfig({displayName:"DetailViewBanner__Banner",componentId:"sc-1wuqvtw-0"})(templateObject_1$M||(templateObject_1$M=__makeTemplateObject(["\n && {\n height: calc(100vw * (1 / ","));\n\n @media (min-width: ","px) {\n height: calc(\n (","px - (2 * ","px)) *\n (1 / ",")\n );\n }\n }\n"],["\n && {\n height: calc(100vw * (1 / ","));\n\n @media (min-width: ","px) {\n height: calc(\n (","px - (2 * ","px)) *\n (1 / ",")\n );\n }\n }\n"])),bannerAspectRatio,minScreenSize.large+1,minScreenSize.large,spacingM,bannerAspectRatio);var templateObject_1$M;var DetailViewIntro=function DetailViewIntro(){var content=useDetailViewContext().content;var hasIntro=content.intro&&content.intro.length>0;if(!hasIntro){return null;}return jsx$1(DetailIntro,{children:content.intro},void 0);};var DetailIntro=_styled.p.withConfig({displayName:"DetailViewIntro__DetailIntro",componentId:"sc-1kubhyf-0"})(templateObject_1$L||(templateObject_1$L=__makeTemplateObject(["\n margin: 0;\n font-size: ","px;\n line-height: 26px;\n font-weight: normal;\n\n min-width: 100%;\n width: 100px;\n\n @media (min-width: ","px) {\n margin-top: ","px;\n margin-bottom: ","px;\n line-height: 24px;\n font-size: ","px;\n }\n"],["\n margin: 0;\n font-size: ","px;\n line-height: 26px;\n font-weight: normal;\n\n min-width: 100%;\n width: 100px;\n\n @media (min-width: ","px) {\n margin-top: ","px;\n margin-bottom: ","px;\n line-height: 24px;\n font-size: ","px;\n }\n"])),fontSizeNormal,minScreenSize.small,spacingS,spacingS+2,fontSizeMedium+2);var templateObject_1$L;var DetailMainSection=function DetailMainSection(_a){var children=_a.children;return jsx$1(DetailMainStyledSection,__assign({className:"detail-view-main"},{children:children}),void 0);};var DetailMainStyledSection=_styled.section.withConfig({displayName:"DetailViewMainSection__DetailMainStyledSection",componentId:"sc-ifywhg-0"})(templateObject_1$K||(templateObject_1$K=__makeTemplateObject(["\n position: relative;\n flex: 1 0 auto;\n display: flex;\n flex-direction: column;\n padding: ","px ","px\n ","px;\n font-size: 16px;\n\n @media (min-width: ","px) {\n padding: ","px\n ","px ","px;\n }\n"],["\n position: relative;\n flex: 1 0 auto;\n display: flex;\n flex-direction: column;\n padding: ","px ","px\n ","px;\n font-size: 16px;\n\n @media (min-width: ","px) {\n padding: ","px\n ","px ","px;\n }\n"])),detailViewSectionPadding-5,detailViewSectionPadding,detailViewSectionPadding,minScreenSize.small,detailViewSectionPaddingLarge-10,detailViewSectionPaddingLarge,detailViewSectionPaddingLarge);var templateObject_1$K;var GutterMarkerIcon=function GutterMarkerIcon(_a){var iconName=_a.iconName,children=_a.children,isActive=_a.isActive,color=_a.color,tooltipResourceKey=_a.tooltipResourceKey,className=_a.className;return jsxs(Host$i$1,__assign({className:className},{children:[jsx$1(IconContainer$1,__assign({isActive:isActive,className:isActive?"ms-bgColor-"+color:'ms-bgColor-white'},{children:isActive&&jsx$1(StyledTooltip,__assign({resourceKey:tooltipResourceKey},{children:jsx$1(StyledIcon$2$1,{className:"ms-fontColor-white",iconName:iconName},void 0)}),void 0)}),void 0),isActive?jsx$1(ActiveContent,__assign({className:"ms-borderColor-"+color},{children:children}),void 0):jsx$1(Content$3,{children:children},void 0)]}),void 0);};var Host$i$1=_styled.div.withConfig({displayName:"GutterMakerIcon__Host",componentId:"sc-aa2cf4-0"})(templateObject_1$J||(templateObject_1$J=__makeTemplateObject(["\n margin: 0;\n display: flex;\n align-content: center;\n"],["\n margin: 0;\n display: flex;\n align-content: center;\n"])));var StyledIcon$2$1=_styled(Icon).withConfig({displayName:"GutterMakerIcon__StyledIcon",componentId:"sc-aa2cf4-1"})(templateObject_2$t||(templateObject_2$t=__makeTemplateObject(["\n font-size: 25px;\n"],["\n font-size: 25px;\n"])));var Content$3=_styled.div.withConfig({displayName:"GutterMakerIcon__Content",componentId:"sc-aa2cf4-2"})(templateObject_3$m||(templateObject_3$m=__makeTemplateObject(["\n flex: 1 1 auto;\n flex-basis: 100%; /*IE fix*/\n\n display: flex;\n align-items: center;\n\n box-sizing: border-box;\n"],["\n flex: 1 1 auto;\n flex-basis: 100%; /*IE fix*/\n\n display: flex;\n align-items: center;\n\n box-sizing: border-box;\n"])));var ActiveContent=_styled(Content$3).withConfig({displayName:"GutterMakerIcon__ActiveContent",componentId:"sc-aa2cf4-3"})(templateObject_4$d$1||(templateObject_4$d$1=__makeTemplateObject(["\n padding-left: 10px;\n min-height: 50px;\n\n border-bottom-style: solid;\n border-bottom-width: 4px;\n"],["\n padding-left: 10px;\n min-height: 50px;\n\n border-bottom-style: solid;\n border-bottom-width: 4px;\n"])));var IconContainer$1=_styled.div.withConfig({displayName:"GutterMakerIcon__IconContainer",componentId:"sc-aa2cf4-4"})(templateObject_5$c||(templateObject_5$c=__makeTemplateObject(["\n flex-grow: 0;\n flex-shrink: 0;\n flex-basis: ",";\n\n display: flex;\n justify-content: center;\n align-items: center;\n\n padding: 10px 0;\n"],["\n flex-grow: 0;\n flex-shrink: 0;\n flex-basis: ",";\n\n display: flex;\n justify-content: center;\n align-items: center;\n\n padding: 10px 0;\n"])),function(_a){var isActive=_a.isActive;return isActive?'50px':'auto';});var StyledTooltip=_styled(Tooltip).withConfig({displayName:"GutterMakerIcon__StyledTooltip",componentId:"sc-aa2cf4-5"})(templateObject_6$5$1||(templateObject_6$5$1=__makeTemplateObject(["\n && {\n display: inherit;\n }\n"],["\n && {\n display: inherit;\n }\n"])));var templateObject_1$J,templateObject_2$t,templateObject_3$m,templateObject_4$d$1,templateObject_5$c,templateObject_6$5$1;var DetailViewTitle=function DetailViewTitle(){var _a=useDetailViewContext(),content=_a.content,item=_a.item;var hasAlert=hasFlag(item.knownState,KnownNewsState.Alert);return jsx$1(GutterMarkerIcon,__assign({iconName:"Warning",isActive:hasAlert,color:"red",tooltipResourceKey:"NewsArticle.alert"},{children:jsx$1(Title$5,__assign({"data-title":true},{children:content.title}),void 0)}),void 0);};var Title$5=_styled.h1.withConfig({displayName:"DetailViewTitle__Title",componentId:"sc-1jbzvna-0"})(templateObject_1$I||(templateObject_1$I=__makeTemplateObject(["\n color: black;\n width: 100%;\n font-size: ","px;\n line-height: 29px;\n margin: 0;\n\n @media (min-width: ","px) {\n font-size: 2.2em;\n line-height: 42px;\n }\n"],["\n color: black;\n width: 100%;\n font-size: ","px;\n line-height: 29px;\n margin: 0;\n\n @media (min-width: ","px) {\n font-size: 2.2em;\n line-height: 42px;\n }\n"])),fontSizeLarge-1,minScreenSize.small);var templateObject_1$I;_styled(ItemMetaInfo).withConfig({displayName:"NewsDetailViewMetaInfo__DetailMetaInfo",componentId:"sc-kib7we-0"})(templateObject_1$H||(templateObject_1$H=__makeTemplateObject(["\n display: flex;\n font-size: ","px;\n margin-top: 12px;\n"],["\n display: flex;\n font-size: ","px;\n margin-top: 12px;\n"])),fontSizeSmall);var templateObject_1$H;var mappers=[InlineImageMapper,InlineFileMapper,InlineQuoteMapper,InlineGalleryMapper,InlineCodeMapper,InlineVideoMapper,InlineTable,InlineContactMapper,InlinePageListMapper,InlineUrlPreviewMapper,InlineActionButtonMapper];var RichTextViewer=function RichTextViewer(_a){var html=_a.html;return jsx$1(TextViewer,{html:html,componentMappers:mappers},void 0);};var DetailViewBody=function DetailViewBody(){var _a=useDetailViewContext(),content=_a.content,resourceType=_a.resourceType;var bodyHtml=content&&content.body;return jsx$1(DetailBody$1,__assign({className:"lt-reach-detail-view-body","data-item-type":resourceType},{children:jsx$1(ItemBodyWrapper,{children:jsx$1(RichTextViewer,{html:bodyHtml},void 0)},void 0)}),void 0);};var DetailBody$1=_styled.div.withConfig({displayName:"DetailViewBody__DetailBody",componentId:"sc-7b4trq-0"})(templateObject_1$G||(templateObject_1$G=__makeTemplateObject(["\n flex: 1 0 auto;\n box-sizing: border-box;\n min-width: 100%;\n width: 100px;\n margin-top: 35px;\n\n // So that headings have the correct semantics for accessibility (i.e. title is h1, subheadings start at h2),\n // but maintain the same visual design, this styles each heading to look one \"step\" larger\n // e.g. h2 looks like h1, etc.\n && {\n h2 {\n font-size: ","px;\n margin: ","px 0;\n }\n\n h3 {\n font-size: ","px;\n }\n\n h4 {\n font-size: ","px;\n }\n\n h3,\n h4,\n h5,\n h6 {\n margin: ","px 0;\n }\n }\n"],["\n flex: 1 0 auto;\n box-sizing: border-box;\n min-width: 100%;\n width: 100px;\n margin-top: 35px;\n\n // So that headings have the correct semantics for accessibility (i.e. title is h1, subheadings start at h2),\n // but maintain the same visual design, this styles each heading to look one \"step\" larger\n // e.g. h2 looks like h1, etc.\n && {\n h2 {\n font-size: ","px;\n margin: ","px 0;\n }\n\n h3 {\n font-size: ","px;\n }\n\n h4 {\n font-size: ","px;\n }\n\n h3,\n h4,\n h5,\n h6 {\n margin: ","px 0;\n }\n }\n"])),fontSizeLarge-1,spacingS+2,fontSizeLarge-3,fontSizeLarge-5,spacingS);var templateObject_1$G;var DetailViewKeywords=function DetailViewKeywords(_a){var filterBaseUrl=_a.filterBaseUrl;var features=useFeatures();var _b=useDetailViewContext(),item=_b.item,userPreferredLanguage=_b.userPreferredLanguage;var formatMessage=useIntl().formatMessage;if(!features.keywords){return null;}return jsx$1(Fragment,{children:Object.keys(item.keywords).length>0&&jsx$1(KeywordsSection,__assign({"aria-label":formatMessage({id:'AriaLabel.section.keywords'})},{children:jsx$1(KeywordsInfo,{keywords:item.keywords,language:userPreferredLanguage,filterBaseUrl:filterBaseUrl},void 0)}),void 0)},void 0);};var KeywordsSection=_styled.section.withConfig({displayName:"DetailViewKeywords__KeywordsSection",componentId:"sc-ltysu4-0"})(templateObject_1$F||(templateObject_1$F=__makeTemplateObject(["\n margin-top: 2em;\n display: flex;\n\n @media (max-width: ","px) {\n font-size: ","px;\n }\n"],["\n margin-top: 2em;\n display: flex;\n\n @media (max-width: ","px) {\n font-size: ","px;\n }\n"])),maxScreenSize.medium,fontSizeSmall);var templateObject_1$F;var ConfirmationBox=function ConfirmationBox(_a){var disabled=_a.disabled,checked=_a.checked,onChange=_a.onChange;var formatMessage=useIntl().formatMessage;return jsx$1(Host$h$1,{children:jsx$1(NeutralCheckBox,{disabled:disabled,checked:checked,onChange:function(_,value){return onChange(value);},label:formatMessage({id:checked?'NewsArticle.confirmed':'NewsArticle.confirm'})},void 0)},void 0);};var Host$h$1=_styled.div.withConfig({displayName:"ConfirmationBox__Host",componentId:"sc-1m5alil-0"})(templateObject_1$E||(templateObject_1$E=__makeTemplateObject(["\n .ms-Checkbox-text {\n font-weight: bold;\n color: black;\n }\n"],["\n .ms-Checkbox-text {\n font-weight: bold;\n color: black;\n }\n"])));var templateObject_1$E;var ConfirmationSection=function ConfirmationSection(_a){var item=_a.item,showDescription=_a.showDescription,readOnly=_a.readOnly,className=_a.className;var refreshStatistics=useNewsApi().refreshStatistics;var _b=useNotificationContext(),dismissToast=_b.dismissToast,showToast=_b.showToast,showError=_b.showError;var _c=useFeedbackApi(),getFeedback=_c.getFeedback,setFeedback=_c.setFeedback,unsetFeedback=_c.unsetFeedback;var _d=usePromise$2(function(){return getFeedback(ItemResourceTypes.News,item.id);}),summary=_d[0],isLoading=_d[1];var _e=useState$2(null),userChecked=_e[0],setChecked=_e[1];var toastHandle=useRef$1(null);var checked=userChecked!==null?userChecked:summary!=null&&!!summary.records.find(function(r){return r.type==='confirm';});return jsxs(Host$g$1,__assign({isLoading:isLoading,className:className},{children:[showDescription&&jsx$1(FormattedMessage$1,{id:"NewsArticle.confirmationRequiredDescription",tagName:"p"},void 0),jsx$1(StyledGutterMarkerIcon,__assign({iconName:"Completed",isActive:!isLoading&&!checked,color:"green"},{children:readOnly?jsx$1(ConfirmationBox,{checked:checked,disabled:true},void 0):jsx$1(ConfirmationBox,{checked:checked,disabled:checked,onChange:handleClickConfirm},void 0)}),void 0)]}),void 0);function handleClickConfirm(){return __awaiter(this,void 0,void 0,function(){var error_1;return __generator(this,function(_a){switch(_a.label){case 0:setChecked(true);_a.label=1;case 1:_a.trys.push([1,4,,5]);return [4/*yield*/,setFeedback(ItemResourceTypes.News,item.id,'confirm')];case 2:_a.sent();toastHandle.current=showToast('NewsArticle.confirmationSuccessToast',{},jsx$1(DefaultButton,__assign({onClick:handleUndo},{children:jsx$1(FormattedMessage$1,{id:"Generic.undo"},void 0)}),void 0),{autoClose:false});return [4/*yield*/,refreshStatistics(item.id,{confirmationCount:1})];case 3:_a.sent();return [3/*break*/,5];case 4:error_1=_a.sent();logger.error(error_1);showError('Generic.error');setChecked(false);return [3/*break*/,5];case 5:return [2/*return*/];}});});}function handleUndo(){return __awaiter(this,void 0,void 0,function(){var error_2;return __generator(this,function(_a){switch(_a.label){case 0:_a.trys.push([0,3,,4]);dismissToast(toastHandle.current);toastHandle.current=null;return [4/*yield*/,unsetFeedback(ItemResourceTypes.News,item.id,'confirm')];case 1:_a.sent();return [4/*yield*/,refreshStatistics(item.id,{confirmationCount:-1})];case 2:_a.sent();setChecked(false);return [3/*break*/,4];case 3:error_2=_a.sent();logger.error(error_2);showError('Generic.error');return [3/*break*/,4];case 4:return [2/*return*/];}});});}};var Host$g$1=_styled.div.withConfig({displayName:"ConfirmationSection__Host",componentId:"sc-1g2fxdb-0"})(templateObject_1$D||(templateObject_1$D=__makeTemplateObject(["\n width: 100%;\n\n opacity: ",";\n\n > p {\n margin: 0 0 5px ","px;\n font-style: italic;\n }\n\n @media (min-width: ","px) {\n > p {\n margin: 0 0 ","px 0;\n }\n }\n\n @media (max-width: ","px) {\n font-size: ","px;\n }\n"],["\n width: 100%;\n\n opacity: ",";\n\n > p {\n margin: 0 0 5px ","px;\n font-style: italic;\n }\n\n @media (min-width: ","px) {\n > p {\n margin: 0 0 ","px 0;\n }\n }\n\n @media (max-width: ","px) {\n font-size: ","px;\n }\n"])),function(_a){var isLoading=_a.isLoading;return isLoading?0.4:1;},spacingM,minScreenSize.small,spacingS,maxScreenSize.medium,fontSizeSmall);var StyledGutterMarkerIcon=_styled(GutterMarkerIcon).withConfig({displayName:"ConfirmationSection__StyledGutterMarkerIcon",componentId:"sc-1g2fxdb-1"})(templateObject_2$s||(templateObject_2$s=__makeTemplateObject(["\n @media (max-width: ","px) {\n margin: 0 ","px 0;\n }\n"],["\n @media (max-width: ","px) {\n margin: 0 ","px 0;\n }\n"])),maxScreenSize.small,spacingM);var templateObject_1$D,templateObject_2$s;var DetailViewConfirmations=function DetailViewConfirmations(){var features=useFeatures();var _a=useDetailViewContext(),item=_a.item,isEditorPreview=_a.isEditorPreview;var formatMessage=useIntl().formatMessage;if(!showConfirmationBox()){return null;}return jsx$1(ConfirmationHost,__assign({"aria-label":formatMessage({id:'NewsArticle.confirmation'})},{children:jsx$1(ConfirmationSection,{item:item,showDescription:true,readOnly:isEditorPreview},void 0)}),void 0);function showConfirmationBox(){return features.confirmation&&item.metadata&&item.metadata.feedbackSettings&&item.metadata.feedbackSettings.feedbackOptions.indexOf('confirm')>=0;}};var ConfirmationHost=_styled.section.withConfig({displayName:"DetailViewConfirmations__ConfirmationHost",componentId:"sc-f8jogv-0"})(templateObject_1$C||(templateObject_1$C=__makeTemplateObject(["\n margin-bottom: ","px;\n\n @media (min-width: ","px) {\n padding: 0 ","px 0 ","px;\n }\n"],["\n margin-bottom: ","px;\n\n @media (min-width: ","px) {\n padding: 0 ","px 0 ","px;\n }\n"])),spacingL,minScreenSize.small,spacingXl,spacingXl);var templateObject_1$C;var DetailViewPageViewTracker=function DetailViewPageViewTracker(){var _a=useDetailViewContext(),resourceType=_a.resourceType,itemId=_a.itemId;usePageViewTracker(resourceType,itemId);return null;};var FeedbackButtonBookmark=function FeedbackButtonBookmark(_a){var isReadOnly=_a.isReadOnly;var _b=useContext(FeedbackButtonContext),item=_b.item,bookmarkCount=_b.statistics.bookmarkCount;return jsxs(CountButtonHost,{children:[jsx$1(BookmarkButton,{item:item,isReadOnly:isReadOnly},void 0),jsx$1(StyledCountLabel,__assign({isDisabled:isReadOnly},{children:bookmarkCount}),void 0)]},void 0);};var StyledCountLabel=_styled(CountLabel).withConfig({displayName:"FeedbackButtonBookmark__StyledCountLabel",componentId:"sc-1ac9lm2-0"})(templateObject_1$B||(templateObject_1$B=__makeTemplateObject(["\n margin-left: 0;\n"],["\n margin-left: 0;\n"])));var templateObject_1$B;var NewsDetailViewFeedbackSection=function NewsDetailViewFeedbackSection(_a){var _b;var hideLikes=_a.hideLikes,hideComments=_a.hideComments,hideProfileUrl=_a.hideProfileUrl,disableLoginForPublicUser=_a.disableLoginForPublicUser;var _c=useDetailViewContext(),item=_c.item,resourceType=_c.resourceType,contentLanguage=_c.contentLanguage,isEditorPreview=_c.isEditorPreview;return jsxs(StyledFeedbackSection,__assign({item:item,language:contentLanguage,type:resourceType,feedbackSettings:(_b=item.metadata)===null||_b===void 0?void 0:_b.feedbackSettings,hideComments:hideComments,hideProfileUrl:hideProfileUrl,disableLoginForPublicUser:disableLoginForPublicUser,isReadOnly:isEditorPreview},{children:[!hideLikes&&jsx$1(FeedbackButtonLike,{isReadOnly:isEditorPreview},void 0),jsx$1(FeedbackButtonBookmark,{isReadOnly:isEditorPreview},void 0),!hideComments&&jsx$1(FeedbackButtonComments,{},void 0),jsx$1(FeedbackButtonViews,{},void 0),jsx$1(FeedbackButtonShare,{isReadOnly:isEditorPreview},void 0),jsx$1(FeedbackButtonConfirmations,{},void 0)]}),void 0);};var StyledFeedbackSection=_styled(FeedbackSection).withConfig({displayName:"NewsDetailViewFeedbackSection__StyledFeedbackSection",componentId:"sc-pjpy6x-0"})(templateObject_1$A||(templateObject_1$A=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),DetailViewSectionPadding);var templateObject_1$A;var DetailViewBodyExternalContent=function DetailViewBodyExternalContent(_a){var itemType=_a.itemType;var content=useDetailViewContext().content;var externalUrl=content&&content.externalUrl;return jsx$1(DetailBody,__assign({className:"lt-reach-detail-view-body"},{children:jsx$1(ItemBodyWrapper,{children:jsx$1(FormattedMessageWithStyle,{id:"ExternalLink."+itemType+".navigateTo",tagName:"p",values:{url:jsx$1(ExternalLink$2,__assign({href:externalUrl,className:"ms-fontColor-accent",target:"_blank",rel:"noopener noreferrer"},{children:externalUrl}),void 0)}},void 0)},void 0)}),void 0);};var DetailBody=_styled.div.withConfig({displayName:"DetailViewBodyExternalContent__DetailBody",componentId:"sc-1xjgw89-0"})(templateObject_1$z||(templateObject_1$z=__makeTemplateObject(["\n flex: 1 0 auto;\n box-sizing: border-box;\n min-width: 100%;\n width: 100px;\n margin-top: 35px;\n"],["\n flex: 1 0 auto;\n box-sizing: border-box;\n min-width: 100%;\n width: 100px;\n margin-top: 35px;\n"])));var templateObject_1$z;var DetailViewHeadline=function DetailViewHeadline(){var content=useDetailViewContext().content;var features=useFeatures();if(!features.contentHeadline||!content.headline){return null;}return jsx$1(Headline$1$1,__assign({"data-detail-view-headline":true},{children:content.headline}),void 0);};var Headline$1$1=_styled.p.withConfig({displayName:"DetailViewHeadline__Headline",componentId:"sc-wsid06-0"})(templateObject_1$y||(templateObject_1$y=__makeTemplateObject(["\n width: 100%;\n font-weight: bold;\n font-size: ","px;\n line-height: 26px;\n margin: 0;\n\n @media (min-width: ","px) {\n line-height: 22px;\n font-size: ","px;\n margin-bottom: ","px;\n }\n"],["\n width: 100%;\n font-weight: bold;\n font-size: ","px;\n line-height: 26px;\n margin: 0;\n\n @media (min-width: ","px) {\n line-height: 22px;\n font-size: ","px;\n margin-bottom: ","px;\n }\n"])),fontSizeNormal,minScreenSize.small,fontSizeMedium,spacingS);var templateObject_1$y;var StateIcon=function StateIcon(_a){var status=_a.status,isActive=_a.isActive,_b=_a.width,width=_b===void 0?16:_b,activeColor=_a.activeColor;var textColors=useContext(ThemeContext$1).theme.textColors;if(status===WorkflowStatus.draft){return jsx$1(Draft,{width:width,color:isActive?activeColor||textColors.onSecondary:textColors.default},void 0);}else if(status===WorkflowStatus.rejected){return jsx$1(Draft,{width:width,color:isActive?activeColor:'#b90000'},void 0);}else if(status===WorkflowStatus.ready){return jsx$1(Ready,{width:width,color:isActive?activeColor||textColors.onSecondary:textColors.default},void 0);}return null;};var Draft=function Draft(_a){var color=_a.color,className=_a.className,_b=_a.width,width=_b===void 0?16.25:_b;var ratio=20/16.25;return jsx$1("svg",__assign({className:className,version:"1.1",id:"Layer_1",x:"0px",y:"0px",width:width+"px",height:width*ratio+"px",viewBox:"0 0 16.25 20",enableBackground:"new 0 0 16.25 20"},{children:jsx$1("path",{fill:color,d:"M10,6.25V0h0.89l5.36,5.361V6.25H10z M11.25,5h2.861L11.25,2.139V5z M10,0H9.25v1.25H10V0z M7.675,1.25H6.1\n\tV0h1.575V1.25z M4.525,1.25H2.95V0h1.575V1.25z M1.25,17.057H0v-1.567h1.25V17.057z M1.25,13.921H0v-1.568h1.25V13.921z\n\t M1.25,10.784H0V9.216h1.25V10.784z M1.25,7.647H0V6.08h1.25V7.647z M1.25,4.512H0V2.943h1.25V4.512z M13.375,\n\t 20h-1.5v-1.25h1.5V20z\n\t M10.375,20h-1.5v-1.25h1.5V20z M7.375,20h-1.5v-1.25h1.5V20z M4.375,20h-1.5v-1.25h1.5V20z M16.25,\n\t 16.964H15v-1.661h1.25V16.964z\n\t M16.25,13.643H15v-1.661h1.25V13.643z M16.25,10.321H15V8.66h1.25V10.321z M16.25,6.25H15V7h1.25V6.25z\n\t M1.25,18.75H0V20h1.25\n\tV18.75z M1.25,0H0v1.25h1.25V0z M16.25,18.75H15V20h1.25V18.75z"},void 0)}),void 0);};var Ready=function Ready(_a){var color=_a.color,className=_a.className,_b=_a.width,width=_b===void 0?18.564:_b;var ratio=20/18.564;return jsx$1("svg",__assign({className:className,version:"1.1",id:"Layer_1",x:"0px",y:"0px",width:width+"px",height:width*ratio+"px",viewBox:"0 0 18.564 20",enableBackground:"new 0 0 18.564 20"},{children:jsx$1("path",{fill:color,d:"M10,6.25v-5H1.25v17.5H10V20H0V0h10.889l5.361,5.361V12.5L15,13.75v-7.5H10z M18.564,14.551L13.125,20\n \tl-2.627-2.637l0.879-0.879l1.748,1.738l4.561-4.551L18.564,14.551z M11.25,5h2.861L11.25,2.139V5z"},void 0)}),void 0);};function useCommonEditorApi(){var api=useApi();return useMemo(function(){return {list:list,getTaskViewCounts:getTaskViewCounts};function list(type,filter,token,sortDefinition){var params=Object.assign({},__assign(__assign(__assign({},filter),getCommaSeparatedChannelsString(filter===null||filter===void 0?void 0:filter.channels)),getCommaSeparatedKeywordsString(filter===null||filter===void 0?void 0:filter.keywords)),{token:token},sortDefinition);return api.custom("editor/"+type+"?"+queryString.stringify(params)).get().then(function(res){return res.body().data();});}function getTaskViewCounts(type,groupId){return __awaiter(this,void 0,void 0,function(){var response;return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,api.custom("editor/"+type+"/taskcounts?"+queryString.stringify({groupId:groupId})).get(groupId)];case 1:response=_a.sent();return [4/*yield*/,response.body().data()];case 2:return [2/*return*/,_a.sent()];}});});}},[api]);}var KeywordPickerGroup=function KeywordPickerGroup(_a){var group=_a.group,keywords=_a.keywords,expanded=_a.expanded,selectedKeywords=_a.selectedKeywords,onChange=_a.onChange,mandatoryKeywordIds=_a.mandatoryKeywordIds;var _b=useState$2(null),isExpanded=_b[0],setIsExpanded=_b[1];var isSelected=!!selectedKeywords.find(function(k){return k.groupId===group.id;});var isCollapsed=!(isExpanded===true||expanded);return jsxs(Host$f$1,{children:[jsxs(GroupButton,__assign({onClick:toggle,iconProps:{iconName:isCollapsed?'CaretRightSolid8':'CaretDownSolid8'},"aria-expanded":!isCollapsed,"aria-controls":group.name+"-list"},{children:[isSelected&&jsx$1(CheckMarkIcon,{iconName:"CheckMark"},void 0),jsx$1(ButtonLabel,__assign({"data-keyword-group":group.name,isSelected:isSelected},{children:jsx$1(KeywordTitle,{groupName:group.name},void 0)}),void 0)]}),void 0),jsx$1(KeywordsList,__assign({id:group.name+"-list","data-keyword-picker-group-list":true,isCollapsed:isCollapsed},{children:keywords.map(function(k){var checked=isKeywordSelected(k);var disabled=isKeywordDisabled(k);return jsx$1(KeywordItem,__assign({"data-keyword":k.name,"data-is-checked":checked,"data-is-disabled":disabled},{children:jsx$1(Checkbox,{label:k.name,onRenderLabel:function(){return jsx$1(KeywordTitle,{groupName:group.name,keywordName:k.name},void 0);},checked:checked,onChange:function(_e,isChecked){return handleChange(isChecked,k);},disabled:disabled},k.id)}),k.name);})}),void 0)]},void 0);function toggle(){setIsExpanded(!isExpanded);}function isKeywordSelected(keyword){return !!selectedKeywords.find(function(k){return k.id===keyword.id;});}function isKeywordDisabled(keyword){return mandatoryKeywordIds===null||mandatoryKeywordIds===void 0?void 0:mandatoryKeywordIds.some(function(id){return id===keyword.id;});}function handleChange(add,keyword){if(onChange){var result=selectedKeywords.filter(function(k){return keyword.id!==k.id;});if(add){result.push(keyword);}onChange(result);}}};var Host$f$1=_styled.div.withConfig({displayName:"KeywordPickerGroup__Host",componentId:"sc-pu16jm-0"})(templateObject_1$x||(templateObject_1$x=__makeTemplateObject(["\n margin-bottom: ","px;\n"],["\n margin-bottom: ","px;\n"])),spacingS);var GroupButton=_styled(ActionButton).withConfig({displayName:"KeywordPickerGroup__GroupButton",componentId:"sc-pu16jm-1"})(templateObject_2$r||(templateObject_2$r=__makeTemplateObject(["\n && {\n height: auto;\n font-size: ","px;\n padding: 0;\n border: 0;\n\n i {\n font-size: ","px;\n\n &:first-child {\n margin: 0;\n }\n }\n }\n"],["\n && {\n height: auto;\n font-size: ","px;\n padding: 0;\n border: 0;\n\n i {\n font-size: ","px;\n\n &:first-child {\n margin: 0;\n }\n }\n }\n"])),fontSizeNormal,fontSizeSmall);var CheckMarkIcon=_styled(Icon).withConfig({displayName:"KeywordPickerGroup__CheckMarkIcon",componentId:"sc-pu16jm-2"})(templateObject_3$l||(templateObject_3$l=__makeTemplateObject(["\n margin-right: 6px;\n margin-left: 12px;\n width: 15px;\n"],["\n margin-right: 6px;\n margin-left: 12px;\n width: 15px;\n"])));var ButtonLabel=_styled.span.withConfig({displayName:"KeywordPickerGroup__ButtonLabel",componentId:"sc-pu16jm-3"})(templateObject_5$b||(templateObject_5$b=__makeTemplateObject(["\n display: inline-flex;\n flex: 1 0 auto;\n\n ","\n"],["\n display: inline-flex;\n flex: 1 0 auto;\n\n ","\n"])),function(p){return !p.isSelected&&css$2(templateObject_4$c$1||(templateObject_4$c$1=__makeTemplateObject(["\n margin-left: 33px; // checkmark icon space\n "],["\n margin-left: 33px; // checkmark icon space\n "])));});var KeywordsList=_styled.ul.withConfig({displayName:"KeywordPickerGroup__KeywordsList",componentId:"sc-pu16jm-4"})(templateObject_7$3$1||(templateObject_7$3$1=__makeTemplateObject(["\n ","\n padding: 0;\n margin: 0 0 0 ","px;\n list-style: none;\n"],["\n ","\n padding: 0;\n margin: 0 0 0 ","px;\n list-style: none;\n"])),function(p){return p.isCollapsed&&css$2(templateObject_6$4$1||(templateObject_6$4$1=__makeTemplateObject(["\n display: none;\n "],["\n display: none;\n "])));},spacingX+10);var KeywordItem=_styled.li.withConfig({displayName:"KeywordPickerGroup__KeywordItem",componentId:"sc-pu16jm-5"})(templateObject_8$3$1||(templateObject_8$3$1=__makeTemplateObject(["\n display: flex;\n align-items: center;\n margin-top: 9px;\n"],["\n display: flex;\n align-items: center;\n margin-top: 9px;\n"])));var templateObject_1$x,templateObject_2$r,templateObject_3$l,templateObject_4$c$1,templateObject_5$b,templateObject_6$4$1,templateObject_7$3$1,templateObject_8$3$1;var KeywordPicker=function KeywordPicker(_a){var _b;var value=_a.value,onChange=_a.onChange,showSelectionToggle=_a.showSelectionToggle,incomingAvailableKeywords=_a.availableKeywords,mandatoryKeywordIds=_a.mandatoryKeywordIds,className=_a.className;var formatMessage=useIntl().formatMessage;var user=useCurrentUser();var _c=useContext(LazySubscriptionContext),allKeywords=_c.allKeywords,selectedKeywordGroups=_c.selectedKeywordGroups;var _d=useState$2(null),searchedKeywords=_d[0],setSearchedKeywords=_d[1];var _e=useState$2(null),searchText=_e[0],setSearchText=_e[1];var selectedKeywords=getSelectedKeywords();var availableKeywords=incomingAvailableKeywords!==null&&incomingAvailableKeywords!==void 0?incomingAvailableKeywords:allKeywords;var visibleKeywords=(_b=searchedKeywords!==null&&searchedKeywords!==void 0?searchedKeywords:availableKeywords)!==null&&_b!==void 0?_b:[];var mandatoryKeywords=mandatoryKeywordIds?availableKeywords.filter(function(k){return mandatoryKeywordIds.includes(k.id);}):[];var noKeywordGroups=(selectedKeywordGroups===null||selectedKeywordGroups===void 0?void 0:selectedKeywordGroups.length)===0;var noAvailableKeywords=!noKeywordGroups&&(availableKeywords===null||availableKeywords===void 0?void 0:availableKeywords.length)===0;var isEmpty=visibleKeywords.length===0;return jsxs(Host$e$1,__assign({className:classNames('keyword-picker',className)},{children:[(noKeywordGroups||noAvailableKeywords)&&jsx$1("span",__assign({className:"keyword-picker-empty"},{children:jsx$1(FormattedMessage$1,{id:noKeywordGroups?'KeywordPicker.noGroupsDefined':'KeywordPicker.noAvailableKeywordsForGroup'},void 0)}),void 0),!noKeywordGroups&&!noAvailableKeywords&&jsxs("div",{children:[jsxs(SearchHost,__assign({className:"keyword-picker-search","data-keyword-picker-search":true},{children:[jsx$1(TextField,{onChange:handleSearch,value:searchText||'',placeholder:formatMessage({id:'KeywordPicker.search'}),ariaLabel:formatMessage({id:'KeywordPicker.search'})},void 0),searchText&&jsx$1(SearchCancelButton,{iconProps:{iconName:'Cancel'},onClick:function(){return handleSearch(null,null);},"aria-hidden":"true"},void 0)]}),void 0),showSelectionToggle&&jsx$1(StyledToggleAllButtons$1,{toggleAll:handleToggleAll},void 0),jsxs(KeywordPickerTree,__assign({className:"keyword-picker-tree"},{children:[isEmpty&&jsx$1(FormattedMessage$1,{id:"KeywordPicker.emptySearch"},void 0),!isEmpty&&selectedKeywordGroups&&selectedKeywordGroups.sort(function(a,b){return a.name.localeCompare(b.name);}).map(function(g){var keywords=visibleKeywords.filter(function(k){return k.groupId===g.id;});return keywords.length===0?null:jsx$1(KeywordPickerGroup,{expanded:!!searchText,group:g,keywords:keywords,selectedKeywords:selectedKeywords,onChange:onChange,mandatoryKeywordIds:mandatoryKeywordIds},g.id);})]}),void 0)]},void 0)]}),void 0);function getSelectedKeywords(){if(value==null||allKeywords==null){return [];}return value.map(function(k){return typeof k==='string'?allKeywords.find(function(a){return a.id===k;}):k;}).filter(function(k){return k;});}function handleSearch(_,text){var hasSearch=text&&text.length;var keywords=hasSearch?availableKeywords.filter(function(k){return getKeywordTitle(user,k.translations,k.name).toLocaleLowerCase().indexOf(text.toLocaleLowerCase())>=0;}):availableKeywords;setSearchedKeywords(keywords);setSearchText(hasSearch?text:null);}function handleToggleAll(checkAll){onChange(checkAll?availableKeywords:mandatoryKeywords);}};var KeywordPickerTree=_styled.div.withConfig({displayName:"KeywordPicker__KeywordPickerTree",componentId:"sc-1ejjfwa-0"})(templateObject_1$w||(templateObject_1$w=__makeTemplateObject(["\n padding-left: 4px;\n"],["\n padding-left: 4px;\n"])));var StyledToggleAllButtons$1=_styled(ToggleAllButtons).withConfig({displayName:"KeywordPicker__StyledToggleAllButtons",componentId:"sc-1ejjfwa-1"})(templateObject_2$q||(templateObject_2$q=__makeTemplateObject(["\n padding-left: 4px;\n"],["\n padding-left: 4px;\n"])));var Host$e$1=_styled.div.withConfig({displayName:"KeywordPicker__Host",componentId:"sc-1ejjfwa-2"})(templateObject_3$k||(templateObject_3$k=__makeTemplateObject(["\n overflow-x: hidden;\n overflow-y: auto;\n\n .ms-TextField-fieldGroup {\n background: none;\n }\n"],["\n overflow-x: hidden;\n overflow-y: auto;\n\n .ms-TextField-fieldGroup {\n background: none;\n }\n"])));var SearchHost=_styled.div.withConfig({displayName:"KeywordPicker__SearchHost",componentId:"sc-1ejjfwa-3"})(templateObject_4$b$1||(templateObject_4$b$1=__makeTemplateObject(["\n position: relative;\n margin-bottom: 8px;\n"],["\n position: relative;\n margin-bottom: 8px;\n"])));var SearchCancelButton=_styled(IconButton).withConfig({displayName:"KeywordPicker__SearchCancelButton",componentId:"sc-1ejjfwa-4"})(templateObject_5$a$1||(templateObject_5$a$1=__makeTemplateObject(["\n position: absolute;\n top: 0;\n right: 0;\n z-index: 10;\n\n &&&:focus::after {\n outline-offset: -2px;\n }\n"],["\n position: absolute;\n top: 0;\n right: 0;\n z-index: 10;\n\n &&&:focus::after {\n outline-offset: -2px;\n }\n"])));var templateObject_1$w,templateObject_2$q,templateObject_3$k,templateObject_4$b$1,templateObject_5$a$1;var $$g=_export;var requireObjectCoercible$c=requireObjectCoercible$b;var isRegExp=isRegexp;var getRegExpFlags=regexpFlags$1$1;var wellKnownSymbol$m=wellKnownSymbol$l;var REPLACE$2=wellKnownSymbol$m('replace');var RegExpPrototype$3=RegExp.prototype;// `String.prototype.replaceAll` method
122340
+ return {id:pageListId,showChildren:showChildren,showPages:true,showDocuments:false,pageId:pageId,keywords:keywords};}var showDocuments=showDocumentsAttribute==='true';var showPages=showPagesAttribute==='true';return {id:pageListId,showChildren:showChildren,showDocuments:showDocuments,showPages:showPages,pageId:pageId,keywords:keywords};}};var PageBreadcrumb=function PageBreadcrumb(_a){var page=_a.page,target=_a.target,languageOverride=_a.language,hideCurrentPageNode=_a.hideCurrentPageNode,className=_a.className;var user=useCurrentUser();var formatMessage=useIntl().formatMessage;var history=useHistory();if(!page||!page.navigationContext){return null;}var _b=getBreadcrumbsItems(page,target,handleOnClick,function(page){return getTitle(page,user,formatMessage,languageOverride);},formatMessage,hideCurrentPageNode),parentNode=_b.parentNode,breadcrumbItems=_b.breadcrumbItems;return jsxs("div",__assign({className:className},{children:[jsx$1(LargeScreenBreadcrumb,{items:breadcrumbItems,onRenderItem:renderBreadcrumbItem,overflowIndex:breadcrumbItems.length>1?1:undefined,"data-breadcrumb":true,overflowAriaLabel:formatMessage({id:'AriaLabel.otherPages'}),focusZoneProps:{handleTabKey:1}},void 0),jsx$1(MobileBreadcrumb,{target:target,parentNode:parentNode},void 0)]}),void 0);function renderBreadcrumbItem(item){if(item.key==='home'){return jsx$1(BreadcrumbHomeItem,__assign({to:item.href,"aria-label":item.text,"data-pages-home-icon":true},{children:jsx$1(HomeIcon,{iconName:"HomeSolid"},void 0)}),void 0);}if(item.isCurrentItem){return jsx$1(BreadcrumbCurrentItem,__assign({"aria-current":"page"},{children:item.text}),void 0);}return jsx$1(BreadcrumbItem,__assign({to:item.href,"data-page-breadcrumb-node":item.key},{children:item.text}),void 0);}function handleOnClick(e,item){e.stopPropagation();e.preventDefault();history.push({pathname:item.href});}};var MobileBreadcrumb=function MobileBreadcrumb(_a){var target=_a.target,parentNode=_a.parentNode;var formatMessage=useIntl().formatMessage;return jsxs(MobileBreadcrumbHost,__assign({"data-mobile-breadcrumb":true},{children:[jsx$1("li",{children:jsx$1(BreadcrumbHomeItem,__assign({to:target,"aria-label":formatMessage({id:'Generic.home'}),"data-pages-home-icon":true},{children:jsx$1(HomeIcon,{iconName:"HomeSolid"},void 0)}),void 0)},void 0),parentNode&&jsxs(ParentNode,{children:[jsx$1(LeftChevronIcon,{iconName:"ChevronLeft"},void 0),jsx$1(BreadcrumbItem,__assign({to:NewsService.getNewsRoute(target,parentNode.id,parentNode.title),"data-page-breadcrumb-parent-node":parentNode.id},{children:parentNode.title}),void 0)]},void 0)]}),void 0);};var MobileBreadcrumbHost=_styled.ul.withConfig({displayName:"PageBreadcrumb__MobileBreadcrumbHost",componentId:"sc-1m4qq1d-0"})(templateObject_1$Q||(templateObject_1$Q=__makeTemplateObject(["\n display: none;\n align-items: center;\n padding: 0;\n margin: 0;\n list-style: none;\n font-size: ","px;\n\n @media (max-width: ","px) {\n display: flex;\n }\n"],["\n display: none;\n align-items: center;\n padding: 0;\n margin: 0;\n list-style: none;\n font-size: ","px;\n\n @media (max-width: ","px) {\n display: flex;\n }\n"])),fontSizeSmall,maxScreenSize.medium);var ParentNode=_styled.li.withConfig({displayName:"PageBreadcrumb__ParentNode",componentId:"sc-1m4qq1d-1"})(templateObject_2$u||(templateObject_2$u=__makeTemplateObject(["\n margin: 0 ","px;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n color: ",";\n"],["\n margin: 0 ","px;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n color: ",";\n"])),spacingM,function(p){return p.theme.palette.accent;});var LeftChevronIcon=_styled(Icon).withConfig({displayName:"PageBreadcrumb__LeftChevronIcon",componentId:"sc-1m4qq1d-2"})(templateObject_3$m||(templateObject_3$m=__makeTemplateObject(["\n font-size: 10px;\n font-weight: bold;\n color: ",";\n"],["\n font-size: 10px;\n font-weight: bold;\n color: ",";\n"])),function(p){return p.theme.palette.accent;});var LargeScreenBreadcrumb=_styled(Breadcrumb).withConfig({displayName:"PageBreadcrumb__LargeScreenBreadcrumb",componentId:"sc-1m4qq1d-3"})(templateObject_4$c$1||(templateObject_4$c$1=__makeTemplateObject(["\n && {\n margin: 0;\n }\n\n .ms-Breadcrumb-chevron {\n font-weight: bold;\n }\n\n @media (max-width: ","px) {\n display: none;\n }\n"],["\n && {\n margin: 0;\n }\n\n .ms-Breadcrumb-chevron {\n font-weight: bold;\n }\n\n @media (max-width: ","px) {\n display: none;\n }\n"])),maxScreenSize.medium);var HomeIcon=_styled(Icon).withConfig({displayName:"PageBreadcrumb__HomeIcon",componentId:"sc-1m4qq1d-4"})(templateObject_5$b||(templateObject_5$b=__makeTemplateObject(["\n padding-top: 1px;\n"],["\n padding-top: 1px;\n"])));var BreadcrumbItem=_styled(NavLink).withConfig({displayName:"PageBreadcrumb__BreadcrumbItem",componentId:"sc-1m4qq1d-5"})(templateObject_6$5$1||(templateObject_6$5$1=__makeTemplateObject(["\n padding: 0 ","px;\n color: ",";\n"],["\n padding: 0 ","px;\n color: ",";\n"])),spacingS,function(p){return p.theme.palette.accent;});var BreadcrumbHomeItem=_styled(NavLink).withConfig({displayName:"PageBreadcrumb__BreadcrumbHomeItem",componentId:"sc-1m4qq1d-6"})(templateObject_7$3$1||(templateObject_7$3$1=__makeTemplateObject(["\n color: ",";\n\n + i {\n padding-left: ","px;\n }\n"],["\n color: ",";\n\n + i {\n padding-left: ","px;\n }\n"])),function(p){return p.theme.palette.accent;},spacingS);var BreadcrumbCurrentItem=_styled.div.withConfig({displayName:"PageBreadcrumb__BreadcrumbCurrentItem",componentId:"sc-1m4qq1d-7"})(templateObject_8$3$1||(templateObject_8$3$1=__makeTemplateObject(["\n padding-left: ","px;\n color: ",";\n"],["\n padding-left: ","px;\n color: ",";\n"])),spacingS,function(p){return p.theme.palette.neutralSecondaryAlt;});var templateObject_1$Q,templateObject_2$u,templateObject_3$m,templateObject_4$c$1,templateObject_5$b,templateObject_6$5$1,templateObject_7$3$1,templateObject_8$3$1;var DetailViewPageDocumentDownload=function DetailViewPageDocumentDownload(){var user=useCurrentUser();var _a=useDetailViewContext(),item=_a.item,preferredContent=_a.content;if(!item){return null;}var content=(preferredContent===null||preferredContent===void 0?void 0:preferredContent.fileInfo)?preferredContent:getContentForPage(item,user).content;if(!(content===null||content===void 0?void 0:content.fileInfo)){return null;}return jsx$1(PageDocumentDownloadButton,{item:item,content:content},void 0);};var PageDocumentDownloadButton=function PageDocumentDownloadButton(_a){var item=_a.item,content=_a.content,basePath=_a.basePath;var _b=useInlinePageDocument({pageId:item.id,fileId:content.fileInfo.fileId,extension:content.fileInfo.extension,title:content.title,fileName:content.fileInfo.fileName},item,basePath),fileUrl=_b.fileUrl,iconName=_b.iconName,title=_b.title,fileName=_b.fileName,onPageDocumentDownloadClick=_b.onPageDocumentDownloadClick;return jsxs(Host$j,{children:[jsx$1(FormattedMessage$1,{id:"Pages.documents.buttonDownloadInfo"},void 0),jsx$1(DownloadButton,{fileUrl:fileUrl,fileName:fileName,title:title,fileIconName:iconName,onClick:onPageDocumentDownloadClick},void 0)]},void 0);};var Host$j=_styled.div.withConfig({displayName:"DetailViewPageDocumentDownload__Host",componentId:"sc-1gtkslm-0"})(templateObject_1$P||(templateObject_1$P=__makeTemplateObject(["\n margin-top: ","px;\n"],["\n margin-top: ","px;\n"])),spacingM);var DownloadButton=_styled(InlinePageDocumentDownloadButton).withConfig({displayName:"DetailViewPageDocumentDownload__DownloadButton",componentId:"sc-1gtkslm-1"})(templateObject_2$t||(templateObject_2$t=__makeTemplateObject(["\n margin-top: ","px;\n @media (min-width: ","px) {\n width: 50%;\n }\n"],["\n margin-top: ","px;\n @media (min-width: ","px) {\n width: 50%;\n }\n"])),spacingS,minScreenSize.medium);var templateObject_1$P,templateObject_2$t;_styled(PublishableItemBanner).withConfig({displayName:"CardBanner__StyledBanner",componentId:"sc-mqzdnh-0"})(templateObject_1$O||(templateObject_1$O=__makeTemplateObject(["\n &.video-view-container {\n height: 100%; /* this is needed for not overlapping the card title */\n }\n"],["\n &.video-view-container {\n height: 100%; /* this is needed for not overlapping the card title */\n }\n"])));var templateObject_1$O;_styled.div.withConfig({displayName:"Card__Host",componentId:"sc-1m8ygh-0"})(templateObject_1$N||(templateObject_1$N=__makeTemplateObject(["\n &.card {\n display: flex;\n background-color: white;\n box-shadow: 1px 1px 4px grey;\n box-sizing: border-box;\n\n width: 100%;\n\n margin-bottom: 10px;\n\n &[data-packed] {\n opacity: 1;\n }\n\n &.card-enter,\n &.card-appear {\n opacity: 0.01;\n }\n\n &.card-enter.card-enter-active,\n &.card-appear.card-appear-active {\n opacity: 1;\n transition: opacity 0.75s ease-in;\n }\n\n @media all and (min-width: ","px) {\n transition: opacity 0.75s ease-in;\n opacity: 0;\n width: ","px;\n }\n\n @media all and (min-width: ","px) {\n width: ","px;\n }\n\n @media all and (min-width: ","px) {\n width: ","px;\n }\n\n @media all and (min-width: ","px) {\n width: ","px;\n }\n }\n"],["\n &.card {\n display: flex;\n background-color: white;\n box-shadow: 1px 1px 4px grey;\n box-sizing: border-box;\n\n width: 100%;\n\n margin-bottom: 10px;\n\n &[data-packed] {\n opacity: 1;\n }\n\n &.card-enter,\n &.card-appear {\n opacity: 0.01;\n }\n\n &.card-enter.card-enter-active,\n &.card-appear.card-appear-active {\n opacity: 1;\n transition: opacity 0.75s ease-in;\n }\n\n @media all and (min-width: ","px) {\n transition: opacity 0.75s ease-in;\n opacity: 0;\n width: ","px;\n }\n\n @media all and (min-width: ","px) {\n width: ","px;\n }\n\n @media all and (min-width: ","px) {\n width: ","px;\n }\n\n @media all and (min-width: ","px) {\n width: ","px;\n }\n }\n"])),minScreenSize.small,cardWidthS,minScreenSize.medium,cardWidthM,minScreenSize.large,cardWidthL,minScreenSize.xLarge,cardWidthXL);_styled.article.withConfig({displayName:"Card__Article",componentId:"sc-1m8ygh-1"})(templateObject_3$l||(templateObject_3$l=__makeTemplateObject(["\n position: relative;\n display: flex;\n flex-direction: column;\n width: 100%;\n\n ","\n\n > .card-banner {\n height: calc(((100vw - ","px) * (1 / ",")));\n flex: 0 1 auto;\n }\n\n .card-title {\n margin-top: 7px;\n margin-bottom: 0;\n font-size: 1.1em;\n }\n\n .card-metaInfo {\n font-size: 0.9em;\n }\n\n .card-metaInfo {\n padding-top: ","px;\n color: #666;\n }\n\n @media all and (min-width: ","px) {\n > .card-banner {\n height: calc(","px * (1 / ","));\n }\n\n .card-title {\n margin-top: 7px;\n font-size: 1.3em;\n }\n\n .card-metaInfo {\n font-size: 0.9em;\n }\n }\n\n @media all and (min-width: ","px) {\n > .card-banner {\n height: calc(","px * (1 / ","));\n }\n\n @media all and (min-width: ","px) {\n > .card-banner {\n height: calc(","px * (1 / ","));\n }\n }\n\n @media all and (min-width: ","px) {\n > .card-banner {\n height: calc(","px * (1 / ","));\n }\n }\n }\n"],["\n position: relative;\n display: flex;\n flex-direction: column;\n width: 100%;\n\n ","\n\n > .card-banner {\n height: calc(((100vw - ","px) * (1 / ",")));\n flex: 0 1 auto;\n }\n\n .card-title {\n margin-top: 7px;\n margin-bottom: 0;\n font-size: 1.1em;\n }\n\n .card-metaInfo {\n font-size: 0.9em;\n }\n\n .card-metaInfo {\n padding-top: ","px;\n color: #666;\n }\n\n @media all and (min-width: ","px) {\n > .card-banner {\n height: calc(","px * (1 / ","));\n }\n\n .card-title {\n margin-top: 7px;\n font-size: 1.3em;\n }\n\n .card-metaInfo {\n font-size: 0.9em;\n }\n }\n\n @media all and (min-width: ","px) {\n > .card-banner {\n height: calc(","px * (1 / ","));\n }\n\n @media all and (min-width: ","px) {\n > .card-banner {\n height: calc(","px * (1 / ","));\n }\n }\n\n @media all and (min-width: ","px) {\n > .card-banner {\n height: calc(","px * (1 / ","));\n }\n }\n }\n"])),function(p){return p.highlight&&css$2(templateObject_2$s||(templateObject_2$s=__makeTemplateObject(["\n &::after {\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n width: ","px;\n display: block;\n background-color: ",";\n }\n "],["\n &::after {\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n width: ","px;\n display: block;\n background-color: ",";\n }\n "])),spacingXs,function(p){return p.theme.palette.accent;});},spacingM,bannerAspectRatio,spacingM,minScreenSize.small,cardWidthS,bannerAspectRatio,minScreenSize.medium,cardWidthM,bannerAspectRatio,minScreenSize.large,cardWidthL,bannerAspectRatio,minScreenSize.xLarge,cardWidthXL,bannerAspectRatio);var templateObject_1$N,templateObject_2$s,templateObject_3$l;var LanguageSelector=function LanguageSelector(props){var history=useHistory();var currentUser=useCurrentUser();var buildPath=useSubscriptionHandlePathBuilder().buildPath;var getAllLanguagesLocalized=useLanguageApi().getAllLanguagesLocalized;var intl=useIntl();var formatMessage=intl.formatMessage;var languageDefinitions=usePromise$2(function(){return getAllLanguagesLocalized(intl);})[0];var features=useFeatures();if(languageDefinitions==null){return null;}if(props.chromeless)return jsx$1(ActionButton,__assign({iconProps:{iconName:'World'},menuProps:{items:getContextualMenuItems(),className:'lt-reach-contextual-menu'},className:classNames(props.className,'header-button')},{children:formatMessage({id:"Generic.languages."+props.selectedLanguage})}),void 0);return jsx$1(Tooltip,__assign({resourceKey:"Generic.translate"},{children:jsx$1(LanguageSelectorButton,{menuIconProps:{iconName:'World'},menuProps:{items:getContextualMenuItems(),className:'lt-reach-contextual-menu',isBeakVisible:props.showBeak},className:classNames(props.className,'header-button'),"data-language-selector-button":true,ariaLabel:formatMessage({id:'AriaLabel.autoTranslation'})},void 0)}),void 0);function getContextualMenuItems(){if(props.languages==null){return [];}var menuItems=[];var preferredLanguageItem=getPreferredLanguageItem();if(preferredLanguageItem){menuItems.push(preferredLanguageItem);}var activeLanguagesItems=getActiveLanguagesItems();activeLanguagesItems.sort(function(a,b){return a.text.localeCompare(b.text);});menuItems=menuItems.concat(activeLanguagesItems);if(!props.hideEditLanguagePreferences){var editLanguagePreferencesItem={key:'edit',text:formatMessage({id:'Generic.editLanguagePreferences'}),iconProps:{iconName:'PlayerSettings'},onClick:handleEditLanguagePreferences,className:'lt-reach-languageselector-menu-item'};menuItems.push(editLanguagePreferencesItem);}return menuItems;}function handleEditLanguagePreferences(){if(props.onEditLanguagePreferencesClick){props.onEditLanguagePreferencesClick();}else {history.push(buildPath('/user'));}}function getActiveLanguagesItems(){return props.languages.map(function(l){var fullLanguage=languageDefinitions.find(function(ld){return ld.code===l;});return {key:l,text:fullLanguage.localizedName,iconProps:{iconName:'World'},onClick:function(){return props.onLanguageChange(l.toString());},className:classNames('lt-reach-languageselector-menu-item',l===props.selectedLanguage&&'selected')};});}function getPreferredLanguageItem(){if(!features.automaticTranslation){return null;}if(!props.onTranslateClick){return null;}var preferredContentLanguage=getPreferredContentLanguage(currentUser);var shouldAddPreferredContentLanguage=preferredContentLanguage!=null&&!contentLanguagesWithoutAutomaticTranslation.includes(preferredContentLanguage)&&allAvailableContentLanguages.includes(preferredContentLanguage)&&props.languages.indexOf(preferredContentLanguage)<0;if(!shouldAddPreferredContentLanguage){return null;}return {key:preferredContentLanguage,text:formatMessage({id:'Generic.automaticTranslation'},{language:formatMessage({id:"Generic.languages."+preferredContentLanguage})}),iconProps:{iconName:'Robot'},onClick:function(){return props.onTranslateClick(preferredContentLanguage);},className:classNames('lt-reach-languageselector-menu-item',preferredContentLanguage===props.selectedLanguage&&'selected')};}};var LanguageSelectorButton=_styled(IconButton).withConfig({displayName:"LanguageSelector__LanguageSelectorButton",componentId:"sc-48zwek-0"})(templateObject_1$M||(templateObject_1$M=__makeTemplateObject(["\n && {\n height: 100%;\n margin: 0;\n background-color: transparent;\n }\n"],["\n && {\n height: 100%;\n margin: 0;\n background-color: transparent;\n }\n"])));var templateObject_1$M;_styled.article.withConfig({displayName:"DetailViewArticle__Host",componentId:"sc-we2q7z-0"})(templateObject_1$L||(templateObject_1$L=__makeTemplateObject(["\n min-width: 300px;\n width: 100%;\n\n flex: 1 0 auto;\n display: flex;\n flex-flow: column nowrap;\n\n @media (min-width: ","px) {\n box-shadow: 1px 1px 4px grey;\n max-width: ","px;\n }\n"],["\n min-width: 300px;\n width: 100%;\n\n flex: 1 0 auto;\n display: flex;\n flex-flow: column nowrap;\n\n @media (min-width: ","px) {\n box-shadow: 1px 1px 4px grey;\n max-width: ","px;\n }\n"])),minScreenSize.large+1,maxContentWidth);var templateObject_1$L;var DetailViewBanner=function DetailViewBanner(){var _a=useDetailViewContext(),item=_a.item,resourceType=_a.resourceType,isEditorPreview=_a.isEditorPreview;if(!item.bannerInfo){return null;}return jsx$1(Banner$3,{itemId:item.id,token:item.fileAccessToken,bannerInfo:item.bannerInfo,useEditorRoutes:isEditorPreview,width:getMaxImageWidth(),canOpenImage:true,resourceType:resourceType},void 0);};var Banner$3=_styled(PublishableItemBanner).withConfig({displayName:"DetailViewBanner__Banner",componentId:"sc-1wuqvtw-0"})(templateObject_1$K||(templateObject_1$K=__makeTemplateObject(["\n && {\n height: calc(100vw * (1 / ","));\n\n @media (min-width: ","px) {\n height: calc(\n (","px - (2 * ","px)) *\n (1 / ",")\n );\n }\n }\n"],["\n && {\n height: calc(100vw * (1 / ","));\n\n @media (min-width: ","px) {\n height: calc(\n (","px - (2 * ","px)) *\n (1 / ",")\n );\n }\n }\n"])),bannerAspectRatio,minScreenSize.large+1,minScreenSize.large,spacingM,bannerAspectRatio);var templateObject_1$K;var DetailViewIntro=function DetailViewIntro(){var content=useDetailViewContext().content;var hasIntro=content.intro&&content.intro.length>0;if(!hasIntro){return null;}return jsx$1(DetailIntro,{children:content.intro},void 0);};var DetailIntro=_styled.p.withConfig({displayName:"DetailViewIntro__DetailIntro",componentId:"sc-1kubhyf-0"})(templateObject_1$J||(templateObject_1$J=__makeTemplateObject(["\n margin: 0;\n font-size: ","px;\n line-height: 26px;\n font-weight: normal;\n\n min-width: 100%;\n width: 100px;\n\n @media (min-width: ","px) {\n margin-top: ","px;\n margin-bottom: ","px;\n line-height: 24px;\n font-size: ","px;\n }\n"],["\n margin: 0;\n font-size: ","px;\n line-height: 26px;\n font-weight: normal;\n\n min-width: 100%;\n width: 100px;\n\n @media (min-width: ","px) {\n margin-top: ","px;\n margin-bottom: ","px;\n line-height: 24px;\n font-size: ","px;\n }\n"])),fontSizeNormal,minScreenSize.small,spacingS,spacingS+2,fontSizeMedium+2);var templateObject_1$J;var DetailMainSection=function DetailMainSection(_a){var children=_a.children;return jsx$1(DetailMainStyledSection,__assign({className:"detail-view-main"},{children:children}),void 0);};var DetailMainStyledSection=_styled.section.withConfig({displayName:"DetailViewMainSection__DetailMainStyledSection",componentId:"sc-ifywhg-0"})(templateObject_1$I||(templateObject_1$I=__makeTemplateObject(["\n position: relative;\n flex: 1 0 auto;\n display: flex;\n flex-direction: column;\n padding: ","px ","px\n ","px;\n font-size: 16px;\n\n @media (min-width: ","px) {\n padding: ","px\n ","px ","px;\n }\n"],["\n position: relative;\n flex: 1 0 auto;\n display: flex;\n flex-direction: column;\n padding: ","px ","px\n ","px;\n font-size: 16px;\n\n @media (min-width: ","px) {\n padding: ","px\n ","px ","px;\n }\n"])),detailViewSectionPadding-5,detailViewSectionPadding,detailViewSectionPadding,minScreenSize.small,detailViewSectionPaddingLarge-10,detailViewSectionPaddingLarge,detailViewSectionPaddingLarge);var templateObject_1$I;var GutterMarkerIcon=function GutterMarkerIcon(_a){var iconName=_a.iconName,children=_a.children,isActive=_a.isActive,color=_a.color,tooltipResourceKey=_a.tooltipResourceKey,className=_a.className;return jsxs(Host$g$1,__assign({className:className},{children:[jsx$1(IconContainer$1,__assign({isActive:isActive,className:isActive?"ms-bgColor-"+color:'ms-bgColor-white'},{children:isActive&&jsx$1(StyledTooltip,__assign({resourceKey:tooltipResourceKey},{children:jsx$1(StyledIcon$2$1,{className:"ms-fontColor-white",iconName:iconName},void 0)}),void 0)}),void 0),isActive?jsx$1(ActiveContent,__assign({className:"ms-borderColor-"+color},{children:children}),void 0):jsx$1(Content$3,{children:children},void 0)]}),void 0);};var Host$g$1=_styled.div.withConfig({displayName:"GutterMakerIcon__Host",componentId:"sc-aa2cf4-0"})(templateObject_1$H||(templateObject_1$H=__makeTemplateObject(["\n margin: 0;\n display: flex;\n align-content: center;\n"],["\n margin: 0;\n display: flex;\n align-content: center;\n"])));var StyledIcon$2$1=_styled(Icon).withConfig({displayName:"GutterMakerIcon__StyledIcon",componentId:"sc-aa2cf4-1"})(templateObject_2$r||(templateObject_2$r=__makeTemplateObject(["\n font-size: 25px;\n"],["\n font-size: 25px;\n"])));var Content$3=_styled.div.withConfig({displayName:"GutterMakerIcon__Content",componentId:"sc-aa2cf4-2"})(templateObject_3$k||(templateObject_3$k=__makeTemplateObject(["\n flex: 1 1 auto;\n flex-basis: 100%; /*IE fix*/\n\n display: flex;\n align-items: center;\n\n box-sizing: border-box;\n"],["\n flex: 1 1 auto;\n flex-basis: 100%; /*IE fix*/\n\n display: flex;\n align-items: center;\n\n box-sizing: border-box;\n"])));var ActiveContent=_styled(Content$3).withConfig({displayName:"GutterMakerIcon__ActiveContent",componentId:"sc-aa2cf4-3"})(templateObject_4$b$1||(templateObject_4$b$1=__makeTemplateObject(["\n padding-left: 10px;\n min-height: 50px;\n\n border-bottom-style: solid;\n border-bottom-width: 4px;\n"],["\n padding-left: 10px;\n min-height: 50px;\n\n border-bottom-style: solid;\n border-bottom-width: 4px;\n"])));var IconContainer$1=_styled.div.withConfig({displayName:"GutterMakerIcon__IconContainer",componentId:"sc-aa2cf4-4"})(templateObject_5$a$1||(templateObject_5$a$1=__makeTemplateObject(["\n flex-grow: 0;\n flex-shrink: 0;\n flex-basis: ",";\n\n display: flex;\n justify-content: center;\n align-items: center;\n\n padding: 10px 0;\n"],["\n flex-grow: 0;\n flex-shrink: 0;\n flex-basis: ",";\n\n display: flex;\n justify-content: center;\n align-items: center;\n\n padding: 10px 0;\n"])),function(_a){var isActive=_a.isActive;return isActive?'50px':'auto';});var StyledTooltip=_styled(Tooltip).withConfig({displayName:"GutterMakerIcon__StyledTooltip",componentId:"sc-aa2cf4-5"})(templateObject_6$4$1||(templateObject_6$4$1=__makeTemplateObject(["\n && {\n display: inherit;\n }\n"],["\n && {\n display: inherit;\n }\n"])));var templateObject_1$H,templateObject_2$r,templateObject_3$k,templateObject_4$b$1,templateObject_5$a$1,templateObject_6$4$1;var DetailViewTitle=function DetailViewTitle(){var _a=useDetailViewContext(),content=_a.content,item=_a.item;var hasAlert=hasFlag(item.knownState,KnownNewsState.Alert);return jsx$1(GutterMarkerIcon,__assign({iconName:"Warning",isActive:hasAlert,color:"red",tooltipResourceKey:"NewsArticle.alert"},{children:jsx$1(Title$5,__assign({"data-title":true},{children:content.title}),void 0)}),void 0);};var Title$5=_styled.h1.withConfig({displayName:"DetailViewTitle__Title",componentId:"sc-1jbzvna-0"})(templateObject_1$G||(templateObject_1$G=__makeTemplateObject(["\n color: black;\n width: 100%;\n font-size: ","px;\n line-height: 29px;\n margin: 0;\n\n @media (min-width: ","px) {\n font-size: 2.2em;\n line-height: 42px;\n }\n"],["\n color: black;\n width: 100%;\n font-size: ","px;\n line-height: 29px;\n margin: 0;\n\n @media (min-width: ","px) {\n font-size: 2.2em;\n line-height: 42px;\n }\n"])),fontSizeLarge-1,minScreenSize.small);var templateObject_1$G;_styled(ItemMetaInfo).withConfig({displayName:"NewsDetailViewMetaInfo__DetailMetaInfo",componentId:"sc-kib7we-0"})(templateObject_1$F||(templateObject_1$F=__makeTemplateObject(["\n display: flex;\n font-size: ","px;\n margin-top: 12px;\n"],["\n display: flex;\n font-size: ","px;\n margin-top: 12px;\n"])),fontSizeSmall);var templateObject_1$F;var mappers=[InlineImageMapper,InlineFileMapper,InlineQuoteMapper,InlineGalleryMapper,InlineCodeMapper,InlineVideoMapper,InlineTable,InlineContactMapper,InlinePageListMapper,InlineUrlPreviewMapper,InlineActionButtonMapper];var RichTextViewer=function RichTextViewer(_a){var html=_a.html;return jsx$1(TextViewer,{html:html,componentMappers:mappers},void 0);};var DetailViewBody=function DetailViewBody(){var _a=useDetailViewContext(),content=_a.content,resourceType=_a.resourceType;var bodyHtml=content&&content.body;return jsx$1(DetailBody$1,__assign({className:"lt-reach-detail-view-body","data-item-type":resourceType},{children:jsx$1(ItemBodyWrapper,{children:jsx$1(RichTextViewer,{html:bodyHtml},void 0)},void 0)}),void 0);};var DetailBody$1=_styled.div.withConfig({displayName:"DetailViewBody__DetailBody",componentId:"sc-7b4trq-0"})(templateObject_1$E||(templateObject_1$E=__makeTemplateObject(["\n flex: 1 0 auto;\n box-sizing: border-box;\n min-width: 100%;\n width: 100px;\n margin-top: 35px;\n\n // So that headings have the correct semantics for accessibility (i.e. title is h1, subheadings start at h2),\n // but maintain the same visual design, this styles each heading to look one \"step\" larger\n // e.g. h2 looks like h1, etc.\n && {\n h2 {\n font-size: ","px;\n margin: ","px 0;\n }\n\n h3 {\n font-size: ","px;\n }\n\n h4 {\n font-size: ","px;\n }\n\n h3,\n h4,\n h5,\n h6 {\n margin: ","px 0;\n }\n }\n"],["\n flex: 1 0 auto;\n box-sizing: border-box;\n min-width: 100%;\n width: 100px;\n margin-top: 35px;\n\n // So that headings have the correct semantics for accessibility (i.e. title is h1, subheadings start at h2),\n // but maintain the same visual design, this styles each heading to look one \"step\" larger\n // e.g. h2 looks like h1, etc.\n && {\n h2 {\n font-size: ","px;\n margin: ","px 0;\n }\n\n h3 {\n font-size: ","px;\n }\n\n h4 {\n font-size: ","px;\n }\n\n h3,\n h4,\n h5,\n h6 {\n margin: ","px 0;\n }\n }\n"])),fontSizeLarge-1,spacingS+2,fontSizeLarge-3,fontSizeLarge-5,spacingS);var templateObject_1$E;var DetailViewKeywords=function DetailViewKeywords(_a){var filterBaseUrl=_a.filterBaseUrl;var features=useFeatures();var _b=useDetailViewContext(),item=_b.item,userPreferredLanguage=_b.userPreferredLanguage;var formatMessage=useIntl().formatMessage;if(!features.keywords){return null;}return jsx$1(Fragment,{children:Object.keys(item.keywords).length>0&&jsx$1(KeywordsSection,__assign({"aria-label":formatMessage({id:'AriaLabel.section.keywords'})},{children:jsx$1(KeywordsInfo,{keywords:item.keywords,language:userPreferredLanguage,filterBaseUrl:filterBaseUrl},void 0)}),void 0)},void 0);};var KeywordsSection=_styled.section.withConfig({displayName:"DetailViewKeywords__KeywordsSection",componentId:"sc-ltysu4-0"})(templateObject_1$D||(templateObject_1$D=__makeTemplateObject(["\n margin-top: 2em;\n display: flex;\n\n @media (max-width: ","px) {\n font-size: ","px;\n }\n"],["\n margin-top: 2em;\n display: flex;\n\n @media (max-width: ","px) {\n font-size: ","px;\n }\n"])),maxScreenSize.medium,fontSizeSmall);var templateObject_1$D;var ConfirmationBox=function ConfirmationBox(_a){var disabled=_a.disabled,checked=_a.checked,onChange=_a.onChange;var formatMessage=useIntl().formatMessage;return jsx$1(Host$f$1,{children:jsx$1(NeutralCheckBox,{disabled:disabled,checked:checked,onChange:function(_,value){return onChange(value);},label:formatMessage({id:checked?'NewsArticle.confirmed':'NewsArticle.confirm'})},void 0)},void 0);};var Host$f$1=_styled.div.withConfig({displayName:"ConfirmationBox__Host",componentId:"sc-1m5alil-0"})(templateObject_1$C||(templateObject_1$C=__makeTemplateObject(["\n .ms-Checkbox-text {\n font-weight: bold;\n color: black;\n }\n"],["\n .ms-Checkbox-text {\n font-weight: bold;\n color: black;\n }\n"])));var templateObject_1$C;var ConfirmationSection=function ConfirmationSection(_a){var item=_a.item,showDescription=_a.showDescription,readOnly=_a.readOnly,className=_a.className;var refreshStatistics=useNewsApi().refreshStatistics;var _b=useNotificationContext(),dismissToast=_b.dismissToast,showToast=_b.showToast,showError=_b.showError;var _c=useFeedbackApi(),getFeedback=_c.getFeedback,setFeedback=_c.setFeedback,unsetFeedback=_c.unsetFeedback;var _d=usePromise$2(function(){return getFeedback(ItemResourceTypes.News,item.id);}),summary=_d[0],isLoading=_d[1];var _e=useState$2(null),userChecked=_e[0],setChecked=_e[1];var toastHandle=useRef$1(null);var checked=userChecked!==null?userChecked:summary!=null&&!!summary.records.find(function(r){return r.type==='confirm';});return jsxs(Host$e$1,__assign({isLoading:isLoading,className:className},{children:[showDescription&&jsx$1(FormattedMessage$1,{id:"NewsArticle.confirmationRequiredDescription",tagName:"p"},void 0),jsx$1(StyledGutterMarkerIcon,__assign({iconName:"Completed",isActive:!isLoading&&!checked,color:"green"},{children:readOnly?jsx$1(ConfirmationBox,{checked:checked,disabled:true},void 0):jsx$1(ConfirmationBox,{checked:checked,disabled:checked,onChange:handleClickConfirm},void 0)}),void 0)]}),void 0);function handleClickConfirm(){return __awaiter(this,void 0,void 0,function(){var error_1;return __generator(this,function(_a){switch(_a.label){case 0:setChecked(true);_a.label=1;case 1:_a.trys.push([1,4,,5]);return [4/*yield*/,setFeedback(ItemResourceTypes.News,item.id,'confirm')];case 2:_a.sent();toastHandle.current=showToast('NewsArticle.confirmationSuccessToast',{},jsx$1(DefaultButton,__assign({onClick:handleUndo},{children:jsx$1(FormattedMessage$1,{id:"Generic.undo"},void 0)}),void 0),{autoClose:false});return [4/*yield*/,refreshStatistics(item.id,{confirmationCount:1})];case 3:_a.sent();return [3/*break*/,5];case 4:error_1=_a.sent();logger.error(error_1);showError('Generic.error');setChecked(false);return [3/*break*/,5];case 5:return [2/*return*/];}});});}function handleUndo(){return __awaiter(this,void 0,void 0,function(){var error_2;return __generator(this,function(_a){switch(_a.label){case 0:_a.trys.push([0,3,,4]);dismissToast(toastHandle.current);toastHandle.current=null;return [4/*yield*/,unsetFeedback(ItemResourceTypes.News,item.id,'confirm')];case 1:_a.sent();return [4/*yield*/,refreshStatistics(item.id,{confirmationCount:-1})];case 2:_a.sent();setChecked(false);return [3/*break*/,4];case 3:error_2=_a.sent();logger.error(error_2);showError('Generic.error');return [3/*break*/,4];case 4:return [2/*return*/];}});});}};var Host$e$1=_styled.div.withConfig({displayName:"ConfirmationSection__Host",componentId:"sc-1g2fxdb-0"})(templateObject_1$B||(templateObject_1$B=__makeTemplateObject(["\n width: 100%;\n\n opacity: ",";\n\n > p {\n margin: 0 0 5px ","px;\n font-style: italic;\n }\n\n @media (min-width: ","px) {\n > p {\n margin: 0 0 ","px 0;\n }\n }\n\n @media (max-width: ","px) {\n font-size: ","px;\n }\n"],["\n width: 100%;\n\n opacity: ",";\n\n > p {\n margin: 0 0 5px ","px;\n font-style: italic;\n }\n\n @media (min-width: ","px) {\n > p {\n margin: 0 0 ","px 0;\n }\n }\n\n @media (max-width: ","px) {\n font-size: ","px;\n }\n"])),function(_a){var isLoading=_a.isLoading;return isLoading?0.4:1;},spacingM,minScreenSize.small,spacingS,maxScreenSize.medium,fontSizeSmall);var StyledGutterMarkerIcon=_styled(GutterMarkerIcon).withConfig({displayName:"ConfirmationSection__StyledGutterMarkerIcon",componentId:"sc-1g2fxdb-1"})(templateObject_2$q||(templateObject_2$q=__makeTemplateObject(["\n @media (max-width: ","px) {\n margin: 0 ","px 0;\n }\n"],["\n @media (max-width: ","px) {\n margin: 0 ","px 0;\n }\n"])),maxScreenSize.small,spacingM);var templateObject_1$B,templateObject_2$q;var DetailViewConfirmations=function DetailViewConfirmations(){var features=useFeatures();var _a=useDetailViewContext(),item=_a.item,isEditorPreview=_a.isEditorPreview;var formatMessage=useIntl().formatMessage;if(!showConfirmationBox()){return null;}return jsx$1(ConfirmationHost,__assign({"aria-label":formatMessage({id:'NewsArticle.confirmation'})},{children:jsx$1(ConfirmationSection,{item:item,showDescription:true,readOnly:isEditorPreview},void 0)}),void 0);function showConfirmationBox(){return features.confirmation&&item.metadata&&item.metadata.feedbackSettings&&item.metadata.feedbackSettings.feedbackOptions.indexOf('confirm')>=0;}};var ConfirmationHost=_styled.section.withConfig({displayName:"DetailViewConfirmations__ConfirmationHost",componentId:"sc-f8jogv-0"})(templateObject_1$A||(templateObject_1$A=__makeTemplateObject(["\n margin-bottom: ","px;\n\n @media (min-width: ","px) {\n padding: 0 ","px 0 ","px;\n }\n"],["\n margin-bottom: ","px;\n\n @media (min-width: ","px) {\n padding: 0 ","px 0 ","px;\n }\n"])),spacingL,minScreenSize.small,spacingXl,spacingXl);var templateObject_1$A;var DetailViewPageViewTracker=function DetailViewPageViewTracker(){var _a=useDetailViewContext(),resourceType=_a.resourceType,itemId=_a.itemId;usePageViewTracker(resourceType,itemId);return null;};var FeedbackButtonBookmark=function FeedbackButtonBookmark(_a){var isReadOnly=_a.isReadOnly;var _b=useContext(FeedbackButtonContext),item=_b.item,bookmarkCount=_b.statistics.bookmarkCount;return jsxs(CountButtonHost,{children:[jsx$1(BookmarkButton,{item:item,isReadOnly:isReadOnly},void 0),jsx$1(StyledCountLabel,__assign({isDisabled:isReadOnly},{children:bookmarkCount}),void 0)]},void 0);};var StyledCountLabel=_styled(CountLabel).withConfig({displayName:"FeedbackButtonBookmark__StyledCountLabel",componentId:"sc-1ac9lm2-0"})(templateObject_1$z||(templateObject_1$z=__makeTemplateObject(["\n margin-left: 0;\n"],["\n margin-left: 0;\n"])));var templateObject_1$z;var NewsDetailViewFeedbackSection=function NewsDetailViewFeedbackSection(_a){var _b;var hideLikes=_a.hideLikes,hideComments=_a.hideComments,hideProfileUrl=_a.hideProfileUrl,disableLoginForPublicUser=_a.disableLoginForPublicUser;var _c=useDetailViewContext(),item=_c.item,resourceType=_c.resourceType,contentLanguage=_c.contentLanguage,isEditorPreview=_c.isEditorPreview;return jsxs(StyledFeedbackSection,__assign({item:item,language:contentLanguage,type:resourceType,feedbackSettings:(_b=item.metadata)===null||_b===void 0?void 0:_b.feedbackSettings,hideComments:hideComments,hideProfileUrl:hideProfileUrl,disableLoginForPublicUser:disableLoginForPublicUser,isReadOnly:isEditorPreview},{children:[!hideLikes&&jsx$1(FeedbackButtonLike,{isReadOnly:isEditorPreview},void 0),jsx$1(FeedbackButtonBookmark,{isReadOnly:isEditorPreview},void 0),!hideComments&&jsx$1(FeedbackButtonComments,{},void 0),jsx$1(FeedbackButtonViews,{},void 0),jsx$1(FeedbackButtonShare,{isReadOnly:isEditorPreview},void 0),jsx$1(FeedbackButtonConfirmations,{},void 0)]}),void 0);};var StyledFeedbackSection=_styled(FeedbackSection).withConfig({displayName:"NewsDetailViewFeedbackSection__StyledFeedbackSection",componentId:"sc-pjpy6x-0"})(templateObject_1$y||(templateObject_1$y=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),DetailViewSectionPadding);var templateObject_1$y;var DetailViewBodyExternalContent=function DetailViewBodyExternalContent(_a){var itemType=_a.itemType;var content=useDetailViewContext().content;var externalUrl=content&&content.externalUrl;return jsx$1(DetailBody,__assign({className:"lt-reach-detail-view-body"},{children:jsx$1(ItemBodyWrapper,{children:jsx$1(FormattedMessageWithStyle,{id:"ExternalLink."+itemType+".navigateTo",tagName:"p",values:{url:jsx$1(ExternalLink$2,__assign({href:externalUrl,className:"ms-fontColor-accent",target:"_blank",rel:"noopener noreferrer"},{children:externalUrl}),void 0)}},void 0)},void 0)}),void 0);};var DetailBody=_styled.div.withConfig({displayName:"DetailViewBodyExternalContent__DetailBody",componentId:"sc-1xjgw89-0"})(templateObject_1$x||(templateObject_1$x=__makeTemplateObject(["\n flex: 1 0 auto;\n box-sizing: border-box;\n min-width: 100%;\n width: 100px;\n margin-top: 35px;\n"],["\n flex: 1 0 auto;\n box-sizing: border-box;\n min-width: 100%;\n width: 100px;\n margin-top: 35px;\n"])));var templateObject_1$x;var DetailViewHeadline=function DetailViewHeadline(){var content=useDetailViewContext().content;var features=useFeatures();if(!features.contentHeadline||!content.headline){return null;}return jsx$1(Headline$1$1,__assign({"data-detail-view-headline":true},{children:content.headline}),void 0);};var Headline$1$1=_styled.p.withConfig({displayName:"DetailViewHeadline__Headline",componentId:"sc-wsid06-0"})(templateObject_1$w||(templateObject_1$w=__makeTemplateObject(["\n width: 100%;\n font-weight: bold;\n font-size: ","px;\n line-height: 26px;\n margin: 0;\n\n @media (min-width: ","px) {\n line-height: 22px;\n font-size: ","px;\n margin-bottom: ","px;\n }\n"],["\n width: 100%;\n font-weight: bold;\n font-size: ","px;\n line-height: 26px;\n margin: 0;\n\n @media (min-width: ","px) {\n line-height: 22px;\n font-size: ","px;\n margin-bottom: ","px;\n }\n"])),fontSizeNormal,minScreenSize.small,fontSizeMedium,spacingS);var templateObject_1$w;var StateIcon=function StateIcon(_a){var status=_a.status,isActive=_a.isActive,_b=_a.width,width=_b===void 0?16:_b,activeColor=_a.activeColor;var textColors=useContext(ThemeContext$1).theme.textColors;if(status===WorkflowStatus.draft){return jsx$1(Draft,{width:width,color:isActive?activeColor||textColors.onSecondary:textColors.default},void 0);}else if(status===WorkflowStatus.rejected){return jsx$1(Draft,{width:width,color:isActive?activeColor:'#b90000'},void 0);}else if(status===WorkflowStatus.ready){return jsx$1(Ready,{width:width,color:isActive?activeColor||textColors.onSecondary:textColors.default},void 0);}return null;};var Draft=function Draft(_a){var color=_a.color,className=_a.className,_b=_a.width,width=_b===void 0?16.25:_b;var ratio=20/16.25;return jsx$1("svg",__assign({className:className,version:"1.1",id:"Layer_1",x:"0px",y:"0px",width:width+"px",height:width*ratio+"px",viewBox:"0 0 16.25 20",enableBackground:"new 0 0 16.25 20"},{children:jsx$1("path",{fill:color,d:"M10,6.25V0h0.89l5.36,5.361V6.25H10z M11.25,5h2.861L11.25,2.139V5z M10,0H9.25v1.25H10V0z M7.675,1.25H6.1\n\tV0h1.575V1.25z M4.525,1.25H2.95V0h1.575V1.25z M1.25,17.057H0v-1.567h1.25V17.057z M1.25,13.921H0v-1.568h1.25V13.921z\n\t M1.25,10.784H0V9.216h1.25V10.784z M1.25,7.647H0V6.08h1.25V7.647z M1.25,4.512H0V2.943h1.25V4.512z M13.375,\n\t 20h-1.5v-1.25h1.5V20z\n\t M10.375,20h-1.5v-1.25h1.5V20z M7.375,20h-1.5v-1.25h1.5V20z M4.375,20h-1.5v-1.25h1.5V20z M16.25,\n\t 16.964H15v-1.661h1.25V16.964z\n\t M16.25,13.643H15v-1.661h1.25V13.643z M16.25,10.321H15V8.66h1.25V10.321z M16.25,6.25H15V7h1.25V6.25z\n\t M1.25,18.75H0V20h1.25\n\tV18.75z M1.25,0H0v1.25h1.25V0z M16.25,18.75H15V20h1.25V18.75z"},void 0)}),void 0);};var Ready=function Ready(_a){var color=_a.color,className=_a.className,_b=_a.width,width=_b===void 0?18.564:_b;var ratio=20/18.564;return jsx$1("svg",__assign({className:className,version:"1.1",id:"Layer_1",x:"0px",y:"0px",width:width+"px",height:width*ratio+"px",viewBox:"0 0 18.564 20",enableBackground:"new 0 0 18.564 20"},{children:jsx$1("path",{fill:color,d:"M10,6.25v-5H1.25v17.5H10V20H0V0h10.889l5.361,5.361V12.5L15,13.75v-7.5H10z M18.564,14.551L13.125,20\n \tl-2.627-2.637l0.879-0.879l1.748,1.738l4.561-4.551L18.564,14.551z M11.25,5h2.861L11.25,2.139V5z"},void 0)}),void 0);};function useCommonEditorApi(){var api=useApi();return useMemo(function(){return {list:list,getTaskViewCounts:getTaskViewCounts};function list(type,filter,token,sortDefinition){var params=Object.assign({},__assign(__assign(__assign({},filter),getCommaSeparatedChannelsString(filter===null||filter===void 0?void 0:filter.channels)),getCommaSeparatedKeywordsString(filter===null||filter===void 0?void 0:filter.keywords)),{token:token},sortDefinition);return api.custom("editor/"+type+"?"+queryString.stringify(params)).get().then(function(res){return res.body().data();});}function getTaskViewCounts(type,groupId){return __awaiter(this,void 0,void 0,function(){var response;return __generator(this,function(_a){switch(_a.label){case 0:return [4/*yield*/,api.custom("editor/"+type+"/taskcounts?"+queryString.stringify({groupId:groupId})).get(groupId)];case 1:response=_a.sent();return [4/*yield*/,response.body().data()];case 2:return [2/*return*/,_a.sent()];}});});}},[api]);}var $$g=_export;var requireObjectCoercible$c=requireObjectCoercible$b;var isRegExp=isRegexp;var getRegExpFlags=regexpFlags$1$1;var wellKnownSymbol$m=wellKnownSymbol$l;var REPLACE$2=wellKnownSymbol$m('replace');var RegExpPrototype$3=RegExp.prototype;// `String.prototype.replaceAll` method
122344
122341
  // https://github.com/tc39/proposal-string-replace-all
122345
122342
  $$g({target:'String',proto:true},{replaceAll:function replaceAll(searchValue,replaceValue){var O=requireObjectCoercible$c(this);var IS_REG_EXP,flags,replacer,string,searchString,template,result,position,index;if(searchValue!=null){IS_REG_EXP=isRegExp(searchValue);if(IS_REG_EXP){flags=String(requireObjectCoercible$c('flags'in RegExpPrototype$3?searchValue.flags:getRegExpFlags.call(searchValue)));if(!~flags.indexOf('g'))throw TypeError('`.replaceAll` does not allow non-global regexes');}replacer=searchValue[REPLACE$2];if(replacer!==undefined){return replacer.call(searchValue,O,replaceValue);}}string=String(O);searchString=String(searchValue);if(searchString==='')return replaceAll.call(string,/(?:)/g,replaceValue);template=string.split(searchString);if(typeof replaceValue!=='function'){return template.join(String(replaceValue));}result=template[0];position=result.length;for(index=1;index<template.length;index++){result+=String(replaceValue(searchString,position,string));position+=searchString.length+template[index].length;result+=template[index];}return result;}});_styled.div.withConfig({displayName:"Textarea__Host",componentId:"sc-170lrb4-0"})(templateObject_1$v||(templateObject_1$v=__makeTemplateObject(["\n display: flex;\n align-items: flex-end;\n position: relative;\n"],["\n display: flex;\n align-items: flex-end;\n position: relative;\n"])));_styled.textarea.withConfig({displayName:"Textarea__StyledTextarea",componentId:"sc-170lrb4-1"})(templateObject_2$p||(templateObject_2$p=__makeTemplateObject(["\n flex: 1 0 auto;\n justify-content: space-between;\n overflow: hidden;\n resize: none;\n min-height: 5px;\n\n ","\n"],["\n flex: 1 0 auto;\n justify-content: space-between;\n overflow: hidden;\n resize: none;\n min-height: 5px;\n\n ","\n"])),InputPlaceholder('font-style: italic'));_styled(IconButton$1).withConfig({displayName:"Textarea__StyledIconButton",componentId:"sc-170lrb4-2"})(templateObject_3$j||(templateObject_3$j=__makeTemplateObject(["\n position: absolute;\n bottom: 2px;\n right: 2px;\n"],["\n position: absolute;\n bottom: 2px;\n right: 2px;\n"])));var templateObject_1$v,templateObject_2$p,templateObject_3$j;var InsertFilesDialogHost=_styled.div.withConfig({displayName:"InsertFilesButton__InsertFilesDialogHost",componentId:"sc-1q7gx3n-0"})(templateObject_2$o||(templateObject_2$o=__makeTemplateObject(["\n ","\n\n position: relative;\n padding: ","px;\n text-align: center;\n\n > div {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n"],["\n ","\n\n position: relative;\n padding: ","px;\n text-align: center;\n\n > div {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n"])),function(p){return p.isActive&&css$2(templateObject_1$u$1||(templateObject_1$u$1=__makeTemplateObject(["\n &::after {\n content: '';\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n\n border: 2px black dashed;\n }\n "],["\n &::after {\n content: '';\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n\n border: 2px black dashed;\n }\n "])));},spacingM);_styled.p.withConfig({displayName:"InsertFilesButton__DragAndDropText",componentId:"sc-1q7gx3n-1"})(templateObject_3$i||(templateObject_3$i=__makeTemplateObject(["\n font-size: ","px;\n margin: ","px auto 0 auto;\n"],["\n font-size: ","px;\n margin: ","px auto 0 auto;\n"])),fontSizeSmall,spacingS);_styled(DefaultButton).withConfig({displayName:"InsertFilesButton__SelectFileButton",componentId:"sc-1q7gx3n-2"})(templateObject_4$a$1||(templateObject_4$a$1=__makeTemplateObject(["\n margin-top: ","px;\n padding: 0 ","px;\n\n i {\n margin: 0 ","px;\n }\n\n span {\n font-weight: normal;\n }\n"],["\n margin-top: ","px;\n padding: 0 ","px;\n\n i {\n margin: 0 ","px;\n }\n\n span {\n font-weight: normal;\n }\n"])),spacingM,spacingXs,spacingXs);_styled.div.withConfig({displayName:"InsertFilesButton__ButtonsContainer",componentId:"sc-1q7gx3n-3"})(templateObject_5$9$1||(templateObject_5$9$1=__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n"],["\n display: flex;\n flex-direction: column;\n"])));var templateObject_1$u$1,templateObject_2$o,templateObject_3$i,templateObject_4$a$1,templateObject_5$9$1;_styled(InsertFilesDialogHost).withConfig({displayName:"InsertImagesButton__Host",componentId:"sc-63tjy6-0"})(templateObject_1$t$1||(templateObject_1$t$1=__makeTemplateObject(["\n cursor: pointer;\n"],["\n cursor: pointer;\n"])));_styled(PrimaryButton).withConfig({displayName:"InsertImagesButton__StyledButton",componentId:"sc-63tjy6-1"})(templateObject_2$n||(templateObject_2$n=__makeTemplateObject(["\n && {\n display: block;\n margin: 10px auto;\n background-color: transparent;\n color: inherit;\n font-size: large;\n line-height: 2em;\n border: none;\n\n &:hover {\n background-color: transparent;\n color: inherit;\n border: 0;\n }\n }\n"],["\n && {\n display: block;\n margin: 10px auto;\n background-color: transparent;\n color: inherit;\n font-size: large;\n line-height: 2em;\n border: none;\n\n &:hover {\n background-color: transparent;\n color: inherit;\n border: 0;\n }\n }\n"])));_styled.div.withConfig({displayName:"InsertImagesButton__Text",componentId:"sc-63tjy6-2"})(templateObject_3$h||(templateObject_3$h=__makeTemplateObject(["\n max-width: 100%;\n font-size: large;\n"],["\n max-width: 100%;\n font-size: large;\n"])));var templateObject_1$t$1,templateObject_2$n,templateObject_3$h;_styled.div.withConfig({displayName:"InsertVideoDialog__VideoHost",componentId:"sc-12gp7sa-0"})(templateObject_1$s$1||(templateObject_1$s$1=__makeTemplateObject(["\n width: 100%;\n margin-top: ","px;\n\n .video-view-container--youtube {\n &:after {\n padding-bottom: calc(9 / 16 * 100%);\n }\n }\n"],["\n width: 100%;\n margin-top: ","px;\n\n .video-view-container--youtube {\n &:after {\n padding-bottom: calc(9 / 16 * 100%);\n }\n }\n"])),spacingS);_styled(TextField).withConfig({displayName:"InsertVideoDialog__StyledTextField",componentId:"sc-12gp7sa-1"})(templateObject_2$m||(templateObject_2$m=__makeTemplateObject(["\n width: 510px;\n\n label {\n font-weight: normal;\n }\n"],["\n width: 510px;\n\n label {\n font-weight: normal;\n }\n"])));var templateObject_1$s$1,templateObject_2$m;var DateTimePicker=function DateTimePicker(props){var timeField=useRef$1();var formatMessage=useIntl().formatMessage;var _a=useState$2(getTime(props.date)),time=_a[0],setTime=_a[1];var _b=useState$2(false),timeHasFocus=_b[0],setTimeHasFocus=_b[1];var _c=useState$2(null),timeErrorMessageResourceKey=_c[0],setTimeErrorMessageResourceKey=_c[1];var momentMonths=['January','February','March','April','May','June','July','August','September','October','November','December'];var momentWeekdays=['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'];useEffect$1(function(){// do not update if the user is typing time
122346
122343
  if(!timeHasFocus){// We might not know that the time field has the focus after an onBlur from the date field.
@@ -122355,14 +122352,14 @@ props.onChanged(newDate.toISOString(),validationResult.isInRange);}function hand
122355
122352
  setTimeout(function(){return timeField.current.focus();},0);}if(!newDate){handleChange(null);}else {// include the current time component when triggering a change.
122356
122353
  // newDate is only a Date without time.
122357
122354
  var newDateOnly=moment(newDate);var timeInMilliseconds=0;if(props.date){var oldDateWithTime=moment(props.date);timeInMilliseconds=oldDateWithTime.diff(oldDateWithTime.clone().startOf('day'));}handleChange(newDateOnly.startOf('day').add(timeInMilliseconds,'ms'));}}function handleTimeBlur(timeString){var newTime=timeString||'00:00';var initialTime=getTime(props.date);if(newTime===initialTime){return;}setTimeHasFocus(false);var timeToday=moment(newTime,'HH:mm');if(!timeToday.isValid()){setTimeErrorMessageResourceKey('DateTimePicker.invalidTime');return;}setTime(timeToday.format('HH:mm'));if(props.date==null){handleChange(timeToday);}else {var timeInMilliseconds=timeToday.diff(moment().startOf('day'));var newValue=moment(props.date).startOf('day').add(timeInMilliseconds,'ms');handleChange(newValue);}}function setTimeError(result){if(result.isInRange||!result.isSameDay){setTimeErrorMessageResourceKey(null);return;}setTimeErrorMessageResourceKey(props.timeValidationResourceKey||props.dateValidationResourceKey);}function isDateTimeInRange(newValue){if(!newValue||!props.minDate&&!props.maxDate){return {isInRange:true,isSameDay:true};}return {isInRange:(!props.minDate||moment(props.minDate).unix()<newValue.unix())&&(!props.maxDate||newValue.unix()<moment(props.maxDate).unix()),isSameDay:isSameDay(newValue,props.minDate||props.maxDate)};}function isSameDay(momentDateTime,otherTime){return momentDateTime&&otherTime&&momentDateTime.isSame(otherTime,'day');}};var IEButtonFix=createGlobalStyle(templateObject_1$r$1||(templateObject_1$r$1=__makeTemplateObject(["\n .browser-name-ie {\n button.ms-DatePicker-goToday {\n left: 15px;\n }\n }\n"],["\n .browser-name-ie {\n button.ms-DatePicker-goToday {\n left: 15px;\n }\n }\n"])));var GlobalDatePickerStyle=createGlobalStyle(templateObject_2$l||(templateObject_2$l=__makeTemplateObject(["\n button.ms-DatePicker-day--today {\n background: "," !important;\n }\n"],["\n button.ms-DatePicker-day--today {\n background: "," !important;\n }\n"])),function(p){return p.theme.palette.accent;});var Host$b$1=_styled.div.withConfig({displayName:"DateTimePicker__Host",componentId:"sc-zzs3p0-0"})(templateObject_3$g||(templateObject_3$g=__makeTemplateObject(["\n .ms-TextField {\n &.is-disabled {\n opacity: 0.5;\n }\n &-field {\n ","\n }\n\n > &-wrapper {\n > &-fieldGroup {\n background: none;\n > i {\n color: initial;\n }\n }\n }\n }\n\n .ms-TextField:not(:first-of-type) {\n margin-top: 5px;\n }\n"],["\n .ms-TextField {\n &.is-disabled {\n opacity: 0.5;\n }\n &-field {\n ","\n }\n\n > &-wrapper {\n > &-fieldGroup {\n background: none;\n > i {\n color: initial;\n }\n }\n }\n }\n\n .ms-TextField:not(:first-of-type) {\n margin-top: 5px;\n }\n"])),InputPlaceholder("\n color: inherit;\n font-style: italic;\n "));var templateObject_1$r$1,templateObject_2$l,templateObject_3$g;var DateRange;(function(DateRange){DateRange[DateRange["TwoYears"]=0]="TwoYears";DateRange[DateRange["OneYear"]=1]="OneYear";DateRange[DateRange["SixMonths"]=2]="SixMonths";DateRange[DateRange["TwoMonths"]=3]="TwoMonths";DateRange[DateRange["OneMonth"]=4]="OneMonth";DateRange[DateRange["SevenDays"]=5]="SevenDays";DateRange[DateRange["YesterDay"]=6]="YesterDay";DateRange[DateRange["Today"]=7]="Today";})(DateRange||(DateRange={}));Object.keys(DateRange).length/2-1;_styled.div.withConfig({displayName:"DateRangeSlider__Host",componentId:"sc-1o5vacm-0"})(templateObject_1$q$1||(templateObject_1$q$1=__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n width: 100%;\n\n .ms-Slider {\n margin-bottom: 0;\n }\n"],["\n display: flex;\n flex-direction: column;\n width: 100%;\n\n .ms-Slider {\n margin-bottom: 0;\n }\n"])));_styled.div.withConfig({displayName:"DateRangeSlider__Value",componentId:"sc-1o5vacm-1"})(templateObject_2$k||(templateObject_2$k=__makeTemplateObject(["\n align-self: flex-end;\n margin-right: 10px;\n"],["\n align-self: flex-end;\n margin-right: 10px;\n"])));_styled.div.withConfig({displayName:"DateRangeSlider__Labels",componentId:"sc-1o5vacm-2"})(templateObject_3$f||(templateObject_3$f=__makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n margin: 0px 10px;\n"],["\n display: flex;\n justify-content: space-between;\n margin: 0px 10px;\n"])));var templateObject_1$q$1,templateObject_2$k,templateObject_3$f;_styled(IconButton).withConfig({displayName:"ExternalNewsLinkButton__StyledIconButton",componentId:"sc-txzoyq-0"})(templateObject_1$p$1||(templateObject_1$p$1=__makeTemplateObject(["\n && {\n padding-left: 0;\n padding-right: 0;\n margin-left: -3px;\n\n &[disabled] {\n background-color: transparent;\n }\n }\n"],["\n && {\n padding-left: 0;\n padding-right: 0;\n margin-left: -3px;\n\n &[disabled] {\n background-color: transparent;\n }\n }\n"])));var templateObject_1$p$1;_styled.div.withConfig({displayName:"CardStyles__Host",componentId:"sc-ovm8js-0"})(templateObject_1$o$1||(templateObject_1$o$1=__makeTemplateObject(["\n display: block;\n padding: 0 ","px ","px ","px;\n flex: 1 1 auto;\n\n &:not([data-banner='image']) {\n position: relative;\n }\n"],["\n display: block;\n padding: 0 ","px ","px ","px;\n flex: 1 1 auto;\n\n &:not([data-banner='image']) {\n position: relative;\n }\n"])),spacingM,spacingM,spacingM);var Intro$3=_styled.p.withConfig({displayName:"CardStyles__Intro",componentId:"sc-ovm8js-1"})(templateObject_2$j$1||(templateObject_2$j$1=__makeTemplateObject(["\n margin: 0;\n font-size: ","px;\n margin-top: ","px;\n"],["\n margin: 0;\n font-size: ","px;\n margin-top: ","px;\n"])),fontSizeSmall,spacingM-3);var templateObject_1$o$1,templateObject_2$j$1;_styled.p.withConfig({displayName:"NewsCard__Headline",componentId:"sc-rf9b9y-0"})(templateObject_1$n$1||(templateObject_1$n$1=__makeTemplateObject(["\n font-size: ","px;\n font-weight: bold;\n"],["\n font-size: ","px;\n font-weight: bold;\n"])),fontSizeSmall);_styled.h2.withConfig({displayName:"NewsCard__Title",componentId:"sc-rf9b9y-1"})(templateObject_2$i$1||(templateObject_2$i$1=__makeTemplateObject(["\n display: inline-block;\n & + .card-metaInfo {\n padding-top: ","px !important;\n }\n"],["\n display: inline-block;\n & + .card-metaInfo {\n padding-top: ","px !important;\n }\n"])),spacingS);_styled(NavLink).withConfig({displayName:"NewsCard__StyledNavLink",componentId:"sc-rf9b9y-2"})(templateObject_3$e$1||(templateObject_3$e$1=__makeTemplateObject(["\n && {\n position: relative;\n z-index: 1;\n color: ",";\n display: block;\n }\n"],["\n && {\n position: relative;\n z-index: 1;\n color: ",";\n display: block;\n }\n"])),function(p){return p.theme.textColors.default;});_styled.div.withConfig({displayName:"NewsCard__MetaInfo",componentId:"sc-rf9b9y-3"})(templateObject_4$9$1||(templateObject_4$9$1=__makeTemplateObject(["\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n"],["\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n"])));_styled(ClickableChannelTitles).withConfig({displayName:"NewsCard__Channels",componentId:"sc-rf9b9y-4"})(templateObject_5$8$1||(templateObject_5$8$1=__makeTemplateObject(["\n display: contents;\n"],["\n display: contents;\n"])));var templateObject_1$n$1,templateObject_2$i$1,templateObject_3$e$1,templateObject_4$9$1,templateObject_5$8$1;_styled.div.withConfig({displayName:"EmptyChannelsView__Host",componentId:"sc-b5s0oy-0"})(templateObject_1$m$1||(templateObject_1$m$1=__makeTemplateObject(["\n color: ",";\n text-align: center;\n display: flex;\n flex-direction: column;\n\n > p {\n font-size: 14px;\n margin: 0;\n padding: 3px 0;\n }\n"],["\n color: ",";\n text-align: center;\n display: flex;\n flex-direction: column;\n\n > p {\n font-size: 14px;\n margin: 0;\n padding: 3px 0;\n }\n"])),function(p){return p.theme.palette.neutralTertiary;});_styled(Icon).withConfig({displayName:"EmptyChannelsView__StyledIcon",componentId:"sc-b5s0oy-1"})(templateObject_2$h$1||(templateObject_2$h$1=__makeTemplateObject(["\n font-size: 100px;\n padding: 30px 0;\n"],["\n font-size: 100px;\n padding: 30px 0;\n"])));var templateObject_1$m$1,templateObject_2$h$1;_styled.div.withConfig({displayName:"PromotedNewsItem__Host",componentId:"sc-drndfq-0"})(templateObject_1$l$1||(templateObject_1$l$1=__makeTemplateObject(["\n position: relative;\n"],["\n position: relative;\n"])));_styled.div.withConfig({displayName:"PromotedNewsItem__Alert",componentId:"sc-drndfq-1"})(templateObject_2$g$1||(templateObject_2$g$1=__makeTemplateObject(["\n display: flex;\n background-color: white;\n box-shadow: 1px 1px 4px grey;\n box-sizing: border-box;\n cursor: pointer;\n width: 100%;\n margin-bottom: 10px;\n border-bottom-width: 4px;\n border-bottom-style: solid;\n"],["\n display: flex;\n background-color: white;\n box-shadow: 1px 1px 4px grey;\n box-sizing: border-box;\n cursor: pointer;\n width: 100%;\n margin-bottom: 10px;\n border-bottom-width: 4px;\n border-bottom-style: solid;\n"])));_styled.div.withConfig({displayName:"PromotedNewsItem__AlertIconOuterContainer",componentId:"sc-drndfq-2"})(templateObject_3$d$1||(templateObject_3$d$1=__makeTemplateObject(["\n display: flex;\n"],["\n display: flex;\n"])));_styled.div.withConfig({displayName:"PromotedNewsItem__IconContainer",componentId:"sc-drndfq-3"})(templateObject_4$8$1||(templateObject_4$8$1=__makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n width: 50px;\n min-height: 50px;\n height: 100%;\n"],["\n display: flex;\n align-items: center;\n justify-content: center;\n width: 50px;\n min-height: 50px;\n height: 100%;\n"])));_styled(Icon).withConfig({displayName:"PromotedNewsItem__StyledIcon",componentId:"sc-drndfq-4"})(templateObject_5$7$1||(templateObject_5$7$1=__makeTemplateObject(["\n font-size: 25px;\n color: white;\n"],["\n font-size: 25px;\n color: white;\n"])));_styled.div.withConfig({displayName:"PromotedNewsItem__ContentContainer",componentId:"sc-drndfq-5"})(templateObject_6$3$1||(templateObject_6$3$1=__makeTemplateObject(["\n display: flex;\n width: 100%;\n"],["\n display: flex;\n width: 100%;\n"])));_styled(DateTime).withConfig({displayName:"PromotedNewsItem__StyledDate",componentId:"sc-drndfq-6"})(templateObject_7$2$1||(templateObject_7$2$1=__makeTemplateObject(["\n font-size: 0.9em;\n color: #666;\n margin-left: 20px;\n min-width: 150px;\n\n @media (max-width: ","px) {\n display: none;\n }\n"],["\n font-size: 0.9em;\n color: #666;\n margin-left: 20px;\n min-width: 150px;\n\n @media (max-width: ","px) {\n display: none;\n }\n"])),maxScreenSize.small);_styled.h2.withConfig({displayName:"PromotedNewsItem__Title",componentId:"sc-drndfq-7"})(templateObject_8$2$1||(templateObject_8$2$1=__makeTemplateObject(["\n font-size: 1.1em;\n margin-top: 0;\n margin-bottom: 0;\n max-width: 1000px;\n\n @media (max-width: ","px) {\n max-width: 700px;\n }\n\n @media (max-width: ","px) {\n max-width: 450px;\n }\n\n @media (max-width: ","px) {\n max-width: 300px;\n }\n\n @media (max-width: ","px) {\n margin-left: 20px;\n max-width: 280px;\n }\n"],["\n font-size: 1.1em;\n margin-top: 0;\n margin-bottom: 0;\n max-width: 1000px;\n\n @media (max-width: ","px) {\n max-width: 700px;\n }\n\n @media (max-width: ","px) {\n max-width: 450px;\n }\n\n @media (max-width: ","px) {\n max-width: 300px;\n }\n\n @media (max-width: ","px) {\n margin-left: 20px;\n max-width: 280px;\n }\n"])),maxScreenSize.xLarge,maxScreenSize.large,maxScreenSize.medium,maxScreenSize.small);_styled.div.withConfig({displayName:"PromotedNewsItem__BookmarkContainer",componentId:"sc-drndfq-8"})(templateObject_9$2$1||(templateObject_9$2$1=__makeTemplateObject(["\n margin-right: 10px;\n align-self: flex-end;\n padding-bottom: 10px;\n"],["\n margin-right: 10px;\n align-self: flex-end;\n padding-bottom: 10px;\n"])));_styled.div.withConfig({displayName:"PromotedNewsItem__TextContainer",componentId:"sc-drndfq-9"})(templateObject_10$1$1||(templateObject_10$1$1=__makeTemplateObject(["\n display: flex;\n width: 100%;\n align-items: center;\n padding: 10px 0;\n"],["\n display: flex;\n width: 100%;\n align-items: center;\n padding: 10px 0;\n"])));var templateObject_1$l$1,templateObject_2$g$1,templateObject_3$d$1,templateObject_4$8$1,templateObject_5$7$1,templateObject_6$3$1,templateObject_7$2$1,templateObject_8$2$1,templateObject_9$2$1,templateObject_10$1$1;function useTranslateApi(){var api=useApi();return useMemo(function(){return {translateContents:translateContents};function translateContents(type,itemId,language){return api.custom(type+"/"+itemId+"/contents/"+language).get().then(function(res){return res.body().data();});}},[api]);}var PageTitle=function PageTitle(_a){var page=_a.page,title=_a.title,search=_a.search,className=_a.className;var user=useCurrentUser();var isDocument=page.pageType===PageType.Document;var language=getLanguageForPage(page,user);var buildPath=useSubscriptionHandlePathBuilder().buildPath;var handleExternalContentClick=useExternalContentClickHandler();var pageTitle=jsx$1(Fragment,{children:search?jsx$1(Highlighter,{searchWords:[search],autoEscape:true,textToHighlight:title},void 0):title},void 0);if(page.useExternalContent){var preferredContentLanguage=getPreferredContentLanguage(user);var url=getExternalContentUrl(page,preferredContentLanguage);var targetRoute=NewsService.getNewsRoute(buildPath('/pages'),page.id,title);return jsx$1(Title$2$1,{children:jsxs(StyledNavLink,__assign({to:targetRoute,onClick:function(e){return handleExternalContentClick(e,page,ItemResourceTypes.Pages);}},{children:[pageTitle,jsx$1(ExternalContentIcon,{tooltipResourceKey:'ExternalLinkButton.pages.navigateTo',tooltipResourceValues:url},void 0)]}),void 0)},void 0);}return jsxs(Title$2$1,__assign({className:className},{children:[isDocument&&jsx$1(FileIcon,{iconName:getFileIconByExtension(page.contents[language].fileInfo.extension)},void 0),pageTitle]}),void 0);};var Title$2$1=_styled.h2.withConfig({displayName:"PageTitle__Title",componentId:"sc-gsx6ad-0"})(templateObject_1$k$1||(templateObject_1$k$1=__makeTemplateObject(["\n display: flex;\n margin: ","px 0 ","px 0;\n font-weight: bold;\n font-size: ","px;\n padding: 0;\n"],["\n display: flex;\n margin: ","px 0 ","px 0;\n font-weight: bold;\n font-size: ","px;\n padding: 0;\n"])),spacingS+5,spacingS,fontSizeMedium);var FileIcon=_styled(Icon).withConfig({displayName:"PageTitle__FileIcon",componentId:"sc-gsx6ad-1"})(templateObject_2$f$1||(templateObject_2$f$1=__makeTemplateObject(["\n font-size: ","px;\n margin-right: ","px;\n align-self: flex-start;\n"],["\n font-size: ","px;\n margin-right: ","px;\n align-self: flex-start;\n"])),fontSizeMedium+4,spacingS);var StyledNavLink=_styled(NavLink).withConfig({displayName:"PageTitle__StyledNavLink",componentId:"sc-gsx6ad-2"})(templateObject_3$c$1||(templateObject_3$c$1=__makeTemplateObject(["\n && {\n position: relative;\n z-index: 1;\n color: ",";\n display: block;\n }\n"],["\n && {\n position: relative;\n z-index: 1;\n color: ",";\n display: block;\n }\n"])),function(p){return p.theme.textColors.default;});var templateObject_1$k$1,templateObject_2$f$1,templateObject_3$c$1;_styled.div.withConfig({displayName:"PageCard__PageModifiedInfo",componentId:"sc-13xtreq-0"})(templateObject_1$j$1||(templateObject_1$j$1=__makeTemplateObject(["\n font-size: ","px;\n color: ",";\n"],["\n font-size: ","px;\n color: ",";\n"])),fontSizeSmall,function(p){return p.theme.palette.neutralSecondaryAlt;});_styled(PageTitle).withConfig({displayName:"PageCard__StyledPageTitle",componentId:"sc-13xtreq-1"})(templateObject_2$e$1||(templateObject_2$e$1=__makeTemplateObject(["\n && {\n margin: 0;\n flex: 1 1 auto;\n }\n"],["\n && {\n margin: 0;\n flex: 1 1 auto;\n }\n"])));_styled(Intro$3).withConfig({displayName:"PageCard__StyledIntro",componentId:"sc-13xtreq-2"})(templateObject_3$b$1||(templateObject_3$b$1=__makeTemplateObject(["\n && {\n margin-top: ","px;\n margin-bottom: ","px;\n }\n"],["\n && {\n margin-top: ","px;\n margin-bottom: ","px;\n }\n"])),spacingS,spacingS);_styled.div.withConfig({displayName:"PageCard__Keywords",componentId:"sc-13xtreq-3"})(templateObject_4$7$1||(templateObject_4$7$1=__makeTemplateObject(["\n font-size: ","px;\n color: ",";\n padding-bottom: ","px;\n"],["\n font-size: ","px;\n color: ",";\n padding-bottom: ","px;\n"])),fontSizeSmall,function(p){return p.theme.palette.neutralSecondaryAlt;},spacingS);_styled.div.withConfig({displayName:"PageCard__Inner",componentId:"sc-13xtreq-4"})(templateObject_5$6$1||(templateObject_5$6$1=__makeTemplateObject(["\n display: flex;\n align-items: center;\n margin: ","px 0 ","px 0;\n"],["\n display: flex;\n align-items: center;\n margin: ","px 0 ","px 0;\n"])),spacingM,spacingS);_styled(DocumentDownloadButton).withConfig({displayName:"PageCard__StyledDocumentDownloadButton",componentId:"sc-13xtreq-5"})(templateObject_6$2$1||(templateObject_6$2$1=__makeTemplateObject(["\n align-self: flex-start;\n z-index: 1;\n"],["\n align-self: flex-start;\n z-index: 1;\n"])));var templateObject_1$j$1,templateObject_2$e$1,templateObject_3$b$1,templateObject_4$7$1,templateObject_5$6$1,templateObject_6$2$1;_styled.p.withConfig({displayName:"PageListItemBody__FullContent",componentId:"sc-7voum-0"})(templateObject_1$i$1||(templateObject_1$i$1=__makeTemplateObject(["\n padding: 0;\n margin: 0 0 ","px 0;\n font-size: ","px;\n line-height: 1.5;\n"],["\n padding: 0;\n margin: 0 0 ","px 0;\n font-size: ","px;\n line-height: 1.5;\n"])),spacingM-5,fontSizeSmall);_styled.div.withConfig({displayName:"PageListItemBody__CutContentContainer",componentId:"sc-7voum-1"})(templateObject_2$d$1||(templateObject_2$d$1=__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n margin-bottom: ","px;\n"],["\n display: flex;\n flex-direction: column;\n margin-bottom: ","px;\n"])),spacingM-5);_styled.p.withConfig({displayName:"PageListItemBody__CutContent",componentId:"sc-7voum-2"})(templateObject_3$a$1||(templateObject_3$a$1=__makeTemplateObject(["\n padding: 0;\n margin: 0;\n ","\n"],["\n padding: 0;\n margin: 0;\n ","\n"])),LineClamp(5,fontSizeSmall,1.5));_styled(ActionButton).withConfig({displayName:"PageListItemBody__StyledActionButton",componentId:"sc-7voum-3"})(templateObject_4$6$1||(templateObject_4$6$1=__makeTemplateObject(["\n && {\n height: auto;\n margin: 0 0 0 auto;\n padding: ","px ","px 0 ","px;\n font-size: ","px;\n z-index: 1;\n\n &:hover {\n text-decoration: underline;\n }\n }\n"],["\n && {\n height: auto;\n margin: 0 0 0 auto;\n padding: ","px ","px 0 ","px;\n font-size: ","px;\n z-index: 1;\n\n &:hover {\n text-decoration: underline;\n }\n }\n"])),spacingXs,spacingXs,spacingXs,fontSizeSmaller);var templateObject_1$i$1,templateObject_2$d$1,templateObject_3$a$1,templateObject_4$6$1;_styled.div.withConfig({displayName:"PageListItem__Host",componentId:"sc-lz5d51-0"})(templateObject_1$h$1||(templateObject_1$h$1=__makeTemplateObject(["\n ",";\n position: relative;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n width: 100%;\n\n padding: ","px;\n"],["\n ",";\n position: relative;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n width: 100%;\n\n padding: ","px;\n"])),CardBorderInline(2,2),spacingM);_styled.div.withConfig({displayName:"PageListItem__Keywords",componentId:"sc-lz5d51-1"})(templateObject_2$c$1||(templateObject_2$c$1=__makeTemplateObject(["\n position: relative;\n font-size: ","px;\n color: ",";\n padding-bottom: ","px;\n\n a {\n position: relative;\n z-index: 1;\n }\n"],["\n position: relative;\n font-size: ","px;\n color: ",";\n padding-bottom: ","px;\n\n a {\n position: relative;\n z-index: 1;\n }\n"])),fontSizeSmall,function(p){return p.theme.palette.neutralSecondaryAlt;},spacingS);_styled.div.withConfig({displayName:"PageListItem__LastUpdated",componentId:"sc-lz5d51-2"})(templateObject_3$9$1||(templateObject_3$9$1=__makeTemplateObject(["\n font-size: ","px;\n color: ",";\n"],["\n font-size: ","px;\n color: ",";\n"])),fontSizeSmall,function(p){return p.theme.palette.neutralSecondaryAlt;});_styled(PageBreadcrumb).withConfig({displayName:"PageListItem__StyledPageBreadcrumb",componentId:"sc-lz5d51-3"})(templateObject_4$5$1||(templateObject_4$5$1=__makeTemplateObject(["\n flex: 1 1 auto;\n width: ","%;\n"],["\n flex: 1 1 auto;\n width: ","%;\n"])),function(p){return p.maxWidth;});_styled.div.withConfig({displayName:"PageListItem__Inner",componentId:"sc-lz5d51-4"})(templateObject_5$5$1||(templateObject_5$5$1=__makeTemplateObject(["\n display: flex;\n align-items: center;\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"],["\n display: flex;\n align-items: center;\n\n a,\n button {\n position: relative;\n z-index: 1;\n }\n"])));var templateObject_1$h$1,templateObject_2$c$1,templateObject_3$9$1,templateObject_4$5$1,templateObject_5$5$1;var PagesDetailViewNavigation=function PagesDetailViewNavigation(_a){var basePath=_a.basePath,navigationContext=_a.navigationContext,activePageId=_a.activePageId,className=_a.className;var features=useFeatures();var user=useCurrentUser();if(!features.inPageNavigation){return null;}var currentPage=navigationContext.siblings.find(function(s){return s.id===activePageId;});if(currentPage==null){return null;}// sort by group and position only the root pages
122358
- var pages=!navigationContext.parent||!navigationContext.parent.id?sortPageNodesByGroupAndPosition(user.groups,navigationContext.siblings):navigationContext.siblings;var previousPage=getSibling(-1);var nextPage=getSibling(1);return jsxs(Host$5$1,__assign({className:className,"data-detail-page-navigation":activePageId},{children:[previousPage&&jsx$1(PageLinkButton,{isNextNode:false,basePath:basePath,page:previousPage,icon:"ChevronLeftSmall","data-detail-page-navigation-previous-node":previousPage.id,"data-detail-page-navigation-node":previousPage.id},void 0),nextPage&&jsx$1(PageLinkButton,{isNextNode:true,className:"next-page-link-button",basePath:basePath,page:nextPage,icon:"ChevronRightSmall","data-detail-page-navigation-next-node":nextPage.id,"data-detail-page-navigation-node":nextPage.id},void 0)]}),void 0);function getSibling(offset){var index=pages.findIndex(function(s){return s.id===activePageId;});return pages[index+offset];}};var Host$5$1=_styled.div.withConfig({displayName:"PagesDetailViewNavigation__Host",componentId:"sc-19ae9g3-0"})(templateObject_1$g$1||(templateObject_1$g$1=__makeTemplateObject(["\n display: flex;\n flex-wrap: wrap;\n"],["\n display: flex;\n flex-wrap: wrap;\n"])));var PageLinkButton=function PageLinkButton(_a){var basePath=_a.basePath,page=_a.page,icon=_a.icon,isNextNode=_a.isNextNode,className=_a.className,props=__rest(_a,["basePath","page","icon","isNextNode","className"]);var user=useCurrentUser();var formatMessage=useIntl().formatMessage;var title=getTitle(page,user,formatMessage);return jsxs(Link$1,__assign({to:getUrl(),className:className},{children:[!isNextNode&&jsx$1(LinkIcon,{iconName:icon},void 0),jsx$1(Content$2$1,__assign({},props,{isNextNode:isNextNode},{children:jsx$1("div",__assign({title:title},{children:title}),void 0)}),void 0),isNextNode&&jsx$1(LinkIcon,{iconName:icon},void 0)]}),void 0);function getUrl(){var baseUrl=NewsService.getNewsRoute(basePath,page.id,title);return page.useExternalContent?baseUrl+"?"+queryString.stringify({noRedirect:true}):baseUrl;}};var Link$1=_styled(NavLink).withConfig({displayName:"PagesDetailViewNavigation__Link",componentId:"sc-19ae9g3-1"})(templateObject_2$b$1||(templateObject_2$b$1=__makeTemplateObject(["\n display: flex;\n align-items: center;\n\n padding-top: ","px;\n padding-bottom: ","px;\n margin-bottom: 2px;\n\n max-width: 45%;\n width: auto;\n border-radius: 5px;\n\n &.next-page-link-button {\n margin-left: auto;\n }\n\n @media (max-width: ","px) {\n max-width: 100% !important;\n margin-bottom: ","px;\n }\n\n background-color: ",";\n && {\n color: ",";\n }\n"],["\n display: flex;\n align-items: center;\n\n padding-top: ","px;\n padding-bottom: ","px;\n margin-bottom: 2px;\n\n max-width: 45%;\n width: auto;\n border-radius: 5px;\n\n &.next-page-link-button {\n margin-left: auto;\n }\n\n @media (max-width: ","px) {\n max-width: 100% !important;\n margin-bottom: ","px;\n }\n\n background-color: ",";\n && {\n color: ",";\n }\n"])),spacingS,spacingS,maxScreenSize.small,spacingS,function(p){return p.theme.palette.neutralLight;},function(p){return p.theme.textColors.default;});var LinkIcon=_styled(Icon).withConfig({displayName:"PagesDetailViewNavigation__LinkIcon",componentId:"sc-19ae9g3-2"})(templateObject_3$8$1||(templateObject_3$8$1=__makeTemplateObject(["\n && {\n display: flex;\n justify-content: center;\n font-size: ","px;\n padding: 0 ","px;\n }\n"],["\n && {\n display: flex;\n justify-content: center;\n font-size: ","px;\n padding: 0 ","px;\n }\n"])),fontSizeNormal,spacingM);var Content$2$1=_styled.div.withConfig({displayName:"PagesDetailViewNavigation__Content",componentId:"sc-19ae9g3-3"})(templateObject_5$4$1||(templateObject_5$4$1=__makeTemplateObject(["\n flex: 0 1 auto;\n display: flex;\n flex-direction: column;\n padding-right: 23px;\n\n white-space: nowrap;\n overflow: hidden;\n\n div {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n ","\n"],["\n flex: 0 1 auto;\n display: flex;\n flex-direction: column;\n padding-right: 23px;\n\n white-space: nowrap;\n overflow: hidden;\n\n div {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n ","\n"])),function(p){return p.isNextNode&&css$2(templateObject_4$4$1||(templateObject_4$4$1=__makeTemplateObject(["\n margin-left: auto;\n padding-left: 23px;\n padding-right: 0;\n "],["\n margin-left: auto;\n padding-left: 23px;\n padding-right: 0;\n "])));});var templateObject_1$g$1,templateObject_2$b$1,templateObject_3$8$1,templateObject_4$4$1,templateObject_5$4$1;_styled(Dropdown).withConfig({displayName:"PagesGroupsSelector__StyledDropdown",componentId:"sc-13yd888-0"})(templateObject_1$f$1||(templateObject_1$f$1=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),ToolbarDropdownStyles);_styled(NavLink).withConfig({displayName:"PagesGroupsSelector__DropdownOption",componentId:"sc-13yd888-1"})(templateObject_2$a$1||(templateObject_2$a$1=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),ToolbarOptionStyles);createGlobalStyle(templateObject_3$7$1||(templateObject_3$7$1=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),ToolbarGlobalDropdownStyles);var templateObject_1$f$1,templateObject_2$a$1,templateObject_3$7$1;_styled.div.withConfig({displayName:"GroupNotificationsSettings__Host",componentId:"sc-1z0rxrb-0"})(templateObject_1$e$1||(templateObject_1$e$1=__makeTemplateObject(["\n width: 400px;\n\n @media (max-width: ","px) {\n width: 100%;\n }\n"],["\n width: 400px;\n\n @media (max-width: ","px) {\n width: 100%;\n }\n"])),maxScreenSize.small);_styled.h2.withConfig({displayName:"GroupNotificationsSettings__Title",componentId:"sc-1z0rxrb-1"})(templateObject_2$9$1||(templateObject_2$9$1=__makeTemplateObject(["\n margin-top: 0;\n"],["\n margin-top: 0;\n"])));_styled.div.withConfig({displayName:"GroupNotificationsSettings__Infos",componentId:"sc-1z0rxrb-2"})(templateObject_3$6$1||(templateObject_3$6$1=__makeTemplateObject(["\n color: ",";\n padding-left: 55px;\n"],["\n color: ",";\n padding-left: 55px;\n"])),function(p){return p.theme.palette.neutralTertiaryAlt;});var templateObject_1$e$1,templateObject_2$9$1,templateObject_3$6$1;function getPostGroups(user){return getGroupsWithExplicitMinRole(GroupRoles.LimitedReader,user,function(g){return g.allowPosts;});}function getPostsBaseRoute(post,user){var _a;var postGroups=getPostGroups(user);var subscriptionHandle=(_a=user.subscription.subscriptionHandle)!==null&&_a!==void 0?_a:user.subscription.id;return postGroups.length>1?"/"+subscriptionHandle+"/posts/groups/"+((post===null||post===void 0?void 0:post.groupId)||''):"/"+subscriptionHandle+"/posts";}function getPostsHashtagFilterRoute(post,user,hashtag){return getPostsBaseRoute(post,user)+"?"+queryString.stringify({search:""+hashtag});}var PostReplies=function PostReplies(_a){var className=_a.className,post=_a.post,comments=_a.comments,initialPageSize=_a.initialPageSize,autoFocusReplyField=_a.autoFocusReplyField,onReplyAdded=_a.onReplyAdded,onReplyDeleted=_a.onReplyDeleted,onThreadReply=_a.onThreadReply;var user=useCurrentUser();var searchPostMentionUsers=usePostsApi().searchPostMentionUsers;if(!post||!post.id){return null;}return jsx$1(StyledPagedCommentsSection,{className:className,mentionSearchHandler:function(text){return searchPostMentionUsers(text,post.groupId);},type:ItemResourceTypes.Posts,scope:ConversationScope.Posts,itemId:post.id,groupIds:[post.groupId],readOnly:false,pageSize:5,initialPageSize:initialPageSize,initialComments:comments,onCommentAdded:onReplyAdded,onCommentDeleted:onReplyDeleted,noItemsYetStringResourceKey:"Posts.replies.empty",autoFocusReplyField:autoFocusReplyField,baseAttachmentPath:"/posts/"+post.id+"/comments",getHashtagFilterRoute:function(hashtag){return getPostsHashtagFilterRoute(post,user,hashtag);},onThreadReply:onThreadReply},post.id);};var StyledPagedCommentsSection=_styled(PagedCommentsSection).withConfig({displayName:"PostReplies__StyledPagedCommentsSection",componentId:"sc-8mrgcg-0"})(templateObject_1$d$1||(templateObject_1$d$1=__makeTemplateObject(["\n display: flex;\n flex: 1 1 auto;\n flex-direction: column;\n > div {\n width: 100%;\n }\n"],["\n display: flex;\n flex: 1 1 auto;\n flex-direction: column;\n > div {\n width: 100%;\n }\n"])));var templateObject_1$d$1;var PostEditor=function PostEditor(_a){var className=_a.className,post=_a.post,onBeforeSave=_a.onBeforeSave,onSaved=_a.onSaved,onCancel=_a.onCancel,keywordSettings=_a.keywordSettings;var features=useFeatures();var _b=usePostsApi(),searchPostMentionUsers=_b.searchPostMentionUsers,updatePost=_b.updatePost;var _c=useContext(LazySubscriptionContext),allKeywords=_c.allKeywords,keywordsByGroupId=_c.keywordsByGroupId;var _d=useNotificationContext(),showToast=_d.showToast,showError=_d.showError;if(allKeywords==null||keywordsByGroupId==null){return null;}return jsx$1(EditCommentWithAttachments,{className:className,onCancel:onCancel,content:post.content,onSave:handleSavePost,mentionSearchHandler:function(text){return searchPostMentionUsers(text,post.groupId);},inputTheme:"dark",item:post,basePath:'/posts',allowKeywords:features.keywords&&features.postKeywords,availableKeywords:keywordSettings===null||keywordSettings===void 0?void 0:keywordSettings.availableKeywords,mandatoryKeywords:keywordSettings===null||keywordSettings===void 0?void 0:keywordSettings.mandatoryKeywords,keywords:post.keywords,saveOnCtrlEnter:true},void 0);function handleSavePost(newContent,attachments,keywords){return __awaiter(this,void 0,void 0,function(){var updatedPost,error_1;return __generator(this,function(_a){switch(_a.label){case 0:_a.trys.push([0,2,,3]);onBeforeSave(__assign(__assign({},post),{content:newContent,attachments:attachments,keywords:keywords}));return [4/*yield*/,updatePost(post.id,newContent,attachments,keywords)];case 1:updatedPost=_a.sent();onSaved(updatedPost);showToast('Posts.successfullyUpdated');return [3/*break*/,3];case 2:error_1=_a.sent();logger.error(error_1);showError('Generic.error');return [3/*break*/,3];case 3:return [2/*return*/];}});});}};_styled(IconButton).withConfig({displayName:"PostFollowButton__StyledIconButton",componentId:"sc-1i97syp-0"})(templateObject_1$c$1||(templateObject_1$c$1=__makeTemplateObject(["\n && {\n margin: 0;\n font-size: inherit;\n\n &[disabled] {\n background: transparent;\n }\n }\n\n i {\n font-size: 20px;\n }\n user-select: none;\n"],["\n && {\n margin: 0;\n font-size: inherit;\n\n &[disabled] {\n background: transparent;\n }\n }\n\n i {\n font-size: 20px;\n }\n user-select: none;\n"])));var templateObject_1$c$1;var PostGroup=function PostGroup(_a){var groupId=_a.groupId,to=_a.to,className=_a.className;var intl=useIntl();var user=useCurrentUser();var group=user.groups.find(function(g){return g.id===groupId;});var groupName=getGroupName(group,user,intl);return jsx$1(Group,__assign({"data-post-group":groupId,title:groupName,to:to,className:className},{children:jsx$1("span",{children:groupName},void 0)}),void 0);};var Group=_styled(NavLink).withConfig({displayName:"PostGroup__Group",componentId:"sc-182l34m-0"})(templateObject_1$b$1||(templateObject_1$b$1=__makeTemplateObject(["\n font-size: ","px;\n height: 100%;\n\n span {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n ","\n"],["\n font-size: ","px;\n height: 100%;\n\n span {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n ","\n"])),fontSizeSmall,function(){return HighlightBubble();});var templateObject_1$b$1;_styled.div.withConfig({displayName:"PostDisplay__Host",componentId:"sc-1tope3b-0"})(templateObject_1$a$1||(templateObject_1$a$1=__makeTemplateObject(["\n ",";\n\n position: relative;\n\n // TODO: The font-sizes should be cleaned up as well,\n // there are too many different places where these are set\n // We set it here to 14px in order to have the same font-size as in the comment editor / comment input\n font-size: ","px;\n line-height: ","px;\n\n display: flex;\n flex-direction: column;\n .ms-layer {\n display: none;\n }\n"],["\n ",";\n\n position: relative;\n\n // TODO: The font-sizes should be cleaned up as well,\n // there are too many different places where these are set\n // We set it here to 14px in order to have the same font-size as in the comment editor / comment input\n font-size: ","px;\n line-height: ","px;\n\n display: flex;\n flex-direction: column;\n .ms-layer {\n display: none;\n }\n"])),CardBorderInline(2,2),fontSizeSmall,spacingM);_styled.div.withConfig({displayName:"PostDisplay__Header",componentId:"sc-1tope3b-1"})(templateObject_2$8$1||(templateObject_2$8$1=__makeTemplateObject(["\n display: flex;\n align-items: flex-start;\n"],["\n display: flex;\n align-items: flex-start;\n"])));var avatarWidth=40;var maxButtonsWidth=120;// max 4 buttons at 30 px each (translate, notifications, like and context menu)
122359
- var paddingLeft=spacingS;var postGroupWidth=250;var postGroupWidthSmall=215;_styled.div.withConfig({displayName:"PostDisplay__HeaderMetadata",componentId:"sc-1tope3b-2"})(templateObject_3$5$1||(templateObject_3$5$1=__makeTemplateObject(["\n display: flex;\n align-items: center;\n\n font-size: ","px;\n padding-left: ","px;\n max-width: calc(\n 100% - ","px - ","px - ","px -\n ","px\n );\n\n @media (max-width: ","px) {\n flex-direction: column;\n max-width: calc(\n 100% - ","px - ","px - ","px\n );\n }\n"],["\n display: flex;\n align-items: center;\n\n font-size: ","px;\n padding-left: ","px;\n max-width: calc(\n 100% - ","px - ","px - ","px -\n ","px\n );\n\n @media (max-width: ","px) {\n flex-direction: column;\n max-width: calc(\n 100% - ","px - ","px - ","px\n );\n }\n"])),fontSizeSmall,paddingLeft,avatarWidth,maxButtonsWidth,paddingLeft,function(p){return p.addSafetySpace?postGroupWidth:0;},maxScreenSize.medium,avatarWidth,maxButtonsWidth,paddingLeft);_styled.div.withConfig({displayName:"PostDisplay__Content",componentId:"sc-1tope3b-3"})(templateObject_4$3$1||(templateObject_4$3$1=__makeTemplateObject(["\n padding-top: 15px;\n a {\n text-decoration: underline;\n }\n"],["\n padding-top: 15px;\n a {\n text-decoration: underline;\n }\n"])));_styled.div.withConfig({displayName:"PostDisplay__ActionButtons",componentId:"sc-1tope3b-4"})(templateObject_5$3$1||(templateObject_5$3$1=__makeTemplateObject(["\n display: flex;\n align-items: center;\n margin-left: auto;\n"],["\n display: flex;\n align-items: center;\n margin-left: auto;\n"])));_styled.div.withConfig({displayName:"PostDisplay__PostDisplayName",componentId:"sc-1tope3b-5"})(templateObject_6$1$1||(templateObject_6$1$1=__makeTemplateObject(["\n font-weight: bold;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n"],["\n font-weight: bold;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n"])));_styled(DateTime).withConfig({displayName:"PostDisplay__PostDateTime",componentId:"sc-1tope3b-6"})(templateObject_7$1$1||(templateObject_7$1$1=__makeTemplateObject(["\n font-size: ","px;\n"],["\n font-size: ","px;\n"])),fontSizeSmaller);_styled(ActionButton).withConfig({displayName:"PostDisplay__AddReplyButton",componentId:"sc-1tope3b-7"})(templateObject_8$1$1||(templateObject_8$1$1=__makeTemplateObject(["\n margin-top: ","px;\n\n && {\n height: auto;\n min-height: 20px;\n border: none;\n padding: 0;\n color: ",";\n align-self: flex-start;\n }\n"],["\n margin-top: ","px;\n\n && {\n height: auto;\n min-height: 20px;\n border: none;\n padding: 0;\n color: ",";\n align-self: flex-start;\n }\n"])),spacingM,function(p){return p.theme.palette.accent;});_styled.div.withConfig({displayName:"PostDisplay__InnerHost",componentId:"sc-1tope3b-8"})(templateObject_10$d||(templateObject_10$d=__makeTemplateObject(["\n position: relative;\n padding: ","px;\n display: flex;\n flex-direction: column;\n\n ","\n"],["\n position: relative;\n padding: ","px;\n display: flex;\n flex-direction: column;\n\n ","\n"])),postsSectionPadding,function(p){return p.highlight&&css$2(templateObject_9$1$1||(templateObject_9$1$1=__makeTemplateObject(["\n &::after {\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n width: 6px;\n display: block;\n background-color: ",";\n }\n "],["\n &::after {\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n width: 6px;\n display: block;\n background-color: ",";\n }\n "])),function(p){return p.theme.palette.accent;});});_styled(PostReplies).withConfig({displayName:"PostDisplay__StyledPostComments",componentId:"sc-1tope3b-9"})(templateObject_11$8||(templateObject_11$8=__makeTemplateObject(["\n padding: ","px;\n background-color: ",";\n"],["\n padding: ","px;\n background-color: ",";\n"])),postsSectionPadding,function(p){return p.theme.palette.neutralLight;});_styled(PostEditor).withConfig({displayName:"PostDisplay__StyledPostEditor",componentId:"sc-1tope3b-10"})(templateObject_12$7||(templateObject_12$7=__makeTemplateObject(["\n margin-top: 7px;\n position: relative;\n"],["\n margin-top: 7px;\n position: relative;\n"])));_styled(NavLink).withConfig({displayName:"PostDisplay__PostLink",componentId:"sc-1tope3b-11"})(templateObject_13$6||(templateObject_13$6=__makeTemplateObject(["\n display: block;\n width: 100%;\n"],["\n display: block;\n width: 100%;\n"])));_styled(PostGroup).withConfig({displayName:"PostDisplay__StyledPostGroup",componentId:"sc-1tope3b-12"})(templateObject_14$6||(templateObject_14$6=__makeTemplateObject(["\n margin-left: ","px;\n max-width: ","px;\n\n @media (max-width: ","px) {\n margin-left: 0;\n margin-top: ","px;\n max-width: ","px;\n align-self: flex-start;\n }\n"],["\n margin-left: ","px;\n max-width: ","px;\n\n @media (max-width: ","px) {\n margin-left: 0;\n margin-top: ","px;\n max-width: ","px;\n align-self: flex-start;\n }\n"])),spacingM,postGroupWidth,maxScreenSize.medium,spacingS,postGroupWidthSmall);_styled(LikeButton).withConfig({displayName:"PostDisplay__StyledLikeButton",componentId:"sc-1tope3b-13"})(templateObject_15$6||(templateObject_15$6=__makeTemplateObject(["\n min-width: 1px;\n margin: 0;\n margin-right: 0 !important; /* IE fix */\n padding: 0 4px;\n i {\n font-size: 20px;\n }\n"],["\n min-width: 1px;\n margin: 0;\n margin-right: 0 !important; /* IE fix */\n padding: 0 4px;\n i {\n font-size: 20px;\n }\n"])));_styled(ImagesAndFilesList).withConfig({displayName:"PostDisplay__StyledImagesAndFilesList",componentId:"sc-1tope3b-14"})(templateObject_16$6||(templateObject_16$6=__makeTemplateObject(["\n margin-top: ","px;\n"],["\n margin-top: ","px;\n"])),spacingM);_styled(IconButton).withConfig({displayName:"PostDisplay__MenuButton",componentId:"sc-1tope3b-15"})(templateObject_17$5||(templateObject_17$5=__makeTemplateObject(["\n && {\n padding: 0;\n i {\n margin: 0;\n font-size: 20px;\n }\n }\n"],["\n && {\n padding: 0;\n i {\n margin: 0;\n font-size: 20px;\n }\n }\n"])));_styled(KeywordsInfo).withConfig({displayName:"PostDisplay__StyledKeywordsInfo",componentId:"sc-1tope3b-16"})(templateObject_18$4||(templateObject_18$4=__makeTemplateObject(["\n margin-top: ","px;\n"],["\n margin-top: ","px;\n"])),spacingM);_styled(ThreadView).withConfig({displayName:"PostDisplay__StyledThreadView",componentId:"sc-1tope3b-17"})(templateObject_19$4||(templateObject_19$4=__makeTemplateObject(["\n padding: ","px;\n background-color: ",";\n"],["\n padding: ","px;\n background-color: ",";\n"])),postsSectionPadding,function(p){return p.theme.palette.neutralLight;});var templateObject_1$a$1,templateObject_2$8$1,templateObject_3$5$1,templateObject_4$3$1,templateObject_5$3$1,templateObject_6$1$1,templateObject_7$1$1,templateObject_8$1$1,templateObject_9$1$1,templateObject_10$d,templateObject_11$8,templateObject_12$7,templateObject_13$6,templateObject_14$6,templateObject_15$6,templateObject_16$6,templateObject_17$5,templateObject_18$4,templateObject_19$4;_styled(Dropdown).withConfig({displayName:"PostGroupsSelector__StyledDropdown",componentId:"sc-g6rhck-0"})(templateObject_1$9$1||(templateObject_1$9$1=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),ToolbarDropdownStyles);_styled(NavLink).withConfig({displayName:"PostGroupsSelector__DropdownOption",componentId:"sc-g6rhck-1"})(templateObject_2$7$1||(templateObject_2$7$1=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),ToolbarOptionStyles);createGlobalStyle(templateObject_3$4$1||(templateObject_3$4$1=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),ToolbarGlobalDropdownStyles);var templateObject_1$9$1,templateObject_2$7$1,templateObject_3$4$1;_styled.div.withConfig({displayName:"PostGroupSelector__Host",componentId:"sc-1wyjpa9-0"})(templateObject_1$8$1||(templateObject_1$8$1=__makeTemplateObject(["\n width: 320px;\n\n @media (max-width: ","px) {\n width: 100%;\n }\n"],["\n width: 320px;\n\n @media (max-width: ","px) {\n width: 100%;\n }\n"])),maxScreenSize.small);_styled.h2.withConfig({displayName:"PostGroupSelector__Title",componentId:"sc-1wyjpa9-1"})(templateObject_2$6$1||(templateObject_2$6$1=__makeTemplateObject(["\n margin-top: 0;\n"],["\n margin-top: 0;\n"])));_styled.a.withConfig({displayName:"PostGroupSelector__Link",componentId:"sc-1wyjpa9-2"})(templateObject_3$3$1||(templateObject_3$3$1=__makeTemplateObject(["\n color: ",";\n font-weight: bold;\n display: flex;\n align-items: center;\n\n span {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n width: calc(100% - 64px); // 40px (avatar) + 14px (padding)\n }\n"],["\n color: ",";\n font-weight: bold;\n display: flex;\n align-items: center;\n\n span {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n width: calc(100% - 64px); // 40px (avatar) + 14px (padding)\n }\n"])),function(p){return p.theme.textColors.default;});_styled.div.withConfig({displayName:"PostGroupSelector__GroupsHost",componentId:"sc-1wyjpa9-3"})(templateObject_5$2$1||(templateObject_5$2$1=__makeTemplateObject(["\n ","\n overflow-y: auto;\n margin: ","px 0 ","px;\n\n > :not(:last-child) {\n margin-bottom: ","px;\n }\n"],["\n ","\n overflow-y: auto;\n margin: ","px 0 ","px;\n\n > :not(:last-child) {\n margin-bottom: ","px;\n }\n"])),function(p){return p.hasMaxHeight&&css$2(templateObject_4$2$1||(templateObject_4$2$1=__makeTemplateObject(["\n max-height: 340px;\n "],["\n max-height: 340px;\n "])));},spacingM,spacingS,spacingS);var templateObject_1$8$1,templateObject_2$6$1,templateObject_3$3$1,templateObject_4$2$1,templateObject_5$2$1;var StreamItemTypes;(function(StreamItemTypes){StreamItemTypes["Post"]="POST";StreamItemTypes["News"]="NEWS";StreamItemTypes["Event"]="EVENT";StreamItemTypes["Page"]="PAGE";})(StreamItemTypes||(StreamItemTypes={}));var StreamConversationScope;(function(StreamConversationScope){StreamConversationScope["Public"]="PUBLIC";StreamConversationScope["Editor"]="EDITOR";StreamConversationScope["Posts"]="POSTS";})(StreamConversationScope||(StreamConversationScope={}));var StreamKnownNewsState;(function(StreamKnownNewsState){StreamKnownNewsState["Unconfirmed"]="UNCONFIRMED";StreamKnownNewsState["Alert"]="ALERT";})(StreamKnownNewsState||(StreamKnownNewsState={}));function isPost(item){return item.type===StreamItemTypes.Post;}function isNews(item){return item.type===StreamItemTypes.News;}function isEvent(item){return item.type===StreamItemTypes.Event;}function isPage(item){return item.type===StreamItemTypes.Page;}function getGroupedKeywordsFromStream(keywords){var groupedKeywords={};(keywords||[]).forEach(function(k){if(!groupedKeywords[k.groupId]){groupedKeywords[k.groupId]=[];}var keyword=__assign(__assign({},k),{translations:(k.translations||[]).reduce(function(prev,curr){var _a;return __assign(__assign({},prev),(_a={},_a[curr.key]=curr.value,_a));},{})});groupedKeywords[k.groupId].push(keyword);});return groupedKeywords;}function convertProperties(items,user,subscriptionChannels){return items.map(function(i){var _a,_b,_c;var mappedItem=__assign(__assign({},i),{keywords:getGroupedKeywordsFromStream(i.keywordsList)});if(isPost(i)){return __assign(__assign({},mappedItem),{groupId:i.groupIds[0],attachments:(_a=i.postAttachments)===null||_a===void 0?void 0:_a.map(function(i){return __assign(__assign({},i),{type:getAttachmentType(i.type)});}),comments:__assign(__assign({},i.postComments),{items:(_b=i.postComments)===null||_b===void 0?void 0:_b.items.map(function(c){var _a;return __assign(__assign({},c),{conversationScope:getConversationScope(c.streamConversationScope),fileAccessToken:i.fileAccessToken,attachments:(_a=c.postCommentAttachments)===null||_a===void 0?void 0:_a.map(function(a){return __assign(__assign({},a),{type:getAttachmentType(a.type)});})});})})});}return __assign(__assign(__assign(__assign({},mappedItem),{userResponse:isEvent(i)?i.userResponseType&&getEventResponse(i.userResponseType):null,channels:(i.channelsList||[]).map(function(c){return {name:getChannelDisplayName(subscriptionChannels,c,user,getPreferredContentLanguage(user))};}),contents:i.contentsList.reduce(function(a,b){var _a;return __assign(__assign({},a),(_a={},_a[b.language]=b,_a));},{}),bannerInfo:i.bannerInfo&&__assign(__assign({},i.bannerInfo),{videoSource:convertStringToVideoSource((_c=i.bannerInfo)===null||_c===void 0?void 0:_c.videoSource)})}),getPageInfos(i)),getKnownNewsState(i));});}function getKnownNewsState(item){var _a,_b;if(!isNews(item)){return {};}var state=KnownNewsState.None;if((_a=item.knownNewsState)===null||_a===void 0?void 0:_a.includes(StreamKnownNewsState.Alert)){state|=KnownNewsState.Alert;}if((_b=item.knownNewsState)===null||_b===void 0?void 0:_b.includes(StreamKnownNewsState.Unconfirmed)){state|=KnownNewsState.Unconfirmed;}return {knownState:state};}function getPageInfos(item){if(!isPage(item)){return {};}return {pageType:getPageType(item.streamPageType),navigationContext:unflattenNavigationContext(item)};}function unflattenNavigationContext(item){var itemNavigationContext;var currentNavigationContext;var parentId=item.parentId;while(parentId!=null){var parent_1=item.path.find(function(c){return c.id===parentId;});if(!itemNavigationContext){itemNavigationContext={parent:parent_1};}else {currentNavigationContext.parent=parent_1;}parentId=parent_1.parentId;currentNavigationContext=parent_1;}return itemNavigationContext||{};}function getAttachmentType(source){switch(source){case GraphQLAttachmentType.News:return AttachmentType.News;case GraphQLAttachmentType.Event:return AttachmentType.Event;case GraphQLAttachmentType.Page:return AttachmentType.Page;case GraphQLAttachmentType.Post:return AttachmentType.Post;case GraphQLAttachmentType.Image:return AttachmentType.Image;case GraphQLAttachmentType.File:return AttachmentType.File;case GraphQLAttachmentType.VimeoVideo:return AttachmentType.VimeoVideo;case GraphQLAttachmentType.YouTubeVideo:return AttachmentType.YouTubeVideo;case GraphQLAttachmentType.Giphy:return AttachmentType.Giphy;default:return null;}}function getConversationScope(streamScope){switch(streamScope){case StreamConversationScope.Public:return ConversationScope.Public;case StreamConversationScope.Editor:return ConversationScope.Editor;case StreamConversationScope.Posts:return ConversationScope.Posts;default:return null;}}function getPageType(pageType){return pageType==='PAGE'?PageType.Page:PageType.Document;}function getEventResponse(source){switch(source){case StreamEventResponse.NotSet:return EventResponse.NotSet;case StreamEventResponse.Registered:return EventResponse.Registered;case StreamEventResponse.Declined:return EventResponse.Declined;default:return null;}}var StreamEventResponse;(function(StreamEventResponse){StreamEventResponse["NotSet"]="NOTSET";StreamEventResponse["Registered"]="REGISTERED";StreamEventResponse["Declined"]="DECLINED";})(StreamEventResponse||(StreamEventResponse={}));var CHANNELS_CONDITION=function CHANNELS_CONDITION(channels,allChannels){var _a,_b;if(!channels){return '';}var channelIds=(_b=(_a=channels.items)===null||_a===void 0?void 0:_a.map(function(c){var _a;return ((_a=allChannels===null||allChannels===void 0?void 0:allChannels.find(function(uc){return uc.name===c;}))===null||_a===void 0?void 0:_a.id)||"INVALID_CHANNEL_"+c;}))===null||_b===void 0?void 0:_b.map(function(c){return "\""+c+"\"";});if(!(channelIds===null||channelIds===void 0?void 0:channelIds.length)){return '';}if(channels.operator===LogicalOperator.And){var channelConditions=channelIds.map(function(c){return "{ channels: { some: { eq: "+c+" } } }";});return "and: [\n "+channelConditions.join()+"\n ]";}return "channels: { some: { in: ["+channelIds+"] } }";};var KEYWORDS_CONDITION=function KEYWORDS_CONDITION(keywords){var _a;if(!keywords||!((_a=keywords.items)===null||_a===void 0?void 0:_a.length)){return '';}if(keywords.operator===LogicalOperator.And){var keywordConditions=keywords.items.map(function(k){return "{ keywordIds: { some: { eq: \""+k+"\" } } }";});return "and: [\n "+keywordConditions.join()+"\n ]";}return "keywordIds: { some: { in: ["+keywords.items.map(function(k){return "\""+k+"\"";})+"] } }";};var OWNER_CONDITION=function OWNER_CONDITION(owner){if(!owner){return '';}return "or: [\n { author: { userPrincipalName: { eq: \""+owner+"\" } } }\n { owner: { userPrincipalName: { eq: \""+owner+"\" } } }\n { onBehalfOf: { userPrincipalName: { eq: \""+owner+"\" } } }\n ]";};var PUBLISHING_DATE_CONDITION=function PUBLISHING_DATE_CONDITION(beforeDate,afterDate){if(!beforeDate&&!afterDate){return '';}if(beforeDate&&afterDate){return "and: [\n { publishingDate: { gt: \""+afterDate+"\" } }\n { publishingDate: { lt: \""+beforeDate+"\" } }\n ]";}return afterDate?"publishingDate: { gt: \""+afterDate+"\" }":"publishingDate: { lt: \""+beforeDate+"\" }";};var AUTHORS_CONDITION=function AUTHORS_CONDITION(authors){if(!authors||!authors.length){return '';}return "or: [\n { owner: { userPrincipalName: { in: ["+(authors===null||authors===void 0?void 0:authors.map(function(a){return "\""+a+"\"";}))+"] } } }\n { onBehalfOf: { userPrincipalName: { in: ["+(authors===null||authors===void 0?void 0:authors.map(function(a){return "\""+a+"\"";}))+"] } } }\n ]";};gql(templateObject_2$5$1||(templateObject_2$5$1=__makeTemplateObject(["\n mutation MarkStreamAsRead {\n markStreamAsRead\n }\n"],["\n mutation MarkStreamAsRead {\n markStreamAsRead\n }\n"])));gql(templateObject_3$2$1||(templateObject_3$2$1=__makeTemplateObject(["\n mutation MarkItemsAsRead($itemIds: [String]) {\n markItemsAsRead(itemIds: $itemIds)\n }\n"],["\n mutation MarkItemsAsRead($itemIds: [String]) {\n markItemsAsRead(itemIds: $itemIds)\n }\n"])));var templateObject_2$5$1,templateObject_3$2$1;var EditorListItem=function EditorListItem(props){var user=useCurrentUser();var formatMessage=useIntl().formatMessage;var itemDomRef=useRef$1();var webAppUrl=useConfiguration().webAppUrl;if(props.language==null){return null;}var item=props.item;var className=classNames(props.className,'editor-list-item',{'editor-list-item-rejected ms-borderColor-red':item.status===WorkflowStatus.rejected&&isCurrentUserItemOwner()},{'editor-list-item-selected ms-fontColor-onSecondary ms-bgColor-themeSecondary':props.isSelected},{'ms-bgColor-white':!props.isSelected},{'editor-list-item--highlighted':props.highlighted});return jsxs(ListItem,__assign({className:className,"data-item-is-published":props.isPublishedItem,"data-is-focusable":true,"data-item-is-selected":props.isSelected,"data-item-id":item.id,ref:itemDomRef},{children:[props.useExternalLink?jsx$1(ExternalLink,__assign({href:""+webAppUrl+props.basePath+"/"+item.id+"/"+props.language,className:"editor-list-content",target:"_blank",rel:"noopener noreferrer",onClick:function(e){var _a;return (_a=props.onClick)===null||_a===void 0?void 0:_a.call(props,e,itemDomRef.current,item,getTitle());}},{children:props.onRenderContent(item,getTitle(),props.isSelected)}),void 0):jsx$1(Content$9,__assign({to:props.basePath+"/"+item.id+"/"+props.language,onClick:function(e){var _a;return (_a=props.onClick)===null||_a===void 0?void 0:_a.call(props,e,itemDomRef.current,item,getTitle());},className:"editor-list-content"},{children:props.onRenderContent(item,getTitle(),props.isSelected)}),void 0),jsxs(Options,{children:[props.allowSelection&&jsx$1(SelectedIconOption,{children:jsx$1(SelectedIcon,{"data-item-select":true,iconProps:{iconName:'CompletedSolid'},ariaLabel:formatMessage({id:'AriaLabel.editor.selectItemButton'}),onClick:toggleSelect,isTouch:env.isTouchDevice,isSelected:props.isSelected,className:classNames('ms-fontColor-neutralTertiary',{'ms-fontColor-themeDarkAlt':props.isSelected})},void 0)},void 0),jsx$1(StatusOption,{status:item.status,isActive:props.isSelected},void 0),jsx$1(Option,__assign({className:"editor-list-persona"},{children:item.owner&&jsx$1(Avatar,{upn:item.owner.userPrincipalName,size:PersonaSize.size48,text:props.item.owner.displayName,hidePersonaDetails:true},void 0)}),void 0)]},void 0)]}),void 0);function isCurrentUserItemOwner(){return props.item.owner&&props.item.owner.userPrincipalName===user.userPrincipalName;}function getTitle(){var title=props.item.contents[props.language].title;return title==null||title.trim().length===0?"<"+formatMessage({id:'Generic.noTitle'})+">":title;}function toggleSelect(){props.onSelect(props.item,!props.isSelected);}};var EditorItemTitle=_styled.h2.withConfig({displayName:"EditorListItem__EditorItemTitle",componentId:"sc-zoqzrc-0"})(templateObject_1$6$1||(templateObject_1$6$1=__makeTemplateObject(["\n && {\n font-weight: 600;\n margin: 0;\n font-size: 17px;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n @media (max-width: 700px) {\n font-size: 15px;\n }\n }\n"],["\n && {\n font-weight: 600;\n margin: 0;\n font-size: 17px;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n @media (max-width: 700px) {\n font-size: 15px;\n }\n }\n"])));var SelectedIcon=_styled(IconButton$1).withConfig({displayName:"EditorListItem__SelectedIcon",componentId:"sc-zoqzrc-1"})(templateObject_2$4$1||(templateObject_2$4$1=__makeTemplateObject(["\n padding: 0;\n height: 100%;\n width: auto;\n font-size: inherit;\n\n opacity: ",";\n\n &:focus {\n opacity: 1;\n }\n\n i {\n font-size: inherit;\n line-height: unset;\n height: auto;\n width: auto;\n padding: 0 19px 0 10px;\n }\n"],["\n padding: 0;\n height: 100%;\n width: auto;\n font-size: inherit;\n\n opacity: ",";\n\n &:focus {\n opacity: 1;\n }\n\n i {\n font-size: inherit;\n line-height: unset;\n height: auto;\n width: auto;\n padding: 0 19px 0 10px;\n }\n"])),function(p){return p.isSelected?1:p.isTouch?0.1:0;});var ListItem=_styled.div.withConfig({displayName:"EditorListItem__ListItem",componentId:"sc-zoqzrc-2"})(templateObject_3$1$1||(templateObject_3$1$1=__makeTemplateObject(["\n position: relative;\n font-family: 'Roboto', sans-serif;\n text-decoration: none;\n ",";\n\n display: flex;\n flex-flow: row nowrap;\n text-align: left;\n\n a,\n a:hover,\n a:active,\n a:visited {\n color: ",";\n text-decoration: none;\n }\n\n &.editor-list-item-rejected {\n border-left-width: 10px;\n border-style: solid;\n border-top: 0;\n border-bottom: 0;\n border-right: 0;\n > .editor-list-content {\n margin-left: 6px;\n }\n }\n\n &:hover {\n "," {\n opacity: 1;\n }\n }\n"],["\n position: relative;\n font-family: 'Roboto', sans-serif;\n text-decoration: none;\n ",";\n\n display: flex;\n flex-flow: row nowrap;\n text-align: left;\n\n a,\n a:hover,\n a:active,\n a:visited {\n color: ",";\n text-decoration: none;\n }\n\n &.editor-list-item-rejected {\n border-left-width: 10px;\n border-style: solid;\n border-top: 0;\n border-bottom: 0;\n border-right: 0;\n > .editor-list-content {\n margin-left: 6px;\n }\n }\n\n &:hover {\n "," {\n opacity: 1;\n }\n }\n"])),CardBorderInline(2,2),function(p){return p.theme.textColors.default;},SelectedIcon);var Options=_styled.div.withConfig({displayName:"EditorListItem__Options",componentId:"sc-zoqzrc-3"})(templateObject_4$1$1||(templateObject_4$1$1=__makeTemplateObject(["\n flex: 0 1 auto;\n display: flex;\n flex-flow: row nowrap;\n padding-right: 15px;\n\n @media (max-width: 700px) {\n padding-right: 6px;\n }\n"],["\n flex: 0 1 auto;\n display: flex;\n flex-flow: row nowrap;\n padding-right: 15px;\n\n @media (max-width: 700px) {\n padding-right: 6px;\n }\n"])));var Option=_styled.div.withConfig({displayName:"EditorListItem__Option",componentId:"sc-zoqzrc-4"})(templateObject_5$1$1||(templateObject_5$1$1=__makeTemplateObject(["\n padding: 6px 25px 6px 6px;\n font-size: 24px;\n text-align: center;\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: center;\n\n flex: 0 1 auto;\n\n &.editor-list-persona {\n width: 32px;\n }\n > div {\n height: 24px;\n }\n\n @media (max-width: 700px) {\n padding: 5px;\n i {\n font-size: 0.9em !important;\n padding: 0;\n }\n }\n"],["\n padding: 6px 25px 6px 6px;\n font-size: 24px;\n text-align: center;\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: center;\n\n flex: 0 1 auto;\n\n &.editor-list-persona {\n width: 32px;\n }\n > div {\n height: 24px;\n }\n\n @media (max-width: 700px) {\n padding: 5px;\n i {\n font-size: 0.9em !important;\n padding: 0;\n }\n }\n"])));var SelectedIconOption=_styled(Option).withConfig({displayName:"EditorListItem__SelectedIconOption",componentId:"sc-zoqzrc-5"})(templateObject_6$t||(templateObject_6$t=__makeTemplateObject(["\n padding: 6px;\n"],["\n padding: 6px;\n"])));var LinkStyle=css$2(templateObject_7$n||(templateObject_7$n=__makeTemplateObject(["\n padding: ","px;\n flex: 1 0 auto;\n /* todo: This smells, but it's required to make the ellipsis work. How to avoid it?*/\n width: 100px;\n margin: ","px ","px ","px ","px;\n\n @media (max-width: 700px) {\n margin: ","px;\n }\n"],["\n padding: ","px;\n flex: 1 0 auto;\n /* todo: This smells, but it's required to make the ellipsis work. How to avoid it?*/\n width: 100px;\n margin: ","px ","px ","px ","px;\n\n @media (max-width: 700px) {\n margin: ","px;\n }\n"])),spacingXs,spacingS,spacingS,spacingS,spacingS+6,spacingXs);var Content$9=_styled(Link$4).withConfig({displayName:"EditorListItem__Content",componentId:"sc-zoqzrc-6"})(templateObject_8$l||(templateObject_8$l=__makeTemplateObject(["\n ",";\n"],["\n ",";\n"])),LinkStyle);var ExternalLink=_styled.a.withConfig({displayName:"EditorListItem__ExternalLink",componentId:"sc-zoqzrc-7"})(templateObject_9$f||(templateObject_9$f=__makeTemplateObject(["\n ",";\n"],["\n ",";\n"])),LinkStyle);var StatusOption=function StatusOption(_a){var _b=_a.status,status=_b===void 0?WorkflowStatus.draft:_b,isActive=_a.isActive;if(status===WorkflowStatus.deleted){return null;}return jsx$1(Option,{children:status===WorkflowStatus.approved?jsx$1("img",{style:{width:'20px'},alt:""},void 0):jsx$1(Tooltip,__assign({resourceKey:'EditorList.'+status||WorkflowStatus.draft},{children:jsx$1(StateIcon,{status:status||WorkflowStatus.draft,width:20,isActive:isActive},void 0)}),void 0)},void 0);};var templateObject_1$6$1,templateObject_2$4$1,templateObject_3$1$1,templateObject_4$1$1,templateObject_5$1$1,templateObject_6$t,templateObject_7$n,templateObject_8$l,templateObject_9$f;var NewsEditorItem=function NewsEditorItem(_a){var title=_a.title,item=_a.item,isSelected=_a.isSelected;return jsxs(Fragment,{children:[jsx$1(EditorItemTitle,__assign({className:classNames({'ms-fontColor-onSecondary':isSelected})},{children:title}),void 0),jsx$1(DateInfo,__assign({className:classNames('ms-fontSize-m',{'ms-fontColor-onSecondary':isSelected})},{children:jsx$1(MetaInfo$1,{dateMode:DateMode.Published,item:item,expiryDate:item.expiryDate,channels:item.channels,readOnly:true,showChannels:true,hideAvatar:true,hideDisplayName:true},void 0)}),void 0)]},void 0);};var MetaInfo$1=_styled(ItemMetaInfo).withConfig({displayName:"NewsEditorItem__MetaInfo",componentId:"sc-1kz3wt0-0"})(templateObject_1$5$1||(templateObject_1$5$1=__makeTemplateObject(["\n [data-meta-info-details] {\n padding-left: 0;\n }\n"],["\n [data-meta-info-details] {\n padding-left: 0;\n }\n"])));var DateInfo=_styled.div.withConfig({displayName:"NewsEditorItem__DateInfo",componentId:"sc-1kz3wt0-1"})(templateObject_2$3$1||(templateObject_2$3$1=__makeTemplateObject(["\n padding-top: 8px;\n @media (max-width: 700px) {\n font-size: 12px;\n }\n"],["\n padding-top: 8px;\n @media (max-width: 700px) {\n font-size: 12px;\n }\n"])));var templateObject_1$5$1,templateObject_2$3$1;var EventDates=_styled.div.withConfig({displayName:"EventEditorItem__EventDates",componentId:"sc-1irp2hc-0"})(templateObject_1$4$1||(templateObject_1$4$1=__makeTemplateObject(["\n margin-top: ","px;\n font-size: ","px;\n\n display: flex;\n flex-direction: column;\n"],["\n margin-top: ","px;\n font-size: ","px;\n\n display: flex;\n flex-direction: column;\n"])),spacingS,fontSizeSmall);_styled.div.withConfig({displayName:"EventEditorItem__EmptyEventDates",componentId:"sc-1irp2hc-1"})(templateObject_2$2$1||(templateObject_2$2$1=__makeTemplateObject(["\n font-style: italic;\n"],["\n font-style: italic;\n"])));_styled.div.withConfig({displayName:"EventEditorItem__EventDateAndRecurrenceInfo",componentId:"sc-1irp2hc-2"})(templateObject_3$15||(templateObject_3$15=__makeTemplateObject(["\n display: flex;\n align-items: center;\n"],["\n display: flex;\n align-items: center;\n"])));_styled(EventRecurrenceSeriesInfo).withConfig({displayName:"EventEditorItem__RecurrenceSeriesInfo",componentId:"sc-1irp2hc-3"})(templateObject_4$M||(templateObject_4$M=__makeTemplateObject(["\n margin-top: ","px;\n"],["\n margin-top: ","px;\n"])),spacingS);_styled(EventDates).withConfig({displayName:"EventEditorItem__DatesInfo",componentId:"sc-1irp2hc-4"})(templateObject_5$E||(templateObject_5$E=__makeTemplateObject(["\n margin-right: ","px;\n"],["\n margin-right: ","px;\n"])),spacingM);var templateObject_1$4$1,templateObject_2$2$1,templateObject_3$15,templateObject_4$M,templateObject_5$E;var CreateNewItemButton=function CreateNewItemButton(_a){var type=_a.type,groupId=_a.groupId,onClick=_a.onClick,className=_a.className;var baseRoute=useBaseRoute();var history=useHistory();var buildPath=useSubscriptionHandlePathBuilder().buildPath;var intl=useIntl();var user=useCurrentUser();var hasSelectedGroup=!!groupId;var groups=getGroupItems();if(hasSelectedGroup||groups.length===1){return jsx$1(StyledPrimaryButton,__assign({iconProps:{iconName:'AddTo'},onClick:function(){return handleOnClick(hasSelectedGroup?undefined:groups[0].key);},className:className,"data-button-create":type},{children:jsx$1(FormattedMessage$1,{id:"EditorList."+type+"CreateButton"},void 0)}),void 0);}if(!groups.length){return null;}return jsx$1(MenuButton,__assign({iconProps:{iconName:'AddTo'},menuProps:{items:groups,calloutProps:{calloutMaxWidth:300},className:'lt-reach-callout'},className:className,"data-button-create":type},{children:jsx$1(FormattedMessage$1,{id:"EditorList."+type+"CreateButton"},void 0)}),void 0);function getGroupItems(){return getGroupsWithExplicitMinRole(GroupRoles.Author,user).map(function(g){return {key:g.id,onClick:function(){return handleOnClick(g.id);},text:getGroupName(g,user,intl)};});}function openEditor(id){history.push(buildPath("/editor/"+type+"/groups/"+id+"/new"));}function handleOnClick(id){if(onClick){onClick(groupId||id);}else {hasSelectedGroup?history.push(baseRoute+"/new"):openEditor(id);}}};var MenuButton=_styled(CommandBarButton).withConfig({displayName:"CreateNewItemButton__MenuButton",componentId:"sc-18o74g9-0"})(templateObject_1$3$1||(templateObject_1$3$1=__makeTemplateObject(["\n && {\n background-color: ",";\n &:hover {\n background-color: ",";\n i,\n span {\n color: ",";\n background-color: transparent;\n }\n }\n\n // the ms-fontColor on the button is not applied on the icons\n i,\n span {\n color: ",";\n }\n }\n\n height: 32px;\n padding: 0 ","px;\n\n i:first-child {\n margin: 0 ","px 0 0;\n }\n\n span {\n white-space: pre;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n"],["\n && {\n background-color: ",";\n &:hover {\n background-color: ",";\n i,\n span {\n color: ",";\n background-color: transparent;\n }\n }\n\n // the ms-fontColor on the button is not applied on the icons\n i,\n span {\n color: ",";\n }\n }\n\n height: 32px;\n padding: 0 ","px;\n\n i:first-child {\n margin: 0 ","px 0 0;\n }\n\n span {\n white-space: pre;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n"])),function(p){return p.theme.semanticColors.primaryButtonBackground;},function(p){return p.theme.semanticColors.primaryButtonBackgroundHovered;},function(p){return p.theme.semanticColors.primaryButtonTextHovered;},function(p){return p.theme.semanticColors.primaryButtonText;},spacingS,spacingS);var StyledPrimaryButton=_styled(PrimaryButton).withConfig({displayName:"CreateNewItemButton__StyledPrimaryButton",componentId:"sc-18o74g9-1"})(templateObject_2$1$1||(templateObject_2$1$1=__makeTemplateObject(["\n padding: 0 ","px;\n\n i {\n margin: 0 ","px 0 0;\n }\n\n span {\n white-space: pre;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n"],["\n padding: 0 ","px;\n\n i {\n margin: 0 ","px 0 0;\n }\n\n span {\n white-space: pre;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n"])),spacingS,spacingS);var templateObject_1$3$1,templateObject_2$1$1;function useEditorApi(){var api=useApi();var fetchFromApi=useApiFactory().fetchFromApi;var sendBeacon=useBeaconHandler();var onRequestToken=useContext(AuthenticationContext).onRequestToken;return useMemo(function(){return {cloneItem:cloneItem,getDeletedItems:getDeletedItems,getVersion:getVersion,getVersions:getVersions,deleteDraft:deleteDraft,deleteRange:deleteRange,deletePermanently:deletePermanently,bulkSetStatus:bulkSetStatus,setStatus:setStatus,removeLease:removeLease,keepLeaseAlive:keepLeaseAlive,saveItem:saveItem,updateGroups:updateGroups,translateContent:translateContent};function translateContent(itemId,translateFrom,translateTo){return api.all("editor/news/"+itemId+"/contents/"+translateFrom+"/translations?"+queryString.stringify({languages:translateTo})).getAll().then(function(response){return response.body(false);});}function updateGroups(itemType,itemId,groupIds){return api.custom("editor/"+itemType+"/"+itemId+"/groups").put(groupIds).then(function(response){return response.body().data();});}function cloneItem(itemType,itemId){return api.all("editor/"+itemType+"?"+queryString.stringify({cloneFromItem:itemId})).post({}).then(function(response){return response.body().data();});}function getDeletedItems(type,filter,token){var params=Object.assign({},__assign(__assign(__assign({},filter),getCommaSeparatedChannelsString(filter===null||filter===void 0?void 0:filter.channels)),getCommaSeparatedKeywordsString(filter===null||filter===void 0?void 0:filter.keywords)),{token:token,pageSize:30});return api.all("editor/"+type+"/recyclebin").get('',params).then(function(res){return res.body().data();});}function getVersions(type,itemId){return from(api.all("editor/"+type+"/"+itemId+"/versions").getAll()).pipe(map(function(response){return response.body().map(function(group){return group.data();});}));}function getVersion(type,itemId,versionId){return api.all("editor/"+type+"/"+itemId+"/versions").get(versionId).then(function(response){return response.body().data();});}function deleteDraft(leaseId,itemId,type){var url="editor/"+type+"/"+itemId+"/draft";if(leaseId){url+="?leaseId="+leaseId;}return api.custom(url).delete();}function deleteRange(type,ids){var data=ids.map(function(id){return {id:id,status:WorkflowStatus.deleted};});return api.custom("editor/"+type).patch(data).then(function(response){return response.body().map(function(item){return item.data();});}).catch(function(){// set null as a result in case of error
122355
+ var pages=!navigationContext.parent||!navigationContext.parent.id?sortPageNodesByGroupAndPosition(user.groups,navigationContext.siblings):navigationContext.siblings;var previousPage=getSibling(-1);var nextPage=getSibling(1);return jsxs(Host$5$1,__assign({className:className,"data-detail-page-navigation":activePageId},{children:[previousPage&&jsx$1(PageLinkButton,{isNextNode:false,basePath:basePath,page:previousPage,icon:"ChevronLeftSmall","data-detail-page-navigation-previous-node":previousPage.id,"data-detail-page-navigation-node":previousPage.id},void 0),nextPage&&jsx$1(PageLinkButton,{isNextNode:true,className:"next-page-link-button",basePath:basePath,page:nextPage,icon:"ChevronRightSmall","data-detail-page-navigation-next-node":nextPage.id,"data-detail-page-navigation-node":nextPage.id},void 0)]}),void 0);function getSibling(offset){var index=pages.findIndex(function(s){return s.id===activePageId;});return pages[index+offset];}};var Host$5$1=_styled.div.withConfig({displayName:"PagesDetailViewNavigation__Host",componentId:"sc-19ae9g3-0"})(templateObject_1$g$1||(templateObject_1$g$1=__makeTemplateObject(["\n display: flex;\n flex-wrap: wrap;\n"],["\n display: flex;\n flex-wrap: wrap;\n"])));var PageLinkButton=function PageLinkButton(_a){var basePath=_a.basePath,page=_a.page,icon=_a.icon,isNextNode=_a.isNextNode,className=_a.className,props=__rest(_a,["basePath","page","icon","isNextNode","className"]);var user=useCurrentUser();var formatMessage=useIntl().formatMessage;var title=getTitle(page,user,formatMessage);return jsxs(Link$1,__assign({to:getUrl(),className:className},{children:[!isNextNode&&jsx$1(LinkIcon,{iconName:icon},void 0),jsx$1(Content$2$1,__assign({},props,{isNextNode:isNextNode},{children:jsx$1("div",__assign({title:title},{children:title}),void 0)}),void 0),isNextNode&&jsx$1(LinkIcon,{iconName:icon},void 0)]}),void 0);function getUrl(){var baseUrl=NewsService.getNewsRoute(basePath,page.id,title);return page.useExternalContent?baseUrl+"?"+queryString.stringify({noRedirect:true}):baseUrl;}};var Link$1=_styled(NavLink).withConfig({displayName:"PagesDetailViewNavigation__Link",componentId:"sc-19ae9g3-1"})(templateObject_2$b$1||(templateObject_2$b$1=__makeTemplateObject(["\n display: flex;\n align-items: center;\n\n padding-top: ","px;\n padding-bottom: ","px;\n margin-bottom: 2px;\n\n max-width: 45%;\n width: auto;\n border-radius: 5px;\n\n &.next-page-link-button {\n margin-left: auto;\n }\n\n @media (max-width: ","px) {\n max-width: 100% !important;\n margin-bottom: ","px;\n }\n\n background-color: ",";\n && {\n color: ",";\n }\n"],["\n display: flex;\n align-items: center;\n\n padding-top: ","px;\n padding-bottom: ","px;\n margin-bottom: 2px;\n\n max-width: 45%;\n width: auto;\n border-radius: 5px;\n\n &.next-page-link-button {\n margin-left: auto;\n }\n\n @media (max-width: ","px) {\n max-width: 100% !important;\n margin-bottom: ","px;\n }\n\n background-color: ",";\n && {\n color: ",";\n }\n"])),spacingS,spacingS,maxScreenSize.small,spacingS,function(p){return p.theme.palette.neutralLight;},function(p){return p.theme.textColors.default;});var LinkIcon=_styled(Icon).withConfig({displayName:"PagesDetailViewNavigation__LinkIcon",componentId:"sc-19ae9g3-2"})(templateObject_3$8$1||(templateObject_3$8$1=__makeTemplateObject(["\n && {\n display: flex;\n justify-content: center;\n font-size: ","px;\n padding: 0 ","px;\n }\n"],["\n && {\n display: flex;\n justify-content: center;\n font-size: ","px;\n padding: 0 ","px;\n }\n"])),fontSizeNormal,spacingM);var Content$2$1=_styled.div.withConfig({displayName:"PagesDetailViewNavigation__Content",componentId:"sc-19ae9g3-3"})(templateObject_5$4$1||(templateObject_5$4$1=__makeTemplateObject(["\n flex: 0 1 auto;\n display: flex;\n flex-direction: column;\n padding-right: 23px;\n\n white-space: nowrap;\n overflow: hidden;\n\n div {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n ","\n"],["\n flex: 0 1 auto;\n display: flex;\n flex-direction: column;\n padding-right: 23px;\n\n white-space: nowrap;\n overflow: hidden;\n\n div {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n ","\n"])),function(p){return p.isNextNode&&css$2(templateObject_4$4$1||(templateObject_4$4$1=__makeTemplateObject(["\n margin-left: auto;\n padding-left: 23px;\n padding-right: 0;\n "],["\n margin-left: auto;\n padding-left: 23px;\n padding-right: 0;\n "])));});var templateObject_1$g$1,templateObject_2$b$1,templateObject_3$8$1,templateObject_4$4$1,templateObject_5$4$1;_styled(Dropdown).withConfig({displayName:"PagesGroupsSelector__StyledDropdown",componentId:"sc-13yd888-0"})(templateObject_1$f$1||(templateObject_1$f$1=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),ToolbarDropdownStyles);_styled(NavLink).withConfig({displayName:"PagesGroupsSelector__DropdownOption",componentId:"sc-13yd888-1"})(templateObject_2$a$1||(templateObject_2$a$1=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),ToolbarOptionStyles);createGlobalStyle(templateObject_3$7$1||(templateObject_3$7$1=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),ToolbarGlobalDropdownStyles);var templateObject_1$f$1,templateObject_2$a$1,templateObject_3$7$1;_styled.div.withConfig({displayName:"GroupNotificationsSettings__Host",componentId:"sc-1z0rxrb-0"})(templateObject_1$e$1||(templateObject_1$e$1=__makeTemplateObject(["\n width: 400px;\n\n @media (max-width: ","px) {\n width: 100%;\n }\n"],["\n width: 400px;\n\n @media (max-width: ","px) {\n width: 100%;\n }\n"])),maxScreenSize.small);_styled.h2.withConfig({displayName:"GroupNotificationsSettings__Title",componentId:"sc-1z0rxrb-1"})(templateObject_2$9$1||(templateObject_2$9$1=__makeTemplateObject(["\n margin-top: 0;\n"],["\n margin-top: 0;\n"])));_styled.div.withConfig({displayName:"GroupNotificationsSettings__Infos",componentId:"sc-1z0rxrb-2"})(templateObject_3$6$1||(templateObject_3$6$1=__makeTemplateObject(["\n color: ",";\n padding-left: 55px;\n"],["\n color: ",";\n padding-left: 55px;\n"])),function(p){return p.theme.palette.neutralTertiaryAlt;});var templateObject_1$e$1,templateObject_2$9$1,templateObject_3$6$1;function getPostGroups(user){return getGroupsWithExplicitMinRole(GroupRoles.LimitedReader,user,function(g){return g.allowPosts;});}function getPostsBaseRoute(post,user){var _a;var postGroups=getPostGroups(user);var subscriptionHandle=(_a=user.subscription.subscriptionHandle)!==null&&_a!==void 0?_a:user.subscription.id;return postGroups.length>1?"/"+subscriptionHandle+"/posts/groups/"+((post===null||post===void 0?void 0:post.groupId)||''):"/"+subscriptionHandle+"/posts";}function getPostsHashtagFilterRoute(post,user,hashtag){return getPostsBaseRoute(post,user)+"?"+queryString.stringify({search:""+hashtag});}var PostReplies=function PostReplies(_a){var className=_a.className,post=_a.post,comments=_a.comments,initialPageSize=_a.initialPageSize,autoFocusReplyField=_a.autoFocusReplyField,onReplyAdded=_a.onReplyAdded,onReplyDeleted=_a.onReplyDeleted,onThreadReply=_a.onThreadReply;var user=useCurrentUser();var searchPostMentionUsers=usePostsApi().searchPostMentionUsers;if(!post||!post.id){return null;}return jsx$1(StyledPagedCommentsSection,{className:className,mentionSearchHandler:function(text){return searchPostMentionUsers(text,post.groupId);},type:ItemResourceTypes.Posts,scope:ConversationScope.Posts,itemId:post.id,groupIds:[post.groupId],readOnly:false,pageSize:5,initialPageSize:initialPageSize,initialComments:comments,onCommentAdded:onReplyAdded,onCommentDeleted:onReplyDeleted,noItemsYetStringResourceKey:"Posts.replies.empty",autoFocusReplyField:autoFocusReplyField,baseAttachmentPath:"/posts/"+post.id+"/comments",getHashtagFilterRoute:function(hashtag){return getPostsHashtagFilterRoute(post,user,hashtag);},onThreadReply:onThreadReply},post.id);};var StyledPagedCommentsSection=_styled(PagedCommentsSection).withConfig({displayName:"PostReplies__StyledPagedCommentsSection",componentId:"sc-8mrgcg-0"})(templateObject_1$d$1||(templateObject_1$d$1=__makeTemplateObject(["\n display: flex;\n flex: 1 1 auto;\n flex-direction: column;\n > div {\n width: 100%;\n }\n"],["\n display: flex;\n flex: 1 1 auto;\n flex-direction: column;\n > div {\n width: 100%;\n }\n"])));var templateObject_1$d$1;var PostEditor=function PostEditor(_a){var className=_a.className,post=_a.post,onBeforeSave=_a.onBeforeSave,onSaved=_a.onSaved,onCancel=_a.onCancel,keywordSettings=_a.keywordSettings;var features=useFeatures();var _b=usePostsApi(),searchPostMentionUsers=_b.searchPostMentionUsers,updatePost=_b.updatePost;var formatMessage=useIntl().formatMessage;var _c=useContext(LazySubscriptionContext),allKeywords=_c.allKeywords,keywordsByGroupId=_c.keywordsByGroupId;var _d=useNotificationContext(),showToast=_d.showToast,showError=_d.showError;if(allKeywords==null||keywordsByGroupId==null){return null;}return jsx$1(EditCommentWithAttachments,{className:className,onCancel:onCancel,content:post.content,onSave:handleSavePost,mentionSearchHandler:function(text){return searchPostMentionUsers(text,post.groupId);},attachmentPreviewTheme:"dark",item:post,basePath:'/posts',allowKeywords:features.keywords&&features.postKeywords,keywordSettings:keywordSettings,keywords:post.keywords,saveOnCtrlEnter:true,ariaLabel:formatMessage({id:'AriaLabel.postInput'})},void 0);function handleSavePost(newContent,attachments,keywords){return __awaiter(this,void 0,void 0,function(){var updatedPost,error_1;return __generator(this,function(_a){switch(_a.label){case 0:_a.trys.push([0,2,,3]);onBeforeSave(__assign(__assign({},post),{content:newContent,attachments:attachments,keywords:keywords}));return [4/*yield*/,updatePost(post.id,newContent,attachments,keywords)];case 1:updatedPost=_a.sent();onSaved(updatedPost);showToast('Posts.successfullyUpdated');return [3/*break*/,3];case 2:error_1=_a.sent();logger.error(error_1);showError('Generic.error');return [3/*break*/,3];case 3:return [2/*return*/];}});});}};_styled(IconButton).withConfig({displayName:"PostFollowButton__StyledIconButton",componentId:"sc-1i97syp-0"})(templateObject_1$c$1||(templateObject_1$c$1=__makeTemplateObject(["\n && {\n margin: 0;\n font-size: inherit;\n\n &[disabled] {\n background: transparent;\n }\n }\n\n i {\n font-size: 20px;\n }\n user-select: none;\n"],["\n && {\n margin: 0;\n font-size: inherit;\n\n &[disabled] {\n background: transparent;\n }\n }\n\n i {\n font-size: 20px;\n }\n user-select: none;\n"])));var templateObject_1$c$1;var PostGroup=function PostGroup(_a){var groupId=_a.groupId,to=_a.to,className=_a.className;var intl=useIntl();var user=useCurrentUser();var group=user.groups.find(function(g){return g.id===groupId;});var groupName=getGroupName(group,user,intl);return jsx$1(Group,__assign({"data-post-group":groupId,title:groupName,to:to,className:className},{children:jsx$1("span",{children:groupName},void 0)}),void 0);};var Group=_styled(NavLink).withConfig({displayName:"PostGroup__Group",componentId:"sc-182l34m-0"})(templateObject_1$b$1||(templateObject_1$b$1=__makeTemplateObject(["\n font-size: ","px;\n height: 100%;\n\n span {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n ","\n"],["\n font-size: ","px;\n height: 100%;\n\n span {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n ","\n"])),fontSizeSmall,function(){return HighlightBubble();});var templateObject_1$b$1;_styled.div.withConfig({displayName:"PostDisplay__Host",componentId:"sc-1tope3b-0"})(templateObject_1$a$1||(templateObject_1$a$1=__makeTemplateObject(["\n ",";\n\n position: relative;\n\n // TODO: The font-sizes should be cleaned up as well,\n // there are too many different places where these are set\n // We set it here to 14px in order to have the same font-size as in the comment editor / comment input\n font-size: ","px;\n line-height: ","px;\n\n display: flex;\n flex-direction: column;\n .ms-layer {\n display: none;\n }\n"],["\n ",";\n\n position: relative;\n\n // TODO: The font-sizes should be cleaned up as well,\n // there are too many different places where these are set\n // We set it here to 14px in order to have the same font-size as in the comment editor / comment input\n font-size: ","px;\n line-height: ","px;\n\n display: flex;\n flex-direction: column;\n .ms-layer {\n display: none;\n }\n"])),CardBorderInline(2,2),fontSizeSmall,spacingM);_styled.div.withConfig({displayName:"PostDisplay__Header",componentId:"sc-1tope3b-1"})(templateObject_2$8$1||(templateObject_2$8$1=__makeTemplateObject(["\n display: flex;\n align-items: flex-start;\n"],["\n display: flex;\n align-items: flex-start;\n"])));var avatarWidth=40;var maxButtonsWidth=120;// max 4 buttons at 30 px each (translate, notifications, like and context menu)
122356
+ var paddingLeft=spacingS;var postGroupWidth=250;var postGroupWidthSmall=215;_styled.div.withConfig({displayName:"PostDisplay__HeaderMetadata",componentId:"sc-1tope3b-2"})(templateObject_3$5$1||(templateObject_3$5$1=__makeTemplateObject(["\n display: flex;\n align-items: center;\n\n font-size: ","px;\n padding-left: ","px;\n max-width: calc(\n 100% - ","px - ","px - ","px -\n ","px\n );\n\n @media (max-width: ","px) {\n flex-direction: column;\n max-width: calc(\n 100% - ","px - ","px - ","px\n );\n }\n"],["\n display: flex;\n align-items: center;\n\n font-size: ","px;\n padding-left: ","px;\n max-width: calc(\n 100% - ","px - ","px - ","px -\n ","px\n );\n\n @media (max-width: ","px) {\n flex-direction: column;\n max-width: calc(\n 100% - ","px - ","px - ","px\n );\n }\n"])),fontSizeSmall,paddingLeft,avatarWidth,maxButtonsWidth,paddingLeft,function(p){return p.addSafetySpace?postGroupWidth:0;},maxScreenSize.medium,avatarWidth,maxButtonsWidth,paddingLeft);_styled.div.withConfig({displayName:"PostDisplay__Content",componentId:"sc-1tope3b-3"})(templateObject_4$3$1||(templateObject_4$3$1=__makeTemplateObject(["\n padding-top: 15px;\n a {\n text-decoration: underline;\n }\n"],["\n padding-top: 15px;\n a {\n text-decoration: underline;\n }\n"])));_styled.div.withConfig({displayName:"PostDisplay__ActionButtons",componentId:"sc-1tope3b-4"})(templateObject_5$3$1||(templateObject_5$3$1=__makeTemplateObject(["\n display: flex;\n align-items: center;\n margin-left: auto;\n"],["\n display: flex;\n align-items: center;\n margin-left: auto;\n"])));_styled.div.withConfig({displayName:"PostDisplay__PostDisplayName",componentId:"sc-1tope3b-5"})(templateObject_6$1$1||(templateObject_6$1$1=__makeTemplateObject(["\n font-weight: bold;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n"],["\n font-weight: bold;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n"])));_styled(DateTime).withConfig({displayName:"PostDisplay__PostDateTime",componentId:"sc-1tope3b-6"})(templateObject_7$1$1||(templateObject_7$1$1=__makeTemplateObject(["\n font-size: ","px;\n"],["\n font-size: ","px;\n"])),fontSizeSmaller);_styled(ActionButton).withConfig({displayName:"PostDisplay__AddReplyButton",componentId:"sc-1tope3b-7"})(templateObject_8$1$1||(templateObject_8$1$1=__makeTemplateObject(["\n margin-top: ","px;\n\n && {\n height: auto;\n min-height: 20px;\n border: none;\n padding: 0;\n color: ",";\n align-self: flex-start;\n }\n"],["\n margin-top: ","px;\n\n && {\n height: auto;\n min-height: 20px;\n border: none;\n padding: 0;\n color: ",";\n align-self: flex-start;\n }\n"])),spacingM,function(p){return p.theme.palette.accent;});_styled.div.withConfig({displayName:"PostDisplay__InnerHost",componentId:"sc-1tope3b-8"})(templateObject_10$d||(templateObject_10$d=__makeTemplateObject(["\n position: relative;\n padding: ","px;\n display: flex;\n flex-direction: column;\n\n ","\n"],["\n position: relative;\n padding: ","px;\n display: flex;\n flex-direction: column;\n\n ","\n"])),postsSectionPadding,function(p){return p.highlight&&css$2(templateObject_9$1$1||(templateObject_9$1$1=__makeTemplateObject(["\n &::after {\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n width: 6px;\n display: block;\n background-color: ",";\n }\n "],["\n &::after {\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n width: 6px;\n display: block;\n background-color: ",";\n }\n "])),function(p){return p.theme.palette.accent;});});_styled(PostReplies).withConfig({displayName:"PostDisplay__StyledPostComments",componentId:"sc-1tope3b-9"})(templateObject_11$8||(templateObject_11$8=__makeTemplateObject(["\n padding: ","px;\n background-color: ",";\n\n @media (max-width: ","px) {\n padding: ","px ","px;\n \n > [data-list] {\n padding: 0 ","px;\n box-sizing: border-box;\n }\n }\n }\n"],["\n padding: ","px;\n background-color: ",";\n\n @media (max-width: ","px) {\n padding: ","px ","px;\n \n > [data-list] {\n padding: 0 ","px;\n box-sizing: border-box;\n }\n }\n }\n"])),postsSectionPadding,function(p){return p.theme.palette.neutralLight;},maxScreenSize.medium,postsSectionPadding,spacingS,spacingS);_styled(PostEditor).withConfig({displayName:"PostDisplay__StyledPostEditor",componentId:"sc-1tope3b-10"})(templateObject_12$7||(templateObject_12$7=__makeTemplateObject(["\n margin-top: 7px;\n position: relative;\n"],["\n margin-top: 7px;\n position: relative;\n"])));_styled(NavLink).withConfig({displayName:"PostDisplay__PostLink",componentId:"sc-1tope3b-11"})(templateObject_13$6||(templateObject_13$6=__makeTemplateObject(["\n display: block;\n width: 100%;\n"],["\n display: block;\n width: 100%;\n"])));_styled(PostGroup).withConfig({displayName:"PostDisplay__StyledPostGroup",componentId:"sc-1tope3b-12"})(templateObject_14$6||(templateObject_14$6=__makeTemplateObject(["\n margin-left: ","px;\n max-width: ","px;\n\n @media (max-width: ","px) {\n margin-left: 0;\n margin-top: ","px;\n max-width: ","px;\n align-self: flex-start;\n }\n"],["\n margin-left: ","px;\n max-width: ","px;\n\n @media (max-width: ","px) {\n margin-left: 0;\n margin-top: ","px;\n max-width: ","px;\n align-self: flex-start;\n }\n"])),spacingM,postGroupWidth,maxScreenSize.medium,spacingS,postGroupWidthSmall);_styled(LikeButton).withConfig({displayName:"PostDisplay__StyledLikeButton",componentId:"sc-1tope3b-13"})(templateObject_15$6||(templateObject_15$6=__makeTemplateObject(["\n min-width: 1px;\n margin: 0;\n margin-right: 0 !important; /* IE fix */\n padding: 0 4px;\n i {\n font-size: 20px;\n }\n"],["\n min-width: 1px;\n margin: 0;\n margin-right: 0 !important; /* IE fix */\n padding: 0 4px;\n i {\n font-size: 20px;\n }\n"])));_styled(ImagesAndFilesList).withConfig({displayName:"PostDisplay__StyledImagesAndFilesList",componentId:"sc-1tope3b-14"})(templateObject_16$6||(templateObject_16$6=__makeTemplateObject(["\n margin-top: ","px;\n"],["\n margin-top: ","px;\n"])),spacingM);_styled(IconButton).withConfig({displayName:"PostDisplay__MenuButton",componentId:"sc-1tope3b-15"})(templateObject_17$5||(templateObject_17$5=__makeTemplateObject(["\n && {\n padding: 0;\n i {\n margin: 0;\n font-size: 20px;\n }\n }\n"],["\n && {\n padding: 0;\n i {\n margin: 0;\n font-size: 20px;\n }\n }\n"])));_styled(KeywordsInfo).withConfig({displayName:"PostDisplay__StyledKeywordsInfo",componentId:"sc-1tope3b-16"})(templateObject_18$4||(templateObject_18$4=__makeTemplateObject(["\n margin-top: ","px;\n"],["\n margin-top: ","px;\n"])),spacingM);_styled(ThreadView).withConfig({displayName:"PostDisplay__StyledThreadView",componentId:"sc-1tope3b-17"})(templateObject_19$4||(templateObject_19$4=__makeTemplateObject(["\n padding: ","px;\n background-color: ",";\n\n @media (max-width: ","px) {\n div[data-comment='create'] {\n margin: 0 -","px;\n }\n }\n"],["\n padding: ","px;\n background-color: ",";\n\n @media (max-width: ","px) {\n div[data-comment='create'] {\n margin: 0 -","px;\n }\n }\n"])),postsSectionPadding,function(p){return p.theme.palette.neutralLight;},maxScreenSize.medium,spacingS);var templateObject_1$a$1,templateObject_2$8$1,templateObject_3$5$1,templateObject_4$3$1,templateObject_5$3$1,templateObject_6$1$1,templateObject_7$1$1,templateObject_8$1$1,templateObject_9$1$1,templateObject_10$d,templateObject_11$8,templateObject_12$7,templateObject_13$6,templateObject_14$6,templateObject_15$6,templateObject_16$6,templateObject_17$5,templateObject_18$4,templateObject_19$4;_styled(Dropdown).withConfig({displayName:"PostGroupsSelector__StyledDropdown",componentId:"sc-g6rhck-0"})(templateObject_1$9$1||(templateObject_1$9$1=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),ToolbarDropdownStyles);_styled(NavLink).withConfig({displayName:"PostGroupsSelector__DropdownOption",componentId:"sc-g6rhck-1"})(templateObject_2$7$1||(templateObject_2$7$1=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),ToolbarOptionStyles);createGlobalStyle(templateObject_3$4$1||(templateObject_3$4$1=__makeTemplateObject(["\n ","\n"],["\n ","\n"])),ToolbarGlobalDropdownStyles);var templateObject_1$9$1,templateObject_2$7$1,templateObject_3$4$1;_styled.div.withConfig({displayName:"PostGroupSelector__Host",componentId:"sc-1wyjpa9-0"})(templateObject_1$8$1||(templateObject_1$8$1=__makeTemplateObject(["\n width: 320px;\n\n @media (max-width: ","px) {\n width: 100%;\n }\n"],["\n width: 320px;\n\n @media (max-width: ","px) {\n width: 100%;\n }\n"])),maxScreenSize.small);_styled.h2.withConfig({displayName:"PostGroupSelector__Title",componentId:"sc-1wyjpa9-1"})(templateObject_2$6$1||(templateObject_2$6$1=__makeTemplateObject(["\n margin-top: 0;\n"],["\n margin-top: 0;\n"])));_styled.a.withConfig({displayName:"PostGroupSelector__Link",componentId:"sc-1wyjpa9-2"})(templateObject_3$3$1||(templateObject_3$3$1=__makeTemplateObject(["\n color: ",";\n font-weight: bold;\n display: flex;\n align-items: center;\n\n span {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n width: calc(100% - 64px); // 40px (avatar) + 14px (padding)\n }\n"],["\n color: ",";\n font-weight: bold;\n display: flex;\n align-items: center;\n\n span {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n width: calc(100% - 64px); // 40px (avatar) + 14px (padding)\n }\n"])),function(p){return p.theme.textColors.default;});_styled.div.withConfig({displayName:"PostGroupSelector__GroupsHost",componentId:"sc-1wyjpa9-3"})(templateObject_5$2$1||(templateObject_5$2$1=__makeTemplateObject(["\n ","\n overflow-y: auto;\n margin: ","px 0 ","px;\n\n > :not(:last-child) {\n margin-bottom: ","px;\n }\n"],["\n ","\n overflow-y: auto;\n margin: ","px 0 ","px;\n\n > :not(:last-child) {\n margin-bottom: ","px;\n }\n"])),function(p){return p.hasMaxHeight&&css$2(templateObject_4$2$1||(templateObject_4$2$1=__makeTemplateObject(["\n max-height: 340px;\n "],["\n max-height: 340px;\n "])));},spacingM,spacingS,spacingS);var templateObject_1$8$1,templateObject_2$6$1,templateObject_3$3$1,templateObject_4$2$1,templateObject_5$2$1;var StreamItemTypes;(function(StreamItemTypes){StreamItemTypes["Post"]="POST";StreamItemTypes["News"]="NEWS";StreamItemTypes["Event"]="EVENT";StreamItemTypes["Page"]="PAGE";})(StreamItemTypes||(StreamItemTypes={}));var StreamConversationScope;(function(StreamConversationScope){StreamConversationScope["Public"]="PUBLIC";StreamConversationScope["Editor"]="EDITOR";StreamConversationScope["Posts"]="POSTS";})(StreamConversationScope||(StreamConversationScope={}));var StreamKnownNewsState;(function(StreamKnownNewsState){StreamKnownNewsState["Unconfirmed"]="UNCONFIRMED";StreamKnownNewsState["Alert"]="ALERT";})(StreamKnownNewsState||(StreamKnownNewsState={}));function isPost(item){return item.type===StreamItemTypes.Post;}function isNews(item){return item.type===StreamItemTypes.News;}function isEvent(item){return item.type===StreamItemTypes.Event;}function isPage(item){return item.type===StreamItemTypes.Page;}function getGroupedKeywordsFromStream(keywords){var groupedKeywords={};(keywords||[]).forEach(function(k){if(!groupedKeywords[k.groupId]){groupedKeywords[k.groupId]=[];}var keyword=__assign(__assign({},k),{translations:(k.translations||[]).reduce(function(prev,curr){var _a;return __assign(__assign({},prev),(_a={},_a[curr.key]=curr.value,_a));},{})});groupedKeywords[k.groupId].push(keyword);});return groupedKeywords;}function convertProperties(items,user,subscriptionChannels){return items.map(function(i){var _a,_b,_c;var mappedItem=__assign(__assign({},i),{keywords:getGroupedKeywordsFromStream(i.keywordsList)});if(isPost(i)){return __assign(__assign({},mappedItem),{groupId:i.groupIds[0],attachments:(_a=i.postAttachments)===null||_a===void 0?void 0:_a.map(function(i){return __assign(__assign({},i),{type:getAttachmentType(i.type)});}),comments:__assign(__assign({},i.postComments),{items:(_b=i.postComments)===null||_b===void 0?void 0:_b.items.map(function(c){var _a;return __assign(__assign({},c),{conversationScope:getConversationScope(c.streamConversationScope),fileAccessToken:i.fileAccessToken,attachments:(_a=c.postCommentAttachments)===null||_a===void 0?void 0:_a.map(function(a){return __assign(__assign({},a),{type:getAttachmentType(a.type)});})});})})});}return __assign(__assign(__assign(__assign({},mappedItem),{userResponse:isEvent(i)?i.userResponseType&&getEventResponse(i.userResponseType):null,channels:(i.channelsList||[]).map(function(c){return {name:getChannelDisplayName(subscriptionChannels,c,user,getPreferredContentLanguage(user))};}),contents:i.contentsList.reduce(function(a,b){var _a;return __assign(__assign({},a),(_a={},_a[b.language]=b,_a));},{}),bannerInfo:i.bannerInfo&&__assign(__assign({},i.bannerInfo),{videoSource:convertStringToVideoSource((_c=i.bannerInfo)===null||_c===void 0?void 0:_c.videoSource)})}),getPageInfos(i)),getKnownNewsState(i));});}function getKnownNewsState(item){var _a,_b;if(!isNews(item)){return {};}var state=KnownNewsState.None;if((_a=item.knownNewsState)===null||_a===void 0?void 0:_a.includes(StreamKnownNewsState.Alert)){state|=KnownNewsState.Alert;}if((_b=item.knownNewsState)===null||_b===void 0?void 0:_b.includes(StreamKnownNewsState.Unconfirmed)){state|=KnownNewsState.Unconfirmed;}return {knownState:state};}function getPageInfos(item){if(!isPage(item)){return {};}return {pageType:getPageType(item.streamPageType),navigationContext:unflattenNavigationContext(item)};}function unflattenNavigationContext(item){var itemNavigationContext;var currentNavigationContext;var parentId=item.parentId;while(parentId!=null){var parent_1=item.path.find(function(c){return c.id===parentId;});if(!itemNavigationContext){itemNavigationContext={parent:parent_1};}else {currentNavigationContext.parent=parent_1;}parentId=parent_1.parentId;currentNavigationContext=parent_1;}return itemNavigationContext||{};}function getAttachmentType(source){switch(source){case GraphQLAttachmentType.News:return AttachmentType.News;case GraphQLAttachmentType.Event:return AttachmentType.Event;case GraphQLAttachmentType.Page:return AttachmentType.Page;case GraphQLAttachmentType.Post:return AttachmentType.Post;case GraphQLAttachmentType.Image:return AttachmentType.Image;case GraphQLAttachmentType.File:return AttachmentType.File;case GraphQLAttachmentType.VimeoVideo:return AttachmentType.VimeoVideo;case GraphQLAttachmentType.YouTubeVideo:return AttachmentType.YouTubeVideo;case GraphQLAttachmentType.Giphy:return AttachmentType.Giphy;default:return null;}}function getConversationScope(streamScope){switch(streamScope){case StreamConversationScope.Public:return ConversationScope.Public;case StreamConversationScope.Editor:return ConversationScope.Editor;case StreamConversationScope.Posts:return ConversationScope.Posts;default:return null;}}function getPageType(pageType){return pageType==='PAGE'?PageType.Page:PageType.Document;}function getEventResponse(source){switch(source){case StreamEventResponse.NotSet:return EventResponse.NotSet;case StreamEventResponse.Registered:return EventResponse.Registered;case StreamEventResponse.Declined:return EventResponse.Declined;default:return null;}}var StreamEventResponse;(function(StreamEventResponse){StreamEventResponse["NotSet"]="NOTSET";StreamEventResponse["Registered"]="REGISTERED";StreamEventResponse["Declined"]="DECLINED";})(StreamEventResponse||(StreamEventResponse={}));var CHANNELS_CONDITION=function CHANNELS_CONDITION(channels,allChannels){var _a,_b;if(!channels){return '';}var channelIds=(_b=(_a=channels.items)===null||_a===void 0?void 0:_a.map(function(c){var _a;return ((_a=allChannels===null||allChannels===void 0?void 0:allChannels.find(function(uc){return uc.name===c;}))===null||_a===void 0?void 0:_a.id)||"INVALID_CHANNEL_"+c;}))===null||_b===void 0?void 0:_b.map(function(c){return "\""+c+"\"";});if(!(channelIds===null||channelIds===void 0?void 0:channelIds.length)){return '';}if(channels.operator===LogicalOperator.And){var channelConditions=channelIds.map(function(c){return "{ channels: { some: { eq: "+c+" } } }";});return "and: [\n "+channelConditions.join()+"\n ]";}return "channels: { some: { in: ["+channelIds+"] } }";};var KEYWORDS_CONDITION=function KEYWORDS_CONDITION(keywords){var _a;if(!keywords||!((_a=keywords.items)===null||_a===void 0?void 0:_a.length)){return '';}if(keywords.operator===LogicalOperator.And){var keywordConditions=keywords.items.map(function(k){return "{ keywordIds: { some: { eq: \""+k+"\" } } }";});return "and: [\n "+keywordConditions.join()+"\n ]";}return "keywordIds: { some: { in: ["+keywords.items.map(function(k){return "\""+k+"\"";})+"] } }";};var OWNER_CONDITION=function OWNER_CONDITION(owner){if(!owner){return '';}return "or: [\n { author: { userPrincipalName: { eq: \""+owner+"\" } } }\n { owner: { userPrincipalName: { eq: \""+owner+"\" } } }\n { onBehalfOf: { userPrincipalName: { eq: \""+owner+"\" } } }\n ]";};var PUBLISHING_DATE_CONDITION=function PUBLISHING_DATE_CONDITION(beforeDate,afterDate){if(!beforeDate&&!afterDate){return '';}if(beforeDate&&afterDate){return "and: [\n { publishingDate: { gt: \""+afterDate+"\" } }\n { publishingDate: { lt: \""+beforeDate+"\" } }\n ]";}return afterDate?"publishingDate: { gt: \""+afterDate+"\" }":"publishingDate: { lt: \""+beforeDate+"\" }";};var AUTHORS_CONDITION=function AUTHORS_CONDITION(authors){if(!authors||!authors.length){return '';}return "or: [\n { owner: { userPrincipalName: { in: ["+(authors===null||authors===void 0?void 0:authors.map(function(a){return "\""+a+"\"";}))+"] } } }\n { onBehalfOf: { userPrincipalName: { in: ["+(authors===null||authors===void 0?void 0:authors.map(function(a){return "\""+a+"\"";}))+"] } } }\n ]";};gql(templateObject_2$5$1||(templateObject_2$5$1=__makeTemplateObject(["\n mutation MarkStreamAsRead {\n markStreamAsRead\n }\n"],["\n mutation MarkStreamAsRead {\n markStreamAsRead\n }\n"])));gql(templateObject_3$2$1||(templateObject_3$2$1=__makeTemplateObject(["\n mutation MarkItemsAsRead($itemIds: [String]) {\n markItemsAsRead(itemIds: $itemIds)\n }\n"],["\n mutation MarkItemsAsRead($itemIds: [String]) {\n markItemsAsRead(itemIds: $itemIds)\n }\n"])));var templateObject_2$5$1,templateObject_3$2$1;var EditorListItem=function EditorListItem(props){var user=useCurrentUser();var formatMessage=useIntl().formatMessage;var itemDomRef=useRef$1();var webAppUrl=useConfiguration().webAppUrl;if(props.language==null){return null;}var item=props.item;var className=classNames(props.className,'editor-list-item',{'editor-list-item-rejected ms-borderColor-red':item.status===WorkflowStatus.rejected&&isCurrentUserItemOwner()},{'editor-list-item-selected ms-fontColor-onSecondary ms-bgColor-themeSecondary':props.isSelected},{'ms-bgColor-white':!props.isSelected},{'editor-list-item--highlighted':props.highlighted});return jsxs(ListItem,__assign({className:className,"data-item-is-published":props.isPublishedItem,"data-is-focusable":true,"data-item-is-selected":props.isSelected,"data-item-id":item.id,ref:itemDomRef},{children:[props.useExternalLink?jsx$1(ExternalLink,__assign({href:""+webAppUrl+props.basePath+"/"+item.id+"/"+props.language,className:"editor-list-content",target:"_blank",rel:"noopener noreferrer",onClick:function(e){var _a;return (_a=props.onClick)===null||_a===void 0?void 0:_a.call(props,e,itemDomRef.current,item,getTitle());}},{children:props.onRenderContent(item,getTitle(),props.isSelected)}),void 0):jsx$1(Content$9,__assign({to:props.basePath+"/"+item.id+"/"+props.language,onClick:function(e){var _a;return (_a=props.onClick)===null||_a===void 0?void 0:_a.call(props,e,itemDomRef.current,item,getTitle());},className:"editor-list-content"},{children:props.onRenderContent(item,getTitle(),props.isSelected)}),void 0),jsxs(Options,{children:[props.allowSelection&&jsx$1(SelectedIconOption,{children:jsx$1(SelectedIcon,{"data-item-select":true,iconProps:{iconName:'CompletedSolid'},ariaLabel:formatMessage({id:'AriaLabel.editor.selectItemButton'}),onClick:toggleSelect,isTouch:env.isTouchDevice,isSelected:props.isSelected,className:classNames('ms-fontColor-neutralTertiary',{'ms-fontColor-themeDarkAlt':props.isSelected})},void 0)},void 0),jsx$1(StatusOption,{status:item.status,isActive:props.isSelected},void 0),jsx$1(Option,__assign({className:"editor-list-persona"},{children:item.owner&&jsx$1(Avatar,{upn:item.owner.userPrincipalName,size:PersonaSize.size48,text:props.item.owner.displayName,hidePersonaDetails:true},void 0)}),void 0)]},void 0)]}),void 0);function isCurrentUserItemOwner(){return props.item.owner&&props.item.owner.userPrincipalName===user.userPrincipalName;}function getTitle(){var title=props.item.contents[props.language].title;return title==null||title.trim().length===0?"<"+formatMessage({id:'Generic.noTitle'})+">":title;}function toggleSelect(){props.onSelect(props.item,!props.isSelected);}};var EditorItemTitle=_styled.h2.withConfig({displayName:"EditorListItem__EditorItemTitle",componentId:"sc-zoqzrc-0"})(templateObject_1$6$1||(templateObject_1$6$1=__makeTemplateObject(["\n && {\n font-weight: 600;\n margin: 0;\n font-size: 17px;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n @media (max-width: 700px) {\n font-size: 15px;\n }\n }\n"],["\n && {\n font-weight: 600;\n margin: 0;\n font-size: 17px;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n @media (max-width: 700px) {\n font-size: 15px;\n }\n }\n"])));var SelectedIcon=_styled(IconButton$1).withConfig({displayName:"EditorListItem__SelectedIcon",componentId:"sc-zoqzrc-1"})(templateObject_2$4$1||(templateObject_2$4$1=__makeTemplateObject(["\n padding: 0;\n height: 100%;\n width: auto;\n font-size: inherit;\n\n opacity: ",";\n\n &:focus {\n opacity: 1;\n }\n\n i {\n font-size: inherit;\n line-height: unset;\n height: auto;\n width: auto;\n padding: 0 19px 0 10px;\n }\n"],["\n padding: 0;\n height: 100%;\n width: auto;\n font-size: inherit;\n\n opacity: ",";\n\n &:focus {\n opacity: 1;\n }\n\n i {\n font-size: inherit;\n line-height: unset;\n height: auto;\n width: auto;\n padding: 0 19px 0 10px;\n }\n"])),function(p){return p.isSelected?1:p.isTouch?0.1:0;});var ListItem=_styled.div.withConfig({displayName:"EditorListItem__ListItem",componentId:"sc-zoqzrc-2"})(templateObject_3$1$1||(templateObject_3$1$1=__makeTemplateObject(["\n position: relative;\n font-family: 'Roboto', sans-serif;\n text-decoration: none;\n ",";\n\n display: flex;\n flex-flow: row nowrap;\n text-align: left;\n\n a,\n a:hover,\n a:active,\n a:visited {\n color: ",";\n text-decoration: none;\n }\n\n &.editor-list-item-rejected {\n border-left-width: 10px;\n border-style: solid;\n border-top: 0;\n border-bottom: 0;\n border-right: 0;\n > .editor-list-content {\n margin-left: 6px;\n }\n }\n\n &:hover {\n "," {\n opacity: 1;\n }\n }\n"],["\n position: relative;\n font-family: 'Roboto', sans-serif;\n text-decoration: none;\n ",";\n\n display: flex;\n flex-flow: row nowrap;\n text-align: left;\n\n a,\n a:hover,\n a:active,\n a:visited {\n color: ",";\n text-decoration: none;\n }\n\n &.editor-list-item-rejected {\n border-left-width: 10px;\n border-style: solid;\n border-top: 0;\n border-bottom: 0;\n border-right: 0;\n > .editor-list-content {\n margin-left: 6px;\n }\n }\n\n &:hover {\n "," {\n opacity: 1;\n }\n }\n"])),CardBorderInline(2,2),function(p){return p.theme.textColors.default;},SelectedIcon);var Options=_styled.div.withConfig({displayName:"EditorListItem__Options",componentId:"sc-zoqzrc-3"})(templateObject_4$1$1||(templateObject_4$1$1=__makeTemplateObject(["\n flex: 0 1 auto;\n display: flex;\n flex-flow: row nowrap;\n padding-right: 15px;\n\n @media (max-width: 700px) {\n padding-right: 6px;\n }\n"],["\n flex: 0 1 auto;\n display: flex;\n flex-flow: row nowrap;\n padding-right: 15px;\n\n @media (max-width: 700px) {\n padding-right: 6px;\n }\n"])));var Option=_styled.div.withConfig({displayName:"EditorListItem__Option",componentId:"sc-zoqzrc-4"})(templateObject_5$1$1||(templateObject_5$1$1=__makeTemplateObject(["\n padding: 6px 25px 6px 6px;\n font-size: 24px;\n text-align: center;\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: center;\n\n flex: 0 1 auto;\n\n &.editor-list-persona {\n width: 32px;\n }\n > div {\n height: 24px;\n }\n\n @media (max-width: 700px) {\n padding: 5px;\n i {\n font-size: 0.9em !important;\n padding: 0;\n }\n }\n"],["\n padding: 6px 25px 6px 6px;\n font-size: 24px;\n text-align: center;\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: center;\n\n flex: 0 1 auto;\n\n &.editor-list-persona {\n width: 32px;\n }\n > div {\n height: 24px;\n }\n\n @media (max-width: 700px) {\n padding: 5px;\n i {\n font-size: 0.9em !important;\n padding: 0;\n }\n }\n"])));var SelectedIconOption=_styled(Option).withConfig({displayName:"EditorListItem__SelectedIconOption",componentId:"sc-zoqzrc-5"})(templateObject_6$t||(templateObject_6$t=__makeTemplateObject(["\n padding: 6px;\n"],["\n padding: 6px;\n"])));var LinkStyle=css$2(templateObject_7$m||(templateObject_7$m=__makeTemplateObject(["\n padding: ","px;\n flex: 1 0 auto;\n /* todo: This smells, but it's required to make the ellipsis work. How to avoid it?*/\n width: 100px;\n margin: ","px ","px ","px ","px;\n\n @media (max-width: 700px) {\n margin: ","px;\n }\n"],["\n padding: ","px;\n flex: 1 0 auto;\n /* todo: This smells, but it's required to make the ellipsis work. How to avoid it?*/\n width: 100px;\n margin: ","px ","px ","px ","px;\n\n @media (max-width: 700px) {\n margin: ","px;\n }\n"])),spacingXs,spacingS,spacingS,spacingS,spacingS+6,spacingXs);var Content$9=_styled(Link$4).withConfig({displayName:"EditorListItem__Content",componentId:"sc-zoqzrc-6"})(templateObject_8$k||(templateObject_8$k=__makeTemplateObject(["\n ",";\n"],["\n ",";\n"])),LinkStyle);var ExternalLink=_styled.a.withConfig({displayName:"EditorListItem__ExternalLink",componentId:"sc-zoqzrc-7"})(templateObject_9$f||(templateObject_9$f=__makeTemplateObject(["\n ",";\n"],["\n ",";\n"])),LinkStyle);var StatusOption=function StatusOption(_a){var _b=_a.status,status=_b===void 0?WorkflowStatus.draft:_b,isActive=_a.isActive;if(status===WorkflowStatus.deleted){return null;}return jsx$1(Option,{children:status===WorkflowStatus.approved?jsx$1("img",{style:{width:'20px'},alt:""},void 0):jsx$1(Tooltip,__assign({resourceKey:'EditorList.'+status||WorkflowStatus.draft},{children:jsx$1(StateIcon,{status:status||WorkflowStatus.draft,width:20,isActive:isActive},void 0)}),void 0)},void 0);};var templateObject_1$6$1,templateObject_2$4$1,templateObject_3$1$1,templateObject_4$1$1,templateObject_5$1$1,templateObject_6$t,templateObject_7$m,templateObject_8$k,templateObject_9$f;var NewsEditorItem=function NewsEditorItem(_a){var title=_a.title,item=_a.item,isSelected=_a.isSelected;return jsxs(Fragment,{children:[jsx$1(EditorItemTitle,__assign({className:classNames({'ms-fontColor-onSecondary':isSelected})},{children:title}),void 0),jsx$1(DateInfo,__assign({className:classNames('ms-fontSize-m',{'ms-fontColor-onSecondary':isSelected})},{children:jsx$1(MetaInfo$1,{dateMode:DateMode.Published,item:item,expiryDate:item.expiryDate,channels:item.channels,readOnly:true,showChannels:true,hideAvatar:true,hideDisplayName:true},void 0)}),void 0)]},void 0);};var MetaInfo$1=_styled(ItemMetaInfo).withConfig({displayName:"NewsEditorItem__MetaInfo",componentId:"sc-1kz3wt0-0"})(templateObject_1$5$1||(templateObject_1$5$1=__makeTemplateObject(["\n [data-meta-info-details] {\n padding-left: 0;\n }\n"],["\n [data-meta-info-details] {\n padding-left: 0;\n }\n"])));var DateInfo=_styled.div.withConfig({displayName:"NewsEditorItem__DateInfo",componentId:"sc-1kz3wt0-1"})(templateObject_2$3$1||(templateObject_2$3$1=__makeTemplateObject(["\n padding-top: 8px;\n @media (max-width: 700px) {\n font-size: 12px;\n }\n"],["\n padding-top: 8px;\n @media (max-width: 700px) {\n font-size: 12px;\n }\n"])));var templateObject_1$5$1,templateObject_2$3$1;var EventDates=_styled.div.withConfig({displayName:"EventEditorItem__EventDates",componentId:"sc-1irp2hc-0"})(templateObject_1$4$1||(templateObject_1$4$1=__makeTemplateObject(["\n margin-top: ","px;\n font-size: ","px;\n\n display: flex;\n flex-direction: column;\n"],["\n margin-top: ","px;\n font-size: ","px;\n\n display: flex;\n flex-direction: column;\n"])),spacingS,fontSizeSmall);_styled.div.withConfig({displayName:"EventEditorItem__EmptyEventDates",componentId:"sc-1irp2hc-1"})(templateObject_2$2$1||(templateObject_2$2$1=__makeTemplateObject(["\n font-style: italic;\n"],["\n font-style: italic;\n"])));_styled.div.withConfig({displayName:"EventEditorItem__EventDateAndRecurrenceInfo",componentId:"sc-1irp2hc-2"})(templateObject_3$16||(templateObject_3$16=__makeTemplateObject(["\n display: flex;\n align-items: center;\n"],["\n display: flex;\n align-items: center;\n"])));_styled(EventRecurrenceSeriesInfo).withConfig({displayName:"EventEditorItem__RecurrenceSeriesInfo",componentId:"sc-1irp2hc-3"})(templateObject_4$M||(templateObject_4$M=__makeTemplateObject(["\n margin-top: ","px;\n"],["\n margin-top: ","px;\n"])),spacingS);_styled(EventDates).withConfig({displayName:"EventEditorItem__DatesInfo",componentId:"sc-1irp2hc-4"})(templateObject_5$E||(templateObject_5$E=__makeTemplateObject(["\n margin-right: ","px;\n"],["\n margin-right: ","px;\n"])),spacingM);var templateObject_1$4$1,templateObject_2$2$1,templateObject_3$16,templateObject_4$M,templateObject_5$E;var CreateNewItemButton=function CreateNewItemButton(_a){var type=_a.type,groupId=_a.groupId,onClick=_a.onClick,className=_a.className;var baseRoute=useBaseRoute();var history=useHistory();var buildPath=useSubscriptionHandlePathBuilder().buildPath;var intl=useIntl();var user=useCurrentUser();var hasSelectedGroup=!!groupId;var groups=getGroupItems();if(hasSelectedGroup||groups.length===1){return jsx$1(StyledPrimaryButton,__assign({iconProps:{iconName:'AddTo'},onClick:function(){return handleOnClick(hasSelectedGroup?undefined:groups[0].key);},className:className,"data-button-create":type},{children:jsx$1(FormattedMessage$1,{id:"EditorList."+type+"CreateButton"},void 0)}),void 0);}if(!groups.length){return null;}return jsx$1(MenuButton,__assign({iconProps:{iconName:'AddTo'},menuProps:{items:groups,calloutProps:{calloutMaxWidth:300},className:'lt-reach-contextual-menu'},className:className,"data-button-create":type},{children:jsx$1(FormattedMessage$1,{id:"EditorList."+type+"CreateButton"},void 0)}),void 0);function getGroupItems(){return getGroupsWithExplicitMinRole(GroupRoles.Author,user).map(function(g){return {key:g.id,onClick:function(){return handleOnClick(g.id);},text:getGroupName(g,user,intl)};});}function openEditor(id){history.push(buildPath("/editor/"+type+"/groups/"+id+"/new"));}function handleOnClick(id){if(onClick){onClick(groupId||id);}else {hasSelectedGroup?history.push(baseRoute+"/new"):openEditor(id);}}};var MenuButton=_styled(CommandBarButton).withConfig({displayName:"CreateNewItemButton__MenuButton",componentId:"sc-18o74g9-0"})(templateObject_1$3$1||(templateObject_1$3$1=__makeTemplateObject(["\n && {\n background-color: ",";\n &:hover {\n background-color: ",";\n i,\n span {\n color: ",";\n background-color: transparent;\n }\n }\n\n // the ms-fontColor on the button is not applied on the icons\n i,\n span {\n color: ",";\n }\n }\n\n height: 32px;\n padding: 0 ","px;\n\n i:first-child {\n margin: 0 ","px 0 0;\n }\n\n span {\n white-space: pre;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n"],["\n && {\n background-color: ",";\n &:hover {\n background-color: ",";\n i,\n span {\n color: ",";\n background-color: transparent;\n }\n }\n\n // the ms-fontColor on the button is not applied on the icons\n i,\n span {\n color: ",";\n }\n }\n\n height: 32px;\n padding: 0 ","px;\n\n i:first-child {\n margin: 0 ","px 0 0;\n }\n\n span {\n white-space: pre;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n"])),function(p){return p.theme.semanticColors.primaryButtonBackground;},function(p){return p.theme.semanticColors.primaryButtonBackgroundHovered;},function(p){return p.theme.semanticColors.primaryButtonTextHovered;},function(p){return p.theme.semanticColors.primaryButtonText;},spacingS,spacingS);var StyledPrimaryButton=_styled(PrimaryButton).withConfig({displayName:"CreateNewItemButton__StyledPrimaryButton",componentId:"sc-18o74g9-1"})(templateObject_2$1$1||(templateObject_2$1$1=__makeTemplateObject(["\n padding: 0 ","px;\n\n i {\n margin: 0 ","px 0 0;\n }\n\n span {\n white-space: pre;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n"],["\n padding: 0 ","px;\n\n i {\n margin: 0 ","px 0 0;\n }\n\n span {\n white-space: pre;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n"])),spacingS,spacingS);var templateObject_1$3$1,templateObject_2$1$1;function useEditorApi(){var api=useApi();var fetchFromApi=useApiFactory().fetchFromApi;var sendBeacon=useBeaconHandler();var onRequestToken=useContext(AuthenticationContext).onRequestToken;return useMemo(function(){return {cloneItem:cloneItem,getDeletedItems:getDeletedItems,getVersion:getVersion,getVersions:getVersions,deleteDraft:deleteDraft,deleteRange:deleteRange,deletePermanently:deletePermanently,bulkSetStatus:bulkSetStatus,setStatus:setStatus,removeLease:removeLease,keepLeaseAlive:keepLeaseAlive,saveItem:saveItem,updateGroups:updateGroups,translateContent:translateContent};function translateContent(itemId,translateFrom,translateTo){return api.all("editor/news/"+itemId+"/contents/"+translateFrom+"/translations?"+queryString.stringify({languages:translateTo})).getAll().then(function(response){return response.body(false);});}function updateGroups(itemType,itemId,groupIds){return api.custom("editor/"+itemType+"/"+itemId+"/groups").put(groupIds).then(function(response){return response.body().data();});}function cloneItem(itemType,itemId){return api.all("editor/"+itemType+"?"+queryString.stringify({cloneFromItem:itemId})).post({}).then(function(response){return response.body().data();});}function getDeletedItems(type,filter,token){var params=Object.assign({},__assign(__assign(__assign({},filter),getCommaSeparatedChannelsString(filter===null||filter===void 0?void 0:filter.channels)),getCommaSeparatedKeywordsString(filter===null||filter===void 0?void 0:filter.keywords)),{token:token,pageSize:30});return api.all("editor/"+type+"/recyclebin").get('',params).then(function(res){return res.body().data();});}function getVersions(type,itemId){return from(api.all("editor/"+type+"/"+itemId+"/versions").getAll()).pipe(map(function(response){return response.body().map(function(group){return group.data();});}));}function getVersion(type,itemId,versionId){return api.all("editor/"+type+"/"+itemId+"/versions").get(versionId).then(function(response){return response.body().data();});}function deleteDraft(leaseId,itemId,type){var url="editor/"+type+"/"+itemId+"/draft";if(leaseId){url+="?leaseId="+leaseId;}return api.custom(url).delete();}function deleteRange(type,ids){var data=ids.map(function(id){return {id:id,status:WorkflowStatus.deleted};});return api.custom("editor/"+type).patch(data).then(function(response){return response.body().map(function(item){return item.data();});}).catch(function(){// set null as a result in case of error
122360
122357
  return null;});}function deletePermanently(type,ids){var itemIds=ids.join(',');return api.custom("editor/"+type+"/recyclebin?"+queryString.stringify({itemIds:itemIds})).delete();}function bulkSetStatus(type,items){return api.custom("editor/"+type).patch(items).then(function(response){return response.body().map(function(item){return item.data();});});}function setStatus(type,itemId,status,leaseId){return __awaiter(this,void 0,void 0,function(){var path,response,ex_1;return __generator(this,function(_a){switch(_a.label){case 0:path="editor/"+type+"/"+itemId+"/status";if(leaseId!=null){path+='?'+queryString.stringify({leaseId:leaseId});}_a.label=1;case 1:_a.trys.push([1,3,,4]);return [4/*yield*/,api.custom(path).put(status)];case 2:response=_a.sent();return [2/*return*/,response.body().data()];case 3:ex_1=_a.sent();throw ex_1.response.statusCode===409?{account:ex_1.response.data}:ex_1;case 4:return [2/*return*/];}});});}function removeLease(itemId,leaseId){return api.custom("editor/"+itemId+"/lease?"+queryString.stringify({leaseId:leaseId})).delete();}function keepLeaseAlive(itemId,leaseId,token,subscriptionId){var _this=this;var expireLeaseToken=token;// every 10 seconds
122361
122358
  var timer=setInterval(function(){return __awaiter(_this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:// update the lease
122362
122359
  return [4/*yield*/,api.custom("editor/"+itemId+"/lease").put({leaseId:leaseId})];case 1:// update the lease
122363
122360
  _a.sent();return [4/*yield*/,onRequestToken()];case 2:// renew the access token
122364
122361
  expireLeaseToken=_a.sent();return [2/*return*/];}});});},1000*10);return {cancel:function(){return clearInterval(timer);},destroy:function(){clearInterval(timer);sendBeacon("/editor/"+itemId+"/lease/delete",expireLeaseToken,subscriptionId,{leaseId:leaseId});}};}function saveItem(subscriptionId,type,item,createLease){if(createLease===void 0){createLease=true;}return from(onRequestToken()).pipe(switchMap(function(token){var config={method:item.id==null?'POST':'PUT',body:JSON.stringify(item),headers:{authorization:'Bearer '+token,'subscription-id':subscriptionId,'Content-Type':'application/json'}};var basePath=type?'/editor/'+type:'/editor';var path=item.id==null?basePath:basePath+"/"+item.id;// note (sl): use custom fetch, since post/put with query string is annoying to build with restful.js
122365
- return fetchFromApi(path+"?createLease="+createLease.toString(),config);}),switchMap(function(response){if(response.status===409){return new Promise(function(_,reject){return response.json().then(function(account){if(account.userPrincipalName!=null){reject({account:account});}else {reject({status:response.status,error:response.statusText});}});});}else if(response.ok){return from(response.json());}else {return throwError({status:response.status,error:response.statusText});}}));}},[onRequestToken,api,fetchFromApi,sendBeacon]);}function useNewsEditorApi(){var api=useApi();var saveItem=useEditorApi().saveItem;return useMemo(function(){return {getNews:getNews,unpublish:unpublish,save:save};function getNews(newsId){return __awaiter(this,void 0,void 0,function(){var response,error_1;return __generator(this,function(_a){switch(_a.label){case 0:_a.trys.push([0,3,,4]);return [4/*yield*/,api.all('editor/news').get(newsId)];case 1:response=_a.sent();return [4/*yield*/,response.body().data()];case 2:return [2/*return*/,_a.sent()];case 3:error_1=_a.sent();if(error_1.response&&error_1.response.statusCode===404){return [2/*return*/,null];}else {throw error_1;}case 4:return [2/*return*/];}});});}function unpublish(id,leaseId){var path=leaseId?"news/"+id+"?"+queryString.stringify({leaseId:leaseId}):"news/"+id;return from(api.custom(path).delete());}function save(item,subscriptionId){if(item.id==null){item.source='Condense';}return saveItem(subscriptionId,ItemResourceTypes.News,item);}},[api,saveItem]);}_styled.div.withConfig({displayName:"GlobalSearchButton__Host",componentId:"sc-1c5dmlm-0"})(templateObject_1$2$1||(templateObject_1$2$1=__makeTemplateObject(["\n display: flex;\n margin-top: ","px;\n justify-content: center;\n"],["\n display: flex;\n margin-top: ","px;\n justify-content: center;\n"])),spacingM);var templateObject_1$2$1;_styled.article.withConfig({displayName:"StreamList__Host",componentId:"sc-1rdkc01-0"})(templateObject_2$1B||(templateObject_2$1B=__makeTemplateObject(["\n position: relative;\n margin-bottom: ","px;\n\n ",";\n"],["\n position: relative;\n margin-bottom: ","px;\n\n ",";\n"])),spacingM,function(p){return p.highlight&&css$2(templateObject_1$1$1||(templateObject_1$1$1=__makeTemplateObject(["\n &::after {\n content: '';\n border-right-width: ","px;\n border-right-color: ",";\n border-right-style: solid;\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n }\n "],["\n &::after {\n content: '';\n border-right-width: ","px;\n border-right-color: ",";\n border-right-style: solid;\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n }\n "])),spacingXs,p.theme.palette.accent);});var templateObject_1$1$1,templateObject_2$1B;function useNewsStreamDataLoader(filter,searchText){var _this=this;var client=useApolloClient();var user=useCurrentUser();var getChannels=useContext(LazySubscriptionContext).getChannels;return function(take,skip){return __awaiter(_this,void 0,void 0,function(){var variables,result,_a,_b,_c,_d,_e,_f,_g,stream,_h,_j;var _k,_l;var _m,_o,_p,_q;return __generator(this,function(_r){switch(_r.label){case 0:variables={take:take,skip:skip!==null&&skip!==void 0?skip:0,unreadOnly:filter===null||filter===void 0?void 0:filter.unreadOnly,searchText:searchText,bookmarksOnly:filter===null||filter===void 0?void 0:filter.bookmarksOnly};_b=(_a=client).query;_k={};_c=NEWS_QUERY;_d=[false];_e="\n ";_f=CHANNELS_CONDITION;_g=[filter===null||filter===void 0?void 0:filter.channels];return [4/*yield*/,getChannels()];case 1:return [4/*yield*/,_b.apply(_a,[(_k.query=_c.apply(void 0,_d.concat([_e+_f.apply(void 0,_g.concat([_r.sent()]))+"\n "+KEYWORDS_CONDITION(filter===null||filter===void 0?void 0:filter.keywords)+"\n "+OWNER_CONDITION(filter===null||filter===void 0?void 0:filter.owner)+"\n "+PUBLISHING_DATE_CONDITION(filter===null||filter===void 0?void 0:filter.beforeDate,filter===null||filter===void 0?void 0:filter.afterDate)+"\n "+AUTHORS_CONDITION(filter===null||filter===void 0?void 0:filter.authors)+"\n "+GROUPS_CONDITION((filter===null||filter===void 0?void 0:filter.groupId)?[filter.groupId]:[])+"\n "])),_k.fetchPolicy='no-cache',_k.variables=variables,_k)])];case 2:result=_r.sent();if(((_m=result===null||result===void 0?void 0:result.errors)===null||_m===void 0?void 0:_m.length)>0){logger.error(result.errors[0]);throw result.errors[0];}stream=(_o=result===null||result===void 0?void 0:result.data)===null||_o===void 0?void 0:_o.stream;_l={};_h=convertProperties;_j=[(_p=stream===null||stream===void 0?void 0:stream.items)!==null&&_p!==void 0?_p:[],user];return [4/*yield*/,getChannels()];case 3:return [2/*return*/,(_l.items=_h.apply(void 0,_j.concat([_r.sent()])),_l.hasNextPage=(_q=stream===null||stream===void 0?void 0:stream.pageInfo)===null||_q===void 0?void 0:_q.hasNextPage,_l.paginationToken=(skip!==null&&skip!==void 0?skip:0)+take,_l)];}});});};}var NEWS_QUERY=function NEWS_QUERY(includeAllItems,whereConditions){if(whereConditions===void 0){whereConditions='';}return gql(templateObject_1$2q||(templateObject_1$2q=__makeTemplateObject(["\n query GetStream(\n $skip: Int!\n $take: Int!\n $searchText: String\n $unreadOnly: Boolean,\n $bookmarksOnly: Boolean\n ) {\n stream(\n searchText: $searchText\n unreadOnly: $unreadOnly\n order: [{ publishingDate: DESC }]\n skip: $skip\n take: $take\n includeAllItems: ","\n bookmarksOnly: $bookmarksOnly\n where: {\n type: { eq: NEWS }\n ","\n }\n ) {\n items {\n id: itemId\n knownNewsState\n type\n contentsList: contents {\n language\n intro\n headline\n title\n externalUrl\n active\n }\n modified\n publishingDate\n permalink\n channelsList: channels\n author {\n userPrincipalName\n displayName\n id: userId\n }\n owner {\n userPrincipalName\n displayName\n id: userId\n }\n onBehalfOf {\n userPrincipalName\n displayName\n id: userId\n }\n statistics {\n commentCount\n likeCount\n }\n metadata {\n feedbackSettings {\n feedbackOptions\n }\n }\n bannerInfo {\n type\n imageId\n videoId\n videoUrl\n videoSource\n isDirectVideoUrl\n }\n fileAccessToken\n keywordsList: keywords {\n id\n name\n groupId\n translations {\n key\n value\n }\n }\n isUnread\n hasNewComments\n groupIds\n useExternalContent\n }\n pageInfo {\n hasNextPage\n }\n }\n }\n "],["\n query GetStream(\n $skip: Int!\n $take: Int!\n $searchText: String\n $unreadOnly: Boolean,\n $bookmarksOnly: Boolean\n ) {\n stream(\n searchText: $searchText\n unreadOnly: $unreadOnly\n order: [{ publishingDate: DESC }]\n skip: $skip\n take: $take\n includeAllItems: ","\n bookmarksOnly: $bookmarksOnly\n where: {\n type: { eq: NEWS }\n ","\n }\n ) {\n items {\n id: itemId\n knownNewsState\n type\n contentsList: contents {\n language\n intro\n headline\n title\n externalUrl\n active\n }\n modified\n publishingDate\n permalink\n channelsList: channels\n author {\n userPrincipalName\n displayName\n id: userId\n }\n owner {\n userPrincipalName\n displayName\n id: userId\n }\n onBehalfOf {\n userPrincipalName\n displayName\n id: userId\n }\n statistics {\n commentCount\n likeCount\n }\n metadata {\n feedbackSettings {\n feedbackOptions\n }\n }\n bannerInfo {\n type\n imageId\n videoId\n videoUrl\n videoSource\n isDirectVideoUrl\n }\n fileAccessToken\n keywordsList: keywords {\n id\n name\n groupId\n translations {\n key\n value\n }\n }\n isUnread\n hasNewComments\n groupIds\n useExternalContent\n }\n pageInfo {\n hasNextPage\n }\n }\n }\n "])),includeAllItems,whereConditions);};var GROUPS_CONDITION=function GROUPS_CONDITION(groupIds){if(!groupIds||!groupIds.length){return '';}return "groupIds: {some: { in: ["+groupIds.map(function(g){return "\""+g+"\"";})+"}] } }";};var templateObject_1$2q;
122362
+ return fetchFromApi(path+"?createLease="+createLease.toString(),config);}),switchMap(function(response){if(response.status===409){return new Promise(function(_,reject){return response.json().then(function(account){if(account.userPrincipalName!=null){reject({account:account});}else {reject({status:response.status,error:response.statusText});}});});}else if(response.ok){return from(response.json());}else {return throwError({status:response.status,error:response.statusText});}}));}},[onRequestToken,api,fetchFromApi,sendBeacon]);}function useNewsEditorApi(){var api=useApi();var saveItem=useEditorApi().saveItem;return useMemo(function(){return {getNews:getNews,unpublish:unpublish,save:save};function getNews(newsId){return __awaiter(this,void 0,void 0,function(){var response,error_1;return __generator(this,function(_a){switch(_a.label){case 0:_a.trys.push([0,3,,4]);return [4/*yield*/,api.all('editor/news').get(newsId)];case 1:response=_a.sent();return [4/*yield*/,response.body().data()];case 2:return [2/*return*/,_a.sent()];case 3:error_1=_a.sent();if(error_1.response&&error_1.response.statusCode===404){return [2/*return*/,null];}else {throw error_1;}case 4:return [2/*return*/];}});});}function unpublish(id,leaseId){var path=leaseId?"news/"+id+"?"+queryString.stringify({leaseId:leaseId}):"news/"+id;return from(api.custom(path).delete());}function save(item,subscriptionId){if(item.id==null){item.source='Condense';}return saveItem(subscriptionId,ItemResourceTypes.News,item);}},[api,saveItem]);}_styled.div.withConfig({displayName:"GlobalSearchButton__Host",componentId:"sc-1c5dmlm-0"})(templateObject_1$2$1||(templateObject_1$2$1=__makeTemplateObject(["\n display: flex;\n margin-top: ","px;\n justify-content: center;\n"],["\n display: flex;\n margin-top: ","px;\n justify-content: center;\n"])),spacingM);var templateObject_1$2$1;_styled.article.withConfig({displayName:"StreamList__Host",componentId:"sc-1rdkc01-0"})(templateObject_2$1C||(templateObject_2$1C=__makeTemplateObject(["\n position: relative;\n margin-bottom: ","px;\n\n ",";\n"],["\n position: relative;\n margin-bottom: ","px;\n\n ",";\n"])),spacingM,function(p){return p.highlight&&css$2(templateObject_1$1$1||(templateObject_1$1$1=__makeTemplateObject(["\n &::after {\n content: '';\n border-right-width: ","px;\n border-right-color: ",";\n border-right-style: solid;\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n }\n "],["\n &::after {\n content: '';\n border-right-width: ","px;\n border-right-color: ",";\n border-right-style: solid;\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n }\n "])),spacingXs,p.theme.palette.accent);});var templateObject_1$1$1,templateObject_2$1C;function useNewsStreamDataLoader(filter,searchText){var _this=this;var client=useApolloClient();var user=useCurrentUser();var getChannels=useContext(LazySubscriptionContext).getChannels;return function(take,skip){return __awaiter(_this,void 0,void 0,function(){var variables,result,_a,_b,_c,_d,_e,_f,_g,stream,_h,_j;var _k,_l;var _m,_o,_p,_q;return __generator(this,function(_r){switch(_r.label){case 0:variables={take:take,skip:skip!==null&&skip!==void 0?skip:0,unreadOnly:filter===null||filter===void 0?void 0:filter.unreadOnly,searchText:searchText,bookmarksOnly:filter===null||filter===void 0?void 0:filter.bookmarksOnly};_b=(_a=client).query;_k={};_c=NEWS_QUERY;_d=[false];_e="\n ";_f=CHANNELS_CONDITION;_g=[filter===null||filter===void 0?void 0:filter.channels];return [4/*yield*/,getChannels()];case 1:return [4/*yield*/,_b.apply(_a,[(_k.query=_c.apply(void 0,_d.concat([_e+_f.apply(void 0,_g.concat([_r.sent()]))+"\n "+KEYWORDS_CONDITION(filter===null||filter===void 0?void 0:filter.keywords)+"\n "+OWNER_CONDITION(filter===null||filter===void 0?void 0:filter.owner)+"\n "+PUBLISHING_DATE_CONDITION(filter===null||filter===void 0?void 0:filter.beforeDate,filter===null||filter===void 0?void 0:filter.afterDate)+"\n "+AUTHORS_CONDITION(filter===null||filter===void 0?void 0:filter.authors)+"\n "+GROUPS_CONDITION((filter===null||filter===void 0?void 0:filter.groupId)?[filter.groupId]:[])+"\n "])),_k.fetchPolicy='no-cache',_k.variables=variables,_k)])];case 2:result=_r.sent();if(((_m=result===null||result===void 0?void 0:result.errors)===null||_m===void 0?void 0:_m.length)>0){logger.error(result.errors[0]);throw result.errors[0];}stream=(_o=result===null||result===void 0?void 0:result.data)===null||_o===void 0?void 0:_o.stream;_l={};_h=convertProperties;_j=[(_p=stream===null||stream===void 0?void 0:stream.items)!==null&&_p!==void 0?_p:[],user];return [4/*yield*/,getChannels()];case 3:return [2/*return*/,(_l.items=_h.apply(void 0,_j.concat([_r.sent()])),_l.hasNextPage=(_q=stream===null||stream===void 0?void 0:stream.pageInfo)===null||_q===void 0?void 0:_q.hasNextPage,_l.paginationToken=(skip!==null&&skip!==void 0?skip:0)+take,_l)];}});});};}var NEWS_QUERY=function NEWS_QUERY(includeAllItems,whereConditions){if(whereConditions===void 0){whereConditions='';}return gql(templateObject_1$2r||(templateObject_1$2r=__makeTemplateObject(["\n query GetStream(\n $skip: Int!\n $take: Int!\n $searchText: String\n $unreadOnly: Boolean,\n $bookmarksOnly: Boolean\n ) {\n stream(\n searchText: $searchText\n unreadOnly: $unreadOnly\n order: [{ publishingDate: DESC }]\n skip: $skip\n take: $take\n includeAllItems: ","\n bookmarksOnly: $bookmarksOnly\n where: {\n type: { eq: NEWS }\n ","\n }\n ) {\n items {\n id: itemId\n knownNewsState\n type\n contentsList: contents {\n language\n intro\n headline\n title\n externalUrl\n active\n }\n modified\n publishingDate\n permalink\n channelsList: channels\n author {\n userPrincipalName\n displayName\n id: userId\n }\n owner {\n userPrincipalName\n displayName\n id: userId\n }\n onBehalfOf {\n userPrincipalName\n displayName\n id: userId\n }\n statistics {\n commentCount\n likeCount\n }\n metadata {\n feedbackSettings {\n feedbackOptions\n }\n }\n bannerInfo {\n type\n imageId\n videoId\n videoUrl\n videoSource\n isDirectVideoUrl\n }\n fileAccessToken\n keywordsList: keywords {\n id\n name\n groupId\n translations {\n key\n value\n }\n }\n isUnread\n hasNewComments\n groupIds\n useExternalContent\n }\n pageInfo {\n hasNextPage\n }\n }\n }\n "],["\n query GetStream(\n $skip: Int!\n $take: Int!\n $searchText: String\n $unreadOnly: Boolean,\n $bookmarksOnly: Boolean\n ) {\n stream(\n searchText: $searchText\n unreadOnly: $unreadOnly\n order: [{ publishingDate: DESC }]\n skip: $skip\n take: $take\n includeAllItems: ","\n bookmarksOnly: $bookmarksOnly\n where: {\n type: { eq: NEWS }\n ","\n }\n ) {\n items {\n id: itemId\n knownNewsState\n type\n contentsList: contents {\n language\n intro\n headline\n title\n externalUrl\n active\n }\n modified\n publishingDate\n permalink\n channelsList: channels\n author {\n userPrincipalName\n displayName\n id: userId\n }\n owner {\n userPrincipalName\n displayName\n id: userId\n }\n onBehalfOf {\n userPrincipalName\n displayName\n id: userId\n }\n statistics {\n commentCount\n likeCount\n }\n metadata {\n feedbackSettings {\n feedbackOptions\n }\n }\n bannerInfo {\n type\n imageId\n videoId\n videoUrl\n videoSource\n isDirectVideoUrl\n }\n fileAccessToken\n keywordsList: keywords {\n id\n name\n groupId\n translations {\n key\n value\n }\n }\n isUnread\n hasNewComments\n groupIds\n useExternalContent\n }\n pageInfo {\n hasNextPage\n }\n }\n }\n "])),includeAllItems,whereConditions);};var GROUPS_CONDITION=function GROUPS_CONDITION(groupIds){if(!groupIds||!groupIds.length){return '';}return "groupIds: {some: { in: ["+groupIds.map(function(g){return "\""+g+"\"";})+"}] } }";};var templateObject_1$2r;
122366
122363
 
122367
122364
  var PublishableItemDetailViewContainer = function PublishableItemDetailViewContainer(_a) {
122368
122365
  var preventExternalContentAutoRedirect = _a.preventExternalContentAutoRedirect,
@@ -124089,7 +124086,7 @@ var StyledIcon$1 = _styled(Icon)(templateObject_9$2 || (templateObject_9$2 = __m
124089
124086
  var Intro = _styled.p(templateObject_10$1 || (templateObject_10$1 = __makeTemplateObject$l(["\n margin: 0;\n padding: 0;\n\n ", "\n"], ["\n margin: 0;\n padding: 0;\n\n ", "\n"])), LineClamp(6, fontSizeSmall, 1.2));
124090
124087
  var KeywordsAndFooter = _styled.div(templateObject_11$1 || (templateObject_11$1 = __makeTemplateObject$l(["\n margin-top: auto;\n"], ["\n margin-top: auto;\n"])));
124091
124088
  var Headline$1 = _styled.p(templateObject_12$1 || (templateObject_12$1 = __makeTemplateObject$l(["\n font-size: ", "px;\n line-height: 1.2;\n font-weight: bold;\n white-space: nowrap;\n margin-top: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n"], ["\n font-size: ", "px;\n line-height: 1.2;\n font-weight: bold;\n white-space: nowrap;\n margin-top: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n"])), fontSizeSmall);
124092
- var StyledTitle = _styled(Title$7)(templateObject_13$1 || (templateObject_13$1 = __makeTemplateObject$l(["\n // info: this height calculation is required for the line-clamp\n // 1.2 refers to the line height, 3 refers to the number of lines\n height: ", "px;\n\n a {\n z-index: 1;\n display: inline-flex;\n }\n\n span {\n ", "\n }\n\n i[data-external-content] {\n line-height: ", "px; // fix icon alignment\n }\n"], ["\n // info: this height calculation is required for the line-clamp\n // 1.2 refers to the line height, 3 refers to the number of lines\n height: ", "px;\n\n a {\n z-index: 1;\n display: inline-flex;\n }\n\n span {\n ", "\n }\n\n i[data-external-content] {\n line-height: ", "px; // fix icon alignment\n }\n"])), fontSizeMedium * 1.2 * 3, LineClamp(3, fontSizeMedium, 1.2), fontSizeMedium - 2);
124089
+ var StyledTitle = _styled(Title$8)(templateObject_13$1 || (templateObject_13$1 = __makeTemplateObject$l(["\n // info: this height calculation is required for the line-clamp\n // 1.2 refers to the line height, 3 refers to the number of lines\n height: ", "px;\n\n a {\n z-index: 1;\n display: inline-flex;\n }\n\n span {\n ", "\n }\n\n i[data-external-content] {\n line-height: ", "px; // fix icon alignment\n }\n"], ["\n // info: this height calculation is required for the line-clamp\n // 1.2 refers to the line height, 3 refers to the number of lines\n height: ", "px;\n\n a {\n z-index: 1;\n display: inline-flex;\n }\n\n span {\n ", "\n }\n\n i[data-external-content] {\n line-height: ", "px; // fix icon alignment\n }\n"])), fontSizeMedium * 1.2 * 3, LineClamp(3, fontSizeMedium, 1.2), fontSizeMedium - 2);
124093
124090
  var StyledFlatKeywords = _styled(FlatKeywords)(templateObject_14$1 || (templateObject_14$1 = __makeTemplateObject$l(["\n font-size: ", "px;\n"], ["\n font-size: ", "px;\n"])), fontSizeSmall);
124094
124091
  var StyledChannels$1 = _styled(ChannelList$1)(templateObject_15$1 || (templateObject_15$1 = __makeTemplateObject$l(["\n margin-top: ", "px;\n margin-bottom: ", "px;\n"], ["\n margin-top: ", "px;\n margin-bottom: ", "px;\n"])), spacingS, spacingM);
124095
124092
  var templateObject_1$l, templateObject_2$c, templateObject_3$8, templateObject_4$8, templateObject_5$6, templateObject_6$5, templateObject_7$3, templateObject_8$2, templateObject_9$2, templateObject_10$1, templateObject_11$1, templateObject_12$1, templateObject_13$1, templateObject_14$1, templateObject_15$1;