playbook_ui 14.24.0.pre.rc.1 → 14.24.0.pre.rc.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f7c659555bc336ddf2054d431ed8a754a7c30cbdb8d39768ee809e5b8c801de4
4
- data.tar.gz: 1f304c66382893591a3002738d79a2c5f7736ec72056ae42186c07e03b289798
3
+ metadata.gz: 1d7c921bbafc031c8734dd2fbda179f02f97762f1bb3b4a2964386933139bd51
4
+ data.tar.gz: 87432d1e7a1256d628fbe3d00341b0887cc7f8b2607865d4a5f6ecc16333f772
5
5
  SHA512:
6
- metadata.gz: cbcdc199c2fb6aa26aaa8363e99b49e9e29d607daf16918e5850a24d68abb6ac115f9a720601c439acbffebc190a9508be6ffa69d449cd6829470b98c33af39f
7
- data.tar.gz: 651647fac808212d5227707f2b43d190ca2f517e47a794cb993ecb04053e86c41e8b6dc25eb4da7e5097b43fc06cc1bbd9e3e634427a2e1a267ee0d367d26a0e
6
+ metadata.gz: 5bdab5a8aafafab76f68147d22a30729c8a23f8bd50bdc6e8528b3ece3cbb0bfe56fedc4de839bfbeefdb01ee641b4d91ca8e105323d7c8f3202957e9ce49fa5
7
+ data.tar.gz: d17e97778b03d734ab6001803d941dcc7bc04a6369c0758c69ada662639de8e88e3c80191d6d43a7338f80b766882bd36685791c8b74fd390b04238cae42faf5
@@ -20,7 +20,7 @@ interface CustomCellProps {
20
20
  customRenderer?: (row: Row<GenericObject>, value: string | undefined) => React.ReactNode
21
21
  selectableRows?: boolean
22
22
  customStyle?: GenericObject
23
- }
23
+ }
24
24
 
