@livetiles/reach-components-react 0.4.0-preview.213 → 0.4.0-preview.214

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
@@ -13555,14 +13555,14 @@ var toLength$2$5 = function (argument) {
13555
13555
  return argument > 0 ? min$1$5(toInteger$2$6(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
13556
13556
  };
13557
13557
 
13558
- var toInteger$1$6 = toInteger$3$5;
13558
+ var toInteger$1$7 = toInteger$3$5;
13559
13559
  var max$7 = Math.max;
13560
13560
  var min$c = Math.min; // Helper for a popular repeating case of the spec:
13561
13561
  // Let integer be ? ToInteger(index).
13562
13562
  // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
13563
13563
 
13564
13564
  var toAbsoluteIndex$1$6 = function (index, length) {
13565
- var integer = toInteger$1$6(index);
13565
+ var integer = toInteger$1$7(index);
13566
13566
  return integer < 0 ? max$7(integer + length, 0) : min$c(integer, length);
13567
13567
  };
13568
13568
 
@@ -18602,13 +18602,13 @@ var speciesConstructor$1$4 = function (O, defaultConstructor) {
18602
18602
  return C === undefined || (S = anObject$2$6(C)[SPECIES$a]) == undefined ? defaultConstructor : aFunction$d(S);
18603
18603
  };
18604
18604
 
18605
- var toInteger$1$5 = toInteger$4$4;
18605
+ var toInteger$1$6 = toInteger$4$4;
18606
18606
  var requireObjectCoercible$3$4 = requireObjectCoercible$6$3; // `String.prototype.{ codePointAt, at }` methods implementation
18607
18607
 
18608
18608
  var createMethod$1$4 = function (CONVERT_TO_STRING) {
18609
18609
  return function ($this, pos) {
18610
18610
  var S = String(requireObjectCoercible$3$4($this));
18611
- var position = toInteger$1$5(pos);
18611
+ var position = toInteger$1$6(pos);
18612
18612
  var size = S.length;
18613
18613
  var first, second;
18614
18614
  if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
@@ -25352,12 +25352,12 @@ var toInteger$2$4 = function (argument) {
25352
25352
  return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor$7 : ceil$4)(argument);
25353
25353
  };
25354
25354
 
25355
- var toInteger$1$4 = toInteger$2$4;
25355
+ var toInteger$1$5 = toInteger$2$4;
25356
25356
  var min$1$3 = Math.min; // `ToLength` abstract operation
25357
25357
  // https://tc39.github.io/ecma262/#sec-tolength
25358
25358
 
25359
25359
  var toLength$1$4 = function (argument) {
25360
- return argument > 0 ? min$1$3(toInteger$1$4(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
25360
+ return argument > 0 ? min$1$3(toInteger$1$5(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
25361
25361
  };
25362
25362
 
25363
25363
  var toInteger$9 = toInteger$2$4;
@@ -42011,14 +42011,14 @@ var thisNumberValue$1 = function (value) {
42011
42011
  return +value;
42012
42012
  };
42013
42013
 
42014
- var toInteger$1$3 = toInteger$4$3;
42014
+ var toInteger$1$4 = toInteger$4$3;
42015
42015
  var requireObjectCoercible$1$4 = requireObjectCoercible$4$3; // `String.prototype.repeat` method implementation
42016
42016
  // https://tc39.github.io/ecma262/#sec-string.prototype.repeat
42017
42017
 
42018
42018
  var stringRepeat = ''.repeat || function repeat(count) {
42019
42019
  var str = String(requireObjectCoercible$1$4(this));
42020
42020
  var result = '';
42021
- var n = toInteger$1$3(count);
42021
+ var n = toInteger$1$4(count);
42022
42022
  if (n < 0 || n == Infinity) throw RangeError('Wrong number of repetitions');
42023
42023
 
42024
42024
  for (; n > 0; (n >>>= 1) && (str += str)) if (n & 1) result += str;
@@ -53172,13 +53172,13 @@ var fixRegexpWellKnownSymbolLogic$3 = function (KEY, length, exec, sham) {
53172
53172
  if (sham) createNonEnumerableProperty$b(RegExp.prototype[SYMBOL], 'sham', true);
53173
53173
  };
53174
53174
 
53175
- var toInteger$1$2 = toInteger$4$2;
53175
+ var toInteger$1$3 = toInteger$4$2;
53176
53176
  var requireObjectCoercible$5$2 = requireObjectCoercible$b$1; // `String.prototype.{ codePointAt, at }` methods implementation
53177
53177
 
53178
53178
  var createMethod$1$3 = function (CONVERT_TO_STRING) {
53179
53179
  return function ($this, pos) {
53180
53180
  var S = String(requireObjectCoercible$5$2($this));
53181
- var position = toInteger$1$2(pos);
53181
+ var position = toInteger$1$3(pos);
53182
53182
  var size = S.length;
53183
53183
  var first, second;
53184
53184
  if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
@@ -79541,13 +79541,13 @@ fixRegExpWellKnownSymbolLogic$2$1('search', 1, function (SEARCH, nativeSearch, m
79541
79541
  return result === null ? -1 : result.index;
79542
79542
  }];
79543
79543
  });
79544
- var toInteger$1$1 = toInteger$4$1;
79544
+ var toInteger$1$2 = toInteger$4$1;
79545
79545
  var requireObjectCoercible$3$1 = requireObjectCoercible$9$1; // `String.prototype.{ codePointAt, at }` methods implementation
79546
79546
 
79547
79547
  var createMethod$1$2 = function (CONVERT_TO_STRING) {
79548
79548
  return function ($this, pos) {
79549
79549
  var S = String(requireObjectCoercible$3$1($this));
79550
- var position = toInteger$1$1(pos);
79550
+ var position = toInteger$1$2(pos);
79551
79551
  var size = S.length;
79552
79552
  var first, second;
79553
79553
  if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
@@ -81937,7 +81937,7 @@ _styled.nav.withConfig({
81937
81937
  });
81938
81938
 
81939
81939
  var FabButtonStyle = function FabButtonStyle(useSecondaryBgColor) {
81940
- return css$2(templateObject_6$8$1 || (templateObject_6$8$1 = __makeTemplateObject$1(["\n display: flex;\n justify-content: center;\n align-items: center;\n width: 50px;\n height: 50px;\n font-size: 20px;\n\n border-radius: 50%;\n box-shadow: 0 3px 5px -1px rgba(0, 0, 0, 0.2),\n 0px 6px 10px 0px rgba(0, 0, 0, 0.14), 0px 1px 18px 0px rgba(0, 0, 0, 0.12);\n transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,\n box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;\n margin-bottom: 15px;\n\n ", "\n "], ["\n display: flex;\n justify-content: center;\n align-items: center;\n width: 50px;\n height: 50px;\n font-size: 20px;\n\n border-radius: 50%;\n box-shadow: 0 3px 5px -1px rgba(0, 0, 0, 0.2),\n 0px 6px 10px 0px rgba(0, 0, 0, 0.14), 0px 1px 18px 0px rgba(0, 0, 0, 0.12);\n transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,\n box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;\n margin-bottom: 15px;\n\n ", "\n "])), useSecondaryBgColor ? css$2(templateObject_4$f$1 || (templateObject_4$f$1 = __makeTemplateObject$1(["\n background-color: ", ";\n color: ", ";\n\n &:hover {\n background-color: ", ";\n }\n "], ["\n background-color: ", ";\n color: ", ";\n\n &:hover {\n background-color: ", ";\n }\n "])), function (p) {
81940
+ return css$2(templateObject_6$8$2 || (templateObject_6$8$2 = __makeTemplateObject$1(["\n display: flex;\n justify-content: center;\n align-items: center;\n width: 50px;\n height: 50px;\n font-size: 20px;\n\n border-radius: 50%;\n box-shadow: 0 3px 5px -1px rgba(0, 0, 0, 0.2),\n 0px 6px 10px 0px rgba(0, 0, 0, 0.14), 0px 1px 18px 0px rgba(0, 0, 0, 0.12);\n transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,\n box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;\n margin-bottom: 15px;\n\n ", "\n "], ["\n display: flex;\n justify-content: center;\n align-items: center;\n width: 50px;\n height: 50px;\n font-size: 20px;\n\n border-radius: 50%;\n box-shadow: 0 3px 5px -1px rgba(0, 0, 0, 0.2),\n 0px 6px 10px 0px rgba(0, 0, 0, 0.14), 0px 1px 18px 0px rgba(0, 0, 0, 0.12);\n transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,\n box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;\n margin-bottom: 15px;\n\n ", "\n "])), useSecondaryBgColor ? css$2(templateObject_4$f$1 || (templateObject_4$f$1 = __makeTemplateObject$1(["\n background-color: ", ";\n color: ", ";\n\n &:hover {\n background-color: ", ";\n }\n "], ["\n background-color: ", ";\n color: ", ";\n\n &:hover {\n background-color: ", ";\n }\n "])), function (p) {
81941
81941
  return p.theme.palette.themeSecondary;
81942
81942
  }, function (p) {
81943
81943
  return p.theme.textColors.onSecondary;
@@ -81980,7 +81980,7 @@ _styled(DefaultButton).withConfig({
81980
81980
  componentId: "sc-1spkihm-4"
81981
81981
  })(templateObject_11$9 || (templateObject_11$9 = __makeTemplateObject$1(["\n && {\n margin-left: auto;\n }\n"], ["\n && {\n margin-left: auto;\n }\n"])));
81982
81982
 
81983
- var templateObject_1$Q$1, templateObject_2$x$1, templateObject_3$n$1, templateObject_4$f$1, templateObject_5$a$2, templateObject_6$8$1, templateObject_7$4$2, templateObject_8$4$2, templateObject_9$3$1, templateObject_10$e, templateObject_11$9;
81983
+ var templateObject_1$Q$1, templateObject_2$x$1, templateObject_3$n$1, templateObject_4$f$1, templateObject_5$a$2, templateObject_6$8$2, templateObject_7$4$2, templateObject_8$4$2, templateObject_9$3$1, templateObject_10$e, templateObject_11$9;
81984
81984
 
81985
81985
  var FormattedMessageWithStyle = function FormattedMessageWithStyle(_a) {
81986
81986
  var _b = _a.tagName,
@@ -87472,9 +87472,9 @@ var AuthenticationContextProvider = function AuthenticationContextProvider(_a) {
87472
87472
  }), void 0);
87473
87473
  };
87474
87474
 
87475
- var version$1 = "0.4.0-preview.213";
87476
- var buildId = "98425";
87477
- var commitId = "6d396036bd492623ffe137482552016181434d4a";
87475
+ var version$1 = "0.4.0-preview.214";
87476
+ var buildId = "98439";
87477
+ var commitId = "ad77f8da3486968b39cc0db0275d8714a556de8d";
87478
87478
  var isCustomerBuild = false;
87479
87479
  var buildInfo = {
87480
87480
  version: version$1,
@@ -131272,8 +131272,8 @@ return {done:true,value:nativeRegExpMethod.call(regexp,str,arg2)};}return {done:
131272
131272
  // 21.2.5.9 RegExp.prototype[@@search](string)
131273
131273
  :function(string){return regexMethod.call(string,this);});}if(sham)createNonEnumerableProperty$3(RegExp.prototype[SYMBOL],'sham',true);};var aFunction$7=function(it){if(typeof it!='function'){throw TypeError(String(it)+' is not a function');}return it;};var anObject$d=anObject$h;var aFunction$6=aFunction$7;var wellKnownSymbol$h=wellKnownSymbol$l;var SPECIES$3=wellKnownSymbol$h('species');// `SpeciesConstructor` abstract operation
131274
131274
  // https://tc39.github.io/ecma262/#sec-speciesconstructor
131275
- var speciesConstructor$2=function(O,defaultConstructor){var C=anObject$d(O).constructor;var S;return C===undefined||(S=anObject$d(C)[SPECIES$3])==undefined?defaultConstructor:aFunction$6(S);};var toInteger$1=toInteger$4;var requireObjectCoercible$9=requireObjectCoercible$c;// `String.prototype.{ codePointAt, at }` methods implementation
131276
- var createMethod$2=function(CONVERT_TO_STRING){return function($this,pos){var S=String(requireObjectCoercible$9($this));var position=toInteger$1(pos);var size=S.length;var first,second;if(position<0||position>=size)return CONVERT_TO_STRING?'':undefined;first=S.charCodeAt(position);return first<0xD800||first>0xDBFF||position+1===size||(second=S.charCodeAt(position+1))<0xDC00||second>0xDFFF?CONVERT_TO_STRING?S.charAt(position):first:CONVERT_TO_STRING?S.slice(position,position+2):(first-0xD800<<10)+(second-0xDC00)+0x10000;};};var stringMultibyte$1={// `String.prototype.codePointAt` method
131275
+ var speciesConstructor$2=function(O,defaultConstructor){var C=anObject$d(O).constructor;var S;return C===undefined||(S=anObject$d(C)[SPECIES$3])==undefined?defaultConstructor:aFunction$6(S);};var toInteger$1$1=toInteger$4;var requireObjectCoercible$9=requireObjectCoercible$c;// `String.prototype.{ codePointAt, at }` methods implementation
131276
+ var createMethod$2=function(CONVERT_TO_STRING){return function($this,pos){var S=String(requireObjectCoercible$9($this));var position=toInteger$1$1(pos);var size=S.length;var first,second;if(position<0||position>=size)return CONVERT_TO_STRING?'':undefined;first=S.charCodeAt(position);return first<0xD800||first>0xDBFF||position+1===size||(second=S.charCodeAt(position+1))<0xDC00||second>0xDFFF?CONVERT_TO_STRING?S.charAt(position):first:CONVERT_TO_STRING?S.slice(position,position+2):(first-0xD800<<10)+(second-0xDC00)+0x10000;};};var stringMultibyte$1={// `String.prototype.codePointAt` method
131277
131277
  // https://tc39.github.io/ecma262/#sec-string.prototype.codepointat
131278
131278
  codeAt:createMethod$2(false),// `String.prototype.at` method
131279
131279
  // https://github.com/mathiasbynens/String.prototype.at
@@ -131835,7 +131835,7 @@ result.items.forEach(function(page){var _a;var node=convertToNavigationNode(page
131835
131835
  // we don't want to add the same node again, instead we just need to
131836
131836
  // append the children of the node
131837
131837
  // we also know then that we don't have to traverse the tree further up and can stop
131838
- 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$p||(templateObject_3$p=__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$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||(templateObject_6$8=__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$e||(templateObject_5$e=__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||(templateObject_8$5=__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||(templateObject_9$3=__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$z,templateObject_3$p,templateObject_4$g,templateObject_5$e,templateObject_6$8,templateObject_7$5$1,templateObject_8$5,templateObject_9$3,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$o||(templateObject_3$o=__makeTemplateObject(["\n padding-top: ","px;\n\n ","\n"],["\n padding-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$d||(templateObject_5$d=__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$S,templateObject_2$y,templateObject_3$o,templateObject_4$f,templateObject_5$d,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$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$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$R,templateObject_2$x;function useLoadPublishedItemsByKeywords(keywords,showPagesAndDocuments,pageType){var searchPublishedPages=usePagesApi().searchPublishedPages;return function(pageSize,token){return searchPublishedPages({keywords:keywords,token:token,pageSize:pageSize,pageType:showPagesAndDocuments?undefined:pageType});};}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 getSubpages=usePagesApi().getSubpages;try{return function(pageSize,token){return getSubpages(pageId,{pageType:showPagesAndDocuments?undefined:pageType,token:token,pageSize:pageSize});};}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
131838
+ 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$p||(templateObject_3$p=__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$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$e||(templateObject_5$e=__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||(templateObject_8$5=__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||(templateObject_9$3=__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$z,templateObject_3$p,templateObject_4$g,templateObject_5$e,templateObject_6$8$1,templateObject_7$5$1,templateObject_8$5,templateObject_9$3,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$o||(templateObject_3$o=__makeTemplateObject(["\n padding-top: ","px;\n\n ","\n"],["\n padding-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$d||(templateObject_5$d=__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$S,templateObject_2$y,templateObject_3$o,templateObject_4$f,templateObject_5$d,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$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$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$R,templateObject_2$x;function useLoadPublishedItemsByKeywords(keywords,showPagesAndDocuments,pageType){var searchPublishedPages=usePagesApi().searchPublishedPages;return function(pageSize,token){return searchPublishedPages({keywords:keywords,token:token,pageSize:pageSize,pageType:showPagesAndDocuments?undefined:pageType});};}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 getSubpages=usePagesApi().getSubpages;try{return function(pageSize,token){return getSubpages(pageId,{pageType:showPagesAndDocuments?undefined:pageType,token:token,pageSize:pageSize});};}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
131839
131839
  // by default pages and documents should be shown
131840
131840
  // for this case the blockProps would be an empty object and
131841
131841
  // we need to set the showPages and showDocuments to true
@@ -132298,14 +132298,14 @@ var fixRegexpWellKnownSymbolLogic = function (KEY, length, exec, sham) {
132298
132298
  if (sham) createNonEnumerableProperty(RegExp.prototype[SYMBOL], 'sham', true);
132299
132299
  };
132300
132300
 
132301
- var toInteger = toInteger$e;
132301
+ var toInteger$1 = toInteger$e;
132302
132302
  var requireObjectCoercible$2 = requireObjectCoercible$m;
132303
132303
 
132304
132304
  // `String.prototype.{ codePointAt, at }` methods implementation
132305
132305
  var createMethod$1 = function (CONVERT_TO_STRING) {
132306
132306
  return function ($this, pos) {
132307
132307
  var S = String(requireObjectCoercible$2($this));
132308
- var position = toInteger(pos);
132308
+ var position = toInteger$1(pos);
132309
132309
  var size = S.length;
132310
132310
  var first, second;
132311
132311
  if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
@@ -132933,7 +132933,7 @@ var Date$1 = _styled(DateTime).withConfig({
132933
132933
  var Intro$1 = _styled.p.withConfig({
132934
132934
  displayName: "NewsCompactCard__Intro",
132935
132935
  componentId: "sc-16ovog0-4"
132936
- })(templateObject_6$7 || (templateObject_6$7 = __makeTemplateObject$l(["\n margin: 0;\n padding: 0;\n ", "\n"], ["\n margin: 0;\n padding: 0;\n ", "\n"])), TextStyle);
132936
+ })(templateObject_6$8 || (templateObject_6$8 = __makeTemplateObject$l(["\n margin: 0;\n padding: 0;\n ", "\n"], ["\n margin: 0;\n padding: 0;\n ", "\n"])), TextStyle);
132937
132937
 
132938
132938
  var Title$3 = _styled.span.withConfig({
132939
132939
  displayName: "NewsCompactCard__Title",
@@ -133007,7 +133007,7 @@ var BannerHost = _styled.div.withConfig({
133007
133007
  });
133008
133008
  });
133009
133009
 
133010
- var templateObject_1$j, templateObject_2$b, templateObject_3$b, templateObject_4$a, templateObject_5$9, templateObject_6$7, templateObject_7$5, templateObject_8$4, templateObject_9$2, templateObject_10$2, templateObject_11$2, templateObject_12$2, templateObject_13$2, templateObject_14$2, templateObject_15$2, templateObject_16$1;
133010
+ var templateObject_1$j, templateObject_2$b, templateObject_3$b, templateObject_4$a, templateObject_5$9, templateObject_6$8, templateObject_7$5, templateObject_8$4, templateObject_9$2, templateObject_10$2, templateObject_11$2, templateObject_12$2, templateObject_13$2, templateObject_14$2, templateObject_15$2, templateObject_16$1;
133011
133011
 
133012
133012
  var EmptyNewsList = function EmptyNewsList() {
133013
133013
  return jsxs(Host$b, {
@@ -133226,7 +133226,7 @@ var Comments = _styled.a.withConfig({
133226
133226
  var StyledIcon$2 = _styled(Icon).withConfig({
133227
133227
  displayName: "NewsList__StyledIcon",
133228
133228
  componentId: "sc-1d0bzx1-4"
133229
- })(templateObject_6$6 || (templateObject_6$6 = __makeTemplateObject$l(["\n ", "\n"], ["\n ", "\n"])), function (p) {
133229
+ })(templateObject_6$7 || (templateObject_6$7 = __makeTemplateObject$l(["\n ", "\n"], ["\n ", "\n"])), function (p) {
133230
133230
  return p.highlight && unreadCommentHighlight;
133231
133231
  });
133232
133232
 
@@ -133242,7 +133242,7 @@ var ErrorContainer$1 = _styled.p.withConfig({
133242
133242
  return p.theme.palette.red;
133243
133243
  }, spacingM);
133244
133244
 
133245
- var templateObject_1$h, templateObject_2$9, templateObject_3$9, templateObject_4$9, templateObject_5$8, templateObject_6$6, templateObject_7$4, templateObject_8$3;
133245
+ var templateObject_1$h, templateObject_2$9, templateObject_3$9, templateObject_4$9, templateObject_5$8, templateObject_6$7, templateObject_7$4, templateObject_8$3;
133246
133246
 
133247
133247
  var ManageChannels = function ManageChannels(_a) {
133248
133248
  var className = _a.className;
@@ -133467,7 +133467,7 @@ var ChannelHost = _styled.div.withConfig({
133467
133467
  var NotificationButton = _styled.div.withConfig({
133468
133468
  displayName: "ManageChannels__NotificationButton",
133469
133469
  componentId: "sc-yyoxfw-5"
133470
- })(templateObject_6$5 || (templateObject_6$5 = __makeTemplateObject$l(["\n margin-left: auto;\n align-self: flex-start;\n"], ["\n margin-left: auto;\n align-self: flex-start;\n"])));
133470
+ })(templateObject_6$6 || (templateObject_6$6 = __makeTemplateObject$l(["\n margin-left: auto;\n align-self: flex-start;\n"], ["\n margin-left: auto;\n align-self: flex-start;\n"])));
133471
133471
 
133472
133472
  var ChannelToggle = _styled(ToggleWithLabel).withConfig({
133473
133473
  displayName: "ManageChannels__ChannelToggle",
@@ -133481,7 +133481,7 @@ var StyledIconButton = _styled(IconButton$1).withConfig({
133481
133481
  return p.theme.textColors.default;
133482
133482
  });
133483
133483
 
133484
- var templateObject_1$g, templateObject_2$8, templateObject_3$8, templateObject_4$8, templateObject_5$7, templateObject_6$5, templateObject_7$3, templateObject_8$2;
133484
+ var templateObject_1$g, templateObject_2$8, templateObject_3$8, templateObject_4$8, templateObject_5$7, templateObject_6$6, templateObject_7$3, templateObject_8$2;
133485
133485
 
133486
133486
  var NewsGridCard = function NewsGridCard(_a) {
133487
133487
  var _b;
@@ -133600,7 +133600,7 @@ var Content$1 = _styled.div(templateObject_4$7 || (templateObject_4$7 = __makeTe
133600
133600
  return p.theme.palette.white;
133601
133601
  });
133602
133602
  var MetaInfo = _styled.div(templateObject_5$6 || (templateObject_5$6 = __makeTemplateObject$l(["\n font-size: ", "px;\n"], ["\n font-size: ", "px;\n"])), fontSizeSmall);
133603
- var DateAndIcon = _styled.div(templateObject_6$4 || (templateObject_6$4 = __makeTemplateObject$l(["\n display: flex;\n"], ["\n display: flex;\n"])));
133603
+ var DateAndIcon = _styled.div(templateObject_6$5 || (templateObject_6$5 = __makeTemplateObject$l(["\n display: flex;\n"], ["\n display: flex;\n"])));
133604
133604
  var PublishingDate = _styled(DateTime)(templateObject_7$2 || (templateObject_7$2 = __makeTemplateObject$l(["\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n align-self: center;\n"], ["\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n align-self: center;\n"])));
133605
133605
  var NewsCardIcon = _styled.div(templateObject_8$1 || (templateObject_8$1 = __makeTemplateObject$l(["\n display: flex;\n margin-left: auto;\n z-index: 10;\n"], ["\n display: flex;\n margin-left: auto;\n z-index: 10;\n"])));
133606
133606
  var StyledIcon$1 = _styled(Icon)(templateObject_9$1 || (templateObject_9$1 = __makeTemplateObject$l(["\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) {
@@ -133616,7 +133616,7 @@ var KeywordsWrapper = _styled.div(templateObject_14$1 || (templateObject_14$1 =
133616
133616
  return p.theme.palette.neutralTertiary;
133617
133617
  });
133618
133618
  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);
133619
- var templateObject_1$f, templateObject_2$7, templateObject_3$7, templateObject_4$7, templateObject_5$6, templateObject_6$4, templateObject_7$2, templateObject_8$1, templateObject_9$1, templateObject_10$1, templateObject_11$1, templateObject_12$1, templateObject_13$1, templateObject_14$1, templateObject_15$1;
133619
+ var templateObject_1$f, templateObject_2$7, templateObject_3$7, templateObject_4$7, templateObject_5$6, templateObject_6$5, templateObject_7$2, templateObject_8$1, templateObject_9$1, templateObject_10$1, templateObject_11$1, templateObject_12$1, templateObject_13$1, templateObject_14$1, templateObject_15$1;
133620
133620
 
133621
133621
  var ErrorContainer = function ErrorContainer() {
133622
133622
  return jsx$1(Host$7, {
@@ -133887,7 +133887,7 @@ var Host$5 = _styled.div.withConfig({
133887
133887
  }, function (p) {
133888
133888
  return p.showBorder && css$2(templateObject_5$4 || (templateObject_5$4 = __makeTemplateObject$l(["\n border: 1px solid ", ";\n box-sizing: border-box;\n "], ["\n border: 1px solid ", ";\n box-sizing: border-box;\n "])), p.theme.palette.neutralTertiaryAlt);
133889
133889
  }, function (p) {
133890
- return p.applyOverlay && css$2(templateObject_6$3 || (templateObject_6$3 = __makeTemplateObject$l(["\n background-color: rgba(0, 0, 0, 0.33);\n\n .bannerImage {\n z-index: -1;\n }\n "], ["\n background-color: rgba(0, 0, 0, 0.33);\n\n .bannerImage {\n z-index: -1;\n }\n "])));
133890
+ return p.applyOverlay && css$2(templateObject_6$4 || (templateObject_6$4 = __makeTemplateObject$l(["\n background-color: rgba(0, 0, 0, 0.33);\n\n .bannerImage {\n z-index: -1;\n }\n "], ["\n background-color: rgba(0, 0, 0, 0.33);\n\n .bannerImage {\n z-index: -1;\n }\n "])));
133891
133891
  });
133892
133892
 
133893
133893
  var Content = _styled.div.withConfig({
@@ -134001,7 +134001,7 @@ var StyledDateTime = _styled(DateTime).withConfig({
134001
134001
  return p.color ? css$2(templateObject_31 || (templateObject_31 = __makeTemplateObject$l(["\n color: ", ";\n "], ["\n color: ", ";\n "])), p.color) : css$2(templateObject_32 || (templateObject_32 = __makeTemplateObject$l(["\n color: ", ";\n "], ["\n color: ", ";\n "])), p.theme.textColors.default);
134002
134002
  });
134003
134003
 
134004
- var templateObject_1$c, templateObject_2$5, templateObject_3$5, templateObject_4$5, templateObject_5$4, templateObject_6$3, templateObject_7$1, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18, templateObject_19, templateObject_20, templateObject_21, templateObject_22, templateObject_23, templateObject_24, templateObject_25, templateObject_26, templateObject_27, templateObject_28, templateObject_29, templateObject_30, templateObject_31, templateObject_32, templateObject_33;
134004
+ var templateObject_1$c, templateObject_2$5, templateObject_3$5, templateObject_4$5, templateObject_5$4, templateObject_6$4, templateObject_7$1, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18, templateObject_19, templateObject_20, templateObject_21, templateObject_22, templateObject_23, templateObject_24, templateObject_25, templateObject_26, templateObject_27, templateObject_28, templateObject_29, templateObject_30, templateObject_31, templateObject_32, templateObject_33;
134005
134005
 
134006
134006
  var HeroPaging = function HeroPaging(_a) {
134007
134007
  var items = _a.items,
@@ -134149,9 +134149,9 @@ var PagingButton = _styled(ActionButton).withConfig({
134149
134149
  var PagingArrow = _styled(IconButton).withConfig({
134150
134150
  displayName: "HeroPaging__PagingArrow",
134151
134151
  componentId: "sc-1y3j8qb-4"
134152
- })(templateObject_6$2 || (templateObject_6$2 = __makeTemplateObject$l(["\n position: absolute;\n top: 50%;\n\n && {\n padding: 0;\n }\n\n &[data-paging-next] {\n left: 100%;\n transform: translate(-5px, -50%);\n }\n\n &[data-paging-back] {\n right: 100%;\n transform: translate(5px, -50%);\n }\n"], ["\n position: absolute;\n top: 50%;\n\n && {\n padding: 0;\n }\n\n &[data-paging-next] {\n left: 100%;\n transform: translate(-5px, -50%);\n }\n\n &[data-paging-back] {\n right: 100%;\n transform: translate(5px, -50%);\n }\n"])));
134152
+ })(templateObject_6$3 || (templateObject_6$3 = __makeTemplateObject$l(["\n position: absolute;\n top: 50%;\n\n && {\n padding: 0;\n }\n\n &[data-paging-next] {\n left: 100%;\n transform: translate(-5px, -50%);\n }\n\n &[data-paging-back] {\n right: 100%;\n transform: translate(5px, -50%);\n }\n"], ["\n position: absolute;\n top: 50%;\n\n && {\n padding: 0;\n }\n\n &[data-paging-next] {\n left: 100%;\n transform: translate(-5px, -50%);\n }\n\n &[data-paging-back] {\n right: 100%;\n transform: translate(5px, -50%);\n }\n"])));
134153
134153
 
134154
- var templateObject_1$b, templateObject_2$4, templateObject_3$4, templateObject_4$4, templateObject_5$3, templateObject_6$2;
134154
+ var templateObject_1$b, templateObject_2$4, templateObject_3$4, templateObject_4$4, templateObject_5$3, templateObject_6$3;
134155
134155
 
134156
134156
  var Hero = function Hero(_a) {
134157
134157
  var items = _a.items,
@@ -134814,9 +134814,9 @@ var Filters = _styled.div.withConfig({
134814
134814
  var StyledNewArticleButton = _styled(NewArticleButton).withConfig({
134815
134815
  displayName: "NewsEditorDashboard__StyledNewArticleButton",
134816
134816
  componentId: "sc-vv9dzu-4"
134817
- })(templateObject_6$1 || (templateObject_6$1 = __makeTemplateObject$l(["\n margin-bottom: ", "px;\n align-self: flex-start;\n"], ["\n margin-bottom: ", "px;\n align-self: flex-start;\n"])), spacingXs);
134817
+ })(templateObject_6$2 || (templateObject_6$2 = __makeTemplateObject$l(["\n margin-bottom: ", "px;\n align-self: flex-start;\n"], ["\n margin-bottom: ", "px;\n align-self: flex-start;\n"])), spacingXs);
134818
134818
 
134819
- var templateObject_1$5, templateObject_2$2, templateObject_3$2, templateObject_4$2, templateObject_5$2, templateObject_6$1;
134819
+ var templateObject_1$5, templateObject_2$2, templateObject_3$2, templateObject_4$2, templateObject_5$2, templateObject_6$2;
134820
134820
 
134821
134821
  // NOTE: This component exists in this project and not in the ui/common/toolbar because it uses DetailViewContext placed in feature/content/
134822
134822
  // Also a generic component `ToolbarLanguageSelector` in ui/common/toolbar complicates the flow and requires some code duplication
@@ -135190,14 +135190,420 @@ var StyledCheckbox = _styled(Checkbox).withConfig({
135190
135190
  var ClearFilterButton$1 = _styled(DefaultButton).withConfig({
135191
135191
  displayName: "ChannelFilter__ClearFilterButton",
135192
135192
  componentId: "sc-1ju8xwz-5"
135193
- })(templateObject_6 || (templateObject_6 = __makeTemplateObject$l(["\n margin-left: auto;\n\n .ms-Button-label {\n font-weight: normal;\n }\n"], ["\n margin-left: auto;\n\n .ms-Button-label {\n font-weight: normal;\n }\n"])));
135193
+ })(templateObject_6$1 || (templateObject_6$1 = __makeTemplateObject$l(["\n margin-left: auto;\n\n .ms-Button-label {\n font-weight: normal;\n }\n"], ["\n margin-left: auto;\n\n .ms-Button-label {\n font-weight: normal;\n }\n"])));
135194
135194
 
135195
135195
  var StyledTextField = _styled(TextField).withConfig({
135196
135196
  displayName: "ChannelFilter__StyledTextField",
135197
135197
  componentId: "sc-1ju8xwz-6"
135198
135198
  })(templateObject_7 || (templateObject_7 = __makeTemplateObject$l(["\n padding-bottom: ", "px;\n"], ["\n padding-bottom: ", "px;\n"])), spacingS);
135199
135199
 
135200
- var templateObject_1$1, templateObject_2$1, templateObject_3$1, templateObject_4$1, templateObject_5$1, templateObject_6, templateObject_7;
135200
+ var templateObject_1$1, templateObject_2$1, templateObject_3$1, templateObject_4$1, templateObject_5$1, templateObject_6$1, templateObject_7;
135201
+
135202
+ function toInteger(dirtyNumber) {
135203
+ if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
135204
+ return NaN;
135205
+ }
135206
+
135207
+ var number = Number(dirtyNumber);
135208
+
135209
+ if (isNaN(number)) {
135210
+ return number;
135211
+ }
135212
+
135213
+ return number < 0 ? Math.ceil(number) : Math.floor(number);
135214
+ }
135215
+
135216
+ function requiredArgs(required, args) {
135217
+ if (args.length < required) {
135218
+ throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');
135219
+ }
135220
+ }
135221
+
135222
+ /**
135223
+ * @name toDate
135224
+ * @category Common Helpers
135225
+ * @summary Convert the given argument to an instance of Date.
135226
+ *
135227
+ * @description
135228
+ * Convert the given argument to an instance of Date.
135229
+ *
135230
+ * If the argument is an instance of Date, the function returns its clone.
135231
+ *
135232
+ * If the argument is a number, it is treated as a timestamp.
135233
+ *
135234
+ * If the argument is none of the above, the function returns Invalid Date.
135235
+ *
135236
+ * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
135237
+ *
135238
+ * @param {Date|Number} argument - the value to convert
135239
+ * @returns {Date} the parsed date in the local time zone
135240
+ * @throws {TypeError} 1 argument required
135241
+ *
135242
+ * @example
135243
+ * // Clone the date:
135244
+ * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
135245
+ * //=> Tue Feb 11 2014 11:30:30
135246
+ *
135247
+ * @example
135248
+ * // Convert the timestamp to date:
135249
+ * const result = toDate(1392098430000)
135250
+ * //=> Tue Feb 11 2014 11:30:30
135251
+ */
135252
+
135253
+ function toDate(argument) {
135254
+ requiredArgs(1, arguments);
135255
+ var argStr = Object.prototype.toString.call(argument); // Clone the date
135256
+
135257
+ if (argument instanceof Date || typeof argument === 'object' && argStr === '[object Date]') {
135258
+ // Prevent the date to lose the milliseconds when passed to new Date() in IE10
135259
+ return new Date(argument.getTime());
135260
+ } else if (typeof argument === 'number' || argStr === '[object Number]') {
135261
+ return new Date(argument);
135262
+ } else {
135263
+ if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {
135264
+ // eslint-disable-next-line no-console
135265
+ console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"); // eslint-disable-next-line no-console
135266
+
135267
+ console.warn(new Error().stack);
135268
+ }
135269
+
135270
+ return new Date(NaN);
135271
+ }
135272
+ }
135273
+
135274
+ /**
135275
+ * @name addDays
135276
+ * @category Day Helpers
135277
+ * @summary Add the specified number of days to the given date.
135278
+ *
135279
+ * @description
135280
+ * Add the specified number of days to the given date.
135281
+ *
135282
+ * ### v2.0.0 breaking changes:
135283
+ *
135284
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
135285
+ *
135286
+ * @param {Date|Number} date - the date to be changed
135287
+ * @param {Number} amount - the amount of days to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
135288
+ * @returns {Date} - the new date with the days added
135289
+ * @throws {TypeError} - 2 arguments required
135290
+ *
135291
+ * @example
135292
+ * // Add 10 days to 1 September 2014:
135293
+ * const result = addDays(new Date(2014, 8, 1), 10)
135294
+ * //=> Thu Sep 11 2014 00:00:00
135295
+ */
135296
+
135297
+ function addDays(dirtyDate, dirtyAmount) {
135298
+ requiredArgs(2, arguments);
135299
+ var date = toDate(dirtyDate);
135300
+ var amount = toInteger(dirtyAmount);
135301
+
135302
+ if (isNaN(amount)) {
135303
+ return new Date(NaN);
135304
+ }
135305
+
135306
+ if (!amount) {
135307
+ // If 0 days, no-op to avoid changing times in the hour before end of DST
135308
+ return date;
135309
+ }
135310
+
135311
+ date.setDate(date.getDate() + amount);
135312
+ return date;
135313
+ }
135314
+
135315
+ /**
135316
+ * @name addMonths
135317
+ * @category Month Helpers
135318
+ * @summary Add the specified number of months to the given date.
135319
+ *
135320
+ * @description
135321
+ * Add the specified number of months to the given date.
135322
+ *
135323
+ * ### v2.0.0 breaking changes:
135324
+ *
135325
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
135326
+ *
135327
+ * @param {Date|Number} date - the date to be changed
135328
+ * @param {Number} amount - the amount of months to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
135329
+ * @returns {Date} the new date with the months added
135330
+ * @throws {TypeError} 2 arguments required
135331
+ *
135332
+ * @example
135333
+ * // Add 5 months to 1 September 2014:
135334
+ * const result = addMonths(new Date(2014, 8, 1), 5)
135335
+ * //=> Sun Feb 01 2015 00:00:00
135336
+ */
135337
+
135338
+ function addMonths(dirtyDate, dirtyAmount) {
135339
+ requiredArgs(2, arguments);
135340
+ var date = toDate(dirtyDate);
135341
+ var amount = toInteger(dirtyAmount);
135342
+
135343
+ if (isNaN(amount)) {
135344
+ return new Date(NaN);
135345
+ }
135346
+
135347
+ if (!amount) {
135348
+ // If 0 months, no-op to avoid changing times in the hour before end of DST
135349
+ return date;
135350
+ }
135351
+
135352
+ var dayOfMonth = date.getDate(); // The JS Date object supports date math by accepting out-of-bounds values for
135353
+ // month, day, etc. For example, new Date(2020, 0, 0) returns 31 Dec 2019 and
135354
+ // new Date(2020, 13, 1) returns 1 Feb 2021. This is *almost* the behavior we
135355
+ // want except that dates will wrap around the end of a month, meaning that
135356
+ // new Date(2020, 13, 31) will return 3 Mar 2021 not 28 Feb 2021 as desired. So
135357
+ // we'll default to the end of the desired month by adding 1 to the desired
135358
+ // month and using a date of 0 to back up one day to the end of the desired
135359
+ // month.
135360
+
135361
+ var endOfDesiredMonth = new Date(date.getTime());
135362
+ endOfDesiredMonth.setMonth(date.getMonth() + amount + 1, 0);
135363
+ var daysInMonth = endOfDesiredMonth.getDate();
135364
+
135365
+ if (dayOfMonth >= daysInMonth) {
135366
+ // If we're already at the end of the month, then this is the correct date
135367
+ // and we're done.
135368
+ return endOfDesiredMonth;
135369
+ } else {
135370
+ // Otherwise, we now know that setting the original day-of-month value won't
135371
+ // cause an overflow, so set the desired day-of-month. Note that we can't
135372
+ // just set the date of `endOfDesiredMonth` because that object may have had
135373
+ // its time changed in the unusual case where where a DST transition was on
135374
+ // the last day of the month and its local time was in the hour skipped or
135375
+ // repeated next to a DST transition. So we use `date` instead which is
135376
+ // guaranteed to still have the original time.
135377
+ date.setFullYear(endOfDesiredMonth.getFullYear(), endOfDesiredMonth.getMonth(), dayOfMonth);
135378
+ return date;
135379
+ }
135380
+ }
135381
+
135382
+ /**
135383
+ * @name startOfWeek
135384
+ * @category Week Helpers
135385
+ * @summary Return the start of a week for the given date.
135386
+ *
135387
+ * @description
135388
+ * Return the start of a week for the given date.
135389
+ * The result will be in the local timezone.
135390
+ *
135391
+ * ### v2.0.0 breaking changes:
135392
+ *
135393
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
135394
+ *
135395
+ * @param {Date|Number} date - the original date
135396
+ * @param {Object} [options] - an object with options.
135397
+ * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}
135398
+ * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)
135399
+ * @returns {Date} the start of a week
135400
+ * @throws {TypeError} 1 argument required
135401
+ * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6
135402
+ *
135403
+ * @example
135404
+ * // The start of a week for 2 September 2014 11:55:00:
135405
+ * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))
135406
+ * //=> Sun Aug 31 2014 00:00:00
135407
+ *
135408
+ * @example
135409
+ * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:
135410
+ * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })
135411
+ * //=> Mon Sep 01 2014 00:00:00
135412
+ */
135413
+
135414
+ function startOfWeek(dirtyDate, dirtyOptions) {
135415
+ requiredArgs(1, arguments);
135416
+ var options = dirtyOptions || {};
135417
+ var locale = options.locale;
135418
+ var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;
135419
+ var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);
135420
+ var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
135421
+
135422
+ if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
135423
+ throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
135424
+ }
135425
+
135426
+ var date = toDate(dirtyDate);
135427
+ var day = date.getDay();
135428
+ var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
135429
+ date.setDate(date.getDate() - diff);
135430
+ date.setHours(0, 0, 0, 0);
135431
+ return date;
135432
+ }
135433
+
135434
+ /**
135435
+ * @name startOfDay
135436
+ * @category Day Helpers
135437
+ * @summary Return the start of a day for the given date.
135438
+ *
135439
+ * @description
135440
+ * Return the start of a day for the given date.
135441
+ * The result will be in the local timezone.
135442
+ *
135443
+ * ### v2.0.0 breaking changes:
135444
+ *
135445
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
135446
+ *
135447
+ * @param {Date|Number} date - the original date
135448
+ * @returns {Date} the start of a day
135449
+ * @throws {TypeError} 1 argument required
135450
+ *
135451
+ * @example
135452
+ * // The start of a day for 2 September 2014 11:55:00:
135453
+ * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))
135454
+ * //=> Tue Sep 02 2014 00:00:00
135455
+ */
135456
+
135457
+ function startOfDay(dirtyDate) {
135458
+ requiredArgs(1, arguments);
135459
+ var date = toDate(dirtyDate);
135460
+ date.setHours(0, 0, 0, 0);
135461
+ return date;
135462
+ }
135463
+
135464
+ /**
135465
+ * @name endOfDay
135466
+ * @category Day Helpers
135467
+ * @summary Return the end of a day for the given date.
135468
+ *
135469
+ * @description
135470
+ * Return the end of a day for the given date.
135471
+ * The result will be in the local timezone.
135472
+ *
135473
+ * ### v2.0.0 breaking changes:
135474
+ *
135475
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
135476
+ *
135477
+ * @param {Date|Number} date - the original date
135478
+ * @returns {Date} the end of a day
135479
+ * @throws {TypeError} 1 argument required
135480
+ *
135481
+ * @example
135482
+ * // The end of a day for 2 September 2014 11:55:00:
135483
+ * const result = endOfDay(new Date(2014, 8, 2, 11, 55, 0))
135484
+ * //=> Tue Sep 02 2014 23:59:59.999
135485
+ */
135486
+
135487
+ function endOfDay(dirtyDate) {
135488
+ requiredArgs(1, arguments);
135489
+ var date = toDate(dirtyDate);
135490
+ date.setHours(23, 59, 59, 999);
135491
+ return date;
135492
+ }
135493
+
135494
+ /**
135495
+ * @name endOfMonth
135496
+ * @category Month Helpers
135497
+ * @summary Return the end of a month for the given date.
135498
+ *
135499
+ * @description
135500
+ * Return the end of a month for the given date.
135501
+ * The result will be in the local timezone.
135502
+ *
135503
+ * ### v2.0.0 breaking changes:
135504
+ *
135505
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
135506
+ *
135507
+ * @param {Date|Number} date - the original date
135508
+ * @returns {Date} the end of a month
135509
+ * @throws {TypeError} 1 argument required
135510
+ *
135511
+ * @example
135512
+ * // The end of a month for 2 September 2014 11:55:00:
135513
+ * const result = endOfMonth(new Date(2014, 8, 2, 11, 55, 0))
135514
+ * //=> Tue Sep 30 2014 23:59:59.999
135515
+ */
135516
+
135517
+ function endOfMonth(dirtyDate) {
135518
+ requiredArgs(1, arguments);
135519
+ var date = toDate(dirtyDate);
135520
+ var month = date.getMonth();
135521
+ date.setFullYear(date.getFullYear(), month + 1, 0);
135522
+ date.setHours(23, 59, 59, 999);
135523
+ return date;
135524
+ }
135525
+
135526
+ /**
135527
+ * @name startOfMonth
135528
+ * @category Month Helpers
135529
+ * @summary Return the start of a month for the given date.
135530
+ *
135531
+ * @description
135532
+ * Return the start of a month for the given date.
135533
+ * The result will be in the local timezone.
135534
+ *
135535
+ * ### v2.0.0 breaking changes:
135536
+ *
135537
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
135538
+ *
135539
+ * @param {Date|Number} date - the original date
135540
+ * @returns {Date} the start of a month
135541
+ * @throws {TypeError} 1 argument required
135542
+ *
135543
+ * @example
135544
+ * // The start of a month for 2 September 2014 11:55:00:
135545
+ * const result = startOfMonth(new Date(2014, 8, 2, 11, 55, 0))
135546
+ * //=> Mon Sep 01 2014 00:00:00
135547
+ */
135548
+
135549
+ function startOfMonth(dirtyDate) {
135550
+ requiredArgs(1, arguments);
135551
+ var date = toDate(dirtyDate);
135552
+ date.setDate(1);
135553
+ date.setHours(0, 0, 0, 0);
135554
+ return date;
135555
+ }
135556
+
135557
+ /**
135558
+ * @name endOfWeek
135559
+ * @category Week Helpers
135560
+ * @summary Return the end of a week for the given date.
135561
+ *
135562
+ * @description
135563
+ * Return the end of a week for the given date.
135564
+ * The result will be in the local timezone.
135565
+ *
135566
+ * ### v2.0.0 breaking changes:
135567
+ *
135568
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
135569
+ *
135570
+ * @param {Date|Number} date - the original date
135571
+ * @param {Object} [options] - an object with options.
135572
+ * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}
135573
+ * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)
135574
+ * @returns {Date} the end of a week
135575
+ * @throws {TypeError} 1 argument required
135576
+ * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6
135577
+ *
135578
+ * @example
135579
+ * // The end of a week for 2 September 2014 11:55:00:
135580
+ * const result = endOfWeek(new Date(2014, 8, 2, 11, 55, 0))
135581
+ * //=> Sat Sep 06 2014 23:59:59.999
135582
+ *
135583
+ * @example
135584
+ * // If the week starts on Monday, the end of the week for 2 September 2014 11:55:00:
135585
+ * const result = endOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })
135586
+ * //=> Sun Sep 07 2014 23:59:59.999
135587
+ */
135588
+ function endOfWeek(dirtyDate, dirtyOptions) {
135589
+ requiredArgs(1, arguments);
135590
+ var options = dirtyOptions || {};
135591
+ var locale = options.locale;
135592
+ var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;
135593
+ var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);
135594
+ var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
135595
+
135596
+ if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
135597
+ throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
135598
+ }
135599
+
135600
+ var date = toDate(dirtyDate);
135601
+ var day = date.getDay();
135602
+ var diff = (day < weekStartsOn ? -7 : 0) + 6 - (day - weekStartsOn);
135603
+ date.setDate(date.getDate() + diff);
135604
+ date.setHours(23, 59, 59, 999);
135605
+ return date;
135606
+ }
135201
135607
 
135202
135608
  var PublishingDateFilter = function PublishingDateFilter() {
135203
135609
  var publishingDateRef = useRef$1();
@@ -135211,6 +135617,9 @@ var PublishingDateFilter = function PublishingDateFilter() {
135211
135617
  showDates = _b[0],
135212
135618
  setShowDates = _b[1];
135213
135619
 
135620
+ var today = new Date();
135621
+ var startOfToday = startOfDay(today);
135622
+ var endOfToday = endOfDay(today);
135214
135623
  return jsxs("div", __assign$g({
135215
135624
  ref: publishingDateRef
135216
135625
  }, {
@@ -135248,7 +135657,7 @@ var PublishingDateFilter = function PublishingDateFilter() {
135248
135657
  noDateResourceKey: "MetadataEditor.noDate",
135249
135658
  selectDateResourceKey: "FilterPanel.publishingDatePlaceholder",
135250
135659
  onChanged: handleStartDateChange,
135251
- maxDate: filter === null || filter === void 0 ? void 0 : filter.beforeDate
135660
+ maxDate: (filter === null || filter === void 0 ? void 0 : filter.beforeDate) || today.toString()
135252
135661
  }, void 0), jsx$1(StyledDateTimePicker, {
135253
135662
  label: formatMessage({
135254
135663
  id: 'FilterPanel.publishingDateTo'
@@ -135258,7 +135667,52 @@ var PublishingDateFilter = function PublishingDateFilter() {
135258
135667
  noDateResourceKey: "MetadataEditor.noDate",
135259
135668
  selectDateResourceKey: "FilterPanel.publishingDatePlaceholder",
135260
135669
  onChanged: handleEndDateChange,
135261
- minDate: filter === null || filter === void 0 ? void 0 : filter.afterDate
135670
+ minDate: filter === null || filter === void 0 ? void 0 : filter.afterDate,
135671
+ maxDate: today.toString()
135672
+ }, void 0), jsxs(DateShortcuts, {
135673
+ children: [jsx$1(FormattedMessage$1, {
135674
+ id: "FilterPanel.publishingDateShortcuts"
135675
+ }, void 0), jsx$1(DateShortcutButton, {
135676
+ onClick: function () {
135677
+ onChange(__assign$g(__assign$g({}, filter), {
135678
+ afterDate: addDays(startOfToday, -1),
135679
+ beforeDate: addDays(endOfToday, -1)
135680
+ }));
135681
+ },
135682
+ label: "FilterPanel.publishingDateShortcuts.yesterday"
135683
+ }, void 0), jsx$1(DateShortcutButton, {
135684
+ onClick: function () {
135685
+ onChange(__assign$g(__assign$g({}, filter), {
135686
+ afterDate: startOfWeek(startOfToday, {
135687
+ weekStartsOn: 1
135688
+ }),
135689
+ beforeDate: endOfWeek(endOfToday, {
135690
+ weekStartsOn: 1
135691
+ })
135692
+ }));
135693
+ },
135694
+ label: "FilterPanel.publishingDateShortcuts.thisWeek"
135695
+ }, void 0), jsx$1(DateShortcutButton, {
135696
+ onClick: function () {
135697
+ onChange(__assign$g(__assign$g({}, filter), {
135698
+ afterDate: startOfWeek(addDays(startOfToday, -7), {
135699
+ weekStartsOn: 1
135700
+ }),
135701
+ beforeDate: endOfWeek(addDays(endOfToday, -7), {
135702
+ weekStartsOn: 1
135703
+ })
135704
+ }));
135705
+ },
135706
+ label: "FilterPanel.publishingDateShortcuts.lastWeek"
135707
+ }, void 0), jsx$1(DateShortcutButton, {
135708
+ onClick: function () {
135709
+ onChange(__assign$g(__assign$g({}, filter), {
135710
+ afterDate: startOfMonth(addMonths(startOfToday, -1)),
135711
+ beforeDate: endOfMonth(addMonths(endOfToday, -1))
135712
+ }));
135713
+ },
135714
+ label: "FilterPanel.publishingDateShortcuts.lastMonth"
135715
+ }, void 0)]
135262
135716
  }, void 0), jsx$1(ClearFilterButton, {
135263
135717
  text: "Clear filter",
135264
135718
  iconProps: {
@@ -135290,6 +135744,22 @@ var PublishingDateFilter = function PublishingDateFilter() {
135290
135744
  }
135291
135745
  };
135292
135746
 
135747
+ var DateShortcutButton = function DateShortcutButton(_a) {
135748
+ var onClick = _a.onClick,
135749
+ label = _a.label;
135750
+ var formatMessage = useIntl().formatMessage;
135751
+ return jsx$1(ActionButton, __assign$g({
135752
+ iconProps: {
135753
+ iconName: 'Calendar'
135754
+ },
135755
+ onClick: onClick
135756
+ }, {
135757
+ children: formatMessage({
135758
+ id: label
135759
+ })
135760
+ }), void 0);
135761
+ };
135762
+
135293
135763
  var Host = _styled.div.withConfig({
135294
135764
  displayName: "PublishingDateFilter__Host",
135295
135765
  componentId: "sc-zv88cu-0"
@@ -135298,7 +135768,7 @@ var Host = _styled.div.withConfig({
135298
135768
  var DateButton = _styled(ActionButton).withConfig({
135299
135769
  displayName: "PublishingDateFilter__DateButton",
135300
135770
  componentId: "sc-zv88cu-1"
135301
- })(templateObject_3 || (templateObject_3 = __makeTemplateObject$l(["\n ", ";\n i {\n order: 1;\n }\n"], ["\n ", ";\n i {\n order: 1;\n }\n"])), function (p) {
135771
+ })(templateObject_3 || (templateObject_3 = __makeTemplateObject$l(["\n ", "\n i {\n order: 1;\n }\n"], ["\n ", "\n i {\n order: 1;\n }\n"])), function (p) {
135302
135772
  return p.isActive && css$2(templateObject_2 || (templateObject_2 = __makeTemplateObject$l(["\n font-weight: bold;\n "], ["\n font-weight: bold;\n "])));
135303
135773
  });
135304
135774
 
@@ -135312,6 +135782,13 @@ var StyledDateTimePicker = _styled(DateTimePicker).withConfig({
135312
135782
  componentId: "sc-zv88cu-3"
135313
135783
  })(templateObject_5 || (templateObject_5 = __makeTemplateObject$l(["\n margin-bottom: ", "px;\n"], ["\n margin-bottom: ", "px;\n"])), spacingS);
135314
135784
 
135315
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
135785
+ var DateShortcuts = _styled.div.withConfig({
135786
+ displayName: "PublishingDateFilter__DateShortcuts",
135787
+ componentId: "sc-zv88cu-4"
135788
+ })(templateObject_6 || (templateObject_6 = __makeTemplateObject$l(["\n margin: ", "px 0;\n display: flex;\n flex-direction: column;\n\n button {\n height: ", "px;\n padding-left: 0;\n .ms-Button-label {\n color: ", ";\n font-weight: bold;\n }\n i {\n margin-left: 0;\n }\n }\n"], ["\n margin: ", "px 0;\n display: flex;\n flex-direction: column;\n\n button {\n height: ", "px;\n padding-left: 0;\n .ms-Button-label {\n color: ", ";\n font-weight: bold;\n }\n i {\n margin-left: 0;\n }\n }\n"])), spacingS, spacingL, function (p) {
135789
+ return p.theme.palette.themePrimary;
135790
+ });
135791
+
135792
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
135316
135793
 
135317
135794
  export { Avatar as A, PublishingDateFilter as B, ChannelFilter as C, EventDetail as E, ItemLayoutMode as I, ManageChannels as M, NewsDetail as N, PropTypes$2 as P, ReachContextProvider as R, ThemeContext$1 as T, UserDetails as U, _assertThisInitialized$b as _, commonjsGlobal$7 as a, _setPrototypeOf$6 as b, commonjsRequire as c, _defineProperty$p as d, _extends$9 as e, minScreenSize as f, PageDetail as g, NewsList as h, NewsGrid as i, useCurrentUser as j, NewsHero as k, NewsEditorDashboard as l, moment$1 as m, Toolbar$1 as n, ToolbarIconButton as o, ToolbarChannelSelector as p, ToolbarMarkAllEventsAsReadButton as q, ToolbarMarkAllNewsAsReadButton as r, ToolbarCloseButton as s, NewsItemContextProvider as t, useWindowSize$2 as u, ToolbarNewsLanguageSelector as v, ToolbarManageNewsItemButton as w, NewsDetailPreview as x, NewsItemPreviewContextProvider as y, ToolbarFilterPanel as z };