25
25
  export const CustomCell = ({
26
26
  getValue,
@@ -35,7 +35,7 @@ export const CustomCell = ({
35
35
 
36
36
  const handleOnExpand = (row: Row<GenericObject>) => {
37
37
  onRowToggleClick && onRowToggleClick(row);
38
-
38
+
39
39
  if (!expandedControl) {
40
40
  setExpanded({ ...expanded, [row.id]: !row.getIsExpanded() });
41
41
  }
@@ -46,8 +46,8 @@ export const CustomCell = ({
46
46
 
47
47
  return (
48
48
  <div style={{ paddingLeft: `${row.depth * 1.25}em`}}>
49
- <Flex
50
- alignItems="center"
49
+ <Flex
50
+ alignItems="center"
51
51
  columnGap="xs"
52
52
  justify="start"
53
53
  orientation="row"
@@ -71,11 +71,12 @@ export const CustomCell = ({
71
71
  >
72
72
  {row.getIsExpanded() ? (
73
73
  <Icon cursor="pointer"
74
- icon="circle-play-down"
74
+ icon="circle-play"
75
+ rotation={90}
75
76
  />
76
77
  ) : (
77
78
  <Icon cursor="pointer"
78
- icon="circle-play"
79
+ icon="circle-play"
79
80
  />
80
81
  )}
81
82
  </button>
@@ -39,11 +39,11 @@
39
39
  style="color: <%= button_color %>"
40
40
  >
41
41
  <%= pb_rails("icon", props: { id: "advanced-table_open_icon", icon: "circle-play", cursor: "pointer" }) %>
42
- <%= pb_rails("icon", props: { id: "advanced-table_close_icon", icon: "circle-play-down", cursor: "pointer" }) %>
42
+ <%= pb_rails("icon", props: { id: "advanced-table_close_icon", icon: "circle-play", cursor: "pointer", rotation: 90 }) %>
43
43
  </button>
44
44
  <% end %>
45
45
  <% end %>
46
- <%= pb_rails("flex/flex_item") do %>
46
+ <%= pb_rails("flex/flex_item") do %>
47
47
  <% if column[:custom_renderer].present? %>
48
48
  <%= raw(column[:custom_renderer].call(object.row, custom_renderer_value(column, index))) %>
49
49
  <% elsif index.zero? %>
@@ -18,7 +18,7 @@ import{r as requireLazysizes}from"./lazysizes-B7xYodB-.js";import{jsx,Fragment,j
18
18
  * LICENSE.md file in the root directory of this source tree.
19
19
  *
20
20
  * @license MIT
21
- */function flexRender(Comp,props){return!Comp?null:isReactComponent(Comp)?React.createElement(Comp,props):Comp}function isReactComponent(component){return isClassComponent(component)||typeof component==="function"||isExoticComponent(component)}function isClassComponent(component){return typeof component==="function"&&(()=>{const proto=Object.getPrototypeOf(component);return proto.prototype&&proto.prototype.isReactComponent})()}function isExoticComponent(component){return typeof component==="object"&&typeof component.$$typeof==="symbol"&&["react.memo","react.forward_ref"].includes(component.$$typeof.description)}function useReactTable(options){const resolvedOptions={state:{},onStateChange:()=>{},renderFallbackValue:null,...options};const[tableRef]=React.useState((()=>({current:createTable(resolvedOptions)})));const[state,setState]=React.useState((()=>tableRef.current.initialState));tableRef.current.setOptions((prev=>({...prev,...options,state:{...state,...options.state},onStateChange:updater=>{setState(updater);options.onStateChange==null||options.onStateChange(updater)}})));return tableRef.current}const displayIcon=icon=>{if(typeof icon==="string"){return[icon,icon]}return icon};const SortIconButton=({header:header,sortIcon:sortIcon})=>{const firstIcon=displayIcon(sortIcon)[0];const secondIcon=displayIcon(sortIcon)[1];const upIcon=getAllIcons()["arrowUpShortWide"].icon;const downIcon=getAllIcons()["arrowDownShortWide"].icon;return jsx(Fragment,{children:header.column.getIsSorted()==="desc"?jsx("div",{className:"sort-button-icon",children:firstIcon==="arrow-up-short-wide"?jsx(Icon,{className:"svg-inline--fa",customIcon:upIcon}):jsx(Icon,{icon:firstIcon})},firstIcon):jsx("div",{className:"sort-button-icon",children:secondIcon==="arrow-down-short-wide"?jsx(Icon,{className:"svg-inline--fa",customIcon:downIcon}):jsx(Icon,{icon:secondIcon})},secondIcon)})};const ToggleIconButton=({row:row,onClick:onClick})=>{const{toggleExpansionIcon:toggleExpansionIcon}=useContext(AdvancedTableContext);return jsx("button",{className:"gray-icon toggle-all-icon",onClick:()=>onClick(row),children:jsx(Icon,{cursor:"pointer",fixedWidth:true,icon:displayIcon(toggleExpansionIcon)[0]})},displayIcon(toggleExpansionIcon)[0])};const findColumnDefByAccessor=(defs,targetAccessor)=>{for(const def of defs){if(def.accessor===targetAccessor){return def}if(Array.isArray(def.columns)&&def.columns.length){const found=findColumnDefByAccessor(def.columns,targetAccessor);if(found)return found}}return void 0};const filterExpandableRows=expandedState=>{for(const expandedRow in expandedState){if(expandedState[expandedRow]===false){delete expandedState[expandedRow]}}return expandedState};const updateExpandAndCollapseState=(tableRows,expanded,targetParent,targetDepth)=>{const updateExpandedRows={};const rows=targetDepth!==void 0?tableRows.flatRows:tableRows.rows;const rowsToToggle=[];for(const row of rows){const shouldBeUpdated=targetDepth!==void 0?row.depth<=targetDepth:targetParent===void 0?row.depth===0:targetParent===row.parentId;if(shouldBeUpdated){rowsToToggle.push(row)}}const anyCollapsed=rowsToToggle.some((row=>!row.getIsExpanded()));const isExpandAction=anyCollapsed;for(const row of rowsToToggle){const shouldUpdate=isExpandAction||targetDepth===void 0?true:row.depth===targetDepth;if(shouldUpdate){updateExpandedRows[row.id]=isExpandAction}}return filterExpandableRows({...expanded,...updateExpandedRows})};const isChrome=()=>{const userAgent=navigator.userAgent.toLowerCase();return userAgent.includes("chrome")&&!userAgent.includes("edg")};const TableHeaderCell=({enableSorting:enableSorting,enableToggleExpansion:enableToggleExpansion,handleExpandOrCollapse:handleExpandOrCollapse,header:header,headerChildren:headerChildren,isPinnedLeft:isPinnedLeft=false,loading:loading,sortIcon:sortIcon,table:table})=>{var _a,_b;const{columnDefinitions:columnDefinitions,expanded:expanded,setExpanded:setExpanded,expandByDepth:expandByDepth,onExpandByDepthClick:onExpandByDepthClick,toggleExpansionIcon:toggleExpansionIcon,sortControl:sortControl,responsive:responsive,selectableRows:selectableRows,hasAnySubRows:hasAnySubRows,showActionsBar:showActionsBar,stickyLeftColumn:stickyLeftColumn,inlineRowLoading:inlineRowLoading,isActionBarVisible:isActionBarVisible}=useContext(AdvancedTableContext);const toggleSortButton=event=>{if(sortControl){const sortIsDesc=(header==null?void 0:header.column.getIsSorted())==="desc";sortIsDesc?sortControl.onChange({desc:true}):sortControl.onChange({desc:false})}else{header==null?void 0:header.column.getToggleSortingHandler()(event)}};const alignmentMap={left:"start",center:"center",right:"end"};const colDef=header?findColumnDefByAccessor(columnDefinitions,header.column.id):void 0;const headerAlignment=((_a=colDef==null?void 0:colDef.columnStyling)==null?void 0:_a.headerAlignment)??((_b=colDef==null?void 0:colDef.columnStyling)==null?void 0:_b.headerAligment);const isLeafColumn=(header==null?void 0:header.column.getLeafColumns().length)===1&&(header==null?void 0:header.column.getLeafColumns()[0].id)===header.column.id;const columnHasVisibleLeaf=col=>{var _a2;return((_a2=col.getIsVisible)==null?void 0:_a2.call(col))||Array.isArray(col.columns)&&col.columns.some((child=>columnHasVisibleLeaf(child)))};const isLastHeaderCell=(()=>{var _a2;if(!header)return false;if(header.colSpan>1&&header.column.parent!==void 0)return true;const parent=header.column.parent;if(!parent){const topHeaders=table==null?void 0:table.getHeaderGroups()[0].headers.filter((h=>columnHasVisibleLeaf(h.column)));return((_a2=topHeaders==null?void 0:topHeaders.at(-1))==null?void 0:_a2.id)===header.id}const visibleSiblings=parent.columns.filter(columnHasVisibleLeaf);return visibleSiblings.at(-1)===header.column})();const cellClassName=classnames("table-header-cells",`${showActionsBar&&isActionBarVisible&&"header-cells-with-actions"}`,`${isChrome()?"chrome-styles":""}`,`${enableSorting?"table-header-cells-active":""}`,{"pinned-left":responsive==="scroll"&&isPinnedLeft},isLastHeaderCell?"last-header-cell":"",stickyLeftColumn&&stickyLeftColumn.length>0&&isPinnedLeft?"sticky-left":"");const cellId=`${loading?`loading-${header==null?void 0:header.id}`:`${header==null?void 0:header.id}`}`;const isToggleExpansionEnabledLoading=(header==null?void 0:header.index)===0&&loading&&(enableToggleExpansion==="all"||"header")&&enableToggleExpansion!=="none";const isToggleExpansionEnabled=(header==null?void 0:header.index)===0&&!loading&&(enableToggleExpansion==="all"||"header")&&enableToggleExpansion!=="none";let justifyHeader;if(headerAlignment&&alignmentMap[headerAlignment]){justifyHeader=alignmentMap[headerAlignment]}else if((header==null?void 0:header.index)===0&&hasAnySubRows||(header==null?void 0:header.index)===0&&inlineRowLoading||(header==null?void 0:header.index)===0&&isToggleExpansionEnabled){justifyHeader=enableSorting?"between":"start"}else{justifyHeader=isLeafColumn?"end":"center"}const[showPopover,setShowPopover]=useState(false);const togglePopover=()=>setShowPopover((prev=>!prev));const handleShouldClose=shouldClose=>setShowPopover(!shouldClose);const popoverReference=jsx("div",{className:"gray-icon toggle-all-icon",onClick:togglePopover,children:jsx(Icon,{icon:displayIcon(toggleExpansionIcon)[0]})});const handleExpandDepth=depth=>{if(onExpandByDepthClick){const flatRows=table==null?void 0:table.getRowModel().flatRows;onExpandByDepthClick(depth,flatRows)}const updated=updateExpandAndCollapseState(table.getRowModel(),expanded,void 0,depth);setExpanded(updated)};return jsx("th",{align:headerAlignment?headerAlignment:"right",className:cellClassName,colSpan:header==null?void 0:header.colSpan,id:cellId,style:{left:isPinnedLeft?(header==null?void 0:header.index)===1?"180px":`${header==null?void 0:header.column.getStart("left")}px`:void 0},children:(header==null?void 0:header.isPlaceholder)?null:headerChildren&&(header==null?void 0:header.index)===0?jsxs(Flex,{alignItems:"center",children:[headerChildren,jsx("div",{children:flexRender(header.column.columnDef.header,header.getContext())})]}):jsxs(Flex,{alignItems:"center",justify:justifyHeader,children:[selectableRows&&(header==null?void 0:header.index)===0&&hasAnySubRows&&jsx(Checkbox,{checked:table==null?void 0:table.getIsAllRowsSelected(),indeterminate:table==null?void 0:table.getIsSomeRowsSelected(),onChange:table==null?void 0:table.getToggleAllRowsSelectedHandler()}),isToggleExpansionEnabled&&hasAnySubRows&&!expandByDepth&&jsx(ToggleIconButton,{onClick:handleExpandOrCollapse}),isToggleExpansionEnabled&&hasAnySubRows&&expandByDepth&&jsx(PbReactPopover,{closeOnClick:"any",placement:"bottom-start",reference:popoverReference,shouldClosePopover:handleShouldClose,show:showPopover,zIndex:3,children:expandByDepth.map(((option,index)=>jsxs(Fragment,{children:[jsx(Flex,{alignItems:"center",className:"pb-advanced-table-popover-option",cursor:"pointer",htmlOptions:{onClick:()=>{handleExpandDepth(option.depth)}},paddingX:"sm",paddingY:"xs",children:option.label}),index!==expandByDepth.length-1&&jsx(SectionSeparator,{})]})))}),isToggleExpansionEnabledLoading&&jsx("div",{className:"loading-toggle-icon header-toggle-icon"}),jsxs(Flex,{className:`${(header==null?void 0:header.index)===0&&enableSorting&&"header-sort-button pb_th_link"}`,cursor:(header==null?void 0:header.index)===0&&enableSorting?"pointer":"default",...(header==null?void 0:header.index)===0&&enableSorting&&{htmlOptions:{onClick:event=>toggleSortButton(event),onKeyDown:event=>{if(event.key==="Enter"){toggleSortButton(event)}},tabIndex:0}},justify:(header==null?void 0:header.index)===0&&enableSorting?"between":headerAlignment?alignmentMap[headerAlignment]:"none",paddingLeft:(header==null?void 0:header.index)===0?enableSorting?"xxs":"xs":"none",children:[jsx("div",{children:flexRender(header==null?void 0:header.column.columnDef.header,header==null?void 0:header.getContext())}),(header==null?void 0:header.index)===0&&header.column.getCanSort()&&enableSorting&&(loading?jsx("div",{className:"loading-toggle-icon"}):jsx(SortIconButton,{header:header,sortIcon:sortIcon}))]})]})},`${header==null?void 0:header.id}-header`)};const TableHeader=({children:children,className:className,dark:dark=false,enableSorting:enableSorting=false,id:id,sortIcon:sortIcon=["arrow-up-short-wide","arrow-down-short-wide"],...props})=>{const{enableToggleExpansion:enableToggleExpansion,handleExpandOrCollapse:handleExpandOrCollapse,loading:loading,table:table,hasAnySubRows:hasAnySubRows,showActionsBar:showActionsBar,selectableRows:selectableRows,responsive:responsive,headerRef:headerRef,virtualizedRows:virtualizedRows,enableVirtualization:enableVirtualization}=useContext(AdvancedTableContext);const isVirtualized=virtualizedRows||enableVirtualization;const classes=classnames(buildCss("pb_advanced_table_header"),globalProps(props),className);const columnPinning=table.getState().columnPinning;const customCellClassnames=classnames("table-header-cells-custom",`${showActionsBar&&"header-cells-with-actions"}`,`${isChrome()?"chrome-styles":""}`,`${responsive==="scroll"&&"pinned-left"}`);const renderRegularTableHeader=()=>jsx("thead",{className:classes,id:id,children:table.getHeaderGroups().map(((headerGroup,index)=>jsxs("tr",{ref:index===0?headerRef:null,children:[!hasAnySubRows&&selectableRows&&jsx("th",{className:customCellClassnames,children:jsx(Checkbox,{checked:table==null?void 0:table.getIsAllRowsSelected(),indeterminate:table==null?void 0:table.getIsSomeRowsSelected(),onChange:table==null?void 0:table.getToggleAllRowsSelectedHandler()})}),headerGroup.headers.map((header=>{const isPinnedLeft=columnPinning.left.includes(header.id);return jsx(TableHeaderCell,{enableSorting:enableSorting,enableToggleExpansion:enableToggleExpansion,handleExpandOrCollapse:handleExpandOrCollapse,header:header,headerChildren:children,isPinnedLeft:isPinnedLeft,loading:loading,sortIcon:sortIcon,table:table},`${header.id}-header`)}))]},`${headerGroup.id}-headerGroup`)))});const renderVirtualizedTableHeader=()=>jsx("thead",{className:classes,"data-virtualized":"true",id:id,children:table.getHeaderGroups().map(((headerGroup,index)=>jsxs("tr",{className:"virtualized-header-row-header",ref:index===0?headerRef:null,children:[!hasAnySubRows&&selectableRows&&jsx("th",{className:classnames(customCellClassnames,"virtualized-header-cell"),children:jsx(Checkbox,{checked:table==null?void 0:table.getIsAllRowsSelected(),indeterminate:table==null?void 0:table.getIsSomeRowsSelected(),onChange:table==null?void 0:table.getToggleAllRowsSelectedHandler()})}),headerGroup.headers.map((header=>{const isPinnedLeft=columnPinning.left.includes(header.id);return jsx(TableHeaderCell,{enableSorting:enableSorting,enableToggleExpansion:enableToggleExpansion,handleExpandOrCollapse:handleExpandOrCollapse,header:header,headerChildren:children,isPinnedLeft:isPinnedLeft,isVirtualized:true,loading:loading,sortIcon:sortIcon,table:table},`${header.id}-header-virtualized`)}))]},`${headerGroup.id}-headerGroup-virtualized`)))});return jsx(Fragment,{children:isVirtualized?renderVirtualizedTableHeader():renderRegularTableHeader()})};const LoadingInline=props=>{const{align:align="left",aria:aria={},className:className,data:data={},dark:dark=false,htmlOptions:htmlOptions={},id:id,text:text2=" Loading"}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss(`pb_loading_inline_kit_${align}`),globalProps(props),className);return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:jsxs(Body$1,{color:"light",dark:dark,children:[jsx(Icon,{aria:{label:"loading icon"},fixedWidth:true,icon:"spinner",pulse:true}),text2]})})};const CollapsibleTrail=({leftOffset:leftOffset})=>{const style={left:`${leftOffset}em`};return jsx("div",{className:"collapsible-trail",style:style})};const renderCollapsibleTrail=currentDepth=>{const lines=[];for(let i=1;i<=currentDepth;i++){const additionalOffset=i>1?(i-1)*.25:0;const leftOffset=i*1+additionalOffset;lines.push(jsx(CollapsibleTrail,{leftOffset:leftOffset},i))}return lines};const SubRowHeaderRow=({collapsibleTrail:collapsibleTrail,enableToggleExpansion:enableToggleExpansion,onClick:onClick,row:row,subRowHeaders:subRowHeaders,table:table})=>{var _a;const{inlineRowLoading:inlineRowLoading,customSort:customSort,onCustomSortClick:onCustomSortClick}=useContext(AdvancedTableContext);const numberOfColumns=table.getAllFlatColumns().length;const rowHasChildren=row.original.children?true:false;const canExpand=inlineRowLoading?rowHasChildren:row.getCanExpand();const hasSubrowsToSort=(_a=row.getParentRow())==null?void 0:_a.subRows;return jsxs("tr",{className:"custom-row bg-silver",children:[jsxs("td",{className:`custom-row-first-column ${isChrome()?"chrome-styles":""}`,colSpan:1,children:[collapsibleTrail&&row.depth>0&&renderCollapsibleTrail(row.depth),jsx("div",{style:{paddingLeft:`${row.depth*1.25}em`},children:jsxs(Flex,{align:"center",columnGap:"xs",justifyContent:customSort&&hasSubrowsToSort&&hasSubrowsToSort.length>1?"between":void 0,children:[jsxs(Flex,{columnGap:"xs",children:[enableToggleExpansion==="all"&&canExpand?jsx(ToggleIconButton,{onClick:onClick,row:row}):null,jsx(Caption,{marginLeft:canExpand?"none":"xs",text:subRowHeaders[row.depth-1]})]}),customSort&&hasSubrowsToSort&&hasSubrowsToSort.length>1&&jsx("button",{"aria-label":"Sort this group",className:"sort-button-icon gray-icon",onClick:()=>{var _a2;onCustomSortClick&&onCustomSortClick((_a2=row.getParentRow())==null?void 0:_a2.subRows)},children:jsx(Icon,{cursor:"pointer",fixedWidth:true,icon:"sort"})})]})})]}),jsx("td",{colSpan:numberOfColumns-1})]})};const LoadingCell=()=>jsx("div",{className:"loading-cell"});const TableCellRenderer=({row:row,collapsibleTrail:collapsibleTrail=true,loading:loading=false,stickyLeftColumn:stickyLeftColumn,columnPinning:columnPinning,customRowStyle:customRowStyle,columnDefinitions:columnDefinitions})=>jsx(Fragment,{children:row.getVisibleCells().map(((cell,i)=>{var _a;const isPinnedLeft=columnPinning.left.includes(cell.column.id);const isLastCell=(()=>{var _a2;const parent=cell.column.parent;if(!parent){const last=row.getVisibleCells().at(-1);return(last==null?void 0:last.column.id)===cell.column.id}const visibleSiblings=parent.columns.filter((col=>col.getIsVisible()));return((_a2=visibleSiblings.at(-1))==null?void 0:_a2.id)===cell.column.id})();const{column:column}=cell;const colDef=findColumnDefByAccessor(columnDefinitions??[],column.id);const cellAlignment=((_a=colDef==null?void 0:colDef.columnStyling)==null?void 0:_a.cellAlignment)??"right";return jsxs("td",{align:cellAlignment,className:classnames(`${cell.id}-cell position_relative`,isChrome()?"chrome-styles":"",isPinnedLeft&&"pinned-left",stickyLeftColumn&&stickyLeftColumn.length>0&&isPinnedLeft&&"sticky-left",isLastCell&&"last-cell"),style:{left:isPinnedLeft?i===1?"180px":`${column.getStart("left")}px`:void 0,backgroundColor:i===0&&(customRowStyle==null?void 0:customRowStyle.backgroundColor),color:customRowStyle==null?void 0:customRowStyle.fontColor},children:[collapsibleTrail&&i===0&&row.depth>0&&renderCollapsibleTrail(row.depth),jsx("span",{id:`${cell.id}-span`,children:loading?jsx(LoadingCell,{}):flexRender(cell.column.columnDef.cell,cell.getContext())})]},`${cell.id}-data`)}))});const RegularTableView=({collapsibleTrail:collapsibleTrail=true,subRowHeaders:subRowHeaders})=>{var _a;const{enableToggleExpansion:enableToggleExpansion,handleExpandOrCollapse:handleExpandOrCollapse,inlineRowLoading:inlineRowLoading,loading:loading,table:table,selectableRows:selectableRows,hasAnySubRows:hasAnySubRows,stickyLeftColumn:stickyLeftColumn,pinnedRows:pinnedRows,headerHeight:headerHeight,rowHeight:rowHeight,rowStyling:rowStyling=[],sampleRowRef:sampleRowRef}=useContext(AdvancedTableContext);useEffect((()=>{if(stickyLeftColumn&&Array.isArray(stickyLeftColumn)){stickyLeftColumn.forEach((columnId=>{const column=table.getColumn(columnId);if(column&&column.getCanPin()){column.pin("left")}}))}}),[stickyLeftColumn,table]);const columnPinning=table.getState().columnPinning||{left:[]};const columnDefinitions=((_a=table.options.meta)==null?void 0:_a.columnDefinitions)||[];function PinnedRow({row:row}){return jsx("tr",{className:classnames(`pinned-row`),style:{backgroundColor:"white",position:"sticky",top:row.getIsPinned()==="top"?`${row.getPinnedIndex()*rowHeight+headerHeight}px`:void 0,zIndex:"3"},children:jsx(TableCellRenderer,{collapsibleTrail:collapsibleTrail,columnDefinitions:columnDefinitions,columnPinning:columnPinning,loading:loading,row:row,stickyLeftColumn:stickyLeftColumn})})}const totalRows=pinnedRows?table.getCenterRows():table.getRowModel().rows;return jsxs(Fragment,{children:[pinnedRows&&table.getTopRows().map((row=>jsx(PinnedRow,{row:row},row.id))),totalRows.map(((row,rowIndex)=>{var _a2,_b,_c;const isExpandable=row.getIsExpanded();const isFirstChildofSubrow=row.depth>0&&row.index===0;const rowHasNoChildren=((_a2=row.original)==null?void 0:_a2.children)&&!row.original.children.length?true:false;const numberOfColumns=table.getAllFlatColumns().length;const isDataLoading=isExpandable&&(inlineRowLoading&&rowHasNoChildren)&&row.depth<((_c=(_b=columnDefinitions[0])==null?void 0:_b.cellAccessors)==null?void 0:_c.length);const rowBackground=isExpandable&&(!inlineRowLoading&&row.getCanExpand()||inlineRowLoading&&rowHasNoChildren);const rowColor=row.getIsSelected()?"bg-row-selection":rowBackground?"bg-silver":"bg-white";const isFirstRegularRow=rowIndex===0&&!row.getIsPinned();const customRowStyle=(rowStyling==null?void 0:rowStyling.length)>0&&(rowStyling==null?void 0:rowStyling.find((s=>(s==null?void 0:s.rowId)===row.id)));return jsxs(React__default.Fragment,{children:[isFirstChildofSubrow&&subRowHeaders&&jsx(SubRowHeaderRow,{collapsibleTrail:collapsibleTrail,enableToggleExpansion:enableToggleExpansion,onClick:handleExpandOrCollapse,row:row,subRowHeaders:subRowHeaders,table:table}),jsxs("tr",{className:`${rowColor} ${row.depth>0?`depth-sub-row-${row.depth}`:""}`,id:`${row.index}-${row.id}-${row.depth}-row`,ref:isFirstRegularRow?sampleRowRef:null,style:{backgroundColor:customRowStyle==null?void 0:customRowStyle.backgroundColor,color:customRowStyle==null?void 0:customRowStyle.fontColor},children:[selectableRows&&!hasAnySubRows&&jsx("td",{className:"checkbox-cell",children:jsx(Checkbox,{checked:row.getIsSelected(),disabled:!row.getCanSelect(),indeterminate:row.getIsSomeSelected(),name:row.id,onChange:row.getToggleSelectedHandler()})}),jsx(TableCellRenderer,{collapsibleTrail:collapsibleTrail,columnDefinitions:columnDefinitions,columnPinning:columnPinning,customRowStyle:customRowStyle,loading:loading,row:row,stickyLeftColumn:stickyLeftColumn})]}),isDataLoading&&jsx("tr",{children:jsx("td",{colSpan:numberOfColumns,style:{paddingLeft:`${row.depth===0?.5:row.depth*2}em`},children:jsx(LoadingInline,{})})},`${row.id}-row`)]},`${row.index}-${row.id}-${row.depth}-row`)}))]})};const VirtualizedTableView=({collapsibleTrail:collapsibleTrail=true,subRowHeaders:subRowHeaders,isFetching:isFetching})=>{var _a;const{enableToggleExpansion:enableToggleExpansion,handleExpandOrCollapse:handleExpandOrCollapse,inlineRowLoading:inlineRowLoading,loading:loading,table:table,selectableRows:selectableRows,hasAnySubRows:hasAnySubRows,virtualizer:virtualizer,flattenedItems:flattenedItems,totalAvailableCount:totalAvailableCount}=useContext(AdvancedTableContext);const columnPinning=table.getState().columnPinning||{left:[]};const sortingState=JSON.stringify(table.getState().sorting||[]);const[columnWidths,setColumnWidths]=useState({});const getHeaderCellWidths=()=>{const widths={};const headerCells=document.querySelectorAll(".table-header-cells, .table-header-cells-custom");if(selectableRows&&!hasAnySubRows&&headerCells.length>0){widths["checkbox"]=`${headerCells[0].getBoundingClientRect().width}px`}table.getFlatHeaders().forEach(((header,index)=>{const headerIndex=selectableRows&&!hasAnySubRows?index+1:index;if(headerCells[headerIndex]){const width=headerCells[headerIndex].getBoundingClientRect().width;widths[header.id]=`${width}px`}}));return widths};const debounce2=(func,wait)=>{let timeout;return function executedFunction(...args){const later=()=>{clearTimeout(timeout);func(...args)};clearTimeout(timeout);timeout=setTimeout(later,wait)}};useLayoutEffect((()=>{const timer=setTimeout((()=>{setColumnWidths(getHeaderCellWidths())}),0);return()=>clearTimeout(timer)}),[table,selectableRows,hasAnySubRows,sortingState]);useEffect((()=>{const handleResize=debounce2((()=>{setColumnWidths(getHeaderCellWidths())}),0);window.addEventListener("resize",handleResize);return()=>{window.removeEventListener("resize",handleResize)}}),[table,selectableRows,hasAnySubRows]);if(!virtualizer||!flattenedItems){return jsx("tr",{children:jsx("td",{colSpan:table.getAllFlatColumns().length||1,children:"No data to display."})})}const virtualItems=((_a=virtualizer.getVirtualItems)==null?void 0:_a.call(virtualizer))||[];if(!virtualItems.length){return jsx("tr",{children:jsx("td",{colSpan:table.getAllFlatColumns().length||1,children:"No items to display."})})}const topLevelRowCount=table.getRowModel().flatRows.filter((row=>row.depth===0)).length;return jsx(Fragment,{children:virtualItems.map((virtualRow=>{var _a2;const item=flattenedItems[virtualRow.index];if(!item)return null;const virtualItemStyle=getVirtualizedRowStyle(virtualRow.start);if(item.type==="header"){return jsx("tr",{className:"virtualized-table-row virtualized-header-row",style:virtualItemStyle,children:jsx("td",{colSpan:table.getAllFlatColumns().length,children:jsx(SubRowHeaderRow,{collapsibleTrail:collapsibleTrail,enableToggleExpansion:enableToggleExpansion,onClick:handleExpandOrCollapse,row:item.row,subRowHeaders:subRowHeaders,table:table})})},`header-${item.id}-sort-${sortingState}`)}if(item.type==="row"){const row=item.row;const isExpandable=row.getIsExpanded();const rowHasNoChildren=((_a2=row.original)==null?void 0:_a2.children)&&!row.original.children.length;const rowBackground=isExpandable&&(!inlineRowLoading&&row.getCanExpand()||inlineRowLoading&&rowHasNoChildren);const rowColor=row.getIsSelected()?"bg-row-selection":rowBackground?"bg-silver":"bg-white";return jsxs("tr",{className:`virtualized-table-row ${rowColor} ${row.depth>0?`depth-sub-row-${row.depth}`:""}`,"data-index":virtualRow.index,ref:node=>{if(node){try{virtualizer.measureElement(node)}catch(err){}}},style:virtualItemStyle,children:[selectableRows&&!hasAnySubRows&&jsx("td",{className:"checkbox-cell",style:{width:columnWidths["checkbox"]||"auto"},children:jsx(Checkbox,{checked:row.getIsSelected(),disabled:!row.getCanSelect(),indeterminate:row.getIsSomeSelected(),name:row.id,onChange:row.getToggleSelectedHandler()})}),row.getVisibleCells().map(((cell,i)=>{var _a3,_b,_c;const isPinnedLeft=columnPinning.left.includes(cell.column.id);const isLastCell=((_c=(_b=(_a3=cell.column.parent)==null?void 0:_a3.columns)==null?void 0:_b.at(-1))==null?void 0:_c.id)===cell.column.id;const cellWidth=columnWidths[cell.column.id]||"auto";return jsxs("td",{align:"right",className:classnames(`${cell.id}-cell position_relative`,isChrome()?"chrome-styles":"",isPinnedLeft&&"pinned-left",isLastCell&&"last-cell"),style:{width:cellWidth},children:[collapsibleTrail&&i===0&&row.depth>0&&renderCollapsibleTrail(row.depth),jsx("span",{id:`${cell.id}-span`,children:loading?jsx(LoadingCell,{}):flexRender(cell.column.columnDef.cell,cell.getContext())})]},`${cell.id}-data`)}))]},`row-${item.id}-sort-${sortingState}`)}if(item.type==="loading"){const row=item.row;const numberOfColumns=table.getAllFlatColumns().length;return jsx("tr",{className:"virtualized-table-row virtualized-loading-row",style:virtualItemStyle,children:jsx("td",{colSpan:numberOfColumns,style:{paddingLeft:`${row.depth===0?.5:row.depth*2}em`},children:jsx(LoadingInline,{})})},`loading-${item.id}-sort-${sortingState}`)}if(item.type==="footer"){return jsx("tr",{className:"virtualized-table-row virtualized-footer",style:virtualItemStyle,children:jsx("td",{colSpan:table.getAllFlatColumns().length,children:jsx(Flex,{align:"center",justify:"center",children:isFetching?jsx(LoadingInline,{}):jsx(Detail,{text:`Showing ${topLevelRowCount} of ${totalAvailableCount} rows`})})})},`footer-row`)}return null}))})};const TableBody=({className:className,collapsibleTrail:collapsibleTrail=true,dark:dark=false,id:id,subRowHeaders:subRowHeaders,isFetching:isFetching,...props})=>{const{responsive:responsive,isPinnedLeft:isPinnedLeft=false,virtualizer:virtualizer,virtualizedRows:virtualizedRows,enableVirtualization:enableVirtualization}=useContext(AdvancedTableContext);const isVirtualized=virtualizedRows||enableVirtualization;const classes=classnames(buildCss("pb_advanced_table_body"),{"pinned-left":responsive==="scroll"&&isPinnedLeft},globalProps(props),className);const style=virtualizer?{height:`${virtualizer.getTotalSize()}px`,position:"relative",width:"100%"}:{};return jsx(Fragment,{children:jsxs("tbody",{className:classes,"data-virtualized":isVirtualized?"true":"false",id:id,style:style,children:[isVirtualized&&virtualizer?jsx(VirtualizedTableView,{collapsibleTrail:collapsibleTrail,isFetching:isFetching,subRowHeaders:subRowHeaders}):jsx(RegularTableView,{collapsibleTrail:collapsibleTrail,subRowHeaders:subRowHeaders}),isVirtualized&&!virtualizer&&jsx("tr",{children:jsx("td",{colSpan:999,style:{padding:"10px",textAlign:"center"},children:jsx("div",{children:"No data to display."})})})]})})};const Pagination=props=>{const{aria:aria={},className:className,data:data={},htmlOptions:htmlOptions={},id:id,current:current=1,onChange:onChange,range:range=5,total:total=1}=props;const[currentPage,setCurrentPage]=useState(current);const handlePageChange=pageNumber=>{if(pageNumber>=1&&pageNumber<=total){setCurrentPage(pageNumber);if(onChange){onChange(pageNumber)}}};const renderPageButtons=()=>{const buttons=[];let rangeStart=Math.max(1,currentPage-Math.floor(range/2));let rangeEnd=Math.min(total,rangeStart+range-1);if(rangeEnd-rangeStart+1<range){if(rangeStart>1){rangeStart=Math.max(1,rangeEnd-range+1)}else{rangeEnd=Math.min(total,rangeStart+range-1)}}if(rangeStart>1){buttons.push(jsx("li",{className:"pagination-number",onClick:()=>handlePageChange(1),children:"1"},1))}if(rangeStart>2){buttons.push(jsx("li",{className:"pagination-number",onClick:()=>handlePageChange(2),children:"2"},2))}for(let i=rangeStart;i<=rangeEnd;i++){buttons.push(jsx("li",{className:`pagination-number ${i===currentPage?"active":""}`,onClick:()=>handlePageChange(i),children:i},i))}if(rangeEnd<total-1){buttons.push(jsx("li",{className:`pagination-number ${total-1===currentPage?"active":""}`,onClick:()=>handlePageChange(total-1),children:total-1},total-1))}if(rangeEnd<total){buttons.push(jsx("li",{className:`pagination-number ${total===currentPage?"active":""}`,onClick:()=>handlePageChange(total),children:total},total))}return buttons};const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_paginate"),globalProps(props),className);return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:jsxs("div",{className:"pb_pagination",children:[jsx("li",{className:`pagination-left ${currentPage===1?"disabled":""}`,onClick:()=>handlePageChange(currentPage-1),children:jsx(Icon,{icon:"chevron-left"})}),renderPageButtons(),jsx("li",{className:`pagination-right ${currentPage===total?"disabled":""}`,onClick:()=>handlePageChange(currentPage+1),children:jsx(Icon,{icon:"chevron-right"})})]})})};const TablePagination=({table:table,onChange:onChange,position:position,range:range=5})=>{const current=table.getState().pagination.pageIndex+1;const total=table.getPageCount();return jsx(Pagination,{current:current,marginBottom:position==="top"?"xs":void 0,marginTop:position==="bottom"?"xs":void 0,onChange:onChange,range:range,total:total},`pagination-${position}-${current}`)};const buildVisibilityTree=(defs,allowed)=>defs.map((def=>{const isGroup=Array.isArray(def.columns)&&def.columns.length>0;if(!(allowed==null?void 0:allowed.length)){return isGroup?{id:def.id,label:def.label,children:buildVisibilityTree(def.columns,allowed)}:{id:def.id,label:def.label}}if(allowed.includes(def.id)){return isGroup?{id:def.id,label:def.label,children:buildVisibilityTree(def.columns,null)}:{id:def.id,label:def.label}}if(isGroup){const kids=buildVisibilityTree(def.columns,allowed).filter(Boolean);return kids.length?{id:def.id,label:def.label,children:kids}:null}return null})).filter(Boolean);const showActionBar=elem=>{elem.style.display="block";const height=elem.scrollHeight+"px";elem.style.height=height;elem.classList.add("is-visible");elem.style.overflow="hidden";window.setTimeout((()=>{if(elem.classList.contains("is-visible")){elem.style.height="";elem.style.overflow="visible"}}),300)};const hideActionBar=elem=>{elem.style.height=elem.scrollHeight+"px";elem.offsetHeight;window.setTimeout((()=>{elem.style.height="0";elem.style.overflow="hidden"}),10);window.setTimeout((()=>{elem.classList.remove("is-visible")}),300)};const TableActionBar=({isVisible:isVisible,selectedCount:selectedCount,actions:actions,type:type="row-selection"})=>{var _a;const cardRef=useRef(null);const{table:table,columnVisibilityControl:columnVisibilityControl,columnDefinitions:columnDefinitions}=useContext(AdvancedTableContext);const includeIds=columnVisibilityControl==null?void 0:columnVisibilityControl.includeIds;const firstLeafId=(_a=table.getAllLeafColumns()[0])==null?void 0:_a.id;const tree=buildVisibilityTree(columnDefinitions,includeIds).filter((node=>node.id!==firstLeafId));const renderLeaf=(id,label)=>{const col=table.getColumn(id);const show=col.getIsVisible();const handleVisibilityChange=()=>{col.toggleVisibility();if(columnVisibilityControl==null?void 0:columnVisibilityControl.onColumnVisibilityChange){const updatedVisibilityState={...table.getAllColumns().reduce(((acc,col2)=>{acc[col2.id]=col2.getIsVisible();return acc}),{})};columnVisibilityControl==null?void 0:columnVisibilityControl.onColumnVisibilityChange(updatedVisibilityState)}};return jsx(Checkbox,{checked:show,onChange:handleVisibilityChange,paddingBottom:"xs",text:label},id)};const gatherLeafIds=node=>node.children&&node.children.length?node.children.flatMap(gatherLeafIds):node.id?[node.id]:[];const renderGroup=node=>{var _a2;const leaves=gatherLeafIds(node);const visibleArray=leaves.map((id=>table.getColumn(id).getIsVisible()));const allOn=visibleArray.every(Boolean);const someOn=visibleArray.some(Boolean);const handleGroupVisibilityChange=()=>{leaves.forEach((id=>table.getColumn(id).toggleVisibility(!allOn)));if(columnVisibilityControl==null?void 0:columnVisibilityControl.onColumnVisibilityChange){const updatedVisibilityState={...table.getAllColumns().reduce(((acc,col)=>{acc[col.id]=col.getIsVisible();return acc}),{})};columnVisibilityControl==null?void 0:columnVisibilityControl.onColumnVisibilityChange(updatedVisibilityState)}};return jsxs(Fragment,{children:[jsx(Checkbox,{checked:allOn,indeterminate:!allOn&&someOn,onChange:handleGroupVisibilityChange,paddingBottom:"xs",text:node.label}),jsx(Flex,{flexDirection:"column",paddingLeft:"lg",children:(_a2=node==null?void 0:node.children)==null?void 0:_a2.map((child=>child.children?renderGroup(child):renderLeaf(child.id,child.label)))})]})};useEffect((()=>{if(cardRef.current&&type==="row-selection"){if(isVisible){showActionBar(cardRef.current)}else{hideActionBar(cardRef.current)}}}),[isVisible,type]);const[showPopover,setShowPopover]=useState(false);const togglePopover=()=>setShowPopover((prev=>!prev));const handleShouldClose=shouldClose=>setShowPopover(!shouldClose);const popoverReference=jsx(Tooltip$1,{placement:"top",text:"Column Configuration",children:jsx("div",{onClick:togglePopover,children:jsx(Icon,{color:"primary",cursor:"pointer",icon:"sliders-h"})})});return jsx(Card,{borderNone:!isVisible,className:`${isVisible&&"show-action-card row-selection-actions-card"}`,htmlOptions:{ref:cardRef},padding:`${isVisible?"xs":"none"}`,children:jsx(Flex,{alignItems:"center",justify:type==="row-selection"?"between":"end",children:type==="row-selection"?jsxs(Fragment,{children:[jsxs(Caption,{color:"light",paddingLeft:"xs",size:"xs",children:[selectedCount," Selected"]}),jsx(FlexItem,{children:actions})]}):jsx(PbReactPopover,{closeOnClick:"outside",placement:"bottom-end",reference:popoverReference,shouldClosePopover:handleShouldClose,show:showPopover,zIndex:3,children:jsxs(Fragment,{children:[jsx(Caption,{paddingY:"sm",text:"Columns Config",textAlign:"center"}),jsx(SectionSeparator,{paddingBottom:"xs"}),tree.map((node=>jsx(Flex,{cursor:"pointer",flexDirection:"column",paddingX:"xs",children:node.children?renderGroup(node):renderLeaf(node.id,node.label)},node.id)))]})})})})};const CustomCell=({getValue:getValue,onRowToggleClick:onRowToggleClick,row:row,value:value,customRenderer:customRenderer,selectableRows:selectableRows,customStyle:customStyle={}})=>{const{setExpanded:setExpanded,expanded:expanded,expandedControl:expandedControl,inlineRowLoading:inlineRowLoading,hasAnySubRows:hasAnySubRows}=useContext(AdvancedTableContext);const handleOnExpand=row2=>{onRowToggleClick&&onRowToggleClick(row2);if(!expandedControl){setExpanded({...expanded,[row2.id]:!row2.getIsExpanded()})}};const RowHasChildren=row.original.children?true:false;const renderButton=inlineRowLoading?RowHasChildren:row.getCanExpand();return jsx("div",{style:{paddingLeft:`${row.depth*1.25}em`},children:jsxs(Flex,{alignItems:"center",columnGap:"xs",justify:"start",orientation:"row",children:[selectableRows&&hasAnySubRows&&jsx(Checkbox,{checked:row.getIsSelected(),disabled:!row.getCanSelect(),indeterminate:row.getIsSomeSelected(),name:row.id,onChange:row.getToggleSelectedHandler()}),renderButton?jsx("button",{className:"gray-icon expand-toggle-icon",onClick:()=>handleOnExpand(row),style:{color:customStyle==null?void 0:customStyle.expandButtonColor},children:row.getIsExpanded()?jsx(Icon,{cursor:"pointer",icon:"circle-play-down"}):jsx(Icon,{cursor:"pointer",icon:"circle-play"})}):null,jsx(FlexItem,{paddingLeft:renderButton?"none":"xs",children:row.depth===0?customRenderer?customRenderer(row,getValue()):getValue():customRenderer?customRenderer(row,value):value})]})})};const createCellFunction=(cellAccessors,customRenderer,isFirstColumn,onRowToggleClick,selectableRows,rowStyling)=>{const cellRenderer=({row:row,getValue:getValue})=>{const rowData=row.original;const customStyle=(rowStyling==null?void 0:rowStyling.length)>0&&(rowStyling==null?void 0:rowStyling.find((s=>(s==null?void 0:s.rowId)===row.id)));if(isFirstColumn){switch(row.depth){case 0:{return jsx(CustomCell,{customRenderer:customRenderer,customStyle:customStyle,getValue:getValue,onRowToggleClick:onRowToggleClick,row:row,selectableRows:selectableRows})}default:{const depthAccessor=cellAccessors[row.depth-1];const accessorValue=rowData[depthAccessor];return accessorValue?jsx(CustomCell,{customRenderer:customRenderer,onRowToggleClick:onRowToggleClick,row:row,selectableRows:selectableRows,value:accessorValue}):"N/A"}}}return customRenderer?customRenderer(row,getValue()):getValue()};cellRenderer.displayName="CellRenderer";return cellRenderer};function useTableState({tableData:tableData,columnDefinitions:columnDefinitions,expandedControl:expandedControl,sortControl:sortControl,onRowToggleClick:onRowToggleClick,selectableRows:selectableRows,initialLoadingRowsCount:initialLoadingRowsCount=10,loading:loading,pagination:pagination=false,paginationProps:paginationProps,virtualizedRows:virtualizedRows=false,tableOptions:tableOptions,columnVisibilityControl:columnVisibilityControl,pinnedRows:pinnedRows,rowStyling:rowStyling}){var _a,_b;const[localExpanded,setLocalExpanded]=useState({});const[loadingStateRowCount,setLoadingStateRowCount]=useState(initialLoadingRowsCount);const[rowSelection,setRowSelection]=useState({});const[localColumnVisibility,setLocalColumnVisibility]=useState({});const[localRowPinning,setLocalRowPinning]=useState({top:[]});const expanded=expandedControl?expandedControl.value:localExpanded;const setExpanded=expandedControl?expandedControl.onChange:setLocalExpanded;const columnVisibility=columnVisibilityControl&&columnVisibilityControl.value?columnVisibilityControl.value:localColumnVisibility;const setColumnVisibility=columnVisibilityControl&&columnVisibilityControl.onChange?columnVisibilityControl.onChange:setLocalColumnVisibility;const rowPinning=(pinnedRows==null?void 0:pinnedRows.value)??localRowPinning;const onRowPinningChange=(pinnedRows==null?void 0:pinnedRows.onChange)??setLocalRowPinning;const fetchSize=20;const[fullData]=useState(tableData);const[dataChunk,setDataChunk]=useState(fullData.slice(0,fetchSize));const[totalFetched,setTotalFetched]=useState(fetchSize);const[isFetching,setIsFetching]=useState(false);const columnHelper=createColumnHelper();const buildColumns=useCallback(((columnDefinitions2,isRoot=true)=>(columnDefinitions2==null?void 0:columnDefinitions2.map(((column,index)=>{const isFirstColumn=isRoot&&index===0;if(column.columns&&column.columns.length>0){return{header:column.header??column.label??"",id:column.id??column.label??`group-${index}`,columns:buildColumns(column.columns,false)}}const columnStructure={...columnHelper.accessor(column.accessor,{header:column.header??column.label??""})};if(column.cellAccessors||column.customRenderer){columnStructure.cell=createCellFunction(column.cellAccessors||[],column.customRenderer,isFirstColumn,onRowToggleClick,selectableRows,rowStyling)}return columnStructure})))||[]),[columnHelper,onRowToggleClick,selectableRows]);const columns=useMemo((()=>buildColumns(columnDefinitions)),[buildColumns,columnDefinitions]);const sorting=useMemo((()=>[{id:columnDefinitions[0].accessor,desc:sortControl&&sortControl.value!==null?!sortControl.value.desc:false}]),[columnDefinitions,sortControl]);const customState=useCallback((()=>({state:{expanded:expanded,...sortControl&&{sorting:sorting},...selectableRows&&{rowSelection:rowSelection},...columnVisibility&&{columnVisibility:columnVisibility},...pinnedRows&&{rowPinning:rowPinning}}})),[expanded,sortControl,sorting,selectableRows,rowSelection,columnVisibility,rowPinning]);const paginationInitializer=useMemo((()=>{if(!pagination)return{};return{getPaginationRowModel:getPaginationRowModel(),paginateExpandedRows:false,initialState:{pagination:{pageIndex:(paginationProps==null?void 0:paginationProps.pageIndex)??0,pageSize:(paginationProps==null?void 0:paginationProps.pageSize)??20}}}}),[pagination,paginationProps]);const table=useReactTable({data:loading?Array(loadingStateRowCount).fill({}):virtualizedRows?dataChunk:tableData,columns:columns,onExpandedChange:setExpanded,getSubRows:row=>row.children,getCoreRowModel:getCoreRowModel(),getExpandedRowModel:getExpandedRowModel(),getSortedRowModel:getSortedRowModel(),enableSortingRemoval:false,sortDescFirst:true,onRowSelectionChange:setRowSelection,onRowPinningChange:onRowPinningChange,getRowId:selectableRows||pinnedRows||rowStyling?row=>row.id:void 0,onColumnVisibilityChange:setColumnVisibility,meta:{columnDefinitions:columnDefinitions},...customState(),...paginationInitializer,...tableOptions});useEffect((()=>{var _a2;const topPins=((_a2=pinnedRows==null?void 0:pinnedRows.value)==null?void 0:_a2.top)??[];if(topPins.length===0){onRowPinningChange({top:[]});return}const rows=table.getRowModel().rows;const collectAllDescendantIds=subs=>subs.flatMap((r=>[r.id,...collectAllDescendantIds(r.subRows)]));const allPinned=[];topPins.forEach((id=>{const parent=rows.find((r=>r.id===id&&r.depth===0));if(parent){allPinned.push(parent.id,...collectAllDescendantIds(parent.subRows))}}));onRowPinningChange({top:allPinned})}),[table,(_b=(_a=pinnedRows==null?void 0:pinnedRows.value)==null?void 0:_a.top)==null?void 0:_b.join(",")]);const hasAnySubRows=table.getRowModel().rows.some((row=>row.subRows&&row.subRows.length>0));const selectedRowsLength=Object.keys(table.getState().rowSelection).length;const fetchNextPage=useCallback((()=>{if(isFetching||totalFetched>=fullData.length)return;setIsFetching(true);setTimeout((()=>{const nextChunk=fullData.slice(totalFetched,totalFetched+fetchSize);setDataChunk((prev=>[...prev,...nextChunk]));setTotalFetched((prev=>prev+nextChunk.length));setIsFetching(false)}),500)}),[isFetching,totalFetched,fullData,fetchSize]);const updateLoadingStateRowCount=useCallback((()=>{const rowsCount=table.getRowModel().rows.length;if(rowsCount!==loadingStateRowCount&&rowsCount!==0){setLoadingStateRowCount(rowsCount)}}),[loadingStateRowCount,table]);return{table:table,expanded:expanded,setExpanded:setExpanded,hasAnySubRows:hasAnySubRows,selectedRowsLength:selectedRowsLength,fetchNextPage:fetchNextPage,updateLoadingStateRowCount:updateLoadingStateRowCount,rowSelection:rowSelection,fullData:fullData,totalFetched:totalFetched,isFetching:isFetching}}function useTableActions({table:table,expanded:expanded,setExpanded:setExpanded,onToggleExpansionClick:onToggleExpansionClick,onRowSelectionChange:onRowSelectionChange}){const[bottomReached,setBottomReached]=useState(false);const bottomTimeout=useRef(null);const handleExpandOrCollapse=useCallback((async row=>{if(onToggleExpansionClick)onToggleExpansionClick(row);const updatedExpandedState=await updateExpandAndCollapseState(table.getRowModel(),expanded,row==null?void 0:row.parentId,void 0);setExpanded(updatedExpandedState)}),[expanded,setExpanded,onToggleExpansionClick,table]);const onPageChange=useCallback((page=>{table.setPageIndex(page-1)}),[table]);const fetchMoreOnBottomReached=useCallback(((containerRef,fetchNextPage,isFetching,totalFetched,totalDBRowCount)=>{if(!containerRef||isFetching||totalFetched>=totalDBRowCount)return;const{scrollTop:scrollTop,scrollHeight:scrollHeight,clientHeight:clientHeight}=containerRef;const distanceFromBottom=scrollHeight-scrollTop-clientHeight;if(distanceFromBottom<50){if(!bottomReached){setBottomReached(true);bottomTimeout.current=setTimeout((()=>{fetchNextPage();setBottomReached(false)}),1e3)}}else{setBottomReached(false);if(bottomTimeout.current){clearTimeout(bottomTimeout.current);bottomTimeout.current=null}}}),[bottomReached]);useEffect((()=>{if(onRowSelectionChange){onRowSelectionChange(table.getState().rowSelection)}}),[table.getState().rowSelection,onRowSelectionChange]);return{handleExpandOrCollapse:handleExpandOrCollapse,onPageChange:onPageChange,fetchMoreOnBottomReached:fetchMoreOnBottomReached}}const AdvancedTable=props=>{const{aria:aria={},actions:actions,children:children,className:className,columnDefinitions:columnDefinitions,columnGroupBorderColor:columnGroupBorderColor,columnVisibilityControl:columnVisibilityControl,customSort:customSort,dark:dark=false,data:data={},enableToggleExpansion:enableToggleExpansion="header",expandedControl:expandedControl,expandByDepth:expandByDepth,onExpandByDepthClick:onExpandByDepthClick,htmlOptions:htmlOptions={},id:id,initialLoadingRowsCount:initialLoadingRowsCount=10,inlineRowLoading:inlineRowLoading=false,loading:loading,maxHeight:maxHeight,onRowToggleClick:onRowToggleClick,onToggleExpansionClick:onToggleExpansionClick,onCustomSortClick:onCustomSortClick,pagination:pagination=false,paginationProps:paginationProps,pinnedRows:pinnedRows,responsive:responsive="scroll",rowStyling:rowStyling,scrollBarNone:scrollBarNone=false,showActionsBar:showActionsBar=true,selectableRows:selectableRows,sortControl:sortControl,stickyLeftColumn:stickyLeftColumn,tableData:tableData,tableOptions:tableOptions,tableProps:tableProps,toggleExpansionIcon:toggleExpansionIcon="arrows-from-line",onRowSelectionChange:onRowSelectionChange,virtualizedRows:virtualizedRows=false,allowFullScreen:allowFullScreen=false,fullScreenControl:fullScreenControl}=props;const tableWrapperRef=useRef(null);const{table:table,expanded:expanded,setExpanded:setExpanded,hasAnySubRows:hasAnySubRows,selectedRowsLength:selectedRowsLength,fetchNextPage:fetchNextPage,updateLoadingStateRowCount:updateLoadingStateRowCount,fullData:fullData,totalFetched:totalFetched,isFetching:isFetching}=useTableState({tableData:tableData,columnDefinitions:columnDefinitions,expandedControl:expandedControl,sortControl:sortControl,onRowToggleClick:onRowToggleClick,selectableRows:selectableRows,initialLoadingRowsCount:initialLoadingRowsCount,loading:loading,pagination:pagination,paginationProps:paginationProps,virtualizedRows:virtualizedRows,tableOptions:tableOptions,columnVisibilityControl:columnVisibilityControl,pinnedRows:pinnedRows,rowStyling:rowStyling});const{handleExpandOrCollapse:handleExpandOrCollapse,onPageChange:onPageChange,fetchMoreOnBottomReached:fetchMoreOnBottomReached}=useTableActions({table:table,expanded:expanded,setExpanded:setExpanded,onToggleExpansionClick:onToggleExpansionClick,onRowSelectionChange:onRowSelectionChange});useEffect((()=>{if(!loading){updateLoadingStateRowCount()}}),[loading,updateLoadingStateRowCount]);useEffect((()=>{fetchMoreOnBottomReached(tableWrapperRef.current,fetchNextPage,isFetching,totalFetched,fullData.length)}),[fetchMoreOnBottomReached,fetchNextPage,isFetching,totalFetched,fullData.length]);const[isFullscreen,setIsFullscreen]=useState(false);const toggleFullscreen=useCallback((()=>{setIsFullscreen((prevState=>!prevState))}),[]);useEffect((()=>{if(allowFullScreen&&fullScreenControl){fullScreenControl({toggleFullscreen:toggleFullscreen,isFullscreen:isFullscreen})}}),[allowFullScreen,fullScreenControl,toggleFullscreen,isFullscreen]);const renderFullscreenHeader=()=>{if(!isFullscreen)return null;const defaultMinimizeIcon=jsx("button",{className:"gray-icon fullscreen-icon",onClick:toggleFullscreen,children:jsx(Icon,{cursor:"pointer",fixedWidth:true,icon:"arrow-down-left-and-arrow-up-right-to-center",...props})});return jsx(Card,{borderNone:true,borderRadius:"none",className:"advanced-table-fullscreen-header",...props,children:jsx(Flex,{justify:"end",children:defaultMinimizeIcon})})};useEffect((()=>{if(!allowFullScreen)return;const handleKeyDown=event=>{if(event.key==="Escape"&&isFullscreen){event.preventDefault();toggleFullscreen()}};document.addEventListener("keydown",handleKeyDown);return()=>{document.removeEventListener("keydown",handleKeyDown)}}),[allowFullScreen,toggleFullscreen,isFullscreen]);const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_advanced_table"),`advanced-table-responsive-${responsive}`,maxHeight?`advanced-table-max-height-${maxHeight}`:"",{"advanced-table-fullscreen":isFullscreen,"advanced-table-allow-fullscreen":allowFullScreen},{"advanced-table-sticky-left-columns":stickyLeftColumn&&stickyLeftColumn.length>0},columnGroupBorderColor?`column-group-border-${columnGroupBorderColor}`:"",scrollBarNone?"advanced-table-hide-scrollbar":"",globalProps(props),className);const tableWrapperStyle=virtualizedRows?getVirtualizedContainerStyles(maxHeight):{};const isActionBarVisible=selectableRows&&showActionsBar&&selectedRowsLength>0||columnVisibilityControl;const tableElement=jsx(Table,{className:`${loading?"content-loading":""}`,dark:dark,dataTable:true,numberSpacing:"tabular",responsive:"none",...tableProps,children:children?children:jsxs(Fragment,{children:[jsx(TableHeader,{}),jsx(TableBody,{isFetching:isFetching})]})});return jsxs(Fragment,{children:[pagination&&jsx(TablePagination,{onChange:onPageChange,position:"top",range:paginationProps==null?void 0:paginationProps.range,table:table}),jsxs("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,onScroll:virtualizedRows?e=>fetchMoreOnBottomReached(e.currentTarget,fetchNextPage,isFetching,totalFetched,fullData.length):void 0,ref:tableWrapperRef,style:tableWrapperStyle,children:[renderFullscreenHeader(),jsx(AdvancedTableProvider,{columnDefinitions:columnDefinitions,columnGroupBorderColor:columnGroupBorderColor,columnVisibilityControl:columnVisibilityControl,customSort:customSort,enableToggleExpansion:enableToggleExpansion,enableVirtualization:virtualizedRows,expandByDepth:expandByDepth,expanded:expanded,expandedControl:expandedControl,handleExpandOrCollapse:handleExpandOrCollapse,hasAnySubRows:hasAnySubRows,inlineRowLoading:inlineRowLoading,isActionBarVisible:isActionBarVisible,isFullscreen:isFullscreen,loading:loading,onCustomSortClick:onCustomSortClick,onExpandByDepthClick:onExpandByDepthClick,pinnedRows:pinnedRows,responsive:responsive,rowStyling:rowStyling,selectableRows:selectableRows,setExpanded:setExpanded,showActionsBar:showActionsBar,sortControl:sortControl,stickyLeftColumn:stickyLeftColumn,subRowHeaders:tableOptions==null?void 0:tableOptions.subRowHeaders,table:table,tableContainerRef:tableWrapperRef,toggleExpansionIcon:toggleExpansionIcon,totalAvailableCount:fullData.length,virtualizedRows:virtualizedRows,children:jsxs(React__default.Fragment,{children:[jsx(TableActionBar,{actions:actions,isVisible:isActionBarVisible,selectedCount:selectedRowsLength,type:columnVisibilityControl?"column-visibility":"row-selection"}),virtualizedRows?jsx("div",{style:{overflow:"auto",width:"100%"},children:tableElement}):tableElement]})})]}),pagination&&jsx(TablePagination,{onChange:onPageChange,position:"bottom",range:paginationProps==null?void 0:paginationProps.range,table:table})]})};AdvancedTable.Header=TableHeader;AdvancedTable.Body=TableBody;const BreadCrumbItem=props=>{const{aria:aria={},className:className,data:data={},htmlOptions:htmlOptions={},id:id,component:component="a",...rest}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const Component=component||"span";const css=classnames(buildCss("pb_bread_crumb_item_kit"),globalProps(props),className);return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:css,id:id,children:jsx(Component,{className:"pb_bread_crumb_item",...domSafeProps(rest)})})};const BreadCrumbs=props=>{const{aria:aria={label:"Breadcrumb Navigation"},className:className,data:data={},htmlOptions:htmlOptions={},id:id,children:children}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const css=classnames(buildCss("pb_bread_crumbs_kit"),globalProps(props),className);return jsx("nav",{...ariaProps,...dataProps,...htmlProps,className:css,id:id,children:children})};const ButtonToolbar=props=>{const{aria:aria={},children:children,className:className,data:data={},htmlOptions:htmlOptions={},id:id,orientation:orientation="horizontal",text:text2,variant:variant="primary"}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_button_toolbar_kit",orientation,variant),globalProps(props),className);return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:children||text2})};const contactTypeMap={cell:"mobile",email:"envelope",extension:"phone-plus",home:"phone",work:"phone-office","work-cell":"phone-laptop","wrong-phone":"phone-slash"};const envelopeIcon=getAllIcons()["envelope"].icon;const formatContact=(contactString,contactType)=>{if(contactType==="email")return contactString;const cleaned=contactString.replace(/\D/g,"");const phoneNumber=cleaned.match(/^(1|)?(\d{3})(\d{3})(\d{4})$/);if(contactType==="extension"){return cleaned.match(/^\d{4}$/)}if(phoneNumber){const intlCode=phoneNumber[1]?"+1 ":"";return[intlCode,"(",phoneNumber[2],") ",phoneNumber[3],"-",phoneNumber[4]].join("")}return null};const Contact=props=>{const{aria:aria={},className:className,contactDetail:contactDetail,contactType:contactType,contactValue:contactValue,data:data={},dark:dark=false,htmlOptions:htmlOptions={},id:id}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_contact_kit"),globalProps(props),className);return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:jsxs(Body$1,{className:"pb_contact_kit",color:"light",dark:dark,tag:"span",children:[contactType==="email"?jsx(Icon,{className:"svg-inline--fa envelope",customIcon:envelopeIcon,dark:dark,fixedWidth:true}):jsx(Icon,{dark:dark,fixedWidth:true,icon:contactTypeMap[contactType]||"phone"}),` ${formatContact(contactValue,contactType)} `,contactDetail&&jsx(Caption,{dark:dark,size:"xs",tag:"span",text:contactDetail})]})})};const CopyButton=props=>{const{aria:aria={},className:className,data:data={},from:from="",id:id,text:text2="Copy",timeout:timeout=1e3,tooltipPlacement:tooltipPlacement="bottom",tooltipText:tooltipText="Copied!",value:value=""}=props;const[copied,copy]=usePBCopy({value:value,from:from,timeout:timeout});const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const classes=classnames(buildCss("pb_copy_button_kit"),globalProps(props),className);return jsx("div",{...ariaProps,...dataProps,className:classes,id:id,children:jsx(Tooltip$1,{forceOpenTooltip:copied,placement:tooltipPlacement,showTooltip:false,text:tooltipText,children:jsx(Button,{icon:"copy",onClick:copy,children:text2})})})};const sizes$1={lg:1,md:3,sm:4};const Currency=props=>{const{abbreviate:abbreviate=false,align:align="left",aria:aria={},amount:amount,data:data={},decimals:decimals="default",emphasized:emphasized=true,htmlOptions:htmlOptions={},id:id,unit:unit,className:className,label:label="",nullDisplay:nullDisplay="",size:size="sm",symbol:symbol="$",variant:variant="default",dark:dark=false,unstyled:unstyled=false,commaSeparator:commaSeparator=false}=props;const emphasizedClass=emphasized?"":"_deemphasized";let variantClass;if(variant==="light"){variantClass="_light"}else if(variant==="bold"){variantClass="_bold"}const[whole,decimal="00"]=amount.split(".");const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_currency_kit",align,size),globalProps(props),className);const getFormattedNumber=input=>new Intl.NumberFormat("en-US",{notation:"compact",maximumFractionDigits:1}).format(input);const getAbbreviatedValue=abbrType=>{const num=`${getFormattedNumber(whole.split(",").join(""))}`,isAmount=abbrType==="amount",isUnit=abbrType==="unit";return isAmount?num.slice(0,-1):isUnit?num.slice(-1):""};const getMatchingDecimalAmount=decimals==="matching"?amount:whole;const getMatchingDecimalValue=decimals==="matching"?"":`.${decimal}`;const formatAmount=amount2=>{if(!commaSeparator)return amount2;const[wholePart,decimalPart]=amount2.split(".");const formattedWhole=new Intl.NumberFormat("en-US").format(parseInt(wholePart));return decimalPart?`${formattedWhole}.${decimalPart}`:formattedWhole};const swapNegative=size==="sm"&&symbol!=="";const handleNegative=amount.startsWith("-")&&swapNegative?"-":"";const getAbsoluteAmount=amountString=>amountString.replace(/^-/,"");const getAbbrOrFormatAmount=abbreviate?getAbbreviatedValue("amount"):formatAmount(getMatchingDecimalAmount);const getAmount=swapNegative?getAbsoluteAmount(getAbbrOrFormatAmount):getAbbrOrFormatAmount;const getAbbreviation=abbreviate?getAbbreviatedValue("unit"):null;const getDecimalValue=abbreviate?"":getMatchingDecimalValue;return jsxs("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:[jsx(Caption,{dark:dark,children:label}),jsx("div",{className:`pb_currency_wrapper${variantClass||emphasizedClass}`,children:unstyled?nullDisplay&&!amount?jsx("div",{children:nullDisplay}):jsxs(Fragment,{children:[jsxs("div",{children:[handleNegative,symbol]}),jsx("div",{children:getAmount}),jsxs("div",{children:[getAbbreviation,unit?unit:getDecimalValue]})]}):nullDisplay&&!amount?jsx(Title,{className:"pb_currency_value",dark:dark,size:sizes$1[size],children:nullDisplay}):jsxs(Fragment,{children:[jsxs(Body$1,{className:"dollar_sign",color:"light",dark:dark,children:[handleNegative,symbol]}),jsx(Title,{className:"pb_currency_value",dark:dark,size:sizes$1[size],children:getAmount}),jsxs(Body$1,{className:"unit",color:"light",dark:dark,children:[getAbbreviation,unit?unit:getDecimalValue]})]})})]})};const statusMap={increase:"positive",decrease:"negative",neutral:"neutral"};const iconMap$1={increase:"arrow-up",decrease:"arrow-down"};const StatChange=props=>{const{change:change="neutral",className:className,dark:dark=false,htmlOptions:htmlOptions={},icon:icon,id:id,value:value}=props;const status=statusMap[change];let returnedIcon=iconMap$1[change];if(icon){returnedIcon=icon}const htmlProps=buildHtmlProps(htmlOptions);return jsx(Fragment,{children:value&&jsx("div",{className:classnames(buildCss("pb_stat_change_kit",status),globalProps(props),className),id:id,...htmlProps,children:jsxs(Body$1,{dark:dark,status:status,children:[" ",returnedIcon&&jsxs(Fragment,{children:[jsx(Icon,{dark:dark,fixed_width:true,icon:returnedIcon})," "]}),`${value}%`]})})})};const StatValue=props=>{const{className:className,htmlOptions:htmlOptions={},id:id,unit:unit,value:value=0}=props;const htmlProps=buildHtmlProps(htmlOptions);const displayValue=function(value2){if(value2||value2===0){return jsx(Title,{size:1,tag:"span",text:`${value2}`})}};const displayUnit=function(unit2){if(unit2){return jsx(Title,{size:3,tag:"span",text:unit2})}};return jsx("div",{className:classnames("pb_stat_value_kit",globalProps(props),className),id:id,...htmlProps,children:jsxs("div",{className:"pb_stat_value_wrapper",children:[displayValue(value)," ",displayUnit(unit)]})})};const DashboardValue=props=>{const{align:align="left",aria:aria={},className:className,data:data={},htmlOptions:htmlOptions={},id:id,statChange:statChange={},statLabel:statLabel,statValue:statValue={}}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_dashboard_value_kit",align),globalProps(props),className);return jsxs("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:[statLabel&&jsx(Body$1,{color:"light",children:statLabel}),statValue&&jsx(StatValue,{unit:statValue.unit,value:statValue.value}),statChange&&jsx(StatChange,{change:statChange.change,value:statChange.value})]})};const PbDate=props=>{const{aria:aria={},alignment:alignment="left",className:className,dark:dark=false,data:data={},htmlOptions:htmlOptions={},id:id,showDayOfWeek:showDayOfWeek=false,showIcon:showIcon=false,size:size="md",unstyled:unstyled=false,value:value}=props;const weekday=DateTime$1.toWeekday(value);const month=DateTime$1.toMonth(value);const day=DateTime$1.toDay(value);const year=DateTime$1.toYear(value);const currentYear=(new Date).getFullYear();const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_date_kit",alignment),globalProps(props),className);return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:unstyled?jsxs(Fragment,{children:[showIcon&&jsx("div",{children:jsx(Icon,{fixedWidth:true,icon:"calendar-alt"})}),showDayOfWeek&&jsxs(Fragment,{children:[jsx("div",{children:weekday}),jsx("div",{children:"•"})]}),jsxs("span",{children:[jsxs("span",{children:[month," ",day]}),currentYear!=year&&jsx("span",{children:`, ${year}`})]})]}):size=="md"||size=="lg"?jsxs(Title,{dark:dark,size:4,tag:"h4",children:[showIcon&&jsx(Body$1,{className:"pb_icon_kit_container",color:"light",tag:"span",children:jsx(Icon,{fixedWidth:true,icon:"calendar-alt"})}),showDayOfWeek&&jsxs(Fragment,{children:[weekday,jsx(Body$1,{color:"light",tag:"span",text:" • "})]}),jsxs("span",{children:[month," ",day]}),currentYear!=year&&jsx("span",{children:`, ${year}`})]}):jsxs(Fragment,{children:[showIcon&&jsx(Caption,{className:"pb_icon_kit_container",dark:dark,tag:"span",children:jsx(Icon,{fixedWidth:true,icon:"calendar-alt",size:"sm"})}),showDayOfWeek&&jsxs(Fragment,{children:[jsx(Caption,{dark:dark,tag:"div",children:weekday}),jsx(Caption,{color:"light",dark:dark,tag:"div",text:" • "})]}),jsxs(Caption,{dark:dark,tag:"span",children:[month," ",day,currentYear!=year&&jsx(Fragment,{children:`, ${year}`})]})]})})};const DatePicker=props=>{if(props.plugins);const{allowInput:allowInput=false,aria:aria={},className:className,customQuickPickDates:customQuickPickDates,dark:dark=false,data:data={},defaultDate:defaultDate="",disableDate:disableDate=null,disableInput:disableInput,disableRange:disableRange=null,disableWeekdays:disableWeekdays=null,enableTime:enableTime=false,error:error,format:format="m/d/Y",hideIcon:hideIcon=false,hideLabel:hideLabel=false,htmlOptions:htmlOptions={},id:id,initializeOnce:initializeOnce=false,inLine:inLine=false,inputAria:inputAria={},inputData:inputData={},inputOnChange:inputOnChange,inputValue:inputValue,label:label="Date Picker",maxDate:maxDate,minDate:minDate,mode:mode="single",name:name,onChange:onChange=()=>{},onClose:onClose,pickerId:pickerId,placeholder:placeholder="Select Date",plugins:plugins=false,position:position,positionElement:positionElement,scrollContainer:scrollContainer,selectionType:selectionType="",showTimezone:showTimezone=false,staticPosition:staticPosition=true,thisRangesEndToday:thisRangesEndToday=false,yearRange:yearRange=[1900,2100],controlsStartId:controlsStartId,controlsEndId:controlsEndId,syncStartWith:syncStartWith,syncEndWith:syncEndWith}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const inputAriaProps=buildAriaProps(inputAria);const inputDataProps=buildDataProps(inputData);useEffect((()=>{datePickerHelper({allowInput:allowInput,customQuickPickDates:customQuickPickDates,defaultDate:defaultDate,disableDate:disableDate,disableRange:disableRange,disableWeekdays:disableWeekdays,enableTime:enableTime,format:format,maxDate:maxDate,minDate:minDate,mode:mode,onChange:onChange,onClose:onClose,pickerId:pickerId,plugins:plugins,position:position,positionElement:positionElement,selectionType:selectionType,showTimezone:showTimezone,staticPosition:staticPosition,thisRangesEndToday:thisRangesEndToday,yearRange:yearRange,controlsStartId:controlsStartId,controlsEndId:controlsEndId,syncStartWith:syncStartWith,syncEndWith:syncEndWith,required:false},scrollContainer)}),initializeOnce?[]:void 0);const filteredProps={...props};if(filteredProps.marginBottom===void 0){filteredProps.marginBottom="sm"}filteredProps==null?true:delete filteredProps.position;const classes=classnames(buildCss("pb_date_picker_kit"),globalProps(filteredProps),error?"error":null,className);const iconWrapperClass=()=>{let base="cal_icon_wrapper";if(dark){base+=" dark"}if(hideLabel){base+=" no_label_shift"}if(error){base+=" error"}return base};const angleDown=getAllIcons()["angleDown"].icon;return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:jsxs("div",{...inputAriaProps,...inputDataProps,className:"input_wrapper",children:[jsx(Caption,{className:"pb_date_picker_kit_label",text:hideLabel?null:label}),jsxs(Fragment,{children:[jsxs("div",{className:"date_picker_input_wrapper",children:[jsx("input",{autoComplete:"off",className:"date_picker_input",disabled:disableInput,id:pickerId,name:name,onChange:inputOnChange,placeholder:placeholder,value:inputValue}),error&&jsx(Body$1,{status:"negative",text:error,variant:null})]}),!hideIcon&&jsx("div",{className:iconWrapperClass(),id:`cal-icon-${pickerId}`,children:jsx(Icon,{className:"cal_icon",icon:"calendar-alt"})}),hideIcon&&inLine?jsxs("div",{children:[jsx("div",{className:`${iconWrapperClass()} date-picker-inline-icon-plus`,id:`${pickerId}-icon-plus`,children:jsx(Icon,{className:"date-picker-plus-icon",icon:"plus"})}),jsx("div",{className:`${iconWrapperClass()} date-picker-inline-angle-down`,id:`${pickerId}-angle-down`,children:jsx(Icon,{className:"angle_down_icon svg-inline--fa",customIcon:angleDown})})]}):null]})]})})};const dateTimestamp$1=(dateValue,includeYear)=>{if(includeYear){return`${DateTime$1.toMonth(dateValue)} ${DateTime$1.toDay(dateValue)}, ${DateTime$1.toYear(dateValue)}`}else{return`${DateTime$1.toMonth(dateValue)} ${DateTime$1.toDay(dateValue)}`}};const dateTimeIso$1=dateValue=>DateTime$1.toIso(dateValue);const DateRangeInline=props=>{const{align:align="left",className:className,dark:dark=false,data:data={},endDate:endDate,htmlOptions:htmlOptions={},icon:icon=false,size:size="sm",startDate:startDate}=props;const dateInCurrentYear=()=>{const currentDate=new Date;return(startDate==null?void 0:startDate.getFullYear())===(endDate==null?void 0:endDate.getFullYear())&&(startDate==null?void 0:startDate.getFullYear())===currentDate.getFullYear()};const dateRangeClasses=buildCss("pb_date_range_inline_kit",align);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const renderTime=date=>jsx("time",{dateTime:dateTimeIso$1(date),children:dateInCurrentYear()?` ${dateTimestamp$1(date,false)} `:` ${dateTimestamp$1(date,true)} `});return jsx("div",{...dataProps,...htmlProps,className:classnames(dateRangeClasses,globalProps(props),className),children:jsxs("div",{className:"pb_date_range_inline_wrapper",children:[size==="xs"&&jsxs(Fragment,{children:[icon&&jsx(Caption,{dark:dark,tag:"span",children:jsx(Icon,{className:"pb_date_range_inline_icon",dark:dark,fixedWidth:true,icon:"calendar-alt",size:size,tag:"span"})}),jsx(Caption,{dark:dark,tag:"span",children:renderTime(startDate)}),jsx(Caption,{dark:dark,tag:"span",children:jsx(Icon,{className:"pb_date_range_inline_arrow",dark:dark,fixedWidth:true,icon:"long-arrow-right",tag:"span"})}),jsx(Caption,{dark:dark,tag:"span",children:renderTime(endDate)})]}),size==="sm"&&jsxs(Fragment,{children:[icon&&jsx(Body$1,{color:"light",dark:dark,tag:"span",children:jsx(Icon,{className:"pb_date_range_inline_icon",dark:dark,fixedWidth:true,icon:"calendar-alt",size:size,tag:"span"})}),jsx(Body$1,{dark:dark,tag:"span",children:renderTime(startDate)}),jsx(Body$1,{color:"light",dark:dark,tag:"span",children:jsx(Icon,{className:"pb_date_range_inline_arrow",dark:dark,fixedWidth:true,icon:"long-arrow-right",tag:"span"})}),jsx(Body$1,{dark:dark,tag:"span",children:renderTime(endDate)})]})]})})};const DateYearStacked=props=>{const{align:align="left",className:className,dark:dark=false,date:date,data:data={},htmlOptions:htmlOptions={}}=props;const css=classnames(buildCss("pb_date_year_stacked",align),globalProps(props),className);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);return jsxs("div",{...dataProps,...htmlProps,className:css,children:[jsx(Title,{dark:dark,size:4,text:`${DateTime$1.toDay(date)} ${DateTime$1.toMonth(date).toUpperCase()}`}),jsx(Body$1,{color:"light",children:DateTime$1.toYear(date)})]})};const DateRangeStacked=props=>{const{className:className,dark:dark=false,endDate:endDate,htmlOptions:htmlOptions={},startDate:startDate,data:data={}}=props;const css=classnames(buildCss("pb_date_range_stacked"),globalProps(props),className);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);return jsx("div",{...dataProps,...htmlProps,className:css,children:jsxs(Flex,{vertical:"center",children:[jsx(FlexItem,{children:jsx(DateYearStacked,{align:"right",dark:dark,date:startDate})}),jsx(FlexItem,{children:jsx("div",{children:jsx(Body$1,{color:"light",tag:"span",children:jsx(Icon,{className:"pb_date_range_stacked_arrow",fixedWidth:true,icon:"long-arrow-right"})})})}),jsx(FlexItem,{children:jsx(DateYearStacked,{dark:dark,date:endDate})})]})})};const sizes={sm:4,md:3};const DateStacked=props=>{const{align:align="left",bold:bold=false,reverse:reverse=false,className:className,dark:dark=false,date:date,data:data={},htmlOptions:htmlOptions={},size:size="sm"}=props;const classes=classnames(buildCss("pb_date_stacked_kit",align,size,{dark:dark,reverse:reverse}),globalProps(props),className);const currentYear=(new Date).getFullYear();const inputYear=DateTime$1.toYear(date);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);return jsx(Fragment,{children:bold==false?jsxs("div",{...dataProps,...htmlProps,className:classes,children:[jsxs("div",{className:"pb_date_stacked_day_month",children:[jsx(Caption,{text:DateTime$1.toMonth(date).toUpperCase()}),jsx(Title,{dark:dark,size:sizes[size],text:DateTime$1.toDay(date).toString()})]}),currentYear!=inputYear&&jsx(Caption,{size:"xs",children:inputYear})]}):jsx("div",{...dataProps,...htmlProps,className:classes,children:jsxs("div",{className:"pb_date_stacked_day_month",children:[jsx(Title,{bold:true,dark:dark,size:"4",text:DateTime$1.toMonth(date)}),jsx(Title,{bold:true,dark:dark,size:"4",text:DateTime$1.toDay(date).toString()}),currentYear!=inputYear&&jsx(Title,{size:"4",children:inputYear})]})})})};const Time=props=>{const{align:align,className:className,date:date,htmlOptions:htmlOptions={},showIcon:showIcon,size:size,timeZone:timeZone,unstyled:unstyled=false,showTimezone:showTimezone=true}=props;const classes=classnames(buildCss("pb_time_kit",align,size),globalProps(props),className);const clockIcon=getAllIcons()["clock"];const htmlProps=buildHtmlProps(htmlOptions);return jsxs("div",{...htmlProps,className:classes,children:[showIcon&&(unstyled?jsxs("span",{children:[jsx(Icon,{className:"svg-inline--fa clock",customIcon:clockIcon.icon})," "]}):jsx(Fragment,{children:jsxs(Body$1,{color:"light",tag:"span",children:[jsx(Icon,{className:"svg-inline--fa clock",customIcon:clockIcon.icon,fixedWidth:true,size:size==="md"?"":"sm"})," "]})})),jsx("time",{dateTime:date.toLocaleString(),children:jsx("span",{children:unstyled?jsxs(Fragment,{children:[jsx("span",{children:DateTime$1.toTimeWithMeridiem(date,timeZone)})," ",showTimezone&&jsx("span",{children:DateTime$1.toTimeZone(date,timeZone)})]}):size==="md"?jsxs(Fragment,{children:[jsx(Body$1,{className:"pb_time",tag:"span",text:DateTime$1.toTimeWithMeridiem(date,timeZone)})," ",showTimezone&&jsx(Body$1,{color:"light",tag:"span",text:DateTime$1.toTimeZone(date,timeZone)})]}):jsxs(Fragment,{children:[jsx(Caption,{color:"light",tag:"span",text:DateTime$1.toTimeWithMeridiem(date,timeZone)})," ",showTimezone&&jsx(Caption,{color:"light",tag:"span",text:DateTime$1.toTimeZone(date,timeZone)})]})})})]})};const DateTime=props=>{const{align:align="left",aria:aria={},className:className,data:data={},htmlOptions:htmlOptions={},showDayOfWeek:showDayOfWeek=false,datetime:datetime2,id:id,showIcon:showIcon=false,size:size="md",timeZone:timeZone="America/New_York"}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_date_time",size),globalProps(props),className);return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:jsxs(Flex,{horizontal:align,vertical:"baseline",children:[jsx(PbDate,{showDayOfWeek:showDayOfWeek,size:size,value:datetime2}),jsx(Time,{date:datetime2,marginLeft:"sm",showIcon:showIcon,size:size,timeZone:timeZone})]})})};const TimeStackedDefault=props=>{if(props.date);const{align:align="left",className:className,dark:dark,data:data={},date:date,htmlOptions:htmlOptions={},time:time,timeZone:timeZone}=props;const classes=classnames(buildCss("pb_time_stacked_kit",align),globalProps(props),className);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);return jsx("div",{className:classes,...dataProps,...htmlProps,children:jsx(Body$1,{className:classnames("pb_time_stacked","time-spacing"),color:"light",dark:dark,children:jsxs("time",{children:[DateTime$1.toTimeWithMeridiem(date?date:new Date(time),timeZone),jsx(Caption,{className:"pb_time_stacked",color:"light",dark:dark,tag:"span",text:DateTime$1.toTimeZone(date?date:new Date(time),timeZone)})]})})})};const DateTimeStacked=props=>{if(props.date);const{date:date,datetime:datetime2,dark:dark,htmlOptions:htmlOptions={},timeZone:timeZone="America/New_York"}=props;const classes=buildCss("pb_date_time_stacked_kit",globalProps(props));const htmlProps=buildHtmlProps(htmlOptions);return jsxs(Flex,{inline:false,vertical:"stretch",...htmlProps,...props,children:[jsx(FlexItem,{children:jsx(DateStacked,{align:"right",bold:true,dark:dark,date:date||datetime2})}),jsx(SectionSeparator,{className:"date-time-padding",orientation:"vertical"}),jsx(FlexItem,{children:jsx(TimeStackedDefault,{className:classes,dark:dark,date:date||datetime2,timeZone:timeZone})})]})};var lib={exports:{}};var Modal$1={};var propTypes={exports:{}};var ReactPropTypesSecret_1;var hasRequiredReactPropTypesSecret;function requireReactPropTypesSecret(){if(hasRequiredReactPropTypesSecret)return ReactPropTypesSecret_1;hasRequiredReactPropTypesSecret=1;var ReactPropTypesSecret="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";ReactPropTypesSecret_1=ReactPropTypesSecret;return ReactPropTypesSecret_1}var factoryWithThrowingShims;var hasRequiredFactoryWithThrowingShims;function requireFactoryWithThrowingShims(){if(hasRequiredFactoryWithThrowingShims)return factoryWithThrowingShims;hasRequiredFactoryWithThrowingShims=1;var ReactPropTypesSecret=requireReactPropTypesSecret();function emptyFunction(){}function emptyFunctionWithReset(){}emptyFunctionWithReset.resetWarningCache=emptyFunction;factoryWithThrowingShims=function(){function shim(props,propName,componentName,location,propFullName,secret){if(secret===ReactPropTypesSecret){return}var err=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");err.name="Invariant Violation";throw err}shim.isRequired=shim;function getShim(){return shim}var ReactPropTypes={array:shim,bigint:shim,bool:shim,func:shim,number:shim,object:shim,string:shim,symbol:shim,any:shim,arrayOf:getShim,element:shim,elementType:shim,instanceOf:getShim,node:shim,objectOf:getShim,oneOf:getShim,oneOfType:getShim,shape:getShim,exact:getShim,checkPropTypes:emptyFunctionWithReset,resetWarningCache:emptyFunction};ReactPropTypes.PropTypes=ReactPropTypes;return ReactPropTypes};return factoryWithThrowingShims}var hasRequiredPropTypes;function requirePropTypes(){if(hasRequiredPropTypes)return propTypes.exports;hasRequiredPropTypes=1;{propTypes.exports=requireFactoryWithThrowingShims()()}return propTypes.exports}var ModalPortal={exports:{}};var focusManager={};var tabbable={exports:{}};var hasRequiredTabbable;function requireTabbable(){if(hasRequiredTabbable)return tabbable.exports;hasRequiredTabbable=1;(function(module,exports){Object.defineProperty(exports,"__esModule",{value:true});exports.default=findTabbableDescendants;
21
+ */function flexRender(Comp,props){return!Comp?null:isReactComponent(Comp)?React.createElement(Comp,props):Comp}function isReactComponent(component){return isClassComponent(component)||typeof component==="function"||isExoticComponent(component)}function isClassComponent(component){return typeof component==="function"&&(()=>{const proto=Object.getPrototypeOf(component);return proto.prototype&&proto.prototype.isReactComponent})()}function isExoticComponent(component){return typeof component==="object"&&typeof component.$$typeof==="symbol"&&["react.memo","react.forward_ref"].includes(component.$$typeof.description)}function useReactTable(options){const resolvedOptions={state:{},onStateChange:()=>{},renderFallbackValue:null,...options};const[tableRef]=React.useState((()=>({current:createTable(resolvedOptions)})));const[state,setState]=React.useState((()=>tableRef.current.initialState));tableRef.current.setOptions((prev=>({...prev,...options,state:{...state,...options.state},onStateChange:updater=>{setState(updater);options.onStateChange==null||options.onStateChange(updater)}})));return tableRef.current}const displayIcon=icon=>{if(typeof icon==="string"){return[icon,icon]}return icon};const SortIconButton=({header:header,sortIcon:sortIcon})=>{const firstIcon=displayIcon(sortIcon)[0];const secondIcon=displayIcon(sortIcon)[1];const upIcon=getAllIcons()["arrowUpShortWide"].icon;const downIcon=getAllIcons()["arrowDownShortWide"].icon;return jsx(Fragment,{children:header.column.getIsSorted()==="desc"?jsx("div",{className:"sort-button-icon",children:firstIcon==="arrow-up-short-wide"?jsx(Icon,{className:"svg-inline--fa",customIcon:upIcon}):jsx(Icon,{icon:firstIcon})},firstIcon):jsx("div",{className:"sort-button-icon",children:secondIcon==="arrow-down-short-wide"?jsx(Icon,{className:"svg-inline--fa",customIcon:downIcon}):jsx(Icon,{icon:secondIcon})},secondIcon)})};const ToggleIconButton=({row:row,onClick:onClick})=>{const{toggleExpansionIcon:toggleExpansionIcon}=useContext(AdvancedTableContext);return jsx("button",{className:"gray-icon toggle-all-icon",onClick:()=>onClick(row),children:jsx(Icon,{cursor:"pointer",fixedWidth:true,icon:displayIcon(toggleExpansionIcon)[0]})},displayIcon(toggleExpansionIcon)[0])};const findColumnDefByAccessor=(defs,targetAccessor)=>{for(const def of defs){if(def.accessor===targetAccessor){return def}if(Array.isArray(def.columns)&&def.columns.length){const found=findColumnDefByAccessor(def.columns,targetAccessor);if(found)return found}}return void 0};const filterExpandableRows=expandedState=>{for(const expandedRow in expandedState){if(expandedState[expandedRow]===false){delete expandedState[expandedRow]}}return expandedState};const updateExpandAndCollapseState=(tableRows,expanded,targetParent,targetDepth)=>{const updateExpandedRows={};const rows=targetDepth!==void 0?tableRows.flatRows:tableRows.rows;const rowsToToggle=[];for(const row of rows){const shouldBeUpdated=targetDepth!==void 0?row.depth<=targetDepth:targetParent===void 0?row.depth===0:targetParent===row.parentId;if(shouldBeUpdated){rowsToToggle.push(row)}}const anyCollapsed=rowsToToggle.some((row=>!row.getIsExpanded()));const isExpandAction=anyCollapsed;for(const row of rowsToToggle){const shouldUpdate=isExpandAction||targetDepth===void 0?true:row.depth===targetDepth;if(shouldUpdate){updateExpandedRows[row.id]=isExpandAction}}return filterExpandableRows({...expanded,...updateExpandedRows})};const isChrome=()=>{const userAgent=navigator.userAgent.toLowerCase();return userAgent.includes("chrome")&&!userAgent.includes("edg")};const TableHeaderCell=({enableSorting:enableSorting,enableToggleExpansion:enableToggleExpansion,handleExpandOrCollapse:handleExpandOrCollapse,header:header,headerChildren:headerChildren,isPinnedLeft:isPinnedLeft=false,loading:loading,sortIcon:sortIcon,table:table})=>{var _a,_b;const{columnDefinitions:columnDefinitions,expanded:expanded,setExpanded:setExpanded,expandByDepth:expandByDepth,onExpandByDepthClick:onExpandByDepthClick,toggleExpansionIcon:toggleExpansionIcon,sortControl:sortControl,responsive:responsive,selectableRows:selectableRows,hasAnySubRows:hasAnySubRows,showActionsBar:showActionsBar,stickyLeftColumn:stickyLeftColumn,inlineRowLoading:inlineRowLoading,isActionBarVisible:isActionBarVisible}=useContext(AdvancedTableContext);const toggleSortButton=event=>{if(sortControl){const sortIsDesc=(header==null?void 0:header.column.getIsSorted())==="desc";sortIsDesc?sortControl.onChange({desc:true}):sortControl.onChange({desc:false})}else{header==null?void 0:header.column.getToggleSortingHandler()(event)}};const alignmentMap={left:"start",center:"center",right:"end"};const colDef=header?findColumnDefByAccessor(columnDefinitions,header.column.id):void 0;const headerAlignment=((_a=colDef==null?void 0:colDef.columnStyling)==null?void 0:_a.headerAlignment)??((_b=colDef==null?void 0:colDef.columnStyling)==null?void 0:_b.headerAligment);const isLeafColumn=(header==null?void 0:header.column.getLeafColumns().length)===1&&(header==null?void 0:header.column.getLeafColumns()[0].id)===header.column.id;const columnHasVisibleLeaf=col=>{var _a2;return((_a2=col.getIsVisible)==null?void 0:_a2.call(col))||Array.isArray(col.columns)&&col.columns.some((child=>columnHasVisibleLeaf(child)))};const isLastHeaderCell=(()=>{var _a2;if(!header)return false;if(header.colSpan>1&&header.column.parent!==void 0)return true;const parent=header.column.parent;if(!parent){const topHeaders=table==null?void 0:table.getHeaderGroups()[0].headers.filter((h=>columnHasVisibleLeaf(h.column)));return((_a2=topHeaders==null?void 0:topHeaders.at(-1))==null?void 0:_a2.id)===header.id}const visibleSiblings=parent.columns.filter(columnHasVisibleLeaf);return visibleSiblings.at(-1)===header.column})();const cellClassName=classnames("table-header-cells",`${showActionsBar&&isActionBarVisible&&"header-cells-with-actions"}`,`${isChrome()?"chrome-styles":""}`,`${enableSorting?"table-header-cells-active":""}`,{"pinned-left":responsive==="scroll"&&isPinnedLeft},isLastHeaderCell?"last-header-cell":"",stickyLeftColumn&&stickyLeftColumn.length>0&&isPinnedLeft?"sticky-left":"");const cellId=`${loading?`loading-${header==null?void 0:header.id}`:`${header==null?void 0:header.id}`}`;const isToggleExpansionEnabledLoading=(header==null?void 0:header.index)===0&&loading&&(enableToggleExpansion==="all"||"header")&&enableToggleExpansion!=="none";const isToggleExpansionEnabled=(header==null?void 0:header.index)===0&&!loading&&(enableToggleExpansion==="all"||"header")&&enableToggleExpansion!=="none";let justifyHeader;if(headerAlignment&&alignmentMap[headerAlignment]){justifyHeader=alignmentMap[headerAlignment]}else if((header==null?void 0:header.index)===0&&hasAnySubRows||(header==null?void 0:header.index)===0&&inlineRowLoading||(header==null?void 0:header.index)===0&&isToggleExpansionEnabled){justifyHeader=enableSorting?"between":"start"}else{justifyHeader=isLeafColumn?"end":"center"}const[showPopover,setShowPopover]=useState(false);const togglePopover=()=>setShowPopover((prev=>!prev));const handleShouldClose=shouldClose=>setShowPopover(!shouldClose);const popoverReference=jsx("div",{className:"gray-icon toggle-all-icon",onClick:togglePopover,children:jsx(Icon,{icon:displayIcon(toggleExpansionIcon)[0]})});const handleExpandDepth=depth=>{if(onExpandByDepthClick){const flatRows=table==null?void 0:table.getRowModel().flatRows;onExpandByDepthClick(depth,flatRows)}const updated=updateExpandAndCollapseState(table.getRowModel(),expanded,void 0,depth);setExpanded(updated)};return jsx("th",{align:headerAlignment?headerAlignment:"right",className:cellClassName,colSpan:header==null?void 0:header.colSpan,id:cellId,style:{left:isPinnedLeft?(header==null?void 0:header.index)===1?"180px":`${header==null?void 0:header.column.getStart("left")}px`:void 0},children:(header==null?void 0:header.isPlaceholder)?null:headerChildren&&(header==null?void 0:header.index)===0?jsxs(Flex,{alignItems:"center",children:[headerChildren,jsx("div",{children:flexRender(header.column.columnDef.header,header.getContext())})]}):jsxs(Flex,{alignItems:"center",justify:justifyHeader,children:[selectableRows&&(header==null?void 0:header.index)===0&&hasAnySubRows&&jsx(Checkbox,{checked:table==null?void 0:table.getIsAllRowsSelected(),indeterminate:table==null?void 0:table.getIsSomeRowsSelected(),onChange:table==null?void 0:table.getToggleAllRowsSelectedHandler()}),isToggleExpansionEnabled&&hasAnySubRows&&!expandByDepth&&jsx(ToggleIconButton,{onClick:handleExpandOrCollapse}),isToggleExpansionEnabled&&hasAnySubRows&&expandByDepth&&jsx(PbReactPopover,{closeOnClick:"any",placement:"bottom-start",reference:popoverReference,shouldClosePopover:handleShouldClose,show:showPopover,zIndex:3,children:expandByDepth.map(((option,index)=>jsxs(Fragment,{children:[jsx(Flex,{alignItems:"center",className:"pb-advanced-table-popover-option",cursor:"pointer",htmlOptions:{onClick:()=>{handleExpandDepth(option.depth)}},paddingX:"sm",paddingY:"xs",children:option.label}),index!==expandByDepth.length-1&&jsx(SectionSeparator,{})]})))}),isToggleExpansionEnabledLoading&&jsx("div",{className:"loading-toggle-icon header-toggle-icon"}),jsxs(Flex,{className:`${(header==null?void 0:header.index)===0&&enableSorting&&"header-sort-button pb_th_link"}`,cursor:(header==null?void 0:header.index)===0&&enableSorting?"pointer":"default",...(header==null?void 0:header.index)===0&&enableSorting&&{htmlOptions:{onClick:event=>toggleSortButton(event),onKeyDown:event=>{if(event.key==="Enter"){toggleSortButton(event)}},tabIndex:0}},justify:(header==null?void 0:header.index)===0&&enableSorting?"between":headerAlignment?alignmentMap[headerAlignment]:"none",paddingLeft:(header==null?void 0:header.index)===0?enableSorting?"xxs":"xs":"none",children:[jsx("div",{children:flexRender(header==null?void 0:header.column.columnDef.header,header==null?void 0:header.getContext())}),(header==null?void 0:header.index)===0&&header.column.getCanSort()&&enableSorting&&(loading?jsx("div",{className:"loading-toggle-icon"}):jsx(SortIconButton,{header:header,sortIcon:sortIcon}))]})]})},`${header==null?void 0:header.id}-header`)};const TableHeader=({children:children,className:className,dark:dark=false,enableSorting:enableSorting=false,id:id,sortIcon:sortIcon=["arrow-up-short-wide","arrow-down-short-wide"],...props})=>{const{enableToggleExpansion:enableToggleExpansion,handleExpandOrCollapse:handleExpandOrCollapse,loading:loading,table:table,hasAnySubRows:hasAnySubRows,showActionsBar:showActionsBar,selectableRows:selectableRows,responsive:responsive,headerRef:headerRef,virtualizedRows:virtualizedRows,enableVirtualization:enableVirtualization}=useContext(AdvancedTableContext);const isVirtualized=virtualizedRows||enableVirtualization;const classes=classnames(buildCss("pb_advanced_table_header"),globalProps(props),className);const columnPinning=table.getState().columnPinning;const customCellClassnames=classnames("table-header-cells-custom",`${showActionsBar&&"header-cells-with-actions"}`,`${isChrome()?"chrome-styles":""}`,`${responsive==="scroll"&&"pinned-left"}`);const renderRegularTableHeader=()=>jsx("thead",{className:classes,id:id,children:table.getHeaderGroups().map(((headerGroup,index)=>jsxs("tr",{ref:index===0?headerRef:null,children:[!hasAnySubRows&&selectableRows&&jsx("th",{className:customCellClassnames,children:jsx(Checkbox,{checked:table==null?void 0:table.getIsAllRowsSelected(),indeterminate:table==null?void 0:table.getIsSomeRowsSelected(),onChange:table==null?void 0:table.getToggleAllRowsSelectedHandler()})}),headerGroup.headers.map((header=>{const isPinnedLeft=columnPinning.left.includes(header.id);return jsx(TableHeaderCell,{enableSorting:enableSorting,enableToggleExpansion:enableToggleExpansion,handleExpandOrCollapse:handleExpandOrCollapse,header:header,headerChildren:children,isPinnedLeft:isPinnedLeft,loading:loading,sortIcon:sortIcon,table:table},`${header.id}-header`)}))]},`${headerGroup.id}-headerGroup`)))});const renderVirtualizedTableHeader=()=>jsx("thead",{className:classes,"data-virtualized":"true",id:id,children:table.getHeaderGroups().map(((headerGroup,index)=>jsxs("tr",{className:"virtualized-header-row-header",ref:index===0?headerRef:null,children:[!hasAnySubRows&&selectableRows&&jsx("th",{className:classnames(customCellClassnames,"virtualized-header-cell"),children:jsx(Checkbox,{checked:table==null?void 0:table.getIsAllRowsSelected(),indeterminate:table==null?void 0:table.getIsSomeRowsSelected(),onChange:table==null?void 0:table.getToggleAllRowsSelectedHandler()})}),headerGroup.headers.map((header=>{const isPinnedLeft=columnPinning.left.includes(header.id);return jsx(TableHeaderCell,{enableSorting:enableSorting,enableToggleExpansion:enableToggleExpansion,handleExpandOrCollapse:handleExpandOrCollapse,header:header,headerChildren:children,isPinnedLeft:isPinnedLeft,isVirtualized:true,loading:loading,sortIcon:sortIcon,table:table},`${header.id}-header-virtualized`)}))]},`${headerGroup.id}-headerGroup-virtualized`)))});return jsx(Fragment,{children:isVirtualized?renderVirtualizedTableHeader():renderRegularTableHeader()})};const LoadingInline=props=>{const{align:align="left",aria:aria={},className:className,data:data={},dark:dark=false,htmlOptions:htmlOptions={},id:id,text:text2=" Loading"}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss(`pb_loading_inline_kit_${align}`),globalProps(props),className);return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:jsxs(Body$1,{color:"light",dark:dark,children:[jsx(Icon,{aria:{label:"loading icon"},fixedWidth:true,icon:"spinner",pulse:true}),text2]})})};const CollapsibleTrail=({leftOffset:leftOffset})=>{const style={left:`${leftOffset}em`};return jsx("div",{className:"collapsible-trail",style:style})};const renderCollapsibleTrail=currentDepth=>{const lines=[];for(let i=1;i<=currentDepth;i++){const additionalOffset=i>1?(i-1)*.25:0;const leftOffset=i*1+additionalOffset;lines.push(jsx(CollapsibleTrail,{leftOffset:leftOffset},i))}return lines};const SubRowHeaderRow=({collapsibleTrail:collapsibleTrail,enableToggleExpansion:enableToggleExpansion,onClick:onClick,row:row,subRowHeaders:subRowHeaders,table:table})=>{var _a;const{inlineRowLoading:inlineRowLoading,customSort:customSort,onCustomSortClick:onCustomSortClick}=useContext(AdvancedTableContext);const numberOfColumns=table.getAllFlatColumns().length;const rowHasChildren=row.original.children?true:false;const canExpand=inlineRowLoading?rowHasChildren:row.getCanExpand();const hasSubrowsToSort=(_a=row.getParentRow())==null?void 0:_a.subRows;return jsxs("tr",{className:"custom-row bg-silver",children:[jsxs("td",{className:`custom-row-first-column ${isChrome()?"chrome-styles":""}`,colSpan:1,children:[collapsibleTrail&&row.depth>0&&renderCollapsibleTrail(row.depth),jsx("div",{style:{paddingLeft:`${row.depth*1.25}em`},children:jsxs(Flex,{align:"center",columnGap:"xs",justifyContent:customSort&&hasSubrowsToSort&&hasSubrowsToSort.length>1?"between":void 0,children:[jsxs(Flex,{columnGap:"xs",children:[enableToggleExpansion==="all"&&canExpand?jsx(ToggleIconButton,{onClick:onClick,row:row}):null,jsx(Caption,{marginLeft:canExpand?"none":"xs",text:subRowHeaders[row.depth-1]})]}),customSort&&hasSubrowsToSort&&hasSubrowsToSort.length>1&&jsx("button",{"aria-label":"Sort this group",className:"sort-button-icon gray-icon",onClick:()=>{var _a2;onCustomSortClick&&onCustomSortClick((_a2=row.getParentRow())==null?void 0:_a2.subRows)},children:jsx(Icon,{cursor:"pointer",fixedWidth:true,icon:"sort"})})]})})]}),jsx("td",{colSpan:numberOfColumns-1})]})};const LoadingCell=()=>jsx("div",{className:"loading-cell"});const TableCellRenderer=({row:row,collapsibleTrail:collapsibleTrail=true,loading:loading=false,stickyLeftColumn:stickyLeftColumn,columnPinning:columnPinning,customRowStyle:customRowStyle,columnDefinitions:columnDefinitions})=>jsx(Fragment,{children:row.getVisibleCells().map(((cell,i)=>{var _a;const isPinnedLeft=columnPinning.left.includes(cell.column.id);const isLastCell=(()=>{var _a2;const parent=cell.column.parent;if(!parent){const last=row.getVisibleCells().at(-1);return(last==null?void 0:last.column.id)===cell.column.id}const visibleSiblings=parent.columns.filter((col=>col.getIsVisible()));return((_a2=visibleSiblings.at(-1))==null?void 0:_a2.id)===cell.column.id})();const{column:column}=cell;const colDef=findColumnDefByAccessor(columnDefinitions??[],column.id);const cellAlignment=((_a=colDef==null?void 0:colDef.columnStyling)==null?void 0:_a.cellAlignment)??"right";return jsxs("td",{align:cellAlignment,className:classnames(`${cell.id}-cell position_relative`,isChrome()?"chrome-styles":"",isPinnedLeft&&"pinned-left",stickyLeftColumn&&stickyLeftColumn.length>0&&isPinnedLeft&&"sticky-left",isLastCell&&"last-cell"),style:{left:isPinnedLeft?i===1?"180px":`${column.getStart("left")}px`:void 0,backgroundColor:i===0&&(customRowStyle==null?void 0:customRowStyle.backgroundColor),color:customRowStyle==null?void 0:customRowStyle.fontColor},children:[collapsibleTrail&&i===0&&row.depth>0&&renderCollapsibleTrail(row.depth),jsx("span",{id:`${cell.id}-span`,children:loading?jsx(LoadingCell,{}):flexRender(cell.column.columnDef.cell,cell.getContext())})]},`${cell.id}-data`)}))});const RegularTableView=({collapsibleTrail:collapsibleTrail=true,subRowHeaders:subRowHeaders})=>{var _a;const{enableToggleExpansion:enableToggleExpansion,handleExpandOrCollapse:handleExpandOrCollapse,inlineRowLoading:inlineRowLoading,loading:loading,table:table,selectableRows:selectableRows,hasAnySubRows:hasAnySubRows,stickyLeftColumn:stickyLeftColumn,pinnedRows:pinnedRows,headerHeight:headerHeight,rowHeight:rowHeight,rowStyling:rowStyling=[],sampleRowRef:sampleRowRef}=useContext(AdvancedTableContext);useEffect((()=>{if(stickyLeftColumn&&Array.isArray(stickyLeftColumn)){stickyLeftColumn.forEach((columnId=>{const column=table.getColumn(columnId);if(column&&column.getCanPin()){column.pin("left")}}))}}),[stickyLeftColumn,table]);const columnPinning=table.getState().columnPinning||{left:[]};const columnDefinitions=((_a=table.options.meta)==null?void 0:_a.columnDefinitions)||[];function PinnedRow({row:row}){return jsx("tr",{className:classnames(`pinned-row`),style:{backgroundColor:"white",position:"sticky",top:row.getIsPinned()==="top"?`${row.getPinnedIndex()*rowHeight+headerHeight}px`:void 0,zIndex:"3"},children:jsx(TableCellRenderer,{collapsibleTrail:collapsibleTrail,columnDefinitions:columnDefinitions,columnPinning:columnPinning,loading:loading,row:row,stickyLeftColumn:stickyLeftColumn})})}const totalRows=pinnedRows?table.getCenterRows():table.getRowModel().rows;return jsxs(Fragment,{children:[pinnedRows&&table.getTopRows().map((row=>jsx(PinnedRow,{row:row},row.id))),totalRows.map(((row,rowIndex)=>{var _a2,_b,_c;const isExpandable=row.getIsExpanded();const isFirstChildofSubrow=row.depth>0&&row.index===0;const rowHasNoChildren=((_a2=row.original)==null?void 0:_a2.children)&&!row.original.children.length?true:false;const numberOfColumns=table.getAllFlatColumns().length;const isDataLoading=isExpandable&&(inlineRowLoading&&rowHasNoChildren)&&row.depth<((_c=(_b=columnDefinitions[0])==null?void 0:_b.cellAccessors)==null?void 0:_c.length);const rowBackground=isExpandable&&(!inlineRowLoading&&row.getCanExpand()||inlineRowLoading&&rowHasNoChildren);const rowColor=row.getIsSelected()?"bg-row-selection":rowBackground?"bg-silver":"bg-white";const isFirstRegularRow=rowIndex===0&&!row.getIsPinned();const customRowStyle=(rowStyling==null?void 0:rowStyling.length)>0&&(rowStyling==null?void 0:rowStyling.find((s=>(s==null?void 0:s.rowId)===row.id)));return jsxs(React__default.Fragment,{children:[isFirstChildofSubrow&&subRowHeaders&&jsx(SubRowHeaderRow,{collapsibleTrail:collapsibleTrail,enableToggleExpansion:enableToggleExpansion,onClick:handleExpandOrCollapse,row:row,subRowHeaders:subRowHeaders,table:table}),jsxs("tr",{className:`${rowColor} ${row.depth>0?`depth-sub-row-${row.depth}`:""}`,id:`${row.index}-${row.id}-${row.depth}-row`,ref:isFirstRegularRow?sampleRowRef:null,style:{backgroundColor:customRowStyle==null?void 0:customRowStyle.backgroundColor,color:customRowStyle==null?void 0:customRowStyle.fontColor},children:[selectableRows&&!hasAnySubRows&&jsx("td",{className:"checkbox-cell",children:jsx(Checkbox,{checked:row.getIsSelected(),disabled:!row.getCanSelect(),indeterminate:row.getIsSomeSelected(),name:row.id,onChange:row.getToggleSelectedHandler()})}),jsx(TableCellRenderer,{collapsibleTrail:collapsibleTrail,columnDefinitions:columnDefinitions,columnPinning:columnPinning,customRowStyle:customRowStyle,loading:loading,row:row,stickyLeftColumn:stickyLeftColumn})]}),isDataLoading&&jsx("tr",{children:jsx("td",{colSpan:numberOfColumns,style:{paddingLeft:`${row.depth===0?.5:row.depth*2}em`},children:jsx(LoadingInline,{})})},`${row.id}-row`)]},`${row.index}-${row.id}-${row.depth}-row`)}))]})};const VirtualizedTableView=({collapsibleTrail:collapsibleTrail=true,subRowHeaders:subRowHeaders,isFetching:isFetching})=>{var _a;const{enableToggleExpansion:enableToggleExpansion,handleExpandOrCollapse:handleExpandOrCollapse,inlineRowLoading:inlineRowLoading,loading:loading,table:table,selectableRows:selectableRows,hasAnySubRows:hasAnySubRows,virtualizer:virtualizer,flattenedItems:flattenedItems,totalAvailableCount:totalAvailableCount}=useContext(AdvancedTableContext);const columnPinning=table.getState().columnPinning||{left:[]};const sortingState=JSON.stringify(table.getState().sorting||[]);const[columnWidths,setColumnWidths]=useState({});const getHeaderCellWidths=()=>{const widths={};const headerCells=document.querySelectorAll(".table-header-cells, .table-header-cells-custom");if(selectableRows&&!hasAnySubRows&&headerCells.length>0){widths["checkbox"]=`${headerCells[0].getBoundingClientRect().width}px`}table.getFlatHeaders().forEach(((header,index)=>{const headerIndex=selectableRows&&!hasAnySubRows?index+1:index;if(headerCells[headerIndex]){const width=headerCells[headerIndex].getBoundingClientRect().width;widths[header.id]=`${width}px`}}));return widths};const debounce2=(func,wait)=>{let timeout;return function executedFunction(...args){const later=()=>{clearTimeout(timeout);func(...args)};clearTimeout(timeout);timeout=setTimeout(later,wait)}};useLayoutEffect((()=>{const timer=setTimeout((()=>{setColumnWidths(getHeaderCellWidths())}),0);return()=>clearTimeout(timer)}),[table,selectableRows,hasAnySubRows,sortingState]);useEffect((()=>{const handleResize=debounce2((()=>{setColumnWidths(getHeaderCellWidths())}),0);window.addEventListener("resize",handleResize);return()=>{window.removeEventListener("resize",handleResize)}}),[table,selectableRows,hasAnySubRows]);if(!virtualizer||!flattenedItems){return jsx("tr",{children:jsx("td",{colSpan:table.getAllFlatColumns().length||1,children:"No data to display."})})}const virtualItems=((_a=virtualizer.getVirtualItems)==null?void 0:_a.call(virtualizer))||[];if(!virtualItems.length){return jsx("tr",{children:jsx("td",{colSpan:table.getAllFlatColumns().length||1,children:"No items to display."})})}const topLevelRowCount=table.getRowModel().flatRows.filter((row=>row.depth===0)).length;return jsx(Fragment,{children:virtualItems.map((virtualRow=>{var _a2;const item=flattenedItems[virtualRow.index];if(!item)return null;const virtualItemStyle=getVirtualizedRowStyle(virtualRow.start);if(item.type==="header"){return jsx("tr",{className:"virtualized-table-row virtualized-header-row",style:virtualItemStyle,children:jsx("td",{colSpan:table.getAllFlatColumns().length,children:jsx(SubRowHeaderRow,{collapsibleTrail:collapsibleTrail,enableToggleExpansion:enableToggleExpansion,onClick:handleExpandOrCollapse,row:item.row,subRowHeaders:subRowHeaders,table:table})})},`header-${item.id}-sort-${sortingState}`)}if(item.type==="row"){const row=item.row;const isExpandable=row.getIsExpanded();const rowHasNoChildren=((_a2=row.original)==null?void 0:_a2.children)&&!row.original.children.length;const rowBackground=isExpandable&&(!inlineRowLoading&&row.getCanExpand()||inlineRowLoading&&rowHasNoChildren);const rowColor=row.getIsSelected()?"bg-row-selection":rowBackground?"bg-silver":"bg-white";return jsxs("tr",{className:`virtualized-table-row ${rowColor} ${row.depth>0?`depth-sub-row-${row.depth}`:""}`,"data-index":virtualRow.index,ref:node=>{if(node){try{virtualizer.measureElement(node)}catch(err){}}},style:virtualItemStyle,children:[selectableRows&&!hasAnySubRows&&jsx("td",{className:"checkbox-cell",style:{width:columnWidths["checkbox"]||"auto"},children:jsx(Checkbox,{checked:row.getIsSelected(),disabled:!row.getCanSelect(),indeterminate:row.getIsSomeSelected(),name:row.id,onChange:row.getToggleSelectedHandler()})}),row.getVisibleCells().map(((cell,i)=>{var _a3,_b,_c;const isPinnedLeft=columnPinning.left.includes(cell.column.id);const isLastCell=((_c=(_b=(_a3=cell.column.parent)==null?void 0:_a3.columns)==null?void 0:_b.at(-1))==null?void 0:_c.id)===cell.column.id;const cellWidth=columnWidths[cell.column.id]||"auto";return jsxs("td",{align:"right",className:classnames(`${cell.id}-cell position_relative`,isChrome()?"chrome-styles":"",isPinnedLeft&&"pinned-left",isLastCell&&"last-cell"),style:{width:cellWidth},children:[collapsibleTrail&&i===0&&row.depth>0&&renderCollapsibleTrail(row.depth),jsx("span",{id:`${cell.id}-span`,children:loading?jsx(LoadingCell,{}):flexRender(cell.column.columnDef.cell,cell.getContext())})]},`${cell.id}-data`)}))]},`row-${item.id}-sort-${sortingState}`)}if(item.type==="loading"){const row=item.row;const numberOfColumns=table.getAllFlatColumns().length;return jsx("tr",{className:"virtualized-table-row virtualized-loading-row",style:virtualItemStyle,children:jsx("td",{colSpan:numberOfColumns,style:{paddingLeft:`${row.depth===0?.5:row.depth*2}em`},children:jsx(LoadingInline,{})})},`loading-${item.id}-sort-${sortingState}`)}if(item.type==="footer"){return jsx("tr",{className:"virtualized-table-row virtualized-footer",style:virtualItemStyle,children:jsx("td",{colSpan:table.getAllFlatColumns().length,children:jsx(Flex,{align:"center",justify:"center",children:isFetching?jsx(LoadingInline,{}):jsx(Detail,{text:`Showing ${topLevelRowCount} of ${totalAvailableCount} rows`})})})},`footer-row`)}return null}))})};const TableBody=({className:className,collapsibleTrail:collapsibleTrail=true,dark:dark=false,id:id,subRowHeaders:subRowHeaders,isFetching:isFetching,...props})=>{const{responsive:responsive,isPinnedLeft:isPinnedLeft=false,virtualizer:virtualizer,virtualizedRows:virtualizedRows,enableVirtualization:enableVirtualization}=useContext(AdvancedTableContext);const isVirtualized=virtualizedRows||enableVirtualization;const classes=classnames(buildCss("pb_advanced_table_body"),{"pinned-left":responsive==="scroll"&&isPinnedLeft},globalProps(props),className);const style=virtualizer?{height:`${virtualizer.getTotalSize()}px`,position:"relative",width:"100%"}:{};return jsx(Fragment,{children:jsxs("tbody",{className:classes,"data-virtualized":isVirtualized?"true":"false",id:id,style:style,children:[isVirtualized&&virtualizer?jsx(VirtualizedTableView,{collapsibleTrail:collapsibleTrail,isFetching:isFetching,subRowHeaders:subRowHeaders}):jsx(RegularTableView,{collapsibleTrail:collapsibleTrail,subRowHeaders:subRowHeaders}),isVirtualized&&!virtualizer&&jsx("tr",{children:jsx("td",{colSpan:999,style:{padding:"10px",textAlign:"center"},children:jsx("div",{children:"No data to display."})})})]})})};const Pagination=props=>{const{aria:aria={},className:className,data:data={},htmlOptions:htmlOptions={},id:id,current:current=1,onChange:onChange,range:range=5,total:total=1}=props;const[currentPage,setCurrentPage]=useState(current);const handlePageChange=pageNumber=>{if(pageNumber>=1&&pageNumber<=total){setCurrentPage(pageNumber);if(onChange){onChange(pageNumber)}}};const renderPageButtons=()=>{const buttons=[];let rangeStart=Math.max(1,currentPage-Math.floor(range/2));let rangeEnd=Math.min(total,rangeStart+range-1);if(rangeEnd-rangeStart+1<range){if(rangeStart>1){rangeStart=Math.max(1,rangeEnd-range+1)}else{rangeEnd=Math.min(total,rangeStart+range-1)}}if(rangeStart>1){buttons.push(jsx("li",{className:"pagination-number",onClick:()=>handlePageChange(1),children:"1"},1))}if(rangeStart>2){buttons.push(jsx("li",{className:"pagination-number",onClick:()=>handlePageChange(2),children:"2"},2))}for(let i=rangeStart;i<=rangeEnd;i++){buttons.push(jsx("li",{className:`pagination-number ${i===currentPage?"active":""}`,onClick:()=>handlePageChange(i),children:i},i))}if(rangeEnd<total-1){buttons.push(jsx("li",{className:`pagination-number ${total-1===currentPage?"active":""}`,onClick:()=>handlePageChange(total-1),children:total-1},total-1))}if(rangeEnd<total){buttons.push(jsx("li",{className:`pagination-number ${total===currentPage?"active":""}`,onClick:()=>handlePageChange(total),children:total},total))}return buttons};const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_paginate"),globalProps(props),className);return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:jsxs("div",{className:"pb_pagination",children:[jsx("li",{className:`pagination-left ${currentPage===1?"disabled":""}`,onClick:()=>handlePageChange(currentPage-1),children:jsx(Icon,{icon:"chevron-left"})}),renderPageButtons(),jsx("li",{className:`pagination-right ${currentPage===total?"disabled":""}`,onClick:()=>handlePageChange(currentPage+1),children:jsx(Icon,{icon:"chevron-right"})})]})})};const TablePagination=({table:table,onChange:onChange,position:position,range:range=5})=>{const current=table.getState().pagination.pageIndex+1;const total=table.getPageCount();return jsx(Pagination,{current:current,marginBottom:position==="top"?"xs":void 0,marginTop:position==="bottom"?"xs":void 0,onChange:onChange,range:range,total:total},`pagination-${position}-${current}`)};const buildVisibilityTree=(defs,allowed)=>defs.map((def=>{const isGroup=Array.isArray(def.columns)&&def.columns.length>0;if(!(allowed==null?void 0:allowed.length)){return isGroup?{id:def.id,label:def.label,children:buildVisibilityTree(def.columns,allowed)}:{id:def.id,label:def.label}}if(allowed.includes(def.id)){return isGroup?{id:def.id,label:def.label,children:buildVisibilityTree(def.columns,null)}:{id:def.id,label:def.label}}if(isGroup){const kids=buildVisibilityTree(def.columns,allowed).filter(Boolean);return kids.length?{id:def.id,label:def.label,children:kids}:null}return null})).filter(Boolean);const showActionBar=elem=>{elem.style.display="block";const height=elem.scrollHeight+"px";elem.style.height=height;elem.classList.add("is-visible");elem.style.overflow="hidden";window.setTimeout((()=>{if(elem.classList.contains("is-visible")){elem.style.height="";elem.style.overflow="visible"}}),300)};const hideActionBar=elem=>{elem.style.height=elem.scrollHeight+"px";elem.offsetHeight;window.setTimeout((()=>{elem.style.height="0";elem.style.overflow="hidden"}),10);window.setTimeout((()=>{elem.classList.remove("is-visible")}),300)};const TableActionBar=({isVisible:isVisible,selectedCount:selectedCount,actions:actions,type:type="row-selection"})=>{var _a;const cardRef=useRef(null);const{table:table,columnVisibilityControl:columnVisibilityControl,columnDefinitions:columnDefinitions}=useContext(AdvancedTableContext);const includeIds=columnVisibilityControl==null?void 0:columnVisibilityControl.includeIds;const firstLeafId=(_a=table.getAllLeafColumns()[0])==null?void 0:_a.id;const tree=buildVisibilityTree(columnDefinitions,includeIds).filter((node=>node.id!==firstLeafId));const renderLeaf=(id,label)=>{const col=table.getColumn(id);const show=col.getIsVisible();const handleVisibilityChange=()=>{col.toggleVisibility();if(columnVisibilityControl==null?void 0:columnVisibilityControl.onColumnVisibilityChange){const updatedVisibilityState={...table.getAllColumns().reduce(((acc,col2)=>{acc[col2.id]=col2.getIsVisible();return acc}),{})};columnVisibilityControl==null?void 0:columnVisibilityControl.onColumnVisibilityChange(updatedVisibilityState)}};return jsx(Checkbox,{checked:show,onChange:handleVisibilityChange,paddingBottom:"xs",text:label},id)};const gatherLeafIds=node=>node.children&&node.children.length?node.children.flatMap(gatherLeafIds):node.id?[node.id]:[];const renderGroup=node=>{var _a2;const leaves=gatherLeafIds(node);const visibleArray=leaves.map((id=>table.getColumn(id).getIsVisible()));const allOn=visibleArray.every(Boolean);const someOn=visibleArray.some(Boolean);const handleGroupVisibilityChange=()=>{leaves.forEach((id=>table.getColumn(id).toggleVisibility(!allOn)));if(columnVisibilityControl==null?void 0:columnVisibilityControl.onColumnVisibilityChange){const updatedVisibilityState={...table.getAllColumns().reduce(((acc,col)=>{acc[col.id]=col.getIsVisible();return acc}),{})};columnVisibilityControl==null?void 0:columnVisibilityControl.onColumnVisibilityChange(updatedVisibilityState)}};return jsxs(Fragment,{children:[jsx(Checkbox,{checked:allOn,indeterminate:!allOn&&someOn,onChange:handleGroupVisibilityChange,paddingBottom:"xs",text:node.label}),jsx(Flex,{flexDirection:"column",paddingLeft:"lg",children:(_a2=node==null?void 0:node.children)==null?void 0:_a2.map((child=>child.children?renderGroup(child):renderLeaf(child.id,child.label)))})]})};useEffect((()=>{if(cardRef.current&&type==="row-selection"){if(isVisible){showActionBar(cardRef.current)}else{hideActionBar(cardRef.current)}}}),[isVisible,type]);const[showPopover,setShowPopover]=useState(false);const togglePopover=()=>setShowPopover((prev=>!prev));const handleShouldClose=shouldClose=>setShowPopover(!shouldClose);const popoverReference=jsx(Tooltip$1,{placement:"top",text:"Column Configuration",children:jsx("div",{onClick:togglePopover,children:jsx(Icon,{color:"primary",cursor:"pointer",icon:"sliders-h"})})});return jsx(Card,{borderNone:!isVisible,className:`${isVisible&&"show-action-card row-selection-actions-card"}`,htmlOptions:{ref:cardRef},padding:`${isVisible?"xs":"none"}`,children:jsx(Flex,{alignItems:"center",justify:type==="row-selection"?"between":"end",children:type==="row-selection"?jsxs(Fragment,{children:[jsxs(Caption,{color:"light",paddingLeft:"xs",size:"xs",children:[selectedCount," Selected"]}),jsx(FlexItem,{children:actions})]}):jsx(PbReactPopover,{closeOnClick:"outside",placement:"bottom-end",reference:popoverReference,shouldClosePopover:handleShouldClose,show:showPopover,zIndex:3,children:jsxs(Fragment,{children:[jsx(Caption,{paddingY:"sm",text:"Columns Config",textAlign:"center"}),jsx(SectionSeparator,{paddingBottom:"xs"}),tree.map((node=>jsx(Flex,{cursor:"pointer",flexDirection:"column",paddingX:"xs",children:node.children?renderGroup(node):renderLeaf(node.id,node.label)},node.id)))]})})})})};const CustomCell=({getValue:getValue,onRowToggleClick:onRowToggleClick,row:row,value:value,customRenderer:customRenderer,selectableRows:selectableRows,customStyle:customStyle={}})=>{const{setExpanded:setExpanded,expanded:expanded,expandedControl:expandedControl,inlineRowLoading:inlineRowLoading,hasAnySubRows:hasAnySubRows}=useContext(AdvancedTableContext);const handleOnExpand=row2=>{onRowToggleClick&&onRowToggleClick(row2);if(!expandedControl){setExpanded({...expanded,[row2.id]:!row2.getIsExpanded()})}};const RowHasChildren=row.original.children?true:false;const renderButton=inlineRowLoading?RowHasChildren:row.getCanExpand();return jsx("div",{style:{paddingLeft:`${row.depth*1.25}em`},children:jsxs(Flex,{alignItems:"center",columnGap:"xs",justify:"start",orientation:"row",children:[selectableRows&&hasAnySubRows&&jsx(Checkbox,{checked:row.getIsSelected(),disabled:!row.getCanSelect(),indeterminate:row.getIsSomeSelected(),name:row.id,onChange:row.getToggleSelectedHandler()}),renderButton?jsx("button",{className:"gray-icon expand-toggle-icon",onClick:()=>handleOnExpand(row),style:{color:customStyle==null?void 0:customStyle.expandButtonColor},children:row.getIsExpanded()?jsx(Icon,{cursor:"pointer",icon:"circle-play",rotation:90}):jsx(Icon,{cursor:"pointer",icon:"circle-play"})}):null,jsx(FlexItem,{paddingLeft:renderButton?"none":"xs",children:row.depth===0?customRenderer?customRenderer(row,getValue()):getValue():customRenderer?customRenderer(row,value):value})]})})};const createCellFunction=(cellAccessors,customRenderer,isFirstColumn,onRowToggleClick,selectableRows,rowStyling)=>{const cellRenderer=({row:row,getValue:getValue})=>{const rowData=row.original;const customStyle=(rowStyling==null?void 0:rowStyling.length)>0&&(rowStyling==null?void 0:rowStyling.find((s=>(s==null?void 0:s.rowId)===row.id)));if(isFirstColumn){switch(row.depth){case 0:{return jsx(CustomCell,{customRenderer:customRenderer,customStyle:customStyle,getValue:getValue,onRowToggleClick:onRowToggleClick,row:row,selectableRows:selectableRows})}default:{const depthAccessor=cellAccessors[row.depth-1];const accessorValue=rowData[depthAccessor];return accessorValue?jsx(CustomCell,{customRenderer:customRenderer,onRowToggleClick:onRowToggleClick,row:row,selectableRows:selectableRows,value:accessorValue}):"N/A"}}}return customRenderer?customRenderer(row,getValue()):getValue()};cellRenderer.displayName="CellRenderer";return cellRenderer};function useTableState({tableData:tableData,columnDefinitions:columnDefinitions,expandedControl:expandedControl,sortControl:sortControl,onRowToggleClick:onRowToggleClick,selectableRows:selectableRows,initialLoadingRowsCount:initialLoadingRowsCount=10,loading:loading,pagination:pagination=false,paginationProps:paginationProps,virtualizedRows:virtualizedRows=false,tableOptions:tableOptions,columnVisibilityControl:columnVisibilityControl,pinnedRows:pinnedRows,rowStyling:rowStyling}){var _a,_b;const[localExpanded,setLocalExpanded]=useState({});const[loadingStateRowCount,setLoadingStateRowCount]=useState(initialLoadingRowsCount);const[rowSelection,setRowSelection]=useState({});const[localColumnVisibility,setLocalColumnVisibility]=useState({});const[localRowPinning,setLocalRowPinning]=useState({top:[]});const expanded=expandedControl?expandedControl.value:localExpanded;const setExpanded=expandedControl?expandedControl.onChange:setLocalExpanded;const columnVisibility=columnVisibilityControl&&columnVisibilityControl.value?columnVisibilityControl.value:localColumnVisibility;const setColumnVisibility=columnVisibilityControl&&columnVisibilityControl.onChange?columnVisibilityControl.onChange:setLocalColumnVisibility;const rowPinning=(pinnedRows==null?void 0:pinnedRows.value)??localRowPinning;const onRowPinningChange=(pinnedRows==null?void 0:pinnedRows.onChange)??setLocalRowPinning;const fetchSize=20;const[fullData]=useState(tableData);const[dataChunk,setDataChunk]=useState(fullData.slice(0,fetchSize));const[totalFetched,setTotalFetched]=useState(fetchSize);const[isFetching,setIsFetching]=useState(false);const columnHelper=createColumnHelper();const buildColumns=useCallback(((columnDefinitions2,isRoot=true)=>(columnDefinitions2==null?void 0:columnDefinitions2.map(((column,index)=>{const isFirstColumn=isRoot&&index===0;if(column.columns&&column.columns.length>0){return{header:column.header??column.label??"",id:column.id??column.label??`group-${index}`,columns:buildColumns(column.columns,false)}}const columnStructure={...columnHelper.accessor(column.accessor,{header:column.header??column.label??""})};if(column.cellAccessors||column.customRenderer){columnStructure.cell=createCellFunction(column.cellAccessors||[],column.customRenderer,isFirstColumn,onRowToggleClick,selectableRows,rowStyling)}return columnStructure})))||[]),[columnHelper,onRowToggleClick,selectableRows]);const columns=useMemo((()=>buildColumns(columnDefinitions)),[buildColumns,columnDefinitions]);const sorting=useMemo((()=>[{id:columnDefinitions[0].accessor,desc:sortControl&&sortControl.value!==null?!sortControl.value.desc:false}]),[columnDefinitions,sortControl]);const customState=useCallback((()=>({state:{expanded:expanded,...sortControl&&{sorting:sorting},...selectableRows&&{rowSelection:rowSelection},...columnVisibility&&{columnVisibility:columnVisibility},...pinnedRows&&{rowPinning:rowPinning}}})),[expanded,sortControl,sorting,selectableRows,rowSelection,columnVisibility,rowPinning]);const paginationInitializer=useMemo((()=>{if(!pagination)return{};return{getPaginationRowModel:getPaginationRowModel(),paginateExpandedRows:false,initialState:{pagination:{pageIndex:(paginationProps==null?void 0:paginationProps.pageIndex)??0,pageSize:(paginationProps==null?void 0:paginationProps.pageSize)??20}}}}),[pagination,paginationProps]);const table=useReactTable({data:loading?Array(loadingStateRowCount).fill({}):virtualizedRows?dataChunk:tableData,columns:columns,onExpandedChange:setExpanded,getSubRows:row=>row.children,getCoreRowModel:getCoreRowModel(),getExpandedRowModel:getExpandedRowModel(),getSortedRowModel:getSortedRowModel(),enableSortingRemoval:false,sortDescFirst:true,onRowSelectionChange:setRowSelection,onRowPinningChange:onRowPinningChange,getRowId:selectableRows||pinnedRows||rowStyling?row=>row.id:void 0,onColumnVisibilityChange:setColumnVisibility,meta:{columnDefinitions:columnDefinitions},...customState(),...paginationInitializer,...tableOptions});useEffect((()=>{var _a2;const topPins=((_a2=pinnedRows==null?void 0:pinnedRows.value)==null?void 0:_a2.top)??[];if(topPins.length===0){onRowPinningChange({top:[]});return}const rows=table.getRowModel().rows;const collectAllDescendantIds=subs=>subs.flatMap((r=>[r.id,...collectAllDescendantIds(r.subRows)]));const allPinned=[];topPins.forEach((id=>{const parent=rows.find((r=>r.id===id&&r.depth===0));if(parent){allPinned.push(parent.id,...collectAllDescendantIds(parent.subRows))}}));onRowPinningChange({top:allPinned})}),[table,(_b=(_a=pinnedRows==null?void 0:pinnedRows.value)==null?void 0:_a.top)==null?void 0:_b.join(",")]);const hasAnySubRows=table.getRowModel().rows.some((row=>row.subRows&&row.subRows.length>0));const selectedRowsLength=Object.keys(table.getState().rowSelection).length;const fetchNextPage=useCallback((()=>{if(isFetching||totalFetched>=fullData.length)return;setIsFetching(true);setTimeout((()=>{const nextChunk=fullData.slice(totalFetched,totalFetched+fetchSize);setDataChunk((prev=>[...prev,...nextChunk]));setTotalFetched((prev=>prev+nextChunk.length));setIsFetching(false)}),500)}),[isFetching,totalFetched,fullData,fetchSize]);const updateLoadingStateRowCount=useCallback((()=>{const rowsCount=table.getRowModel().rows.length;if(rowsCount!==loadingStateRowCount&&rowsCount!==0){setLoadingStateRowCount(rowsCount)}}),[loadingStateRowCount,table]);return{table:table,expanded:expanded,setExpanded:setExpanded,hasAnySubRows:hasAnySubRows,selectedRowsLength:selectedRowsLength,fetchNextPage:fetchNextPage,updateLoadingStateRowCount:updateLoadingStateRowCount,rowSelection:rowSelection,fullData:fullData,totalFetched:totalFetched,isFetching:isFetching}}function useTableActions({table:table,expanded:expanded,setExpanded:setExpanded,onToggleExpansionClick:onToggleExpansionClick,onRowSelectionChange:onRowSelectionChange}){const[bottomReached,setBottomReached]=useState(false);const bottomTimeout=useRef(null);const handleExpandOrCollapse=useCallback((async row=>{if(onToggleExpansionClick)onToggleExpansionClick(row);const updatedExpandedState=await updateExpandAndCollapseState(table.getRowModel(),expanded,row==null?void 0:row.parentId,void 0);setExpanded(updatedExpandedState)}),[expanded,setExpanded,onToggleExpansionClick,table]);const onPageChange=useCallback((page=>{table.setPageIndex(page-1)}),[table]);const fetchMoreOnBottomReached=useCallback(((containerRef,fetchNextPage,isFetching,totalFetched,totalDBRowCount)=>{if(!containerRef||isFetching||totalFetched>=totalDBRowCount)return;const{scrollTop:scrollTop,scrollHeight:scrollHeight,clientHeight:clientHeight}=containerRef;const distanceFromBottom=scrollHeight-scrollTop-clientHeight;if(distanceFromBottom<50){if(!bottomReached){setBottomReached(true);bottomTimeout.current=setTimeout((()=>{fetchNextPage();setBottomReached(false)}),1e3)}}else{setBottomReached(false);if(bottomTimeout.current){clearTimeout(bottomTimeout.current);bottomTimeout.current=null}}}),[bottomReached]);useEffect((()=>{if(onRowSelectionChange){onRowSelectionChange(table.getState().rowSelection)}}),[table.getState().rowSelection,onRowSelectionChange]);return{handleExpandOrCollapse:handleExpandOrCollapse,onPageChange:onPageChange,fetchMoreOnBottomReached:fetchMoreOnBottomReached}}const AdvancedTable=props=>{const{aria:aria={},actions:actions,children:children,className:className,columnDefinitions:columnDefinitions,columnGroupBorderColor:columnGroupBorderColor,columnVisibilityControl:columnVisibilityControl,customSort:customSort,dark:dark=false,data:data={},enableToggleExpansion:enableToggleExpansion="header",expandedControl:expandedControl,expandByDepth:expandByDepth,onExpandByDepthClick:onExpandByDepthClick,htmlOptions:htmlOptions={},id:id,initialLoadingRowsCount:initialLoadingRowsCount=10,inlineRowLoading:inlineRowLoading=false,loading:loading,maxHeight:maxHeight,onRowToggleClick:onRowToggleClick,onToggleExpansionClick:onToggleExpansionClick,onCustomSortClick:onCustomSortClick,pagination:pagination=false,paginationProps:paginationProps,pinnedRows:pinnedRows,responsive:responsive="scroll",rowStyling:rowStyling,scrollBarNone:scrollBarNone=false,showActionsBar:showActionsBar=true,selectableRows:selectableRows,sortControl:sortControl,stickyLeftColumn:stickyLeftColumn,tableData:tableData,tableOptions:tableOptions,tableProps:tableProps,toggleExpansionIcon:toggleExpansionIcon="arrows-from-line",onRowSelectionChange:onRowSelectionChange,virtualizedRows:virtualizedRows=false,allowFullScreen:allowFullScreen=false,fullScreenControl:fullScreenControl}=props;const tableWrapperRef=useRef(null);const{table:table,expanded:expanded,setExpanded:setExpanded,hasAnySubRows:hasAnySubRows,selectedRowsLength:selectedRowsLength,fetchNextPage:fetchNextPage,updateLoadingStateRowCount:updateLoadingStateRowCount,fullData:fullData,totalFetched:totalFetched,isFetching:isFetching}=useTableState({tableData:tableData,columnDefinitions:columnDefinitions,expandedControl:expandedControl,sortControl:sortControl,onRowToggleClick:onRowToggleClick,selectableRows:selectableRows,initialLoadingRowsCount:initialLoadingRowsCount,loading:loading,pagination:pagination,paginationProps:paginationProps,virtualizedRows:virtualizedRows,tableOptions:tableOptions,columnVisibilityControl:columnVisibilityControl,pinnedRows:pinnedRows,rowStyling:rowStyling});const{handleExpandOrCollapse:handleExpandOrCollapse,onPageChange:onPageChange,fetchMoreOnBottomReached:fetchMoreOnBottomReached}=useTableActions({table:table,expanded:expanded,setExpanded:setExpanded,onToggleExpansionClick:onToggleExpansionClick,onRowSelectionChange:onRowSelectionChange});useEffect((()=>{if(!loading){updateLoadingStateRowCount()}}),[loading,updateLoadingStateRowCount]);useEffect((()=>{fetchMoreOnBottomReached(tableWrapperRef.current,fetchNextPage,isFetching,totalFetched,fullData.length)}),[fetchMoreOnBottomReached,fetchNextPage,isFetching,totalFetched,fullData.length]);const[isFullscreen,setIsFullscreen]=useState(false);const toggleFullscreen=useCallback((()=>{setIsFullscreen((prevState=>!prevState))}),[]);useEffect((()=>{if(allowFullScreen&&fullScreenControl){fullScreenControl({toggleFullscreen:toggleFullscreen,isFullscreen:isFullscreen})}}),[allowFullScreen,fullScreenControl,toggleFullscreen,isFullscreen]);const renderFullscreenHeader=()=>{if(!isFullscreen)return null;const defaultMinimizeIcon=jsx("button",{className:"gray-icon fullscreen-icon",onClick:toggleFullscreen,children:jsx(Icon,{cursor:"pointer",fixedWidth:true,icon:"arrow-down-left-and-arrow-up-right-to-center",...props})});return jsx(Card,{borderNone:true,borderRadius:"none",className:"advanced-table-fullscreen-header",...props,children:jsx(Flex,{justify:"end",children:defaultMinimizeIcon})})};useEffect((()=>{if(!allowFullScreen)return;const handleKeyDown=event=>{if(event.key==="Escape"&&isFullscreen){event.preventDefault();toggleFullscreen()}};document.addEventListener("keydown",handleKeyDown);return()=>{document.removeEventListener("keydown",handleKeyDown)}}),[allowFullScreen,toggleFullscreen,isFullscreen]);const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_advanced_table"),`advanced-table-responsive-${responsive}`,maxHeight?`advanced-table-max-height-${maxHeight}`:"",{"advanced-table-fullscreen":isFullscreen,"advanced-table-allow-fullscreen":allowFullScreen},{"advanced-table-sticky-left-columns":stickyLeftColumn&&stickyLeftColumn.length>0},columnGroupBorderColor?`column-group-border-${columnGroupBorderColor}`:"",scrollBarNone?"advanced-table-hide-scrollbar":"",globalProps(props),className);const tableWrapperStyle=virtualizedRows?getVirtualizedContainerStyles(maxHeight):{};const isActionBarVisible=selectableRows&&showActionsBar&&selectedRowsLength>0||columnVisibilityControl;const tableElement=jsx(Table,{className:`${loading?"content-loading":""}`,dark:dark,dataTable:true,numberSpacing:"tabular",responsive:"none",...tableProps,children:children?children:jsxs(Fragment,{children:[jsx(TableHeader,{}),jsx(TableBody,{isFetching:isFetching})]})});return jsxs(Fragment,{children:[pagination&&jsx(TablePagination,{onChange:onPageChange,position:"top",range:paginationProps==null?void 0:paginationProps.range,table:table}),jsxs("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,onScroll:virtualizedRows?e=>fetchMoreOnBottomReached(e.currentTarget,fetchNextPage,isFetching,totalFetched,fullData.length):void 0,ref:tableWrapperRef,style:tableWrapperStyle,children:[renderFullscreenHeader(),jsx(AdvancedTableProvider,{columnDefinitions:columnDefinitions,columnGroupBorderColor:columnGroupBorderColor,columnVisibilityControl:columnVisibilityControl,customSort:customSort,enableToggleExpansion:enableToggleExpansion,enableVirtualization:virtualizedRows,expandByDepth:expandByDepth,expanded:expanded,expandedControl:expandedControl,handleExpandOrCollapse:handleExpandOrCollapse,hasAnySubRows:hasAnySubRows,inlineRowLoading:inlineRowLoading,isActionBarVisible:isActionBarVisible,isFullscreen:isFullscreen,loading:loading,onCustomSortClick:onCustomSortClick,onExpandByDepthClick:onExpandByDepthClick,pinnedRows:pinnedRows,responsive:responsive,rowStyling:rowStyling,selectableRows:selectableRows,setExpanded:setExpanded,showActionsBar:showActionsBar,sortControl:sortControl,stickyLeftColumn:stickyLeftColumn,subRowHeaders:tableOptions==null?void 0:tableOptions.subRowHeaders,table:table,tableContainerRef:tableWrapperRef,toggleExpansionIcon:toggleExpansionIcon,totalAvailableCount:fullData.length,virtualizedRows:virtualizedRows,children:jsxs(React__default.Fragment,{children:[jsx(TableActionBar,{actions:actions,isVisible:isActionBarVisible,selectedCount:selectedRowsLength,type:columnVisibilityControl?"column-visibility":"row-selection"}),virtualizedRows?jsx("div",{style:{overflow:"auto",width:"100%"},children:tableElement}):tableElement]})})]}),pagination&&jsx(TablePagination,{onChange:onPageChange,position:"bottom",range:paginationProps==null?void 0:paginationProps.range,table:table})]})};AdvancedTable.Header=TableHeader;AdvancedTable.Body=TableBody;const BreadCrumbItem=props=>{const{aria:aria={},className:className,data:data={},htmlOptions:htmlOptions={},id:id,component:component="a",...rest}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const Component=component||"span";const css=classnames(buildCss("pb_bread_crumb_item_kit"),globalProps(props),className);return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:css,id:id,children:jsx(Component,{className:"pb_bread_crumb_item",...domSafeProps(rest)})})};const BreadCrumbs=props=>{const{aria:aria={label:"Breadcrumb Navigation"},className:className,data:data={},htmlOptions:htmlOptions={},id:id,children:children}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const css=classnames(buildCss("pb_bread_crumbs_kit"),globalProps(props),className);return jsx("nav",{...ariaProps,...dataProps,...htmlProps,className:css,id:id,children:children})};const ButtonToolbar=props=>{const{aria:aria={},children:children,className:className,data:data={},htmlOptions:htmlOptions={},id:id,orientation:orientation="horizontal",text:text2,variant:variant="primary"}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_button_toolbar_kit",orientation,variant),globalProps(props),className);return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:children||text2})};const contactTypeMap={cell:"mobile",email:"envelope",extension:"phone-plus",home:"phone",work:"phone-office","work-cell":"phone-laptop","wrong-phone":"phone-slash"};const envelopeIcon=getAllIcons()["envelope"].icon;const formatContact=(contactString,contactType)=>{if(contactType==="email")return contactString;const cleaned=contactString.replace(/\D/g,"");const phoneNumber=cleaned.match(/^(1|)?(\d{3})(\d{3})(\d{4})$/);if(contactType==="extension"){return cleaned.match(/^\d{4}$/)}if(phoneNumber){const intlCode=phoneNumber[1]?"+1 ":"";return[intlCode,"(",phoneNumber[2],") ",phoneNumber[3],"-",phoneNumber[4]].join("")}return null};const Contact=props=>{const{aria:aria={},className:className,contactDetail:contactDetail,contactType:contactType,contactValue:contactValue,data:data={},dark:dark=false,htmlOptions:htmlOptions={},id:id}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_contact_kit"),globalProps(props),className);return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:jsxs(Body$1,{className:"pb_contact_kit",color:"light",dark:dark,tag:"span",children:[contactType==="email"?jsx(Icon,{className:"svg-inline--fa envelope",customIcon:envelopeIcon,dark:dark,fixedWidth:true}):jsx(Icon,{dark:dark,fixedWidth:true,icon:contactTypeMap[contactType]||"phone"}),` ${formatContact(contactValue,contactType)} `,contactDetail&&jsx(Caption,{dark:dark,size:"xs",tag:"span",text:contactDetail})]})})};const CopyButton=props=>{const{aria:aria={},className:className,data:data={},from:from="",id:id,text:text2="Copy",timeout:timeout=1e3,tooltipPlacement:tooltipPlacement="bottom",tooltipText:tooltipText="Copied!",value:value=""}=props;const[copied,copy]=usePBCopy({value:value,from:from,timeout:timeout});const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const classes=classnames(buildCss("pb_copy_button_kit"),globalProps(props),className);return jsx("div",{...ariaProps,...dataProps,className:classes,id:id,children:jsx(Tooltip$1,{forceOpenTooltip:copied,placement:tooltipPlacement,showTooltip:false,text:tooltipText,children:jsx(Button,{icon:"copy",onClick:copy,children:text2})})})};const sizes$1={lg:1,md:3,sm:4};const Currency=props=>{const{abbreviate:abbreviate=false,align:align="left",aria:aria={},amount:amount,data:data={},decimals:decimals="default",emphasized:emphasized=true,htmlOptions:htmlOptions={},id:id,unit:unit,className:className,label:label="",nullDisplay:nullDisplay="",size:size="sm",symbol:symbol="$",variant:variant="default",dark:dark=false,unstyled:unstyled=false,commaSeparator:commaSeparator=false}=props;const emphasizedClass=emphasized?"":"_deemphasized";let variantClass;if(variant==="light"){variantClass="_light"}else if(variant==="bold"){variantClass="_bold"}const[whole,decimal="00"]=amount.split(".");const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_currency_kit",align,size),globalProps(props),className);const getFormattedNumber=input=>new Intl.NumberFormat("en-US",{notation:"compact",maximumFractionDigits:1}).format(input);const getAbbreviatedValue=abbrType=>{const num=`${getFormattedNumber(whole.split(",").join(""))}`,isAmount=abbrType==="amount",isUnit=abbrType==="unit";return isAmount?num.slice(0,-1):isUnit?num.slice(-1):""};const getMatchingDecimalAmount=decimals==="matching"?amount:whole;const getMatchingDecimalValue=decimals==="matching"?"":`.${decimal}`;const formatAmount=amount2=>{if(!commaSeparator)return amount2;const[wholePart,decimalPart]=amount2.split(".");const formattedWhole=new Intl.NumberFormat("en-US").format(parseInt(wholePart));return decimalPart?`${formattedWhole}.${decimalPart}`:formattedWhole};const swapNegative=size==="sm"&&symbol!=="";const handleNegative=amount.startsWith("-")&&swapNegative?"-":"";const getAbsoluteAmount=amountString=>amountString.replace(/^-/,"");const getAbbrOrFormatAmount=abbreviate?getAbbreviatedValue("amount"):formatAmount(getMatchingDecimalAmount);const getAmount=swapNegative?getAbsoluteAmount(getAbbrOrFormatAmount):getAbbrOrFormatAmount;const getAbbreviation=abbreviate?getAbbreviatedValue("unit"):null;const getDecimalValue=abbreviate?"":getMatchingDecimalValue;return jsxs("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:[jsx(Caption,{dark:dark,children:label}),jsx("div",{className:`pb_currency_wrapper${variantClass||emphasizedClass}`,children:unstyled?nullDisplay&&!amount?jsx("div",{children:nullDisplay}):jsxs(Fragment,{children:[jsxs("div",{children:[handleNegative,symbol]}),jsx("div",{children:getAmount}),jsxs("div",{children:[getAbbreviation,unit?unit:getDecimalValue]})]}):nullDisplay&&!amount?jsx(Title,{className:"pb_currency_value",dark:dark,size:sizes$1[size],children:nullDisplay}):jsxs(Fragment,{children:[jsxs(Body$1,{className:"dollar_sign",color:"light",dark:dark,children:[handleNegative,symbol]}),jsx(Title,{className:"pb_currency_value",dark:dark,size:sizes$1[size],children:getAmount}),jsxs(Body$1,{className:"unit",color:"light",dark:dark,children:[getAbbreviation,unit?unit:getDecimalValue]})]})})]})};const statusMap={increase:"positive",decrease:"negative",neutral:"neutral"};const iconMap$1={increase:"arrow-up",decrease:"arrow-down"};const StatChange=props=>{const{change:change="neutral",className:className,dark:dark=false,htmlOptions:htmlOptions={},icon:icon,id:id,value:value}=props;const status=statusMap[change];let returnedIcon=iconMap$1[change];if(icon){returnedIcon=icon}const htmlProps=buildHtmlProps(htmlOptions);return jsx(Fragment,{children:value&&jsx("div",{className:classnames(buildCss("pb_stat_change_kit",status),globalProps(props),className),id:id,...htmlProps,children:jsxs(Body$1,{dark:dark,status:status,children:[" ",returnedIcon&&jsxs(Fragment,{children:[jsx(Icon,{dark:dark,fixed_width:true,icon:returnedIcon})," "]}),`${value}%`]})})})};const StatValue=props=>{const{className:className,htmlOptions:htmlOptions={},id:id,unit:unit,value:value=0}=props;const htmlProps=buildHtmlProps(htmlOptions);const displayValue=function(value2){if(value2||value2===0){return jsx(Title,{size:1,tag:"span",text:`${value2}`})}};const displayUnit=function(unit2){if(unit2){return jsx(Title,{size:3,tag:"span",text:unit2})}};return jsx("div",{className:classnames("pb_stat_value_kit",globalProps(props),className),id:id,...htmlProps,children:jsxs("div",{className:"pb_stat_value_wrapper",children:[displayValue(value)," ",displayUnit(unit)]})})};const DashboardValue=props=>{const{align:align="left",aria:aria={},className:className,data:data={},htmlOptions:htmlOptions={},id:id,statChange:statChange={},statLabel:statLabel,statValue:statValue={}}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_dashboard_value_kit",align),globalProps(props),className);return jsxs("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:[statLabel&&jsx(Body$1,{color:"light",children:statLabel}),statValue&&jsx(StatValue,{unit:statValue.unit,value:statValue.value}),statChange&&jsx(StatChange,{change:statChange.change,value:statChange.value})]})};const PbDate=props=>{const{aria:aria={},alignment:alignment="left",className:className,dark:dark=false,data:data={},htmlOptions:htmlOptions={},id:id,showDayOfWeek:showDayOfWeek=false,showIcon:showIcon=false,size:size="md",unstyled:unstyled=false,value:value}=props;const weekday=DateTime$1.toWeekday(value);const month=DateTime$1.toMonth(value);const day=DateTime$1.toDay(value);const year=DateTime$1.toYear(value);const currentYear=(new Date).getFullYear();const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_date_kit",alignment),globalProps(props),className);return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:unstyled?jsxs(Fragment,{children:[showIcon&&jsx("div",{children:jsx(Icon,{fixedWidth:true,icon:"calendar-alt"})}),showDayOfWeek&&jsxs(Fragment,{children:[jsx("div",{children:weekday}),jsx("div",{children:"•"})]}),jsxs("span",{children:[jsxs("span",{children:[month," ",day]}),currentYear!=year&&jsx("span",{children:`, ${year}`})]})]}):size=="md"||size=="lg"?jsxs(Title,{dark:dark,size:4,tag:"h4",children:[showIcon&&jsx(Body$1,{className:"pb_icon_kit_container",color:"light",tag:"span",children:jsx(Icon,{fixedWidth:true,icon:"calendar-alt"})}),showDayOfWeek&&jsxs(Fragment,{children:[weekday,jsx(Body$1,{color:"light",tag:"span",text:" • "})]}),jsxs("span",{children:[month," ",day]}),currentYear!=year&&jsx("span",{children:`, ${year}`})]}):jsxs(Fragment,{children:[showIcon&&jsx(Caption,{className:"pb_icon_kit_container",dark:dark,tag:"span",children:jsx(Icon,{fixedWidth:true,icon:"calendar-alt",size:"sm"})}),showDayOfWeek&&jsxs(Fragment,{children:[jsx(Caption,{dark:dark,tag:"div",children:weekday}),jsx(Caption,{color:"light",dark:dark,tag:"div",text:" • "})]}),jsxs(Caption,{dark:dark,tag:"span",children:[month," ",day,currentYear!=year&&jsx(Fragment,{children:`, ${year}`})]})]})})};const DatePicker=props=>{if(props.plugins);const{allowInput:allowInput=false,aria:aria={},className:className,customQuickPickDates:customQuickPickDates,dark:dark=false,data:data={},defaultDate:defaultDate="",disableDate:disableDate=null,disableInput:disableInput,disableRange:disableRange=null,disableWeekdays:disableWeekdays=null,enableTime:enableTime=false,error:error,format:format="m/d/Y",hideIcon:hideIcon=false,hideLabel:hideLabel=false,htmlOptions:htmlOptions={},id:id,initializeOnce:initializeOnce=false,inLine:inLine=false,inputAria:inputAria={},inputData:inputData={},inputOnChange:inputOnChange,inputValue:inputValue,label:label="Date Picker",maxDate:maxDate,minDate:minDate,mode:mode="single",name:name,onChange:onChange=()=>{},onClose:onClose,pickerId:pickerId,placeholder:placeholder="Select Date",plugins:plugins=false,position:position,positionElement:positionElement,scrollContainer:scrollContainer,selectionType:selectionType="",showTimezone:showTimezone=false,staticPosition:staticPosition=true,thisRangesEndToday:thisRangesEndToday=false,yearRange:yearRange=[1900,2100],controlsStartId:controlsStartId,controlsEndId:controlsEndId,syncStartWith:syncStartWith,syncEndWith:syncEndWith}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const inputAriaProps=buildAriaProps(inputAria);const inputDataProps=buildDataProps(inputData);useEffect((()=>{datePickerHelper({allowInput:allowInput,customQuickPickDates:customQuickPickDates,defaultDate:defaultDate,disableDate:disableDate,disableRange:disableRange,disableWeekdays:disableWeekdays,enableTime:enableTime,format:format,maxDate:maxDate,minDate:minDate,mode:mode,onChange:onChange,onClose:onClose,pickerId:pickerId,plugins:plugins,position:position,positionElement:positionElement,selectionType:selectionType,showTimezone:showTimezone,staticPosition:staticPosition,thisRangesEndToday:thisRangesEndToday,yearRange:yearRange,controlsStartId:controlsStartId,controlsEndId:controlsEndId,syncStartWith:syncStartWith,syncEndWith:syncEndWith,required:false},scrollContainer)}),initializeOnce?[]:void 0);const filteredProps={...props};if(filteredProps.marginBottom===void 0){filteredProps.marginBottom="sm"}filteredProps==null?true:delete filteredProps.position;const classes=classnames(buildCss("pb_date_picker_kit"),globalProps(filteredProps),error?"error":null,className);const iconWrapperClass=()=>{let base="cal_icon_wrapper";if(dark){base+=" dark"}if(hideLabel){base+=" no_label_shift"}if(error){base+=" error"}return base};const angleDown=getAllIcons()["angleDown"].icon;return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:jsxs("div",{...inputAriaProps,...inputDataProps,className:"input_wrapper",children:[jsx(Caption,{className:"pb_date_picker_kit_label",text:hideLabel?null:label}),jsxs(Fragment,{children:[jsxs("div",{className:"date_picker_input_wrapper",children:[jsx("input",{autoComplete:"off",className:"date_picker_input",disabled:disableInput,id:pickerId,name:name,onChange:inputOnChange,placeholder:placeholder,value:inputValue}),error&&jsx(Body$1,{status:"negative",text:error,variant:null})]}),!hideIcon&&jsx("div",{className:iconWrapperClass(),id:`cal-icon-${pickerId}`,children:jsx(Icon,{className:"cal_icon",icon:"calendar-alt"})}),hideIcon&&inLine?jsxs("div",{children:[jsx("div",{className:`${iconWrapperClass()} date-picker-inline-icon-plus`,id:`${pickerId}-icon-plus`,children:jsx(Icon,{className:"date-picker-plus-icon",icon:"plus"})}),jsx("div",{className:`${iconWrapperClass()} date-picker-inline-angle-down`,id:`${pickerId}-angle-down`,children:jsx(Icon,{className:"angle_down_icon svg-inline--fa",customIcon:angleDown})})]}):null]})]})})};const dateTimestamp$1=(dateValue,includeYear)=>{if(includeYear){return`${DateTime$1.toMonth(dateValue)} ${DateTime$1.toDay(dateValue)}, ${DateTime$1.toYear(dateValue)}`}else{return`${DateTime$1.toMonth(dateValue)} ${DateTime$1.toDay(dateValue)}`}};const dateTimeIso$1=dateValue=>DateTime$1.toIso(dateValue);const DateRangeInline=props=>{const{align:align="left",className:className,dark:dark=false,data:data={},endDate:endDate,htmlOptions:htmlOptions={},icon:icon=false,size:size="sm",startDate:startDate}=props;const dateInCurrentYear=()=>{const currentDate=new Date;return(startDate==null?void 0:startDate.getFullYear())===(endDate==null?void 0:endDate.getFullYear())&&(startDate==null?void 0:startDate.getFullYear())===currentDate.getFullYear()};const dateRangeClasses=buildCss("pb_date_range_inline_kit",align);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const renderTime=date=>jsx("time",{dateTime:dateTimeIso$1(date),children:dateInCurrentYear()?` ${dateTimestamp$1(date,false)} `:` ${dateTimestamp$1(date,true)} `});return jsx("div",{...dataProps,...htmlProps,className:classnames(dateRangeClasses,globalProps(props),className),children:jsxs("div",{className:"pb_date_range_inline_wrapper",children:[size==="xs"&&jsxs(Fragment,{children:[icon&&jsx(Caption,{dark:dark,tag:"span",children:jsx(Icon,{className:"pb_date_range_inline_icon",dark:dark,fixedWidth:true,icon:"calendar-alt",size:size,tag:"span"})}),jsx(Caption,{dark:dark,tag:"span",children:renderTime(startDate)}),jsx(Caption,{dark:dark,tag:"span",children:jsx(Icon,{className:"pb_date_range_inline_arrow",dark:dark,fixedWidth:true,icon:"long-arrow-right",tag:"span"})}),jsx(Caption,{dark:dark,tag:"span",children:renderTime(endDate)})]}),size==="sm"&&jsxs(Fragment,{children:[icon&&jsx(Body$1,{color:"light",dark:dark,tag:"span",children:jsx(Icon,{className:"pb_date_range_inline_icon",dark:dark,fixedWidth:true,icon:"calendar-alt",size:size,tag:"span"})}),jsx(Body$1,{dark:dark,tag:"span",children:renderTime(startDate)}),jsx(Body$1,{color:"light",dark:dark,tag:"span",children:jsx(Icon,{className:"pb_date_range_inline_arrow",dark:dark,fixedWidth:true,icon:"long-arrow-right",tag:"span"})}),jsx(Body$1,{dark:dark,tag:"span",children:renderTime(endDate)})]})]})})};const DateYearStacked=props=>{const{align:align="left",className:className,dark:dark=false,date:date,data:data={},htmlOptions:htmlOptions={}}=props;const css=classnames(buildCss("pb_date_year_stacked",align),globalProps(props),className);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);return jsxs("div",{...dataProps,...htmlProps,className:css,children:[jsx(Title,{dark:dark,size:4,text:`${DateTime$1.toDay(date)} ${DateTime$1.toMonth(date).toUpperCase()}`}),jsx(Body$1,{color:"light",children:DateTime$1.toYear(date)})]})};const DateRangeStacked=props=>{const{className:className,dark:dark=false,endDate:endDate,htmlOptions:htmlOptions={},startDate:startDate,data:data={}}=props;const css=classnames(buildCss("pb_date_range_stacked"),globalProps(props),className);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);return jsx("div",{...dataProps,...htmlProps,className:css,children:jsxs(Flex,{vertical:"center",children:[jsx(FlexItem,{children:jsx(DateYearStacked,{align:"right",dark:dark,date:startDate})}),jsx(FlexItem,{children:jsx("div",{children:jsx(Body$1,{color:"light",tag:"span",children:jsx(Icon,{className:"pb_date_range_stacked_arrow",fixedWidth:true,icon:"long-arrow-right"})})})}),jsx(FlexItem,{children:jsx(DateYearStacked,{dark:dark,date:endDate})})]})})};const sizes={sm:4,md:3};const DateStacked=props=>{const{align:align="left",bold:bold=false,reverse:reverse=false,className:className,dark:dark=false,date:date,data:data={},htmlOptions:htmlOptions={},size:size="sm"}=props;const classes=classnames(buildCss("pb_date_stacked_kit",align,size,{dark:dark,reverse:reverse}),globalProps(props),className);const currentYear=(new Date).getFullYear();const inputYear=DateTime$1.toYear(date);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);return jsx(Fragment,{children:bold==false?jsxs("div",{...dataProps,...htmlProps,className:classes,children:[jsxs("div",{className:"pb_date_stacked_day_month",children:[jsx(Caption,{text:DateTime$1.toMonth(date).toUpperCase()}),jsx(Title,{dark:dark,size:sizes[size],text:DateTime$1.toDay(date).toString()})]}),currentYear!=inputYear&&jsx(Caption,{size:"xs",children:inputYear})]}):jsx("div",{...dataProps,...htmlProps,className:classes,children:jsxs("div",{className:"pb_date_stacked_day_month",children:[jsx(Title,{bold:true,dark:dark,size:"4",text:DateTime$1.toMonth(date)}),jsx(Title,{bold:true,dark:dark,size:"4",text:DateTime$1.toDay(date).toString()}),currentYear!=inputYear&&jsx(Title,{size:"4",children:inputYear})]})})})};const Time=props=>{const{align:align,className:className,date:date,htmlOptions:htmlOptions={},showIcon:showIcon,size:size,timeZone:timeZone,unstyled:unstyled=false,showTimezone:showTimezone=true}=props;const classes=classnames(buildCss("pb_time_kit",align,size),globalProps(props),className);const clockIcon=getAllIcons()["clock"];const htmlProps=buildHtmlProps(htmlOptions);return jsxs("div",{...htmlProps,className:classes,children:[showIcon&&(unstyled?jsxs("span",{children:[jsx(Icon,{className:"svg-inline--fa clock",customIcon:clockIcon.icon})," "]}):jsx(Fragment,{children:jsxs(Body$1,{color:"light",tag:"span",children:[jsx(Icon,{className:"svg-inline--fa clock",customIcon:clockIcon.icon,fixedWidth:true,size:size==="md"?"":"sm"})," "]})})),jsx("time",{dateTime:date.toLocaleString(),children:jsx("span",{children:unstyled?jsxs(Fragment,{children:[jsx("span",{children:DateTime$1.toTimeWithMeridiem(date,timeZone)})," ",showTimezone&&jsx("span",{children:DateTime$1.toTimeZone(date,timeZone)})]}):size==="md"?jsxs(Fragment,{children:[jsx(Body$1,{className:"pb_time",tag:"span",text:DateTime$1.toTimeWithMeridiem(date,timeZone)})," ",showTimezone&&jsx(Body$1,{color:"light",tag:"span",text:DateTime$1.toTimeZone(date,timeZone)})]}):jsxs(Fragment,{children:[jsx(Caption,{color:"light",tag:"span",text:DateTime$1.toTimeWithMeridiem(date,timeZone)})," ",showTimezone&&jsx(Caption,{color:"light",tag:"span",text:DateTime$1.toTimeZone(date,timeZone)})]})})})]})};const DateTime=props=>{const{align:align="left",aria:aria={},className:className,data:data={},htmlOptions:htmlOptions={},showDayOfWeek:showDayOfWeek=false,datetime:datetime2,id:id,showIcon:showIcon=false,size:size="md",timeZone:timeZone="America/New_York"}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_date_time",size),globalProps(props),className);return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:jsxs(Flex,{horizontal:align,vertical:"baseline",children:[jsx(PbDate,{showDayOfWeek:showDayOfWeek,size:size,value:datetime2}),jsx(Time,{date:datetime2,marginLeft:"sm",showIcon:showIcon,size:size,timeZone:timeZone})]})})};const TimeStackedDefault=props=>{if(props.date);const{align:align="left",className:className,dark:dark,data:data={},date:date,htmlOptions:htmlOptions={},time:time,timeZone:timeZone}=props;const classes=classnames(buildCss("pb_time_stacked_kit",align),globalProps(props),className);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);return jsx("div",{className:classes,...dataProps,...htmlProps,children:jsx(Body$1,{className:classnames("pb_time_stacked","time-spacing"),color:"light",dark:dark,children:jsxs("time",{children:[DateTime$1.toTimeWithMeridiem(date?date:new Date(time),timeZone),jsx(Caption,{className:"pb_time_stacked",color:"light",dark:dark,tag:"span",text:DateTime$1.toTimeZone(date?date:new Date(time),timeZone)})]})})})};const DateTimeStacked=props=>{if(props.date);const{date:date,datetime:datetime2,dark:dark,htmlOptions:htmlOptions={},timeZone:timeZone="America/New_York"}=props;const classes=buildCss("pb_date_time_stacked_kit",globalProps(props));const htmlProps=buildHtmlProps(htmlOptions);return jsxs(Flex,{inline:false,vertical:"stretch",...htmlProps,...props,children:[jsx(FlexItem,{children:jsx(DateStacked,{align:"right",bold:true,dark:dark,date:date||datetime2})}),jsx(SectionSeparator,{className:"date-time-padding",orientation:"vertical"}),jsx(FlexItem,{children:jsx(TimeStackedDefault,{className:classes,dark:dark,date:date||datetime2,timeZone:timeZone})})]})};var lib={exports:{}};var Modal$1={};var propTypes={exports:{}};var ReactPropTypesSecret_1;var hasRequiredReactPropTypesSecret;function requireReactPropTypesSecret(){if(hasRequiredReactPropTypesSecret)return ReactPropTypesSecret_1;hasRequiredReactPropTypesSecret=1;var ReactPropTypesSecret="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";ReactPropTypesSecret_1=ReactPropTypesSecret;return ReactPropTypesSecret_1}var factoryWithThrowingShims;var hasRequiredFactoryWithThrowingShims;function requireFactoryWithThrowingShims(){if(hasRequiredFactoryWithThrowingShims)return factoryWithThrowingShims;hasRequiredFactoryWithThrowingShims=1;var ReactPropTypesSecret=requireReactPropTypesSecret();function emptyFunction(){}function emptyFunctionWithReset(){}emptyFunctionWithReset.resetWarningCache=emptyFunction;factoryWithThrowingShims=function(){function shim(props,propName,componentName,location,propFullName,secret){if(secret===ReactPropTypesSecret){return}var err=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");err.name="Invariant Violation";throw err}shim.isRequired=shim;function getShim(){return shim}var ReactPropTypes={array:shim,bigint:shim,bool:shim,func:shim,number:shim,object:shim,string:shim,symbol:shim,any:shim,arrayOf:getShim,element:shim,elementType:shim,instanceOf:getShim,node:shim,objectOf:getShim,oneOf:getShim,oneOfType:getShim,shape:getShim,exact:getShim,checkPropTypes:emptyFunctionWithReset,resetWarningCache:emptyFunction};ReactPropTypes.PropTypes=ReactPropTypes;return ReactPropTypes};return factoryWithThrowingShims}var hasRequiredPropTypes;function requirePropTypes(){if(hasRequiredPropTypes)return propTypes.exports;hasRequiredPropTypes=1;{propTypes.exports=requireFactoryWithThrowingShims()()}return propTypes.exports}var ModalPortal={exports:{}};var focusManager={};var tabbable={exports:{}};var hasRequiredTabbable;function requireTabbable(){if(hasRequiredTabbable)return tabbable.exports;hasRequiredTabbable=1;(function(module,exports){Object.defineProperty(exports,"__esModule",{value:true});exports.default=findTabbableDescendants;
22
22
  /*!
23
23
  * Adapted from jQuery UI core
24
24
  *
@@ -1 +1 @@
1
- import"./_weekday_stacked-C16ua8Si.js";import"./lazysizes-B7xYodB-.js";import"./_typeahead-Db4YQA5c.js";import"./_line_graph-BfCo79KE.js";import"./lib-DnQyMxO1.js";import"react/jsx-runtime";import"react";import"react-dom";import"react-trix";import"trix";import"react-is";
1
+ import"./_weekday_stacked-DfH_cGOX.js";import"./lazysizes-B7xYodB-.js";import"./_typeahead-Db4YQA5c.js";import"./_line_graph-BfCo79KE.js";import"./lib-DnQyMxO1.js";import"react/jsx-runtime";import"react";import"react-dom";import"react-trix";import"trix";import"react-is";