playbook_ui 18.1.0.pre.rc.3 → 18.1.0.pre.rc.4

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: b509d67399d2f700fb0fdb9121ba71f5430009a0ad2d4c8c86b685cd904cf0d0
4
- data.tar.gz: ee187a8a1510f7c9c51c68dfa5532d250ddd96e6688384386a092890eb84a9d3
3
+ metadata.gz: 81d76f51de9e88ac32f50756b803e8a063264b582bc8e9797ef49e2dfba04867
4
+ data.tar.gz: 5a214970102ba6d3a2abe9a4e2342aaf4e79b2e1e55b8ad6acdd597580e678ce
5
5
  SHA512:
6
- metadata.gz: dcc3382e3c37957e7f805db7de2b4f78b9b03bb40e8b11d283519842af3790d016626ae63b194268033a196ce8ea0fce84c30c5a8f73b42f9901655db25d3009
7
- data.tar.gz: 315da4f419ed8096a01da8ef3d990dce428f4b60fc810e82cfb1c051f34e928ea4d7b3b8ccae5d7076eb61803cbf79526703a4a5a38b573b286fa6ea7be2a541
6
+ metadata.gz: 7ca0873a34437139622dca8b4848cde6f266bfb059caa97af140a2226e327772bea439c0b90140e9dba01f32082ee6cf8ea066ad1c626a77ea5de7e9efcf88a5
7
+ data.tar.gz: af0f9628b3defe688b29dacf8beffb13e37235c30e92e1eb6b6cf4af96708ed1c4d0a072704ecb990ae74bd8759b0cbb1dae5a81d2ddea2322cad39a90ebfca3
@@ -52,6 +52,7 @@ type DatePickerProps = {
52
52
  allowInput?: boolean,
53
53
  aria?: { [key: string]: string },
54
54
  className?: string,
55
+ closeOnSelect?: boolean,
55
56
  customQuickPickDates: { override: boolean, dates: any[] },
56
57
  dark?: boolean,
57
58
  data?: { [key: string]: string },
@@ -103,6 +104,7 @@ const DatePicker = (props: DatePickerProps): React.ReactElement => {
103
104
  allowInput = false,
104
105
  aria = {},
105
106
  className,
107
+ closeOnSelect = true,
106
108
  customQuickPickDates,
107
109
  dark = false,
108
110
  data = {},
@@ -180,6 +182,7 @@ const DatePicker = (props: DatePickerProps): React.ReactElement => {
180
182
  useEffect(() => {
181
183
  datePickerHelper({
182
184
  allowInput,
185
+ closeOnSelect,
183
186
  customQuickPickDates,
184
187
  defaultDate: normalizedDefaultDate,
185
188
  disableDate,
@@ -91,6 +91,8 @@ module Playbook
91
91
  default: "pointer"
92
92
  prop :year_ascending, type: Playbook::Props::Boolean,
93
93
  default: false
94
+ prop :close_on_select, type: Playbook::Props::Boolean,
95
+ default: true
94
96
 
95
97
  def classname
96
98
  default_margin_bottom = margin_bottom.present? ? "" : " mb_sm"
@@ -101,6 +103,7 @@ module Playbook
101
103
  def date_picker_config
102
104
  {
103
105
  allowInput: allow_input,
106
+ closeOnSelect: close_on_select,
104
107
  customQuickPickDates: custom_quick_pick_dates,
105
108
  defaultDate: default_date,
106
109
  disableDate: disable_date,
@@ -510,4 +510,18 @@ describe('DatePicker Kit', () => {
510
510
  )
511
511
  })
512
512
  })
513
+
514
+ test('passes closeOnSelect to flatpickr', async () => {
515
+ render(
516
+ <DatePicker
517
+ closeOnSelect={false}
518
+ pickerId="date-picker-close-on-select"
519
+ />
520
+ )
521
+
522
+ await waitFor(() => {
523
+ const input = document.getElementById('date-picker-close-on-select')
524
+ expect(input._flatpickr.config.closeOnSelect).toBe(false)
525
+ })
526
+ })
513
527
  })
@@ -0,0 +1,5 @@
1
+ <%= pb_rails("date_picker", props: {
2
+ close_on_select: false,
3
+ default_date: DateTime.now.utc.iso8601,
4
+ picker_id: "date-picker-close-on-select"
5
+ }) %>
@@ -0,0 +1,21 @@
1
+ import React from 'react'
2
+
3
+ import DatePicker from '../_date_picker'
4
+
5
+ const DEFAULT_DATE = new Date()
6
+
7
+ const DatePickerCloseOnSelect = (props) => {
8
+ return (
9
+ <>
10
+ <DatePicker
11
+ closeOnSelect={false}
12
+ defaultDate={DEFAULT_DATE}
13
+ initializeOnce
14
+ pickerId="date-picker-close-on-select"
15
+ {...props}
16
+ />
17
+ </>
18
+ )
19
+ }
20
+
21
+ export default DatePickerCloseOnSelect
@@ -0,0 +1,3 @@
1
+ When `closeOnSelect` / `close_on_select` is set to `false`, the DatePicker remains open after a date is selected and closes when the user clicks outside it. The prop defaults to `true`.
2
+
3
+ In React, use `initializeOnce` when the change handler updates state so that rerendering does not reinitialize and close the DatePicker.
@@ -3,6 +3,7 @@
3
3
  "propTargets": {},
4
4
  "defaults": {
5
5
  "allowInput": false,
6
+ "closeOnSelect": true,
6
7
  "dark": false,
7
8
  "defaultDate": "",
8
9
  "disableInput": false,
@@ -33,6 +33,7 @@ examples:
33
33
  - date_picker_positions: Custom Positions
34
34
  - date_picker_positions_element: Custom Position (based on element)
35
35
  - date_picker_required_indicator: Required Indicator
36
+ - date_picker_close_on_select: Close on Select
36
37
  - date_picker_turbo_frames: Within Turbo Frames
37
38
 
38
39
  react:
@@ -68,4 +69,5 @@ examples:
68
69
  - date_picker_positions: Custom Positions
69
70
  - date_picker_positions_element: Custom Position (based on element)
70
71
  - date_picker_required_indicator: Required Indicator
72
+ - date_picker_close_on_select: Close on Select
71
73
  - date_picker_dialog_submission: Dialog Form Submission
@@ -31,3 +31,4 @@ export { default as DatePickerAndDropdownRange } from './_date_picker_and_dropdo
31
31
  export { default as DatePickerRequiredIndicator } from "./_date_picker_required_indicator.jsx";
32
32
  export { default as DatePickerDialogSubmission } from "./_date_picker_dialog_submission.jsx";
33
33
  export { default as DatePickerYearAsc } from './_date_picker_year_asc.jsx'
34
+ export { default as DatePickerCloseOnSelect } from './_date_picker_close_on_select.jsx'
@@ -15,6 +15,14 @@
15
15
  ],
16
16
  "default": false
17
17
  },
18
+ "closeOnSelect": {
19
+ "type": "boolean",
20
+ "platforms": [
21
+ "react",
22
+ "rails"
23
+ ],
24
+ "default": true
25
+ },
18
26
  "customQuickPickDates": {
19
27
  "type": "GenericObject",
20
28
  "platforms": [
@@ -21,7 +21,7 @@ const nextValue = (value: SortValue[], name: string): SortValue => {
21
21
  }
22
22
 
23
23
  const directionIcon = (dir: Direction) => (
24
- dir == 'asc' ? 'arrow-up-short-wide' : 'arrow-down-wide-short'
24
+ dir == 'asc' ? 'arrow-up-wide-short' : 'arrow-down-short-wide'
25
25
  )
26
26
 
27
27
  const renderOptions = (options: SortOptions, value: SortValue[], handleChange: (arg0: SortValue) => void) => (
@@ -115,9 +115,9 @@ module Playbook
115
115
  def sort_icon(direction)
116
116
  case direction
117
117
  when "asc"
118
- "arrow-up-short-wide"
118
+ "arrow-up-wide-short"
119
119
  when "desc"
120
- "arrow-down-wide-short"
120
+ "arrow-down-short-wide"
121
121
  else
122
122
  ""
123
123
  end
@@ -3972,6 +3972,14 @@
3972
3972
  ],
3973
3973
  "default": false
3974
3974
  },
3975
+ "closeOnSelect": {
3976
+ "type": "boolean",
3977
+ "platforms": [
3978
+ "react",
3979
+ "rails"
3980
+ ],
3981
+ "default": true
3982
+ },
3975
3983
  "customQuickPickDates": {
3976
3984
  "type": "GenericObject",
3977
3985
  "platforms": [
data/dist/ai/forms.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "metadataVersion": 1,
3
- "version": "18.1.0-rc.3",
3
+ "version": "18.1.0-rc.4",
4
4
  "builder": {
5
5
  "class": "Playbook::Forms::Builder",
6
6
  "helper": "pb_form_with",
data/dist/ai/index.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
- "version": "18.1.0-rc.3",
2
+ "version": "18.1.0-rc.4",
3
3
  "metadataVersion": 1,
4
4
  "forms": "forms.json",
5
- "generated": "2026-09-29T19:46:50.397Z",
5
+ "generated": "2026-10-02T20:48:38.790Z",
6
6
  "schemas": {
7
7
  "globalProps": "global-props.schema.json",
8
8
  "globalEventProps": "global-event-props.schema.json",
@@ -15,6 +15,14 @@
15
15
  ],
16
16
  "default": false
17
17
  },
18
+ "closeOnSelect": {
19
+ "type": "boolean",
20
+ "platforms": [
21
+ "react",
22
+ "rails"
23
+ ],
24
+ "default": true
25
+ },
18
26
  "customQuickPickDates": {
19
27
  "type": "GenericObject",
20
28
  "platforms": [
@@ -1 +1 @@
1
- import{jsx,Fragment,jsxs}from"react/jsx-runtime";import*as React from"react";import React__default,{forwardRef,useRef,useEffect,createContext,useContext,useState,useCallback,useMemo}from"react";import{i as isValidEmoji,F as Flex,I as Icon,C as Caption,B as Body,b as Draggable,c as DialogContext,d as Title,a as Card,e as Image,D as Detail}from"./_detail-BqqzPTNr.js";import{b as buildAriaProps,a as buildDataProps,c as buildHtmlProps,d as classnames,g as globalProps,e as buildCss,n as noop,f as globalInlineProps}from"./globalProps-K1DCn3il.js";import{U as getAllIcons,V as spacing,c as colors,W as useCollapsible,X as DateTime,g as getDefaultExportFromCjs,y as createPopper,Y as uniqueId,Z as isPortaledFloatingKitInteraction,H as PB_FLOATING_OWNER_ATTR,_ as resolveFullscreenOverlayForElement,z as flatpickr,$ as omitBy,a0 as isEmpty,a1 as map,a2 as partial,a3 as find}from"./lib-7vm9BMqp.js";import*as ReactDOM from"react-dom";import ReactDOM__default from"react-dom";const buttonClassName=props=>{const{disabled:disabled=false,fullWidth:fullWidth=false,highlight:highlight,icon:icon,loading:loading=false,type:type="inline",variant:variant="primary",size:size=null,text:text,children:children}=props;const classNames=["pb_button_kit"];const isIconOnly=icon&&!text&&!children&&variant!=="reaction";if(variant)classNames.push(`pb_button_${variant}`);if(type)classNames.push(`pb_button_${type}`);if(fullWidth)classNames.push("pb_button_block");classNames.push(disabled?"pb_button_disabled":"pb_button_enabled");if(loading)classNames.push("pb_button_loading");if(size)classNames.push(`pb_button_size_${size}`);if(variant==="reaction"&&icon&&!isValidEmoji(icon))classNames.push("pb_button_reaction_default");if(variant==="reaction"&&highlight)classNames.push("pb_button_active");if(isIconOnly)classNames.push("pb_button_icon_only");return classNames.join(" ")};const spinnerIcon=getAllIcons()["spinner"];const Button=props=>{const{aria:aria={},children:children,className:className,count:count,data:data={},disabled:disabled,htmlOptions:htmlOptions={},icon:icon=null,iconRight:iconRight=false,id:id,loading:loading=false,onClick:onClick,tabIndex:tabIndex,link:link=null,newWindow:newWindow=false,target:target="",text:text,htmlType:htmlType="button",value:value,variant:variant,form:form=null}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const css=classnames(buttonClassName(props),globalProps(props),className);const loadingIcon=jsx("div",{className:"loading-icon",children:jsx(Icon,{className:"svg-inline--fa",customIcon:spinnerIcon.icon,fixedWidth:true,pulse:true})});const content=jsxs("span",{className:"pb_button_content",children:[icon&&!iconRight&&jsx(Icon,{className:"button_with_icon",icon:icon}),jsx("span",{children:text||children}),icon&&iconRight&&jsx(Icon,{className:"button_with_icon_right",icon:icon})]});const ifLoading=()=>{if(loading){return jsx(Fragment,{children:loadingIcon})}else{return content}};const getTargetAttribute=()=>{if(target&&link){return target}else if(newWindow){return"_blank"}return null};const displayButton=()=>{if(link){return jsx("a",{...ariaProps,...dataProps,...htmlProps,className:css,href:link,id:id,rel:target!=="child"?"noreferrer":null,role:"link",tabIndex:tabIndex,target:getTargetAttribute(),children:ifLoading()})}else if(variant==="reaction"){return jsxs("button",{...ariaProps,...dataProps,...htmlProps,className:css,disabled:disabled,form:form,id:id,onClick:onClick,role:"button",tabIndex:tabIndex,type:htmlType,value:value,children:[icon&&isValidEmoji(icon)&&jsxs(Flex,{align:"center",children:[jsx(Icon,{icon:icon}),count&&jsx(Caption,{paddingLeft:"xxs",size:"xs",children:count})]}),!isValidEmoji(icon)&&jsx(Icon,{icon:icon?icon:"face-smile-plus"})]})}else{return jsx("button",{...ariaProps,...dataProps,...htmlProps,className:css,disabled:disabled,form:form,id:id,onClick:onClick,role:"button",tabIndex:tabIndex,type:htmlType,value:value,children:ifLoading()})}};return jsx(Fragment,{children:displayButton()})};const Checkbox=forwardRef(((props,ref)=>{const{aria:aria={},checked:checked=false,children:children,className:className,dark:dark=false,data:data={},disabled:disabled=false,error:error=false,htmlOptions:htmlOptions={},id:id,indeterminate:indeterminate=false,name:name="",onChange:onChange=()=>{},requiredIndicator:requiredIndicator=false,tabIndex:tabIndex,text:text="",value:value=""}=props;const internalRef=useRef(null);const setRefs=el=>{internalRef.current=el;if(typeof ref==="function"){ref(el)}else if(ref){ref.current=el}};const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_checkbox_kit",checked?"checked":null,error?"error":null,indeterminate?"indeterminate":null),globalProps(props),className);useEffect((()=>{if(internalRef.current){internalRef.current.checked=checked;internalRef.current.indeterminate=indeterminate}}),[indeterminate,checked]);const checkboxChildren=()=>{if(children)return children;else return jsx("input",{defaultChecked:checked,disabled:disabled,name:name,onChange:onChange,ref:setRefs,tabIndex:tabIndex,type:"checkbox",value:value})};return jsxs("label",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:[jsx(Fragment,{children:checkboxChildren()}),!indeterminate&&jsx("span",{className:"pb_checkbox_checkmark",children:jsx(Icon,{className:"check_icon",fixedWidth:true,icon:"check"})}),indeterminate&&jsx("span",{className:"pb_checkbox_indeterminate",children:jsx(Icon,{className:"indeterminate_icon",fixedWidth:true,icon:"minus"})}),jsxs(Body,{className:"pb_checkbox_label",dark:dark,status:error?"negative":null,variant:null,children:[text,requiredIndicator&&jsx("span",{"aria-hidden":"true",className:"pb_required_indicator",style:{color:colors.error,marginLeft:spacing.space_xs},children:"*"})]})]})}));Checkbox.displayName="Checkbox";const CircleIconButton=props=>{const{aria:aria={},className:className,dark:dark,data:data={},disabled:disabled,htmlOptions:htmlOptions={},icon:icon,id:id,loading:loading=false,onClick:onClick=noop,type:type,target:target,link:link,newWindow:newWindow,variant:variant,size:size="default"}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const sizeClass=size==="sm"?"size_small":"";const classes=classnames(buildCss("pb_circle_icon_button_kit"),sizeClass,globalProps(props),className);return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:jsx(Button,{aria:aria,dark:dark,disabled:disabled,htmlType:type,link:link,loading:loading,newWindow:newWindow,onClick:onClick,target:target,text:null,variant:variant,children:jsx(Icon,{fixedWidth:true,htmlOptions:{"aria-hidden":true},icon:icon})})})};const showElement=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.classList.add("is-visible")}elem.style.height="";elem.style.overflow="visible"}),300)};const hideElement=elem=>{elem.style.height=elem.scrollHeight+"px";window.setTimeout((()=>{elem.style.height="0";elem.style.paddingTop="0";elem.style.paddingBottom="0";elem.style.overflow="hidden"}),1);window.setTimeout((()=>{elem.classList.remove("is-visible");elem.style.overflow=""}),300)};const CollapsibleContext=createContext({});const CollapsibleContent=({children:children,className:className,...props})=>{const context=useContext(CollapsibleContext);const contentCSS=buildCss("pb_collapsible_content_kit");const contentSpacing=globalProps(props);const contentRef=useRef(null);useEffect((()=>{if(contentRef.current){if(context.collapsed){hideElement(contentRef.current)}else{showElement(contentRef.current)}}}),[context.collapsed]);return jsx("div",{className:classnames(contentCSS,contentSpacing,"toggle-content",className),"data-collapsible-content":"true",ref:contentRef,children:children})};const FlexItem=props=>{const{children:children,className:className,fixedSize:fixedSize,grow:grow,htmlOptions:htmlOptions={},shrink:shrink,flex:flex="none",order:order="none",alignSelf:alignSelf,displayFlex:displayFlex}=props;const growClass=grow===true?"pb_flex_item_kit_grow":"";const displayFlexClass=displayFlex===true?"pb_flex_item_kit_display_flex":"";const flexClass=flex!=="none"?`pb_flex_item_kit_flex_${flex}`:"";const shrinkClass=shrink===true?"pb_flex_item_kit_shrink":"";const alignSelfClass=alignSelf?`pb_flex_item_kit_align_self_${alignSelf}`:"";const fixedStyle=fixedSize!==void 0?{flexBasis:`${fixedSize}`}:null;const orderClass=order!=="none"?`pb_flex_item_kit_order_${order}`:"";const dynamicInlineProps=globalInlineProps(props);const{style:htmlStyle,...htmlOptionsWithoutStyle}=htmlOptions;const htmlStyleObj=htmlStyle&&typeof htmlStyle==="object"?htmlStyle:{};const combinedStyles={...htmlStyleObj,...fixedStyle,...dynamicInlineProps};const htmlProps=buildHtmlProps(htmlOptionsWithoutStyle);return jsx("div",{...htmlProps,className:classnames("pb_flex_item_kit",growClass,shrinkClass,flexClass,displayFlexClass,orderClass,alignSelfClass,globalProps(props),className),style:combinedStyles,children:children})};const colorMap={default:"text_lt_default",light:"text_lt_light",lighter:"text_lt_lighter",link:"primary",error:"error",success:"text_dk_success_sm"};const CollapsibleIcon=({collapsed:collapsed,icon:icon,iconSize:iconSize,iconColor:iconColor,onIconClick:onIconClick})=>{const color=colorMap[iconColor];const showIcon=icon2=>{if(icon2==="none"){return[]}else if(typeof icon2==="string"){return[icon2,icon2]}return icon2};const handleIconClick=e=>{if(onIconClick){e.stopPropagation();onIconClick()}};return jsx(Fragment,{children:icon!=="none"?collapsed?jsx("div",{className:"icon_wrapper",onClick:e=>handleIconClick(e),style:{verticalAlign:"middle"},children:jsx(Icon,{color:color,icon:icon?showIcon(icon)[0]:"chevron-down",size:iconSize})},icon?showIcon(icon)[0]:"chevron-down"):jsx("div",{className:"icon_wrapper",onClick:e=>handleIconClick(e),style:{verticalAlign:"middle"},children:jsx(Icon,{color:color,icon:icon?showIcon(icon)[1]:"chevron-up",size:iconSize})},icon?showIcon(icon)[1]:"chevron-up"):jsx("div",{})})};const CollapsibleMain=({children:children,className:className,cursor:cursor="pointer",...props})=>{const{collapsed:collapsed,toggle:toggle,icon:icon,iconSize:iconSize,iconColor:iconColor,onIconClick:onIconClick,onClick:onClick}=useContext(CollapsibleContext);const mainCSS=buildCss("pb_collapsible_main_kit");const mainSpacing=globalProps(props,{cursor:cursor});const handleCollapsibleClick=()=>{onClick&&onClick();const disableToggle=onClick&&onClick();if(disableToggle!==true){toggle()}};return jsx("div",{className:classnames(mainCSS,mainSpacing,className),children:jsx("div",{onClick:handleCollapsibleClick,children:jsxs(Flex,{spacing:"between",vertical:"center",children:[jsx(FlexItem,{children:children}),jsx(FlexItem,{children:jsx(CollapsibleIcon,{collapsed:collapsed,icon:icon,iconColor:iconColor,iconSize:iconSize,onIconClick:onIconClick})})]})})})};const Collapsible=({aria:aria={},className:className,children:children,collapsed:collapsed=true,data:data={},htmlOptions:htmlOptions={},icon:icon,iconColor:iconColor="default",iconSize:iconSize,onIconClick:onIconClick,onClick:onClick,id:id,tag:tag="div",...props})=>{const[isCollapsed,toggle,setIsCollapsed]=useCollapsible(collapsed);useEffect((()=>{setIsCollapsed(collapsed)}),[collapsed]);if(children.length!==2){throw new Error("Collapsible requires <CollapsibleMain> and <CollapsibleContent> to function properly.")}const FirstChild=children[0];const Main=FirstChild.type===CollapsibleMain?FirstChild:null;const Content=children[1];const{children:mainChildren=null,...mainProps}=Main?Main.props:{};const{children:contentChildren,...contentProps}=Content.props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_collapsible_kit"),globalProps(props),className);const dynamicInlineProps=globalInlineProps(props);const Tag=`${tag}`;return jsx(CollapsibleContext.Provider,{value:{collapsed:isCollapsed,toggle:toggle,icon:icon,iconSize:iconSize,iconColor:iconColor,onIconClick:onIconClick,onClick:onClick},children:jsxs(Tag,{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,style:dynamicInlineProps,children:[Main?jsx(CollapsibleMain,{...mainProps,children:mainChildren}):FirstChild,jsx(CollapsibleContent,{...contentProps,children:contentChildren})]})})};Collapsible.Main=CollapsibleMain;Collapsible.Content=CollapsibleContent;Collapsible.Icon=CollapsibleIcon;const SectionSeparator=props=>{const{aria:aria={},children:children,className:className,color:color="default",data:data={},htmlOptions:htmlOptions={},id:id,lineStyle:lineStyle="solid",orientation:orientation="horizontal",text:text,dark:dark=false,variant:variant="card"}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames("pb_section_separator_kit",`pb_section_separator_${variant}`,`pb_section_separator_${orientation}`,lineStyle==="dashed"?"pb_section_separator_dashed":"pb_section_separator_solid",color!=="default"?`pb_section_separator_color_${color}`:"pb_section_separator_color_default",globalProps(props),className);const dynamicInlineProps=globalInlineProps(props);return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,style:dynamicInlineProps,children:children&&children||text&&jsx("span",{children:jsx(Caption,{dark:dark,text:text})})})};var warning_1;var hasRequiredWarning;function requireWarning(){if(hasRequiredWarning)return warning_1;hasRequiredWarning=1;var warning2=function(){};warning_1=warning2;return warning_1}const List=props=>{const{aria:aria={},borderless:borderless=false,children:children,className:className,dark:dark=false,data:data={},enableDrag:enableDrag=false,htmlOptions:htmlOptions={},id:id,layout:layout="",ordered:ordered=false,role:role,size:size="",tabIndex:tabIndex,xpadding:xpadding=false,variant:variant,text:text}=props;const layoutClass={left:"layout_left",right:"layout_right",default:""};const childrenWithProps=React__default.Children.map(children,(child=>React__default.cloneElement(child,{text:text,variant:variant,enableDrag:enableDrag})));const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_list_kit",layoutClass[layout],size,{dark:dark,borderless:borderless,ordered:ordered,xpadding:xpadding}),globalProps(props),className);return jsx(Fragment,{children:enableDrag?jsx(Draggable.Container,{children:jsx("div",{className:classes,children:ordered?jsx("ol",{...ariaProps,...dataProps,...htmlProps,className:className,id:id,role:role,tabIndex:tabIndex,children:childrenWithProps}):jsx("ul",{...ariaProps,...dataProps,...htmlProps,className:className,id:id,role:role,tabIndex:tabIndex,children:childrenWithProps})})}):jsx("div",{className:classes,children:ordered?jsx("ol",{...ariaProps,...dataProps,...htmlProps,className:className,id:id,role:role,tabIndex:tabIndex,children:childrenWithProps}):jsx("ul",{...ariaProps,...dataProps,...htmlProps,className:className,id:id,role:role,tabIndex:tabIndex,children:childrenWithProps})})})};const ListItem=props=>{const{aria:aria={},children:children,className:className,data:data={},enableDrag:enableDrag,dragId:dragId,dragHandle:dragHandle=true,htmlOptions:htmlOptions={},id:id,tabIndex:tabIndex}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_item_kit"),globalProps(props),className);return jsx(Fragment,{children:enableDrag?jsx(Draggable.Item,{dragId:dragId,children:jsxs("li",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,tabIndex:tabIndex,children:[dragHandle&&jsx("span",{className:"pb_draggable_handle",style:{verticalAlign:"middle"},children:jsx(Body,{color:"light",children:jsx(Icon,{icon:"grip-dots-vertical",verticalAlign:"middle"})})}),children]})}):jsx("li",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,tabIndex:tabIndex,children:children})})};const calculateDateRange=(timePeriod,amount)=>{const endDate=new Date;const startDate=new Date;switch(timePeriod){case"days":startDate.setDate(endDate.getDate()-amount);break;case"weeks":startDate.setDate(endDate.getDate()-amount*7);break;case"months":startDate.setMonth(endDate.getMonth()-amount);break;case"quarters":startDate.setMonth(endDate.getMonth()-amount*3);break;case"years":startDate.setFullYear(endDate.getFullYear()-amount);break;default:throw new Error("Invalid time period")}return[startDate,endDate]};const formatDate=date=>{const day=String(date.getDate()).padStart(2,"0");const month=String(date.getMonth()+1).padStart(2,"0");const year=date.getFullYear();return`${month}/${day}/${year}`};const createOptionFromCustomDate=customDate=>{let dateRange;if(Array.isArray(customDate.value)){dateRange=customDate.value.map((dateStr=>new Date(dateStr)))}else{dateRange=calculateDateRange(customDate.value.timePeriod,customDate.value.amount)}return{label:customDate.label,value:dateRange,formattedStartDate:formatDate(dateRange[0]),formattedEndDate:formatDate(dateRange[1]),id:`quickpick-${customDate.label.toLowerCase().replace(/\s+/g,"-")}`}};const getQuickPickOptions=(rangeEndsToday=false,customQuickPickDates)=>{const today=new Date;const yesterday=DateTime.getYesterdayDate(new Date);const thisWeekStartDate=DateTime.getFirstDayOfWeek(new Date);const thisWeekEndDate=rangeEndsToday?new Date:DateTime.getLastDayOfWeek(new Date);const lastWeekStartDate=DateTime.getPreviousWeekStartDate(new Date);const lastWeekEndDate=DateTime.getPreviousWeekEndDate(new Date);const thisMonthStartDate=DateTime.getMonthStartDate(new Date);const thisMonthEndDate=rangeEndsToday?new Date:DateTime.getMonthEndDate(new Date);const lastMonthStartDate=DateTime.getPreviousMonthStartDate(new Date);const lastMonthEndDate=DateTime.getPreviousMonthEndDate(new Date);const thisQuarterStartDate=DateTime.getQuarterStartDate(new Date);const thisQuarterEndDate=rangeEndsToday?new Date:DateTime.getQuarterEndDate(new Date);const lastQuarterStartDate=DateTime.getPreviousQuarterStartDate(new Date);const lastQuarterEndDate=DateTime.getPreviousQuarterEndDate(new Date);const thisYearStartDate=DateTime.getYearStartDate(new Date);const thisYearEndDate=rangeEndsToday?new Date:DateTime.getYearEndDate(new Date);const lastYearStartDate=DateTime.getPreviousYearStartDate(new Date);const lastYearEndDate=DateTime.getPreviousYearEndDate(new Date);const defaultOptions=[{label:"Today",value:[today,today],id:"quickpick-today"},{label:"Yesterday",value:[yesterday,yesterday],formattedStartDate:`${formatDate(yesterday)}`,formattedEndDate:`${formatDate(yesterday)}`,id:"quickpick-yesterday"},{label:"This Week",value:[thisWeekStartDate,thisWeekEndDate],formattedStartDate:`${formatDate(thisWeekStartDate)}`,formattedEndDate:`${formatDate(thisWeekEndDate)}`,id:"quickpick-this-week"},{label:"This Month",value:[thisMonthStartDate,thisMonthEndDate],formattedStartDate:`${formatDate(thisMonthStartDate)}`,formattedEndDate:`${formatDate(thisMonthEndDate)}`,id:"quickpick-this-month"},{label:"This Quarter",value:[thisQuarterStartDate,thisQuarterEndDate],formattedStartDate:`${formatDate(thisQuarterStartDate)}`,formattedEndDate:`${formatDate(thisQuarterEndDate)}`,id:"quickpick-this-quarter"},{label:"This Year",value:[thisYearStartDate,thisYearEndDate],formattedStartDate:`${formatDate(thisYearStartDate)}`,formattedEndDate:`${formatDate(thisYearEndDate)}`,id:"quickpick-this-year"},{label:"Last Week",value:[lastWeekStartDate,lastWeekEndDate],formattedStartDate:`${formatDate(lastWeekStartDate)}`,formattedEndDate:`${formatDate(lastWeekEndDate)}`,id:"quickpick-last-week"},{label:"Last Month",value:[lastMonthStartDate,lastMonthEndDate],formattedStartDate:`${formatDate(lastMonthStartDate)}`,formattedEndDate:`${formatDate(lastMonthEndDate)}`,id:"quickpick-last-month"},{label:"Last Quarter",value:[lastQuarterStartDate,lastQuarterEndDate],formattedStartDate:`${formatDate(lastQuarterStartDate)}`,formattedEndDate:`${formatDate(lastQuarterEndDate)}`,id:"quickpick-last-quarter"},{label:"Last Year",value:[lastYearStartDate,lastYearEndDate],formattedStartDate:`${formatDate(lastYearStartDate)}`,formattedEndDate:`${formatDate(lastYearEndDate)}`,id:"quickpick-last-year"}];if(customQuickPickDates&&customQuickPickDates.dates&&customQuickPickDates.dates.length>0){const customOptions=customQuickPickDates.dates.map(createOptionFromCustomDate);if(customQuickPickDates.override===false){return[...defaultOptions,...customOptions]}return customOptions}return defaultOptions};var ManagerReferenceNodeContext=React.createContext();var ManagerReferenceNodeSetterContext=React.createContext();function Manager(_ref){var children=_ref.children;var _React$useState=React.useState(null),referenceNode=_React$useState[0],setReferenceNode=_React$useState[1];var hasUnmounted=React.useRef(false);React.useEffect((function(){return function(){hasUnmounted.current=true}}),[]);var handleSetReferenceNode=React.useCallback((function(node){if(!hasUnmounted.current){setReferenceNode(node)}}),[]);return React.createElement(ManagerReferenceNodeContext.Provider,{value:referenceNode},React.createElement(ManagerReferenceNodeSetterContext.Provider,{value:handleSetReferenceNode},children))}var unwrapArray=function unwrapArray2(arg){return Array.isArray(arg)?arg[0]:arg};var safeInvoke=function safeInvoke2(fn){if(typeof fn==="function"){for(var _len=arguments.length,args=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){args[_key-1]=arguments[_key]}return fn.apply(void 0,args)}};var setRef=function setRef2(ref,node){if(typeof ref==="function"){return safeInvoke(ref,node)}else if(ref!=null){ref.current=node}};var fromEntries=function fromEntries2(entries){return entries.reduce((function(acc,_ref){var key=_ref[0],value=_ref[1];acc[key]=value;return acc}),{})};var useIsomorphicLayoutEffect=typeof window!=="undefined"&&window.document&&window.document.createElement?React.useLayoutEffect:React.useEffect;var reactFastCompare;var hasRequiredReactFastCompare;function requireReactFastCompare(){if(hasRequiredReactFastCompare)return reactFastCompare;hasRequiredReactFastCompare=1;var hasElementType=typeof Element!=="undefined";var hasMap=typeof Map==="function";var hasSet=typeof Set==="function";var hasArrayBuffer=typeof ArrayBuffer==="function"&&!!ArrayBuffer.isView;function equal(a,b){if(a===b)return true;if(a&&b&&typeof a=="object"&&typeof b=="object"){if(a.constructor!==b.constructor)return false;var length,i,keys;if(Array.isArray(a)){length=a.length;if(length!=b.length)return false;for(i=length;i--!==0;)if(!equal(a[i],b[i]))return false;return true}var it;if(hasMap&&a instanceof Map&&b instanceof Map){if(a.size!==b.size)return false;it=a.entries();while(!(i=it.next()).done)if(!b.has(i.value[0]))return false;it=a.entries();while(!(i=it.next()).done)if(!equal(i.value[1],b.get(i.value[0])))return false;return true}if(hasSet&&a instanceof Set&&b instanceof Set){if(a.size!==b.size)return false;it=a.entries();while(!(i=it.next()).done)if(!b.has(i.value[0]))return false;return true}if(hasArrayBuffer&&ArrayBuffer.isView(a)&&ArrayBuffer.isView(b)){length=a.length;if(length!=b.length)return false;for(i=length;i--!==0;)if(a[i]!==b[i])return false;return true}if(a.constructor===RegExp)return a.source===b.source&&a.flags===b.flags;if(a.valueOf!==Object.prototype.valueOf)return a.valueOf()===b.valueOf();if(a.toString!==Object.prototype.toString)return a.toString()===b.toString();keys=Object.keys(a);length=keys.length;if(length!==Object.keys(b).length)return false;for(i=length;i--!==0;)if(!Object.prototype.hasOwnProperty.call(b,keys[i]))return false;if(hasElementType&&a instanceof Element)return false;for(i=length;i--!==0;){if((keys[i]==="_owner"||keys[i]==="__v"||keys[i]==="__o")&&a.$$typeof){continue}if(!equal(a[keys[i]],b[keys[i]]))return false}return true}return a!==a&&b!==b}reactFastCompare=function isEqual2(a,b){try{return equal(a,b)}catch(error){if((error.message||"").match(/stack|recursion/i)){console.warn("react-fast-compare cannot handle circular refs");return false}throw error}};return reactFastCompare}var reactFastCompareExports=requireReactFastCompare();const isEqual=getDefaultExportFromCjs(reactFastCompareExports);var EMPTY_MODIFIERS$1=[];var usePopper=function usePopper2(referenceElement,popperElement,options){if(options===void 0){options={}}var prevOptions=React.useRef(null);var optionsWithDefaults={onFirstUpdate:options.onFirstUpdate,placement:options.placement||"bottom",strategy:options.strategy||"absolute",modifiers:options.modifiers||EMPTY_MODIFIERS$1};var _React$useState=React.useState({styles:{popper:{position:optionsWithDefaults.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),state=_React$useState[0],setState=_React$useState[1];var updateStateModifier=React.useMemo((function(){return{name:"updateState",enabled:true,phase:"write",fn:function fn(_ref){var state2=_ref.state;var elements=Object.keys(state2.elements);ReactDOM.flushSync((function(){setState({styles:fromEntries(elements.map((function(element){return[element,state2.styles[element]||{}]}))),attributes:fromEntries(elements.map((function(element){return[element,state2.attributes[element]]})))})}))},requires:["computeStyles"]}}),[]);var popperOptions=React.useMemo((function(){var newOptions={onFirstUpdate:optionsWithDefaults.onFirstUpdate,placement:optionsWithDefaults.placement,strategy:optionsWithDefaults.strategy,modifiers:[].concat(optionsWithDefaults.modifiers,[updateStateModifier,{name:"applyStyles",enabled:false}])};if(isEqual(prevOptions.current,newOptions)){return prevOptions.current||newOptions}else{prevOptions.current=newOptions;return newOptions}}),[optionsWithDefaults.onFirstUpdate,optionsWithDefaults.placement,optionsWithDefaults.strategy,optionsWithDefaults.modifiers,updateStateModifier]);var popperInstanceRef=React.useRef();useIsomorphicLayoutEffect((function(){if(popperInstanceRef.current){popperInstanceRef.current.setOptions(popperOptions)}}),[popperOptions]);useIsomorphicLayoutEffect((function(){if(referenceElement==null||popperElement==null){return}var createPopper$1=options.createPopper||createPopper;var popperInstance=createPopper$1(referenceElement,popperElement,popperOptions);popperInstanceRef.current=popperInstance;return function(){popperInstance.destroy();popperInstanceRef.current=null}}),[referenceElement,popperElement,options.createPopper]);return{state:popperInstanceRef.current?popperInstanceRef.current.state:null,styles:state.styles,attributes:state.attributes,update:popperInstanceRef.current?popperInstanceRef.current.update:null,forceUpdate:popperInstanceRef.current?popperInstanceRef.current.forceUpdate:null}};var NOOP=function NOOP2(){return void 0};var NOOP_PROMISE=function NOOP_PROMISE2(){return Promise.resolve(null)};var EMPTY_MODIFIERS=[];function Popper(_ref){var _ref$placement=_ref.placement,placement=_ref$placement===void 0?"bottom":_ref$placement,_ref$strategy=_ref.strategy,strategy=_ref$strategy===void 0?"absolute":_ref$strategy,_ref$modifiers=_ref.modifiers,modifiers=_ref$modifiers===void 0?EMPTY_MODIFIERS:_ref$modifiers,referenceElement=_ref.referenceElement,onFirstUpdate=_ref.onFirstUpdate,innerRef=_ref.innerRef,children=_ref.children;var referenceNode=React.useContext(ManagerReferenceNodeContext);var _React$useState=React.useState(null),popperElement=_React$useState[0],setPopperElement=_React$useState[1];var _React$useState2=React.useState(null),arrowElement=_React$useState2[0],setArrowElement=_React$useState2[1];React.useEffect((function(){setRef(innerRef,popperElement)}),[innerRef,popperElement]);var options=React.useMemo((function(){return{placement:placement,strategy:strategy,onFirstUpdate:onFirstUpdate,modifiers:[].concat(modifiers,[{name:"arrow",enabled:arrowElement!=null,options:{element:arrowElement}}])}}),[placement,strategy,onFirstUpdate,modifiers,arrowElement]);var _usePopper=usePopper(referenceElement||referenceNode,popperElement,options),state=_usePopper.state,styles=_usePopper.styles,forceUpdate=_usePopper.forceUpdate,update=_usePopper.update;var childrenProps=React.useMemo((function(){return{ref:setPopperElement,style:styles.popper,placement:state?state.placement:placement,hasPopperEscaped:state&&state.modifiersData.hide?state.modifiersData.hide.hasPopperEscaped:null,isReferenceHidden:state&&state.modifiersData.hide?state.modifiersData.hide.isReferenceHidden:null,arrowProps:{style:styles.arrow,ref:setArrowElement},forceUpdate:forceUpdate||NOOP,update:update||NOOP_PROMISE}}),[setPopperElement,setArrowElement,placement,state,styles,update,forceUpdate]);return unwrapArray(children)(childrenProps)}var warningExports=requireWarning();const warning=getDefaultExportFromCjs(warningExports);function Reference(_ref){var children=_ref.children,innerRef=_ref.innerRef;var setReferenceNode=React.useContext(ManagerReferenceNodeSetterContext);var refHandler=React.useCallback((function(node){setRef(innerRef,node);safeInvoke(setReferenceNode,node)}),[innerRef,setReferenceNode]);React.useEffect((function(){return function(){return setRef(innerRef,null)}}),[]);React.useEffect((function(){warning(Boolean(setReferenceNode),"`Reference` should not be used outside of a `Manager` component.")}),[setReferenceNode]);return unwrapArray(children)({ref:refHandler})}const POPOVER_MODIFIERS={offset:{enabled:true,name:"offset",options:{offset:[0,20]},phase:"main"}};const popoverModifiers=({modifiers:modifiers,offset:offset})=>offset?modifiers.concat([POPOVER_MODIFIERS.offset]):modifiers;const getAppendTarget=(appendTo,targetId)=>{if(appendTo&&appendTo!=="body"){if(appendTo==="parent"){const referenceWrapper2=document.querySelector(`#reference-${targetId}`);if(referenceWrapper2==null?void 0:referenceWrapper2.parentElement){return referenceWrapper2.parentElement}}const selectorMatch=document.querySelector(appendTo);if(selectorMatch instanceof HTMLElement)return selectorMatch}const referenceWrapper=document.querySelector(`#reference-${targetId}`);const fullscreenOverlay=resolveFullscreenOverlayForElement(referenceWrapper);if(fullscreenOverlay)return fullscreenOverlay;return document.body};const Popover=props=>{const{aria:aria={},className:className,children:children,data:data={},htmlOptions:htmlOptions={},id:id,modifiers:modifiers,offset:offset,placement:placement,referenceElement:referenceElement,zIndex:zIndex,maxHeight:maxHeight,maxWidth:maxWidth,minHeight:minHeight,minWidth:minWidth,width:width,targetId:targetId}=props;const items=globalProps(props).split(" ");const filteredItems=items.filter((item=>!item.includes("min-width")&&!item.includes("width")));const filteredGlobalProps=filteredItems.join(" ");const popoverSpacing=filteredGlobalProps.includes("dark")||!filteredGlobalProps?"p_sm":filteredGlobalProps;const overflowHandling=maxHeight||maxWidth?"overflow_handling":"";const zIndexStyle=zIndex?{zIndex:zIndex}:{};const[selectMenuPortalTarget,setSelectMenuPortalTarget]=useState(null);const floatingRootRef=useCallback((node=>{setSelectMenuPortalTarget(node)}),[]);const menuPortalApi=useMemo((()=>({selectMenuPortalTarget:selectMenuPortalTarget})),[selectMenuPortalTarget]);const widthHeightStyles=()=>Object.assign({},maxHeight?{maxHeight:maxHeight}:{},maxWidth?{maxWidth:maxWidth}:{},minHeight?{minHeight:minHeight}:{},minWidth?{minWidth:minWidth}:{},width?{width:width}:{});const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_popover_kit"),filteredGlobalProps,className);return jsx(Popper,{modifiers:popoverModifiers({modifiers:modifiers,offset:offset||false}),placement:placement,referenceElement:referenceElement,children:({placement:placement2,ref:ref,style:style})=>jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,"data-placement":placement2,id:id,ref:ref,style:Object.assign({},style,zIndexStyle),children:jsx("div",{className:classnames(`${buildCss("pb_popover_tooltip")} show`),children:jsx("div",{className:classnames("pb_popover_body",popoverSpacing),id:targetId,style:widthHeightStyles(),...targetId?{[PB_FLOATING_OWNER_ATTR]:targetId}:{},children:jsxs(DialogContext.Provider,{value:menuPortalApi,children:[jsx("div",{className:classnames("pb_popover_scroll_region",overflowHandling),children:children}),jsx("div",{"aria-hidden":"true",className:"pb_popover_floating_root","data-pb-dialog-floating-root":"true",...targetId?{[PB_FLOATING_OWNER_ATTR]:targetId}:{},ref:floatingRootRef})]})})})})})};const PbReactPopover=props=>{const[targetId]=useState(uniqueId("id-"));const{appendTo:appendTo,className:className,children:children,modifiers:modifiers=[],offset:offset=false,placement:placement="left",portal:portal="body",reference:reference,referenceElement:referenceElement,show:show=false,usePortal:usePortal=true,zIndex:zIndex,maxHeight:maxHeight,maxWidth:maxWidth,minHeight:minHeight,minWidth:minWidth,width:width,closeOnClick:closeOnClick,shouldClosePopover:shouldClosePopover=noop}=props;const shouldClosePopoverRef=useRef(shouldClosePopover);useEffect((()=>{shouldClosePopoverRef.current=shouldClosePopover}),[shouldClosePopover]);useEffect((()=>{if(!closeOnClick)return;const handleClick=e=>{const targetEl=e.target instanceof Element?e.target:null;const targetIsPopover=(targetEl==null?void 0:targetEl.closest("#"+targetId))!==null||isPortaledFloatingKitInteraction(e.target,targetId,e.clientX,e.clientY);const targetIsReference=(targetEl==null?void 0:targetEl.closest("#reference-"+targetId))!==null;const shouldClose=()=>{setTimeout((()=>shouldClosePopoverRef.current(true)),0)};switch(closeOnClick){case"outside":if(!targetIsPopover&&!targetIsReference)shouldClose();break;case"inside":if(isPortaledFloatingKitInteraction(e.target,targetId,e.clientX,e.clientY))return;if(targetIsPopover)shouldClose();break;case"any":if(isPortaledFloatingKitInteraction(e.target,targetId,e.clientX,e.clientY))return;if(targetIsPopover||!targetIsPopover&&!targetIsReference)shouldClose();break}};document.body.addEventListener("click",handleClick,{capture:true});return()=>{document.body.removeEventListener("click",handleClick,{capture:true})}}),[targetId,closeOnClick]);const popoverComponent=jsx(Popover,{className:className,maxHeight:maxHeight,maxWidth:maxWidth,minHeight:minHeight,minWidth:minWidth,modifiers:modifiers,offset:offset,placement:placement,referenceElement:referenceElement,targetId:targetId,width:width,zIndex:zIndex,...props,children:children});return jsx(Manager,{children:jsxs(Fragment,{children:[reference&&!referenceElement&&jsx(Reference,{children:({ref:ref})=>jsx("span",{className:"pb_popover_reference_wrapper",id:"reference-"+targetId,ref:ref,children:jsx(reference.type,{...reference.props})})}),show&&(usePortal?jsx(Fragment,{children:ReactDOM__default.createPortal(popoverComponent,getAppendTarget(appendTo,targetId))}):popoverComponent)]})})};const dropdownOptionsFor=config=>{var _a;if(config.variant==="quickpick"&&!((_a=config.options)==null?void 0:_a.length)){return getQuickPickOptions(config.rangeEndsToday,config.customQuickPickDates).map((opt=>({value:opt.id||opt.label,label:opt.label})))}return(config.options||[]).map((opt=>({value:opt.id||opt.value||opt.label,label:opt.label})))};const labelFor=(config,value)=>{if(config.type==="select"){const match=config.options.find((opt=>opt.value===value));if(match)return match.text||match.value}if(config.type==="dropdown"){const match=dropdownOptionsFor(config).find((opt=>opt.value===value));if(match)return match.label||match.value}return value};const ChipVisual=({dark:dark,name:name,displayValue:displayValue})=>jsxs("div",{className:"pb_interactive_filter_container",children:[jsx(Caption,{dark:dark,text:name}),jsxs(Flex,{alignItems:"center",gap:"xxs",children:[jsx(Title,{dark:dark,size:4,text:displayValue||"—"}),jsx(Icon,{color:"primary",fixedWidth:true,icon:"angle-down",size:"xs"})]})]});const InlineCalendar=({calendarValue:calendarValue,config:config,onSinglePick:onSinglePick})=>{const containerRef=useRef(null);useEffect((()=>{if(!containerRef.current)return;const fp=flatpickr(containerRef.current,{inline:true,defaultDate:calendarValue||void 0,mode:config.mode||"single",dateFormat:config.format||"m/d/Y",minDate:config.minDate,maxDate:config.maxDate,nextArrow:'<i class="far fa-angle-right"></i>',prevArrow:'<i class="far fa-angle-left"></i>',onChange:(_selectedDates,dateStr)=>{config.onChange(dateStr);if((config.mode||"single")==="single")onSinglePick()}});return()=>fp.destroy()}),[calendarValue]);return jsx("div",{ref:containerRef})};const InteractiveFilter=({dark:dark=false,name:name,value:value,editorValue:editorValue,config:config})=>{const[open,setOpen]=useState(false);const pickerId=useMemo((()=>uniqueId("interactive-filter-date-")),[]);const displayValue=labelFor(config,value);const activeValue=editorValue??config.editorValue??value;const renderEditor=()=>{switch(config.type){case"select":case"dropdown":{const options=config.type==="dropdown"?dropdownOptionsFor(config):config.options.map((opt=>({value:opt.value,label:opt.text||opt.value})));return jsx("ul",{className:"pb_interactive_filter_options",role:"listbox",children:options.map((option=>{const isActive=option.value===activeValue;return jsx("li",{"aria-selected":isActive,className:`pb_interactive_filter_option${isActive?" active":""}`,onClick:()=>{config.onChange(option.value);setOpen(false)},onKeyDown:event=>{if(event.key==="Enter"||event.key===" "){event.preventDefault();config.onChange(option.value);setOpen(false)}},role:"option",tabIndex:0,children:jsx("span",{children:option.label})},option.value)}))})}case"date-picker":return jsx(InlineCalendar,{calendarValue:activeValue,config:config,onSinglePick:()=>setOpen(false)})}};const trigger=jsx("button",{"aria-expanded":open,"aria-haspopup":"dialog",className:`pb_interactive_filter_trigger${dark?" dark":""}`,"data-picker-id":pickerId,onClick:()=>setOpen((prev=>!prev)),type:"button",children:jsx(ChipVisual,{dark:dark,displayValue:displayValue,name:name})});return jsx(PbReactPopover,{closeOnClick:"outside",offset:true,placement:"bottom-start",reference:trigger,shouldClosePopover:()=>setOpen(false),show:open,zIndex:10,children:jsx("div",{className:`pb_interactive_filter_editor pb_interactive_filter_editor--${config.type}`,children:renderEditor()})})};const hiddenFilters=value=>isEmpty(value)&&value!==true;const CurrentFilters=({dark:dark,filters:filters,interactiveFilters:interactiveFilters={}})=>{const displayableFilters=omitBy(filters,hiddenFilters);return jsxs("div",{className:"maskContainer",children:[isEmpty(filters)&&jsx("div",{className:"filters",children:jsx(Body,{color:"light",paddingLeft:"xs",size:4,tag:"span",text:"No Filter Selected"})}),!isEmpty(filters)&&jsxs("div",{className:"filters",children:[jsx("div",{className:"left_gradient"}),map(displayableFilters,((value,name)=>{const interactiveConfig=interactiveFilters[name];return jsx("div",{className:`filter${interactiveConfig?" interactive":""}`,children:interactiveConfig?jsx(InteractiveFilter,{config:interactiveConfig,dark:dark,editorValue:interactiveConfig.editorValue,name:String(name),value:interactiveConfig.value!==void 0?interactiveConfig.value:value===true?"":value}):value===true?jsx(Title,{dark:dark,size:4,tag:"h4",text:`${name}`}):jsxs("div",{children:[jsx(Caption,{dark:dark,text:`${name}`}),jsx(Title,{dark:dark,size:4,tag:"h4",text:value})]})},`filter-${name}`)})),jsx("div",{className:"right_gradient"})]})]})};const FilterBackground=props=>{const{background:background=true,className:className,children:children,dark:dark,htmlOptions:htmlOptions={}}=props;const htmlProps=buildHtmlProps(htmlOptions);return jsx("div",{...htmlProps,className:classnames(`pb_filter_kit ${className}`,globalProps(props)),children:background?jsx(Card,{dark:dark,padding:"none",children:children}):jsx(Fragment,{children:children})})};const FiltersPopover=({children:children,dark:dark,maxHeight:maxHeight,minWidth:minWidth,placement:placement="bottom-start",popoverProps:popoverProps})=>{const[hide,updateHide]=useState(true);const toggle=()=>updateHide(!hide);const filterButton=jsx(CircleIconButton,{dark:dark,icon:"filter",id:"filter",onClick:toggle,variant:"secondary"});return jsx(PbReactPopover,{closeOnClick:"outside",maxHeight:maxHeight,minWidth:minWidth,placement:placement,reference:filterButton,shouldClosePopover:updateHide,show:!hide,...popoverProps,children:jsx("div",{className:"pb-form",children:typeof children==="function"?children({closePopover:()=>updateHide(true)}):children})})};const TitleCount=props=>{const{align:align="left",aria:aria={},className:className,dark:dark=false,data:data={},htmlOptions:htmlOptions={},count:count,id:id,title:title,size:size="sm"}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const css=classnames(buildCss("pb_title_count_kit",align,size),globalProps(props),className);const formatCount=count.toLocaleString();return jsxs("div",{...ariaProps,...dataProps,...htmlProps,className:css,id:id,children:[jsx(Title,{className:title!==void 0?"pb_title_count_text":"",dark:dark,size:size==="lg"?3:4,text:title}),jsx(Body,{color:"light",dark:dark,children:count&&formatCount})]})};const resultsText=results=>results==1?"Result":"Results";const formatResultsCount=n=>n.toLocaleString();const ResultsCount=({dark:dark,results:results,title:title})=>{const resultTitle=()=>{if(results==null)return null;return jsx(TitleCount,{align:"center",count:results,dark:dark,title:`${resultsText(results)}:`})};const justResults=()=>{if(results==null)return null;return jsx(Caption,{className:"filter-results",dark:dark,size:"xs",text:`${formatResultsCount(results)} ${resultsText(results)}`})};const displayResultsCount=()=>{if(results!=null&&results>=0&&title){return jsx(Fragment,{children:resultTitle()})}else if(results!=null&&results>=0){return jsx(Fragment,{children:justResults()})}else{return jsx("div",{})}};return jsx(Fragment,{children:displayResultsCount()})};const nextValue=(value,name)=>{const current=find(value,{name:name});return{name:name,dir:current&&current.dir=="asc"?"desc":"asc"}};const directionIcon=dir=>dir=="asc"?"arrow-up-short-wide":"arrow-down-wide-short";const renderOptions=(options,value,handleChange)=>map(options,((label,name)=>{const next=nextValue(value,String(name));return jsx(ListItem,{children:jsx(Button,{htmlType:void 0,onClick:partial(handleChange,next),text:` ${label}`,variant:"link"})},`option-${next.name}-${next.dir}`)}));const SortMenu=({dark:dark,options:options,value:value,onChange:onChange})=>{const[hide,updateHide]=useState(true);const toggle=()=>updateHide(!hide);const handleChange=value2=>{updateHide(true);onChange([value2])};const sortButton=jsx(Button,{dark:dark,htmlType:void 0,id:"sort-button",onClick:toggle,paddingRight:"none",variant:"link",children:map(value,(({dir:dir,name:name})=>jsxs("span",{children:[` ${options[name]}`,jsx(Icon,{dark:dark,icon:directionIcon(dir)})]},`current-sort-${name}-${dir}`)))});return jsx(PbReactPopover,{className:"pb_filter_sort_menu",closeOnClick:"outside",padding:"none",placement:"bottom",reference:sortButton,shouldClosePopover:updateHide,show:!hide,children:jsx(List,{children:renderOptions(options,value,handleChange)})})};const FilterSingle=({onSortChange:onSortChange,sortOptions:sortOptions,sortValue:sortValue,filters:filters,interactiveFilters:interactiveFilters,results:results,children:children,dark:dark,maxHeight:maxHeight,minWidth:minWidth,placement:placement,popoverProps:popoverProps,...bgProps})=>jsx(FilterBackground,{dark:dark,...bgProps,children:jsxs(Flex,{orientation:"row",paddingRight:"lg",vertical:"center",children:[children&&jsxs(Fragment,{children:[jsx(FiltersPopover,{dark:dark,maxHeight:maxHeight,minWidth:minWidth,placement:placement,popoverProps:popoverProps,children:children}),jsx(CurrentFilters,{dark:dark,filters:filters,interactiveFilters:interactiveFilters})]}),jsx(ResultsCount,{dark:dark,results:results}),!isEmpty(sortOptions)&&jsx(SortMenu,{dark:dark,onChange:onSortChange,options:sortOptions,value:sortValue})]})});const FilterDouble=({onSortChange:onSortChange,sortOptions:sortOptions,sortValue:sortValue,filters:filters,interactiveFilters:interactiveFilters,results:results,children:children,dark:dark,maxHeight:maxHeight,minWidth:minWidth,placement:placement,popoverProps:popoverProps,...bgProps})=>jsxs(FilterBackground,{dark:dark,...bgProps,children:[jsxs(Flex,{orientation:"row",vertical:"center",children:[jsx(FiltersPopover,{dark:dark,maxHeight:maxHeight,minWidth:minWidth,placement:placement,popoverProps:popoverProps,children:children}),jsx(CurrentFilters,{dark:dark,filters:filters,interactiveFilters:interactiveFilters})]}),jsx(SectionSeparator,{dark:dark}),jsxs(Flex,{className:"filter-bottom",orientation:"row",spacing:"between",vertical:"center",children:[jsx(ResultsCount,{dark:dark,results:results,title:true}),jsxs(Flex,{orientation:"row",vertical:"center",children:[jsx(Caption,{dark:dark,text:"sort by:"}),jsx(SortMenu,{dark:dark,onChange:onSortChange,options:sortOptions,value:sortValue})]})]})]});const FilterResponsive=({children:children,dark:dark,filters:filters,interactiveFilters:interactiveFilters,maxHeight:maxHeight,minWidth:minWidth,onSortChange:onSortChange,placement:placement,popoverProps:popoverProps,results:results,sortOptions:sortOptions,sortValue:sortValue,...bgProps})=>{const showSort=!isEmpty(sortOptions);return jsx(FilterBackground,{dark:dark,...bgProps,children:jsxs("div",{className:"pb_filter_responsive_layout",children:[jsxs("div",{className:"pb_filter_responsive_filters",children:[children&&jsx(FiltersPopover,{dark:dark,maxHeight:maxHeight,minWidth:minWidth,placement:placement,popoverProps:popoverProps,children:children}),jsx(CurrentFilters,{dark:dark,filters:filters,interactiveFilters:interactiveFilters})]}),jsx("div",{className:"pb_filter_responsive_results_inline",children:jsx(ResultsCount,{dark:dark,results:results})}),jsx("div",{className:"pb_filter_responsive_sep",children:jsx(SectionSeparator,{dark:dark})}),jsxs("div",{className:"pb_filter_responsive_bottom filter-bottom",children:[jsx("div",{className:"pb_filter_responsive_results_bar",children:jsx(ResultsCount,{dark:dark,results:results,title:true})}),jsx("div",{className:"pb_filter_responsive_sort",children:showSort&&jsxs(Fragment,{children:[jsx(Caption,{className:"pb_filter_responsive_sort_label",dark:dark,text:"sort by:"}),jsx(SortMenu,{dark:dark,onChange:onSortChange,options:sortOptions,value:sortValue})]})})]})]})})};const FilterSidebar=({onCollapse:onCollapse,onSortChange:onSortChange,sortOptions:sortOptions,sortValue:sortValue,filters:filters,results:results,children:children,dark:dark,isCollapsed:isCollapsed,maxHeight:maxHeight,minWidth:minWidth,placement:placement,popoverProps:popoverProps,...bgProps})=>jsxs(FilterBackground,{dark:dark,...bgProps,children:[jsx(Card.Body,{paddingX:"sm",paddingY:"xs",children:jsxs(Flex,{align:"center",justify:"between",orientation:"row",children:[jsx(ResultsCount,{dark:dark,results:results,title:true}),jsx("div",{onClick:onCollapse,children:jsx(Caption,{color:"link",cursor:"pointer",size:"xs",text:isCollapsed?"Expand All":"Collapse All"})})]})}),jsx(SectionSeparator,{dark:dark}),jsx(Fragment,{children:children})]});const FilterSection=({children:children,collapsible:collapsible=false,collapsed:collapsed=true,headerText:headerText})=>{if(collapsible){return jsxs(Collapsible,{collapsed:collapsed,padding:"none",children:[jsx(Collapsible.Main,{paddingX:"sm",paddingY:"xs",children:jsx(Caption,{children:headerText})}),jsx(Collapsible.Content,{className:"filter_section_collapsible",paddingX:"sm",children:children})]})}return jsx(Body,{paddingTop:"xs",paddingX:"sm",children:jsxs(Fragment,{children:[headerText&&jsx(Caption,{marginBottom:"sm",children:headerText}),children]})})};const Filter=({double:double=false,responsive:responsive,variant:variant,...templateProps})=>{const{children:children,className:className,...layoutProps}=templateProps;const useResponsiveStacked=responsive==="stacked"&&Boolean(children);const mergedClassName=classnames(useResponsiveStacked&&"pb_filter_responsive",className);const displayFilter=()=>{if(variant==="sidebar"){return jsx(FilterSidebar,{className:className,...layoutProps,children:children})}if(useResponsiveStacked){return jsx(FilterResponsive,{...layoutProps,className:mergedClassName,children:children})}if(double===true){return jsx(FilterDouble,{...layoutProps,className:className,children:children})}return jsx(FilterSingle,{...layoutProps,className:className,children:children})};return jsx(Fragment,{children:displayFilter()})};Filter.Section=FilterSection;const LoadingInline=props=>{const{align:align="left",aria:aria={},className:className,color:color="light",data:data={},dark:dark=false,htmlOptions:htmlOptions={},id:id,text:text=" Loading",variant:variant="dotted"}=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,{color:color,dark:dark,children:[jsx(Icon,{aria:{label:"loading icon"},fixedWidth:true,icon:variant==="dotted"?"spinner":variant==="solid"?"circle-notch":void 0,pulse:true}),text]})})};const Nav=props=>{const{aria:aria={},borderless:borderless=false,children:children,className:className,data:data={},dark:dark=false,extendedUnderline:extendedUnderline=false,highlight:highlight=true,htmlOptions:htmlOptions={},id:id,link:link="#",onClick:onClick,orientation:orientation="vertical",title:title="",variant:variant="normal",itemSpacing:itemSpacing}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const cardCss=classnames(buildCss("pb_nav_list",variant,orientation,{highlight:highlight,borderless:borderless}),variant==="normal"&&orientation==="horizontal"&&extendedUnderline&&"pb_nav_extended_underline",globalProps(props),className);const childrenWithProps=React__default.Children.map(children,(child=>{if(React__default.isValidElement(child)){const childProps={orientation:orientation,variant:variant,itemSpacing:itemSpacing};return React__default.cloneElement(child,childProps)}return child}));return jsxs("nav",{...ariaProps,...dataProps,...htmlProps,className:cardCss,id:id,children:[title&&jsx("div",{className:"pb_nav_list_title",children:jsx("a",{className:"pb_nav_list_item_link_text",href:link,onClick:onClick,children:jsx(Caption,{dark:dark,size:"md",text:`${title}`})})}),jsx("div",{className:"pb_nav_wrapper",children:childrenWithProps})]})};const NavItem=props=>{const fontWeightDefault=(orientation2,variant2)=>orientation2==="horizontal"&&variant2==="subtle"?"regular":orientation2==="horizontal"&&variant2==="normal"?"bold":"regular";const{active:active=false,highlighted_border:highlighted_border=true,aria:aria={},orientation:orientation,variant:variant,fontWeight:fontWeight=fontWeightDefault(orientation,variant),children:children,className:className,collapsible:collapsible,data:data={},dark:dark=false,fontSize:fontSize="normal",htmlOptions:htmlOptions={},iconLeft:iconLeft,iconRight:iconRight,onIconRightClick:onIconRightClick,onIconLeftClick:onIconLeftClick,id:id,imageUrl:imageUrl,link:link,onClick:onClick,target:target="_self",text:text="",collapsibleTrail:collapsibleTrail,collapsed:collapsed,itemSpacing:itemSpacing,margin:margin,marginBottom:marginBottom,marginTop:marginTop,marginRight:marginRight,marginLeft:marginLeft,marginX:marginX,marginY:marginY,disabled:disabled=false}=props;const spacingMarginProps={margin:margin,marginBottom:marginBottom,marginTop:marginTop,marginRight:marginRight,marginLeft:marginLeft,marginX:marginX,marginY:marginY};const filterItemSpacing=obj=>{const filteredPadding2={};const filteredMargin2={};for(const key in obj){if(key.startsWith("padding")){filteredPadding2[key]=obj[key]}else if(key.startsWith("margin")){filteredMargin2[key]=obj[key]}}return{filteredPadding:filteredPadding2,filteredMargin:filteredMargin2}};const{filteredPadding:filteredPadding,filteredMargin:filteredMargin}=filterItemSpacing(itemSpacing);const finalItemSpacing={...filteredMargin||{},...Object.entries(spacingMarginProps).reduce(((acc,[prop,value])=>{if(value){acc[prop]=value}return acc}),{})};const filteredProps={...props};filteredProps==null?true:delete filteredProps.margin;filteredProps==null?true:delete filteredProps.marginX;filteredProps==null?true:delete filteredProps.marginY;filteredProps==null?true:delete filteredProps.marginBottom;filteredProps==null?true:delete filteredProps.marginTop;filteredProps==null?true:delete filteredProps.marginRight;filteredProps==null?true:delete filteredProps.marginLeft;const isLink=!!link&&!disabled;const Tag=isLink?"a":"div";const activeClass=active===true?"active":"";const highlightedBorderClass=active===true&&highlighted_border===false?"highlighted_border_none":"";const collapsibleTrailClass=collapsible&&collapsibleTrail?"collapsible_trail":"";const disabledClass=disabled?"pb_nav_item_disabled":"";const fontSizeMapping={small:"font_size_small",normal:"font_size_normal"};const fontWeightMapping={bold:"font_bold",bolder:"font_bolder",regular:"font_regular"};const fontSizeClass=fontSizeMapping[fontSize];const fontWeightClass=fontWeightMapping[fontWeight];const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const tagClasses=classnames(collapsible?"pb_nav_list_item_link_collapsible":"pb_nav_list_item_link");const classes=classnames(buildCss("pb_nav_list_kit_item",activeClass,highlightedBorderClass),collapsible?buildCss("pb_collapsible_nav_item",activeClass,highlightedBorderClass):"",fontSizeClass,fontWeightClass,tagClasses,collapsible?globalProps(filteredProps,{...filteredPadding}):globalProps(props,{...itemSpacing}),disabledClass,className);const handleIconClick=e=>{if(onIconLeftClick){e.stopPropagation();onIconLeftClick()}};const childrenWithProps=React__default.Children.map(children,(child=>{if(React__default.isValidElement(child)){const childProps={itemSpacing:itemSpacing,...disabled&&{disabled:disabled}};return React__default.cloneElement(child,childProps)}return child}));const collapsibleClasses=buildCss("collapsible_nav_wrapper",activeClass,highlightedBorderClass,collapsibleTrailClass,disabledClass);const handleKeyDown=e=>{if(!disabled&&!isLink&&(e.key==="Enter"||e.key===" ")){e.preventDefault();onClick==null?void 0:onClick()}};const handleClick=e=>{if(disabled){e.preventDefault();e.stopPropagation();return}onClick==null?void 0:onClick()};return jsx(Fragment,{children:collapsible?jsx(Fragment,{children:jsxs(Collapsible,{className:collapsibleClasses,collapsed:collapsed,icon:iconRight&&iconRight,iconSize:"xs",id:id,onClick:disabled?void 0:onClick,onIconClick:disabled?void 0:onIconRightClick,children:[jsx(Collapsible.Main,{className:globalProps({...finalItemSpacing}),dark:dark,children:jsxs(Tag,{...ariaProps,...dataProps,...htmlProps,className:classes,href:isLink?link:void 0,id:id,role:!isLink?"button":void 0,tabIndex:!isLink?0:void 0,target:isLink?target:void 0,children:[imageUrl&&jsx("div",{className:"pb_nav_list_item_icon_section_collapsible",onClick:e=>handleIconClick(e),onKeyDown:!isLink?handleKeyDown:void 0,children:jsx(Image,{className:"pb_nav_img_wrapper",url:imageUrl})},imageUrl),iconLeft&&jsx("div",{className:"pb_nav_list_item_icon_section_collapsible",onClick:e=>handleIconClick(e),children:jsx(Icon,{className:"pb_nav_list_item_icon_left_collapsible",fixedWidth:true,icon:iconLeft})},iconLeft),jsx("span",{className:"pb_nav_list_item_text_collapsible",children:text})]})}),jsx(Collapsible.Content,{children:childrenWithProps})]})}):jsxs(Tag,{...ariaProps,...dataProps,...htmlProps,"aria-disabled":disabled,className:classes,href:isLink?link:void 0,id:id,onClick:handleClick,onKeyDown:!isLink?handleKeyDown:void 0,role:!isLink?"button":void 0,tabIndex:disabled?-1:!isLink?0:void 0,target:isLink?target:void 0,children:[imageUrl&&jsx("div",{className:"pb_nav_list_item_icon_section",children:jsx(Image,{className:"pb_nav_img_wrapper",url:imageUrl})},imageUrl),iconLeft&&jsx("div",{className:"pb_nav_list_item_icon_section",children:jsx(Icon,{className:"pb_nav_list_item_icon_left",fixedWidth:true,icon:iconLeft})},iconLeft),jsx("span",{className:"pb_nav_list_item_text",children:text||children}),iconRight&&jsx("div",{className:"pb_nav_list_item_icon_section",children:jsx(Icon,{className:"pb_nav_list_item_icon_right",fixedWidth:true,icon:iconRight})},iconRight)]})})};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[isMobile,setIsMobile]=useState(false);const[isDropdownOpen,setIsDropdownOpen]=useState(false);const[dropdownPosition,setDropdownPosition]=useState("below");const dropdownRef=useRef(null);useEffect((()=>{const checkMobile=()=>{setIsMobile(window.innerWidth<=767)};checkMobile();let timeoutId=null;const throttledCheckMobile=()=>{if(timeoutId===null){timeoutId=setTimeout((()=>{checkMobile();timeoutId=null}),150)}};window.addEventListener("resize",throttledCheckMobile);return()=>{window.removeEventListener("resize",throttledCheckMobile);if(timeoutId)clearTimeout(timeoutId)}}),[]);useEffect((()=>{const handleClickOutside=event=>{if(dropdownRef.current&&!dropdownRef.current.contains(event.target)){setIsDropdownOpen(false)}};if(isDropdownOpen){document.addEventListener("mousedown",handleClickOutside)}return()=>{document.removeEventListener("mousedown",handleClickOutside)}}),[isDropdownOpen]);const checkDropdownPosition=()=>{if(dropdownRef.current){const rect=dropdownRef.current.getBoundingClientRect();const dropdownHeight=200;const spaceBelow=window.innerHeight-rect.bottom;const spaceAbove=rect.top;if(spaceBelow<dropdownHeight&&spaceAbove>spaceBelow){setDropdownPosition("above")}else{setDropdownPosition("below")}}};const handleDropdownToggle=()=>{if(!isDropdownOpen){checkDropdownPosition()}setIsDropdownOpen(!isDropdownOpen)};const handlePageChange=pageNumber=>{if(pageNumber>=1&&pageNumber<=total){setCurrentPage(pageNumber);setIsDropdownOpen(false);if(onChange){onChange(pageNumber)}}};const createPageOptions=()=>{const options=[];for(let pageNumber=1;pageNumber<=total;pageNumber++){options.push({label:String(pageNumber),value:String(pageNumber),id:`page-${pageNumber}`})}return options};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};useEffect((()=>{if(current>=1&&current<=total){setCurrentPage(current)}}),[current,total]);const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_paginate"),globalProps(props),className);if(total<=1){return null}return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:jsx("div",{className:`pb_pagination ${isMobile?"pb_pagination_mobile":""}`,children:isMobile?jsxs(Flex,{alignItems:"center",children:[jsx("li",{className:`pagination-left ${currentPage===1?"disabled":""}`,onClick:()=>handlePageChange(currentPage-1),children:jsxs(Flex,{alignItems:"center",children:[jsx(Icon,{icon:"chevron-left"}),jsx(Detail,{color:"default",marginLeft:"xxs",children:"Prev"})]})}),jsxs("div",{className:"pagination-dropdown",ref:dropdownRef,children:[jsx("div",{className:"pagination-dropdown-trigger",onClick:handleDropdownToggle,children:jsxs(Flex,{alignItems:"center",gap:"xxs",justify:"between",children:[jsx(Detail,{bold:true,color:"default",children:currentPage}),jsxs(Detail,{color:"default",children:["of ",total]}),jsx(Icon,{color:"primary",icon:isDropdownOpen?"chevron-up":"chevron-down",size:"xs"})]})}),isDropdownOpen&&jsx("div",{className:`pagination-dropdown-menu ${dropdownPosition}`,children:createPageOptions().map((option=>jsx("div",{className:`pagination-dropdown-option ${Number(option.value)===currentPage?"active":""}`,onClick:()=>handlePageChange(Number(option.value)),children:jsxs(Body,{children:["Page ",option.label]})},option.id)))})]}),jsx("li",{className:`pagination-right ${currentPage===total?"disabled":""}`,onClick:()=>handlePageChange(currentPage+1),children:jsxs(Flex,{alignItems:"center",children:[jsx(Detail,{color:"default",marginRight:"xxs",children:"Next"}),jsx(Icon,{icon:"chevron-right"})]})})]}):jsxs(Fragment,{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 TableHead=props=>{const{aria:aria={},children:children,className:className,data:data={},headerStyle:headerStyle="default",htmlOptions:htmlOptions={},id:id,tag:tag="table"}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames("pb_table_thead",{pb_table_thead_borderless:headerStyle==="borderless"||headerStyle==="floating",pb_table_thead_floating:headerStyle==="floating"},globalProps(props),className);const isTableTag=tag==="table";return jsx(Fragment,{children:isTableTag?jsx("thead",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:children}):jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:children})})};const isEmptySortMenuItem=item=>Object.keys(item).length===0;const isSortingStyle=sortMenu=>Array.isArray(sortMenu)&&sortMenu.length>0&&!(sortMenu.length===1&&isEmptySortMenuItem(sortMenu[0]));const getActiveItem=sortMenu=>{let activeItem={};sortMenu.forEach((item=>{if(item.active===true){activeItem=item}}));return activeItem};const getSortItems=sortMenu=>[...new Set(sortMenu.map((item=>item.item)).filter(Boolean))];const getSortItemsFor=(sortMenu,sortItem)=>sortMenu.filter((item=>item.item===sortItem));const getActiveOrFirstItem=items=>{const activeItem=items.find((item=>item.active===true));return activeItem||items[0]};const getNextLink=(sortMenu,sortItem="")=>{var _a;const sortMenuFor=sortItem?getSortItemsFor(sortMenu,sortItem):sortMenu;if(sortMenuFor.every((item=>item.active===false))){return((_a=sortMenuFor[0])==null?void 0:_a.link)||""}let link="";sortMenuFor.forEach(((item,index)=>{var _a2;if(item.active===true){const nextIndex=(index+1)%sortMenuFor.length;link=((_a2=sortMenuFor[nextIndex])==null?void 0:_a2.link)||""}}));return link};const getSortIcon=(direction,active)=>{switch(direction){case"asc":return active?"sort-amount-up":"";case"desc":return active?"sort-amount-down":"";default:return"arrow-up-arrow-down"}};const isDropdownSelect=(sortMenu,colSpan,sortDropdown)=>isSortingStyle(sortMenu)&&(sortDropdown===true||sortDropdown!==false&&colSpan!=null&&colSpan>1);const TableHeader=props=>{const{alignContent:alignContent="center",aria:aria={},children:children,className:className,colSpan:colSpan,data:data={},headerStyle:headerStyle="default",htmlOptions:htmlOptions={},id:id,justifySortIcon:justifySortIcon="between",placement:placement="bottom-end",sortDropdown:sortDropdown,sortMenu:sortMenu=[{}],tag:tag="table",text:text}=props;const[showSortPopover,setShowSortPopover]=useState(false);const{colSpan:htmlColSpan,colspan:htmlColspan,...restHtmlOptions}=htmlOptions;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(restHtmlOptions);const classes=classnames("pb_table_th",{pb_table_thead_borderless:headerStyle==="borderless"||headerStyle==="floating",pb_table_thead_floating:headerStyle==="floating"},globalProps(props),className);const isTableTag=tag==="table";const resolvedColSpan=colSpan??htmlColSpan??htmlColspan;const sortingEnabled=isSortingStyle(sortMenu);const dropdownEnabled=isTableTag&&isDropdownSelect(sortMenu,resolvedColSpan,sortDropdown);const activeItem=sortingEnabled?getActiveItem(sortMenu):{};const nextLink=sortingEnabled?getNextLink(sortMenu):"";const sortIconName=sortingEnabled?getSortIcon(activeItem.direction,activeItem.active):"";const isSortActive=Object.keys(activeItem).length>0;const linkStyle=isSortActive?void 0:{color:"#687887"};const headerId=id||(dropdownEnabled?uniqueId("pb-th"):void 0);const closeSortPopover=shouldClose=>{setShowSortPopover(!shouldClose)};const handleSortLinkClick=event=>{if(!dropdownEnabled)return;event.preventDefault();event.stopPropagation();setShowSortPopover((open=>!open))};const sortLink=jsx("a",{href:dropdownEnabled?"#":nextLink,onClick:handleSortLinkClick,style:linkStyle,children:jsx(Flex,{align:alignContent,className:"pb_th_link",justify:justifySortIcon,children:jsxs(Fragment,{children:[text||children,sortIconName!==""&&jsx(Icon,{className:isSortActive?"pb_th_active":"",fixedWidth:true,icon:sortIconName,paddingLeft:"xs"})]})})});const sortDropdownMenu=dropdownEnabled&&jsx(PbReactPopover,{className:"pb_filter_sort_menu",closeOnClick:"outside",padding:"none",placement:placement,reference:sortLink,shouldClosePopover:closeSortPopover,show:showSortPopover,children:jsx(Nav,{className:"pb_table_header_dropdown",data:{"pb-table-header":headerId},children:getSortItems(sortMenu).map((sortItemName=>{const item=getActiveOrFirstItem(getSortItemsFor(sortMenu,sortItemName));return jsx(NavItem,{active:item.active,className:"header_nav_item",highlighted_border:false,iconRight:getSortIcon(item.direction,item.active),link:getNextLink(sortMenu,sortItemName),onClick:()=>setShowSortPopover(false),padding:"xs",text:item.item||""},sortItemName)}))})});const headerContent=(()=>{if(!sortingEnabled)return text||children;if(dropdownEnabled)return sortDropdownMenu;return sortLink})();return jsx(Fragment,{children:isTableTag?jsx("th",{...ariaProps,...dataProps,...htmlProps,className:classes,...resolvedColSpan!=null&&{colSpan:resolvedColSpan},id:headerId,children:headerContent}):jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:headerId,children:headerContent})})};const TableBody=props=>{const{aria:aria={},children:children,className:className,data:data={},draggableContainer:draggableContainer=false,htmlOptions:htmlOptions={},id:id,tag:tag="table"}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames("pb_table_tbody",globalProps(props),className);const isTableTag=tag==="table";return jsx(Fragment,{children:isTableTag?draggableContainer?jsx(Draggable.Container,{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,tag:"tbody",children:children}):jsx("tbody",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:children}):draggableContainer?jsx(Draggable.Container,{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:children}):jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:children})})};const TableRow=props=>{const{aria:aria={},children:children,collapsible:collapsible,collapsibleContent:collapsibleContent,collapsibleSideHighlight:collapsibleSideHighlight=true,className:className,data:data={},dark:dark=false,dragId:dragId,draggableItem:draggableItem=false,headerStyle:headerStyle="default",htmlOptions:htmlOptions={},id:id,toggleCellId:toggleCellId,sideHighlightColor:sideHighlightColor="none",tag:tag="table"}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const sideHighlightClass=sideHighlightColor!=""?`side_highlight_${sideHighlightColor}`:null;const[isCollapsed,setIsCollapsed]=useCollapsible(true);const collapsibleRow=collapsible&&isCollapsed===true?"collapsible_table_row":null;const classes=classnames(buildCss("pb_table_row_kit",sideHighlightClass),"pb_table_tr",{pb_table_tr_borderless_header:headerStyle==="borderless"},collapsibleRow,globalProps(props),className);const isTableTag=tag==="table";const colSpan=React__default.Children.count(children);const handleRowClick=event=>{if(toggleCellId){const target=event.target;const clickedCell=target.closest(`#${toggleCellId}`);const isIconClick=target instanceof SVGElement&&(target.matches("svg.pb_custom_icon")||target.closest("svg.pb_custom_icon"));if(clickedCell||clickedCell&&isIconClick){setIsCollapsed(!isCollapsed)}}else{setIsCollapsed(!isCollapsed)}};return jsx(Fragment,{children:collapsible?isTableTag?jsxs(Fragment,{children:[jsx("tr",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,onClick:e=>handleRowClick(e),style:{cursor:toggleCellId?"default":"pointer"},children:children}),jsx("tr",{children:jsxs(Collapsible,{collapsed:isCollapsed,dark:dark,htmlOptions:{colSpan:colSpan},padding:"none",tag:"td",children:[jsx("tr",{}),jsx(Collapsible.Content,{className:collapsibleSideHighlight?`table_collapsible_side_highlight`:"",dark:dark,margin:"none",padding:"none",children:collapsibleContent})]})})]}):jsxs(Fragment,{children:[jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,onClick:handleRowClick,style:{cursor:"pointer"},children:children}),jsx("tr",{children:jsxs(Collapsible,{collapsed:isCollapsed,dark:dark,htmlOptions:{colSpan:colSpan},padding:"none",tag:"td",children:[jsx("tr",{}),jsx(Collapsible.Content,{className:collapsibleSideHighlight?`table_collapsible_side_highlight`:"",dark:dark,margin:"none",padding:"none",children:collapsibleContent})]})})]}):isTableTag?draggableItem?jsx(Draggable.Item,{...ariaProps,...dataProps,...htmlProps,className:classes,dragId:dragId,tag:"tr",children:children}):jsx("tr",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:children}):draggableItem?jsx(Draggable.Item,{...ariaProps,...dataProps,...htmlProps,className:classes,dragId:dragId,children:children}):jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:children})})};const TableCell=props=>{const{aria:aria={},children:children,className:className,colSpan:colSpan,data:data={},htmlOptions:htmlOptions={},id:id,tag:tag="table",text:text}=props;const{colSpan:htmlColSpan,colspan:htmlColspan,...restHtmlOptions}=htmlOptions;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(restHtmlOptions);const classes=classnames("pb_table_td",globalProps(props),className);const isTableTag=tag==="table";const resolvedColSpan=colSpan??htmlColSpan??htmlColspan;return jsx(Fragment,{children:isTableTag?jsx("td",{...ariaProps,...dataProps,...htmlProps,className:classes,...resolvedColSpan!=null&&{colSpan:resolvedColSpan},id:id,children:text||children}):jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:text||children})})};const addDataTitle=()=>{const tables=document.querySelectorAll(".table-responsive-collapse");[].forEach.call(tables,(table=>{const headers=[];[].forEach.call(table.querySelectorAll("th"),(header=>{const colSpan=header.colSpan;for(let i=0;i<colSpan;i++){headers.push(header.textContent.replace(/\r?\n|\r/,""))}}));[].forEach.call(table.querySelectorAll("tbody tr"),(row=>{[].forEach.call(row.cells,((cell,headerIndex)=>{cell.setAttribute("data-title",headers[headerIndex])}))}))}))};const Table=props=>{const{aria:aria={},variant:variant="default",cardProps:cardProps={},titleProps:titleProps={},children:children,className:className,collapse:collapse=(variant==="withFilter"?"md":"sm"),container:container=true,dark:dark,data:data={},dataTable:dataTable=false,disableHover:disableHover=false,filterProps:filterProps={},filterContent:filterContent,headerStyle:headerStyle="default",htmlOptions:htmlOptions={},id:id,outerPadding:outerPadding="",pagination:pagination,responsive:responsive="collapse",singleLine:singleLine=false,size:size="sm",sticky:sticky=false,stickyLeftColumn:stickyLeftColumn=[],stickyRightColumn:stickyRightColumn=[],striped:striped=false,tag:tag="table",title:title,contrastBorder:contrastBorder=false,verticalBorder:verticalBorder=false}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const tableCollapseCss=responsive==="collapse"?`table-collapse-${collapse}`:"";const contrastBorderCss=contrastBorder?"contrast-border":"";const verticalBorderCss=verticalBorder?"vertical-border":"";const spaceCssName=outerPadding!=="none"?"space_":"";const outerPaddingCss=outerPadding?`outer_padding_${spaceCssName}${outerPadding}`:"";const isTableTag=tag==="table";const dynamicInlineProps=globalInlineProps(props);const stickyRightColumnReversed=stickyRightColumn.reverse();const isFilterVariant=variant==="withFilter";const effectiveContainer=isFilterVariant?false:container;const classNames=classnames("pb_table",`table-${size}`,`table-responsive-${responsive}`,{"table-card":effectiveContainer,"table-dark":dark,data_table:dataTable,"single-line":singleLine,"no-hover":disableHover,"sticky-header":sticky,"sticky-left-column":stickyLeftColumn.length,"sticky-right-column":stickyRightColumn.length,striped:striped,"header-borderless":headerStyle==="borderless","header-floating":headerStyle==="floating",[outerPaddingCss]:outerPadding!==""},globalProps(props),tableCollapseCss,contrastBorderCss,verticalBorderCss,className);useEffect((()=>{const handleStickyLeftColumns=()=>{if(!stickyLeftColumn.length)return;let accumulatedWidth=0;stickyLeftColumn.forEach(((colId,index)=>{const isLastColumn=index===stickyLeftColumn.length-1;const header=document.querySelector(`th[data-sticky-id="${colId}"]`);const cells=document.querySelectorAll(`td[data-sticky-id="${colId}"]`);if(header){header.classList.add("sticky");header.style.left=`${accumulatedWidth}px`;if(!isLastColumn){header.classList.add("with-border-right");header.classList.remove("sticky-left-shadow")}else{header.classList.remove("with-border-right");header.classList.add("sticky-left-shadow")}const headerWidth=header.offsetWidth;accumulatedWidth+=headerWidth;cells.forEach((cell=>{cell.classList.add("sticky");cell.style.left=`${accumulatedWidth-headerWidth}px`;if(!isLastColumn){cell.classList.add("with-border-right");cell.classList.remove("sticky-left-shadow")}else{cell.classList.remove("with-border-right");cell.classList.add("sticky-left-shadow")}}))}}))};setTimeout((()=>{handleStickyLeftColumns()}),10);window.addEventListener("resize",handleStickyLeftColumns);return()=>{window.removeEventListener("resize",handleStickyLeftColumns)}}),[stickyLeftColumn]);useEffect((()=>{const handleStickyRightColumns=()=>{if(!stickyRightColumn.length)return;let accumulatedWidth=0;stickyRightColumnReversed.forEach(((colId,index)=>{const isLastColumn=index===stickyRightColumn.length-1;const header=document.querySelector(`th[data-sticky-id="${colId}"]`);const cells=document.querySelectorAll(`td[data-sticky-id="${colId}"]`);if(header){header.classList.add("sticky");header.style.right=`${accumulatedWidth}px`;if(!isLastColumn){header.classList.add("with-border-left");header.classList.remove("sticky-right-shadow")}else{header.classList.remove("with-border-left");header.classList.add("sticky-right-shadow")}const headerWidth=header.offsetWidth;accumulatedWidth+=headerWidth;cells.forEach((cell=>{cell.classList.add("sticky");cell.style.right=`${accumulatedWidth-headerWidth}px`;if(!isLastColumn){cell.classList.add("with-border-left");cell.classList.remove("sticky-right-shadow")}else{cell.classList.remove("with-border-left");cell.classList.add("sticky-right-shadow")}}))}}))};setTimeout((()=>{handleStickyRightColumns()}),10);window.addEventListener("resize",handleStickyRightColumns);return()=>{window.removeEventListener("resize",handleStickyRightColumns)}}),[stickyRightColumn]);useEffect((()=>{addDataTitle()}),[]);const renderTable=()=>{const tableElement=responsive==="scroll"?jsx("div",{className:"table-responsive-scroll",children:isTableTag?jsx("table",{...ariaProps,...dataProps,...htmlProps,className:classNames,id:id,style:dynamicInlineProps,children:children}):jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classNames,id:id,style:dynamicInlineProps,children:children})}):isTableTag?jsx("table",{...ariaProps,...dataProps,...htmlProps,className:classNames,id:id,style:dynamicInlineProps,children:children}):jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classNames,id:id,style:dynamicInlineProps,children:children});return tableElement};const renderCardVariant=()=>{const tableElement=responsive==="scroll"?jsx("div",{className:"table-responsive-scroll",children:isTableTag?jsx("table",{...ariaProps,...dataProps,...htmlProps,className:classNames,id:id,style:dynamicInlineProps,children:children}):jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classNames,id:id,style:dynamicInlineProps,children:children})}):isTableTag?jsx("table",{...ariaProps,...dataProps,...htmlProps,className:classNames,id:id,style:dynamicInlineProps,children:children}):jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classNames,id:id,style:dynamicInlineProps,children:children});const defaultFilterProps={background:false,maxHeight:"50vh",minWidth:"xs",popoverProps:{width:"350px"}};const mergedFilterProps={...defaultFilterProps,...filterProps};const defaultCardProps={padding:"none"};const mergedCardProps={...defaultCardProps,...cardProps};const defaultTitleProps={size:3,paddingY:"md"};const mergedTitleProps={...defaultTitleProps,...titleProps};return jsxs(Fragment,{children:[title&&jsx(Title,{...mergedTitleProps,text:title}),jsx(Card,{...mergedCardProps,children:jsxs(Flex,{align:"stretch",flexDirection:"column",gap:"none",children:[filterContent&&jsx(Filter,{...mergedFilterProps,children:filterContent}),filterContent&&jsx(SectionSeparator,{}),pagination&&jsxs(Fragment,{children:[pagination,jsx(SectionSeparator,{})]}),tableElement,pagination&&jsx(Fragment,{children:pagination})]})})]})};return jsx(Fragment,{children:isFilterVariant?renderCardVariant():renderTable()})};Table.Head=TableHead;Table.Header=TableHeader;Table.Body=TableBody;Table.Row=TableRow;Table.Cell=TableCell;export{Button as B,Checkbox as C,FlexItem as F,LoadingInline as L,Nav as N,PbReactPopover as P,SectionSeparator as S,Table as T,Pagination as a,CircleIconButton as b,List as c,ListItem as d,NavItem as e,Collapsible as f,getQuickPickOptions as g,Filter as h,TableRow as i,TitleCount as j,requireWarning as r};
1
+ import{jsx,Fragment,jsxs}from"react/jsx-runtime";import*as React from"react";import React__default,{forwardRef,useRef,useEffect,createContext,useContext,useState,useCallback,useMemo}from"react";import{i as isValidEmoji,F as Flex,I as Icon,C as Caption,B as Body,b as Draggable,c as DialogContext,d as Title,a as Card,e as Image,D as Detail}from"./_detail-BqqzPTNr.js";import{b as buildAriaProps,a as buildDataProps,c as buildHtmlProps,d as classnames,g as globalProps,e as buildCss,n as noop,f as globalInlineProps}from"./globalProps-K1DCn3il.js";import{U as getAllIcons,V as spacing,c as colors,W as useCollapsible,X as DateTime,g as getDefaultExportFromCjs,y as createPopper,Y as uniqueId,Z as isPortaledFloatingKitInteraction,H as PB_FLOATING_OWNER_ATTR,_ as resolveFullscreenOverlayForElement,z as flatpickr,$ as omitBy,a0 as isEmpty,a1 as map,a2 as partial,a3 as find}from"./lib-7vm9BMqp.js";import*as ReactDOM from"react-dom";import ReactDOM__default from"react-dom";const buttonClassName=props=>{const{disabled:disabled=false,fullWidth:fullWidth=false,highlight:highlight,icon:icon,loading:loading=false,type:type="inline",variant:variant="primary",size:size=null,text:text,children:children}=props;const classNames=["pb_button_kit"];const isIconOnly=icon&&!text&&!children&&variant!=="reaction";if(variant)classNames.push(`pb_button_${variant}`);if(type)classNames.push(`pb_button_${type}`);if(fullWidth)classNames.push("pb_button_block");classNames.push(disabled?"pb_button_disabled":"pb_button_enabled");if(loading)classNames.push("pb_button_loading");if(size)classNames.push(`pb_button_size_${size}`);if(variant==="reaction"&&icon&&!isValidEmoji(icon))classNames.push("pb_button_reaction_default");if(variant==="reaction"&&highlight)classNames.push("pb_button_active");if(isIconOnly)classNames.push("pb_button_icon_only");return classNames.join(" ")};const spinnerIcon=getAllIcons()["spinner"];const Button=props=>{const{aria:aria={},children:children,className:className,count:count,data:data={},disabled:disabled,htmlOptions:htmlOptions={},icon:icon=null,iconRight:iconRight=false,id:id,loading:loading=false,onClick:onClick,tabIndex:tabIndex,link:link=null,newWindow:newWindow=false,target:target="",text:text,htmlType:htmlType="button",value:value,variant:variant,form:form=null}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const css=classnames(buttonClassName(props),globalProps(props),className);const loadingIcon=jsx("div",{className:"loading-icon",children:jsx(Icon,{className:"svg-inline--fa",customIcon:spinnerIcon.icon,fixedWidth:true,pulse:true})});const content=jsxs("span",{className:"pb_button_content",children:[icon&&!iconRight&&jsx(Icon,{className:"button_with_icon",icon:icon}),jsx("span",{children:text||children}),icon&&iconRight&&jsx(Icon,{className:"button_with_icon_right",icon:icon})]});const ifLoading=()=>{if(loading){return jsx(Fragment,{children:loadingIcon})}else{return content}};const getTargetAttribute=()=>{if(target&&link){return target}else if(newWindow){return"_blank"}return null};const displayButton=()=>{if(link){return jsx("a",{...ariaProps,...dataProps,...htmlProps,className:css,href:link,id:id,rel:target!=="child"?"noreferrer":null,role:"link",tabIndex:tabIndex,target:getTargetAttribute(),children:ifLoading()})}else if(variant==="reaction"){return jsxs("button",{...ariaProps,...dataProps,...htmlProps,className:css,disabled:disabled,form:form,id:id,onClick:onClick,role:"button",tabIndex:tabIndex,type:htmlType,value:value,children:[icon&&isValidEmoji(icon)&&jsxs(Flex,{align:"center",children:[jsx(Icon,{icon:icon}),count&&jsx(Caption,{paddingLeft:"xxs",size:"xs",children:count})]}),!isValidEmoji(icon)&&jsx(Icon,{icon:icon?icon:"face-smile-plus"})]})}else{return jsx("button",{...ariaProps,...dataProps,...htmlProps,className:css,disabled:disabled,form:form,id:id,onClick:onClick,role:"button",tabIndex:tabIndex,type:htmlType,value:value,children:ifLoading()})}};return jsx(Fragment,{children:displayButton()})};const Checkbox=forwardRef(((props,ref)=>{const{aria:aria={},checked:checked=false,children:children,className:className,dark:dark=false,data:data={},disabled:disabled=false,error:error=false,htmlOptions:htmlOptions={},id:id,indeterminate:indeterminate=false,name:name="",onChange:onChange=()=>{},requiredIndicator:requiredIndicator=false,tabIndex:tabIndex,text:text="",value:value=""}=props;const internalRef=useRef(null);const setRefs=el=>{internalRef.current=el;if(typeof ref==="function"){ref(el)}else if(ref){ref.current=el}};const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_checkbox_kit",checked?"checked":null,error?"error":null,indeterminate?"indeterminate":null),globalProps(props),className);useEffect((()=>{if(internalRef.current){internalRef.current.checked=checked;internalRef.current.indeterminate=indeterminate}}),[indeterminate,checked]);const checkboxChildren=()=>{if(children)return children;else return jsx("input",{defaultChecked:checked,disabled:disabled,name:name,onChange:onChange,ref:setRefs,tabIndex:tabIndex,type:"checkbox",value:value})};return jsxs("label",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:[jsx(Fragment,{children:checkboxChildren()}),!indeterminate&&jsx("span",{className:"pb_checkbox_checkmark",children:jsx(Icon,{className:"check_icon",fixedWidth:true,icon:"check"})}),indeterminate&&jsx("span",{className:"pb_checkbox_indeterminate",children:jsx(Icon,{className:"indeterminate_icon",fixedWidth:true,icon:"minus"})}),jsxs(Body,{className:"pb_checkbox_label",dark:dark,status:error?"negative":null,variant:null,children:[text,requiredIndicator&&jsx("span",{"aria-hidden":"true",className:"pb_required_indicator",style:{color:colors.error,marginLeft:spacing.space_xs},children:"*"})]})]})}));Checkbox.displayName="Checkbox";const CircleIconButton=props=>{const{aria:aria={},className:className,dark:dark,data:data={},disabled:disabled,htmlOptions:htmlOptions={},icon:icon,id:id,loading:loading=false,onClick:onClick=noop,type:type,target:target,link:link,newWindow:newWindow,variant:variant,size:size="default"}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const sizeClass=size==="sm"?"size_small":"";const classes=classnames(buildCss("pb_circle_icon_button_kit"),sizeClass,globalProps(props),className);return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:jsx(Button,{aria:aria,dark:dark,disabled:disabled,htmlType:type,link:link,loading:loading,newWindow:newWindow,onClick:onClick,target:target,text:null,variant:variant,children:jsx(Icon,{fixedWidth:true,htmlOptions:{"aria-hidden":true},icon:icon})})})};const showElement=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.classList.add("is-visible")}elem.style.height="";elem.style.overflow="visible"}),300)};const hideElement=elem=>{elem.style.height=elem.scrollHeight+"px";window.setTimeout((()=>{elem.style.height="0";elem.style.paddingTop="0";elem.style.paddingBottom="0";elem.style.overflow="hidden"}),1);window.setTimeout((()=>{elem.classList.remove("is-visible");elem.style.overflow=""}),300)};const CollapsibleContext=createContext({});const CollapsibleContent=({children:children,className:className,...props})=>{const context=useContext(CollapsibleContext);const contentCSS=buildCss("pb_collapsible_content_kit");const contentSpacing=globalProps(props);const contentRef=useRef(null);useEffect((()=>{if(contentRef.current){if(context.collapsed){hideElement(contentRef.current)}else{showElement(contentRef.current)}}}),[context.collapsed]);return jsx("div",{className:classnames(contentCSS,contentSpacing,"toggle-content",className),"data-collapsible-content":"true",ref:contentRef,children:children})};const FlexItem=props=>{const{children:children,className:className,fixedSize:fixedSize,grow:grow,htmlOptions:htmlOptions={},shrink:shrink,flex:flex="none",order:order="none",alignSelf:alignSelf,displayFlex:displayFlex}=props;const growClass=grow===true?"pb_flex_item_kit_grow":"";const displayFlexClass=displayFlex===true?"pb_flex_item_kit_display_flex":"";const flexClass=flex!=="none"?`pb_flex_item_kit_flex_${flex}`:"";const shrinkClass=shrink===true?"pb_flex_item_kit_shrink":"";const alignSelfClass=alignSelf?`pb_flex_item_kit_align_self_${alignSelf}`:"";const fixedStyle=fixedSize!==void 0?{flexBasis:`${fixedSize}`}:null;const orderClass=order!=="none"?`pb_flex_item_kit_order_${order}`:"";const dynamicInlineProps=globalInlineProps(props);const{style:htmlStyle,...htmlOptionsWithoutStyle}=htmlOptions;const htmlStyleObj=htmlStyle&&typeof htmlStyle==="object"?htmlStyle:{};const combinedStyles={...htmlStyleObj,...fixedStyle,...dynamicInlineProps};const htmlProps=buildHtmlProps(htmlOptionsWithoutStyle);return jsx("div",{...htmlProps,className:classnames("pb_flex_item_kit",growClass,shrinkClass,flexClass,displayFlexClass,orderClass,alignSelfClass,globalProps(props),className),style:combinedStyles,children:children})};const colorMap={default:"text_lt_default",light:"text_lt_light",lighter:"text_lt_lighter",link:"primary",error:"error",success:"text_dk_success_sm"};const CollapsibleIcon=({collapsed:collapsed,icon:icon,iconSize:iconSize,iconColor:iconColor,onIconClick:onIconClick})=>{const color=colorMap[iconColor];const showIcon=icon2=>{if(icon2==="none"){return[]}else if(typeof icon2==="string"){return[icon2,icon2]}return icon2};const handleIconClick=e=>{if(onIconClick){e.stopPropagation();onIconClick()}};return jsx(Fragment,{children:icon!=="none"?collapsed?jsx("div",{className:"icon_wrapper",onClick:e=>handleIconClick(e),style:{verticalAlign:"middle"},children:jsx(Icon,{color:color,icon:icon?showIcon(icon)[0]:"chevron-down",size:iconSize})},icon?showIcon(icon)[0]:"chevron-down"):jsx("div",{className:"icon_wrapper",onClick:e=>handleIconClick(e),style:{verticalAlign:"middle"},children:jsx(Icon,{color:color,icon:icon?showIcon(icon)[1]:"chevron-up",size:iconSize})},icon?showIcon(icon)[1]:"chevron-up"):jsx("div",{})})};const CollapsibleMain=({children:children,className:className,cursor:cursor="pointer",...props})=>{const{collapsed:collapsed,toggle:toggle,icon:icon,iconSize:iconSize,iconColor:iconColor,onIconClick:onIconClick,onClick:onClick}=useContext(CollapsibleContext);const mainCSS=buildCss("pb_collapsible_main_kit");const mainSpacing=globalProps(props,{cursor:cursor});const handleCollapsibleClick=()=>{onClick&&onClick();const disableToggle=onClick&&onClick();if(disableToggle!==true){toggle()}};return jsx("div",{className:classnames(mainCSS,mainSpacing,className),children:jsx("div",{onClick:handleCollapsibleClick,children:jsxs(Flex,{spacing:"between",vertical:"center",children:[jsx(FlexItem,{children:children}),jsx(FlexItem,{children:jsx(CollapsibleIcon,{collapsed:collapsed,icon:icon,iconColor:iconColor,iconSize:iconSize,onIconClick:onIconClick})})]})})})};const Collapsible=({aria:aria={},className:className,children:children,collapsed:collapsed=true,data:data={},htmlOptions:htmlOptions={},icon:icon,iconColor:iconColor="default",iconSize:iconSize,onIconClick:onIconClick,onClick:onClick,id:id,tag:tag="div",...props})=>{const[isCollapsed,toggle,setIsCollapsed]=useCollapsible(collapsed);useEffect((()=>{setIsCollapsed(collapsed)}),[collapsed]);if(children.length!==2){throw new Error("Collapsible requires <CollapsibleMain> and <CollapsibleContent> to function properly.")}const FirstChild=children[0];const Main=FirstChild.type===CollapsibleMain?FirstChild:null;const Content=children[1];const{children:mainChildren=null,...mainProps}=Main?Main.props:{};const{children:contentChildren,...contentProps}=Content.props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_collapsible_kit"),globalProps(props),className);const dynamicInlineProps=globalInlineProps(props);const Tag=`${tag}`;return jsx(CollapsibleContext.Provider,{value:{collapsed:isCollapsed,toggle:toggle,icon:icon,iconSize:iconSize,iconColor:iconColor,onIconClick:onIconClick,onClick:onClick},children:jsxs(Tag,{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,style:dynamicInlineProps,children:[Main?jsx(CollapsibleMain,{...mainProps,children:mainChildren}):FirstChild,jsx(CollapsibleContent,{...contentProps,children:contentChildren})]})})};Collapsible.Main=CollapsibleMain;Collapsible.Content=CollapsibleContent;Collapsible.Icon=CollapsibleIcon;const SectionSeparator=props=>{const{aria:aria={},children:children,className:className,color:color="default",data:data={},htmlOptions:htmlOptions={},id:id,lineStyle:lineStyle="solid",orientation:orientation="horizontal",text:text,dark:dark=false,variant:variant="card"}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames("pb_section_separator_kit",`pb_section_separator_${variant}`,`pb_section_separator_${orientation}`,lineStyle==="dashed"?"pb_section_separator_dashed":"pb_section_separator_solid",color!=="default"?`pb_section_separator_color_${color}`:"pb_section_separator_color_default",globalProps(props),className);const dynamicInlineProps=globalInlineProps(props);return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,style:dynamicInlineProps,children:children&&children||text&&jsx("span",{children:jsx(Caption,{dark:dark,text:text})})})};var warning_1;var hasRequiredWarning;function requireWarning(){if(hasRequiredWarning)return warning_1;hasRequiredWarning=1;var warning2=function(){};warning_1=warning2;return warning_1}const List=props=>{const{aria:aria={},borderless:borderless=false,children:children,className:className,dark:dark=false,data:data={},enableDrag:enableDrag=false,htmlOptions:htmlOptions={},id:id,layout:layout="",ordered:ordered=false,role:role,size:size="",tabIndex:tabIndex,xpadding:xpadding=false,variant:variant,text:text}=props;const layoutClass={left:"layout_left",right:"layout_right",default:""};const childrenWithProps=React__default.Children.map(children,(child=>React__default.cloneElement(child,{text:text,variant:variant,enableDrag:enableDrag})));const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_list_kit",layoutClass[layout],size,{dark:dark,borderless:borderless,ordered:ordered,xpadding:xpadding}),globalProps(props),className);return jsx(Fragment,{children:enableDrag?jsx(Draggable.Container,{children:jsx("div",{className:classes,children:ordered?jsx("ol",{...ariaProps,...dataProps,...htmlProps,className:className,id:id,role:role,tabIndex:tabIndex,children:childrenWithProps}):jsx("ul",{...ariaProps,...dataProps,...htmlProps,className:className,id:id,role:role,tabIndex:tabIndex,children:childrenWithProps})})}):jsx("div",{className:classes,children:ordered?jsx("ol",{...ariaProps,...dataProps,...htmlProps,className:className,id:id,role:role,tabIndex:tabIndex,children:childrenWithProps}):jsx("ul",{...ariaProps,...dataProps,...htmlProps,className:className,id:id,role:role,tabIndex:tabIndex,children:childrenWithProps})})})};const ListItem=props=>{const{aria:aria={},children:children,className:className,data:data={},enableDrag:enableDrag,dragId:dragId,dragHandle:dragHandle=true,htmlOptions:htmlOptions={},id:id,tabIndex:tabIndex}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_item_kit"),globalProps(props),className);return jsx(Fragment,{children:enableDrag?jsx(Draggable.Item,{dragId:dragId,children:jsxs("li",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,tabIndex:tabIndex,children:[dragHandle&&jsx("span",{className:"pb_draggable_handle",style:{verticalAlign:"middle"},children:jsx(Body,{color:"light",children:jsx(Icon,{icon:"grip-dots-vertical",verticalAlign:"middle"})})}),children]})}):jsx("li",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,tabIndex:tabIndex,children:children})})};const calculateDateRange=(timePeriod,amount)=>{const endDate=new Date;const startDate=new Date;switch(timePeriod){case"days":startDate.setDate(endDate.getDate()-amount);break;case"weeks":startDate.setDate(endDate.getDate()-amount*7);break;case"months":startDate.setMonth(endDate.getMonth()-amount);break;case"quarters":startDate.setMonth(endDate.getMonth()-amount*3);break;case"years":startDate.setFullYear(endDate.getFullYear()-amount);break;default:throw new Error("Invalid time period")}return[startDate,endDate]};const formatDate=date=>{const day=String(date.getDate()).padStart(2,"0");const month=String(date.getMonth()+1).padStart(2,"0");const year=date.getFullYear();return`${month}/${day}/${year}`};const createOptionFromCustomDate=customDate=>{let dateRange;if(Array.isArray(customDate.value)){dateRange=customDate.value.map((dateStr=>new Date(dateStr)))}else{dateRange=calculateDateRange(customDate.value.timePeriod,customDate.value.amount)}return{label:customDate.label,value:dateRange,formattedStartDate:formatDate(dateRange[0]),formattedEndDate:formatDate(dateRange[1]),id:`quickpick-${customDate.label.toLowerCase().replace(/\s+/g,"-")}`}};const getQuickPickOptions=(rangeEndsToday=false,customQuickPickDates)=>{const today=new Date;const yesterday=DateTime.getYesterdayDate(new Date);const thisWeekStartDate=DateTime.getFirstDayOfWeek(new Date);const thisWeekEndDate=rangeEndsToday?new Date:DateTime.getLastDayOfWeek(new Date);const lastWeekStartDate=DateTime.getPreviousWeekStartDate(new Date);const lastWeekEndDate=DateTime.getPreviousWeekEndDate(new Date);const thisMonthStartDate=DateTime.getMonthStartDate(new Date);const thisMonthEndDate=rangeEndsToday?new Date:DateTime.getMonthEndDate(new Date);const lastMonthStartDate=DateTime.getPreviousMonthStartDate(new Date);const lastMonthEndDate=DateTime.getPreviousMonthEndDate(new Date);const thisQuarterStartDate=DateTime.getQuarterStartDate(new Date);const thisQuarterEndDate=rangeEndsToday?new Date:DateTime.getQuarterEndDate(new Date);const lastQuarterStartDate=DateTime.getPreviousQuarterStartDate(new Date);const lastQuarterEndDate=DateTime.getPreviousQuarterEndDate(new Date);const thisYearStartDate=DateTime.getYearStartDate(new Date);const thisYearEndDate=rangeEndsToday?new Date:DateTime.getYearEndDate(new Date);const lastYearStartDate=DateTime.getPreviousYearStartDate(new Date);const lastYearEndDate=DateTime.getPreviousYearEndDate(new Date);const defaultOptions=[{label:"Today",value:[today,today],id:"quickpick-today"},{label:"Yesterday",value:[yesterday,yesterday],formattedStartDate:`${formatDate(yesterday)}`,formattedEndDate:`${formatDate(yesterday)}`,id:"quickpick-yesterday"},{label:"This Week",value:[thisWeekStartDate,thisWeekEndDate],formattedStartDate:`${formatDate(thisWeekStartDate)}`,formattedEndDate:`${formatDate(thisWeekEndDate)}`,id:"quickpick-this-week"},{label:"This Month",value:[thisMonthStartDate,thisMonthEndDate],formattedStartDate:`${formatDate(thisMonthStartDate)}`,formattedEndDate:`${formatDate(thisMonthEndDate)}`,id:"quickpick-this-month"},{label:"This Quarter",value:[thisQuarterStartDate,thisQuarterEndDate],formattedStartDate:`${formatDate(thisQuarterStartDate)}`,formattedEndDate:`${formatDate(thisQuarterEndDate)}`,id:"quickpick-this-quarter"},{label:"This Year",value:[thisYearStartDate,thisYearEndDate],formattedStartDate:`${formatDate(thisYearStartDate)}`,formattedEndDate:`${formatDate(thisYearEndDate)}`,id:"quickpick-this-year"},{label:"Last Week",value:[lastWeekStartDate,lastWeekEndDate],formattedStartDate:`${formatDate(lastWeekStartDate)}`,formattedEndDate:`${formatDate(lastWeekEndDate)}`,id:"quickpick-last-week"},{label:"Last Month",value:[lastMonthStartDate,lastMonthEndDate],formattedStartDate:`${formatDate(lastMonthStartDate)}`,formattedEndDate:`${formatDate(lastMonthEndDate)}`,id:"quickpick-last-month"},{label:"Last Quarter",value:[lastQuarterStartDate,lastQuarterEndDate],formattedStartDate:`${formatDate(lastQuarterStartDate)}`,formattedEndDate:`${formatDate(lastQuarterEndDate)}`,id:"quickpick-last-quarter"},{label:"Last Year",value:[lastYearStartDate,lastYearEndDate],formattedStartDate:`${formatDate(lastYearStartDate)}`,formattedEndDate:`${formatDate(lastYearEndDate)}`,id:"quickpick-last-year"}];if(customQuickPickDates&&customQuickPickDates.dates&&customQuickPickDates.dates.length>0){const customOptions=customQuickPickDates.dates.map(createOptionFromCustomDate);if(customQuickPickDates.override===false){return[...defaultOptions,...customOptions]}return customOptions}return defaultOptions};var ManagerReferenceNodeContext=React.createContext();var ManagerReferenceNodeSetterContext=React.createContext();function Manager(_ref){var children=_ref.children;var _React$useState=React.useState(null),referenceNode=_React$useState[0],setReferenceNode=_React$useState[1];var hasUnmounted=React.useRef(false);React.useEffect((function(){return function(){hasUnmounted.current=true}}),[]);var handleSetReferenceNode=React.useCallback((function(node){if(!hasUnmounted.current){setReferenceNode(node)}}),[]);return React.createElement(ManagerReferenceNodeContext.Provider,{value:referenceNode},React.createElement(ManagerReferenceNodeSetterContext.Provider,{value:handleSetReferenceNode},children))}var unwrapArray=function unwrapArray2(arg){return Array.isArray(arg)?arg[0]:arg};var safeInvoke=function safeInvoke2(fn){if(typeof fn==="function"){for(var _len=arguments.length,args=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){args[_key-1]=arguments[_key]}return fn.apply(void 0,args)}};var setRef=function setRef2(ref,node){if(typeof ref==="function"){return safeInvoke(ref,node)}else if(ref!=null){ref.current=node}};var fromEntries=function fromEntries2(entries){return entries.reduce((function(acc,_ref){var key=_ref[0],value=_ref[1];acc[key]=value;return acc}),{})};var useIsomorphicLayoutEffect=typeof window!=="undefined"&&window.document&&window.document.createElement?React.useLayoutEffect:React.useEffect;var reactFastCompare;var hasRequiredReactFastCompare;function requireReactFastCompare(){if(hasRequiredReactFastCompare)return reactFastCompare;hasRequiredReactFastCompare=1;var hasElementType=typeof Element!=="undefined";var hasMap=typeof Map==="function";var hasSet=typeof Set==="function";var hasArrayBuffer=typeof ArrayBuffer==="function"&&!!ArrayBuffer.isView;function equal(a,b){if(a===b)return true;if(a&&b&&typeof a=="object"&&typeof b=="object"){if(a.constructor!==b.constructor)return false;var length,i,keys;if(Array.isArray(a)){length=a.length;if(length!=b.length)return false;for(i=length;i--!==0;)if(!equal(a[i],b[i]))return false;return true}var it;if(hasMap&&a instanceof Map&&b instanceof Map){if(a.size!==b.size)return false;it=a.entries();while(!(i=it.next()).done)if(!b.has(i.value[0]))return false;it=a.entries();while(!(i=it.next()).done)if(!equal(i.value[1],b.get(i.value[0])))return false;return true}if(hasSet&&a instanceof Set&&b instanceof Set){if(a.size!==b.size)return false;it=a.entries();while(!(i=it.next()).done)if(!b.has(i.value[0]))return false;return true}if(hasArrayBuffer&&ArrayBuffer.isView(a)&&ArrayBuffer.isView(b)){length=a.length;if(length!=b.length)return false;for(i=length;i--!==0;)if(a[i]!==b[i])return false;return true}if(a.constructor===RegExp)return a.source===b.source&&a.flags===b.flags;if(a.valueOf!==Object.prototype.valueOf)return a.valueOf()===b.valueOf();if(a.toString!==Object.prototype.toString)return a.toString()===b.toString();keys=Object.keys(a);length=keys.length;if(length!==Object.keys(b).length)return false;for(i=length;i--!==0;)if(!Object.prototype.hasOwnProperty.call(b,keys[i]))return false;if(hasElementType&&a instanceof Element)return false;for(i=length;i--!==0;){if((keys[i]==="_owner"||keys[i]==="__v"||keys[i]==="__o")&&a.$$typeof){continue}if(!equal(a[keys[i]],b[keys[i]]))return false}return true}return a!==a&&b!==b}reactFastCompare=function isEqual2(a,b){try{return equal(a,b)}catch(error){if((error.message||"").match(/stack|recursion/i)){console.warn("react-fast-compare cannot handle circular refs");return false}throw error}};return reactFastCompare}var reactFastCompareExports=requireReactFastCompare();const isEqual=getDefaultExportFromCjs(reactFastCompareExports);var EMPTY_MODIFIERS$1=[];var usePopper=function usePopper2(referenceElement,popperElement,options){if(options===void 0){options={}}var prevOptions=React.useRef(null);var optionsWithDefaults={onFirstUpdate:options.onFirstUpdate,placement:options.placement||"bottom",strategy:options.strategy||"absolute",modifiers:options.modifiers||EMPTY_MODIFIERS$1};var _React$useState=React.useState({styles:{popper:{position:optionsWithDefaults.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),state=_React$useState[0],setState=_React$useState[1];var updateStateModifier=React.useMemo((function(){return{name:"updateState",enabled:true,phase:"write",fn:function fn(_ref){var state2=_ref.state;var elements=Object.keys(state2.elements);ReactDOM.flushSync((function(){setState({styles:fromEntries(elements.map((function(element){return[element,state2.styles[element]||{}]}))),attributes:fromEntries(elements.map((function(element){return[element,state2.attributes[element]]})))})}))},requires:["computeStyles"]}}),[]);var popperOptions=React.useMemo((function(){var newOptions={onFirstUpdate:optionsWithDefaults.onFirstUpdate,placement:optionsWithDefaults.placement,strategy:optionsWithDefaults.strategy,modifiers:[].concat(optionsWithDefaults.modifiers,[updateStateModifier,{name:"applyStyles",enabled:false}])};if(isEqual(prevOptions.current,newOptions)){return prevOptions.current||newOptions}else{prevOptions.current=newOptions;return newOptions}}),[optionsWithDefaults.onFirstUpdate,optionsWithDefaults.placement,optionsWithDefaults.strategy,optionsWithDefaults.modifiers,updateStateModifier]);var popperInstanceRef=React.useRef();useIsomorphicLayoutEffect((function(){if(popperInstanceRef.current){popperInstanceRef.current.setOptions(popperOptions)}}),[popperOptions]);useIsomorphicLayoutEffect((function(){if(referenceElement==null||popperElement==null){return}var createPopper$1=options.createPopper||createPopper;var popperInstance=createPopper$1(referenceElement,popperElement,popperOptions);popperInstanceRef.current=popperInstance;return function(){popperInstance.destroy();popperInstanceRef.current=null}}),[referenceElement,popperElement,options.createPopper]);return{state:popperInstanceRef.current?popperInstanceRef.current.state:null,styles:state.styles,attributes:state.attributes,update:popperInstanceRef.current?popperInstanceRef.current.update:null,forceUpdate:popperInstanceRef.current?popperInstanceRef.current.forceUpdate:null}};var NOOP=function NOOP2(){return void 0};var NOOP_PROMISE=function NOOP_PROMISE2(){return Promise.resolve(null)};var EMPTY_MODIFIERS=[];function Popper(_ref){var _ref$placement=_ref.placement,placement=_ref$placement===void 0?"bottom":_ref$placement,_ref$strategy=_ref.strategy,strategy=_ref$strategy===void 0?"absolute":_ref$strategy,_ref$modifiers=_ref.modifiers,modifiers=_ref$modifiers===void 0?EMPTY_MODIFIERS:_ref$modifiers,referenceElement=_ref.referenceElement,onFirstUpdate=_ref.onFirstUpdate,innerRef=_ref.innerRef,children=_ref.children;var referenceNode=React.useContext(ManagerReferenceNodeContext);var _React$useState=React.useState(null),popperElement=_React$useState[0],setPopperElement=_React$useState[1];var _React$useState2=React.useState(null),arrowElement=_React$useState2[0],setArrowElement=_React$useState2[1];React.useEffect((function(){setRef(innerRef,popperElement)}),[innerRef,popperElement]);var options=React.useMemo((function(){return{placement:placement,strategy:strategy,onFirstUpdate:onFirstUpdate,modifiers:[].concat(modifiers,[{name:"arrow",enabled:arrowElement!=null,options:{element:arrowElement}}])}}),[placement,strategy,onFirstUpdate,modifiers,arrowElement]);var _usePopper=usePopper(referenceElement||referenceNode,popperElement,options),state=_usePopper.state,styles=_usePopper.styles,forceUpdate=_usePopper.forceUpdate,update=_usePopper.update;var childrenProps=React.useMemo((function(){return{ref:setPopperElement,style:styles.popper,placement:state?state.placement:placement,hasPopperEscaped:state&&state.modifiersData.hide?state.modifiersData.hide.hasPopperEscaped:null,isReferenceHidden:state&&state.modifiersData.hide?state.modifiersData.hide.isReferenceHidden:null,arrowProps:{style:styles.arrow,ref:setArrowElement},forceUpdate:forceUpdate||NOOP,update:update||NOOP_PROMISE}}),[setPopperElement,setArrowElement,placement,state,styles,update,forceUpdate]);return unwrapArray(children)(childrenProps)}var warningExports=requireWarning();const warning=getDefaultExportFromCjs(warningExports);function Reference(_ref){var children=_ref.children,innerRef=_ref.innerRef;var setReferenceNode=React.useContext(ManagerReferenceNodeSetterContext);var refHandler=React.useCallback((function(node){setRef(innerRef,node);safeInvoke(setReferenceNode,node)}),[innerRef,setReferenceNode]);React.useEffect((function(){return function(){return setRef(innerRef,null)}}),[]);React.useEffect((function(){warning(Boolean(setReferenceNode),"`Reference` should not be used outside of a `Manager` component.")}),[setReferenceNode]);return unwrapArray(children)({ref:refHandler})}const POPOVER_MODIFIERS={offset:{enabled:true,name:"offset",options:{offset:[0,20]},phase:"main"}};const popoverModifiers=({modifiers:modifiers,offset:offset})=>offset?modifiers.concat([POPOVER_MODIFIERS.offset]):modifiers;const getAppendTarget=(appendTo,targetId)=>{if(appendTo&&appendTo!=="body"){if(appendTo==="parent"){const referenceWrapper2=document.querySelector(`#reference-${targetId}`);if(referenceWrapper2==null?void 0:referenceWrapper2.parentElement){return referenceWrapper2.parentElement}}const selectorMatch=document.querySelector(appendTo);if(selectorMatch instanceof HTMLElement)return selectorMatch}const referenceWrapper=document.querySelector(`#reference-${targetId}`);const fullscreenOverlay=resolveFullscreenOverlayForElement(referenceWrapper);if(fullscreenOverlay)return fullscreenOverlay;return document.body};const Popover=props=>{const{aria:aria={},className:className,children:children,data:data={},htmlOptions:htmlOptions={},id:id,modifiers:modifiers,offset:offset,placement:placement,referenceElement:referenceElement,zIndex:zIndex,maxHeight:maxHeight,maxWidth:maxWidth,minHeight:minHeight,minWidth:minWidth,width:width,targetId:targetId}=props;const items=globalProps(props).split(" ");const filteredItems=items.filter((item=>!item.includes("min-width")&&!item.includes("width")));const filteredGlobalProps=filteredItems.join(" ");const popoverSpacing=filteredGlobalProps.includes("dark")||!filteredGlobalProps?"p_sm":filteredGlobalProps;const overflowHandling=maxHeight||maxWidth?"overflow_handling":"";const zIndexStyle=zIndex?{zIndex:zIndex}:{};const[selectMenuPortalTarget,setSelectMenuPortalTarget]=useState(null);const floatingRootRef=useCallback((node=>{setSelectMenuPortalTarget(node)}),[]);const menuPortalApi=useMemo((()=>({selectMenuPortalTarget:selectMenuPortalTarget})),[selectMenuPortalTarget]);const widthHeightStyles=()=>Object.assign({},maxHeight?{maxHeight:maxHeight}:{},maxWidth?{maxWidth:maxWidth}:{},minHeight?{minHeight:minHeight}:{},minWidth?{minWidth:minWidth}:{},width?{width:width}:{});const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_popover_kit"),filteredGlobalProps,className);return jsx(Popper,{modifiers:popoverModifiers({modifiers:modifiers,offset:offset||false}),placement:placement,referenceElement:referenceElement,children:({placement:placement2,ref:ref,style:style})=>jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,"data-placement":placement2,id:id,ref:ref,style:Object.assign({},style,zIndexStyle),children:jsx("div",{className:classnames(`${buildCss("pb_popover_tooltip")} show`),children:jsx("div",{className:classnames("pb_popover_body",popoverSpacing),id:targetId,style:widthHeightStyles(),...targetId?{[PB_FLOATING_OWNER_ATTR]:targetId}:{},children:jsxs(DialogContext.Provider,{value:menuPortalApi,children:[jsx("div",{className:classnames("pb_popover_scroll_region",overflowHandling),children:children}),jsx("div",{"aria-hidden":"true",className:"pb_popover_floating_root","data-pb-dialog-floating-root":"true",...targetId?{[PB_FLOATING_OWNER_ATTR]:targetId}:{},ref:floatingRootRef})]})})})})})};const PbReactPopover=props=>{const[targetId]=useState(uniqueId("id-"));const{appendTo:appendTo,className:className,children:children,modifiers:modifiers=[],offset:offset=false,placement:placement="left",portal:portal="body",reference:reference,referenceElement:referenceElement,show:show=false,usePortal:usePortal=true,zIndex:zIndex,maxHeight:maxHeight,maxWidth:maxWidth,minHeight:minHeight,minWidth:minWidth,width:width,closeOnClick:closeOnClick,shouldClosePopover:shouldClosePopover=noop}=props;const shouldClosePopoverRef=useRef(shouldClosePopover);useEffect((()=>{shouldClosePopoverRef.current=shouldClosePopover}),[shouldClosePopover]);useEffect((()=>{if(!closeOnClick)return;const handleClick=e=>{const targetEl=e.target instanceof Element?e.target:null;const targetIsPopover=(targetEl==null?void 0:targetEl.closest("#"+targetId))!==null||isPortaledFloatingKitInteraction(e.target,targetId,e.clientX,e.clientY);const targetIsReference=(targetEl==null?void 0:targetEl.closest("#reference-"+targetId))!==null;const shouldClose=()=>{setTimeout((()=>shouldClosePopoverRef.current(true)),0)};switch(closeOnClick){case"outside":if(!targetIsPopover&&!targetIsReference)shouldClose();break;case"inside":if(isPortaledFloatingKitInteraction(e.target,targetId,e.clientX,e.clientY))return;if(targetIsPopover)shouldClose();break;case"any":if(isPortaledFloatingKitInteraction(e.target,targetId,e.clientX,e.clientY))return;if(targetIsPopover||!targetIsPopover&&!targetIsReference)shouldClose();break}};document.body.addEventListener("click",handleClick,{capture:true});return()=>{document.body.removeEventListener("click",handleClick,{capture:true})}}),[targetId,closeOnClick]);const popoverComponent=jsx(Popover,{className:className,maxHeight:maxHeight,maxWidth:maxWidth,minHeight:minHeight,minWidth:minWidth,modifiers:modifiers,offset:offset,placement:placement,referenceElement:referenceElement,targetId:targetId,width:width,zIndex:zIndex,...props,children:children});return jsx(Manager,{children:jsxs(Fragment,{children:[reference&&!referenceElement&&jsx(Reference,{children:({ref:ref})=>jsx("span",{className:"pb_popover_reference_wrapper",id:"reference-"+targetId,ref:ref,children:jsx(reference.type,{...reference.props})})}),show&&(usePortal?jsx(Fragment,{children:ReactDOM__default.createPortal(popoverComponent,getAppendTarget(appendTo,targetId))}):popoverComponent)]})})};const dropdownOptionsFor=config=>{var _a;if(config.variant==="quickpick"&&!((_a=config.options)==null?void 0:_a.length)){return getQuickPickOptions(config.rangeEndsToday,config.customQuickPickDates).map((opt=>({value:opt.id||opt.label,label:opt.label})))}return(config.options||[]).map((opt=>({value:opt.id||opt.value||opt.label,label:opt.label})))};const labelFor=(config,value)=>{if(config.type==="select"){const match=config.options.find((opt=>opt.value===value));if(match)return match.text||match.value}if(config.type==="dropdown"){const match=dropdownOptionsFor(config).find((opt=>opt.value===value));if(match)return match.label||match.value}return value};const ChipVisual=({dark:dark,name:name,displayValue:displayValue})=>jsxs("div",{className:"pb_interactive_filter_container",children:[jsx(Caption,{dark:dark,text:name}),jsxs(Flex,{alignItems:"center",gap:"xxs",children:[jsx(Title,{dark:dark,size:4,text:displayValue||"—"}),jsx(Icon,{color:"primary",fixedWidth:true,icon:"angle-down",size:"xs"})]})]});const InlineCalendar=({calendarValue:calendarValue,config:config,onSinglePick:onSinglePick})=>{const containerRef=useRef(null);useEffect((()=>{if(!containerRef.current)return;const fp=flatpickr(containerRef.current,{inline:true,defaultDate:calendarValue||void 0,mode:config.mode||"single",dateFormat:config.format||"m/d/Y",minDate:config.minDate,maxDate:config.maxDate,nextArrow:'<i class="far fa-angle-right"></i>',prevArrow:'<i class="far fa-angle-left"></i>',onChange:(_selectedDates,dateStr)=>{config.onChange(dateStr);if((config.mode||"single")==="single")onSinglePick()}});return()=>fp.destroy()}),[calendarValue]);return jsx("div",{ref:containerRef})};const InteractiveFilter=({dark:dark=false,name:name,value:value,editorValue:editorValue,config:config})=>{const[open,setOpen]=useState(false);const pickerId=useMemo((()=>uniqueId("interactive-filter-date-")),[]);const displayValue=labelFor(config,value);const activeValue=editorValue??config.editorValue??value;const renderEditor=()=>{switch(config.type){case"select":case"dropdown":{const options=config.type==="dropdown"?dropdownOptionsFor(config):config.options.map((opt=>({value:opt.value,label:opt.text||opt.value})));return jsx("ul",{className:"pb_interactive_filter_options",role:"listbox",children:options.map((option=>{const isActive=option.value===activeValue;return jsx("li",{"aria-selected":isActive,className:`pb_interactive_filter_option${isActive?" active":""}`,onClick:()=>{config.onChange(option.value);setOpen(false)},onKeyDown:event=>{if(event.key==="Enter"||event.key===" "){event.preventDefault();config.onChange(option.value);setOpen(false)}},role:"option",tabIndex:0,children:jsx("span",{children:option.label})},option.value)}))})}case"date-picker":return jsx(InlineCalendar,{calendarValue:activeValue,config:config,onSinglePick:()=>setOpen(false)})}};const trigger=jsx("button",{"aria-expanded":open,"aria-haspopup":"dialog",className:`pb_interactive_filter_trigger${dark?" dark":""}`,"data-picker-id":pickerId,onClick:()=>setOpen((prev=>!prev)),type:"button",children:jsx(ChipVisual,{dark:dark,displayValue:displayValue,name:name})});return jsx(PbReactPopover,{closeOnClick:"outside",offset:true,placement:"bottom-start",reference:trigger,shouldClosePopover:()=>setOpen(false),show:open,zIndex:10,children:jsx("div",{className:`pb_interactive_filter_editor pb_interactive_filter_editor--${config.type}`,children:renderEditor()})})};const hiddenFilters=value=>isEmpty(value)&&value!==true;const CurrentFilters=({dark:dark,filters:filters,interactiveFilters:interactiveFilters={}})=>{const displayableFilters=omitBy(filters,hiddenFilters);return jsxs("div",{className:"maskContainer",children:[isEmpty(filters)&&jsx("div",{className:"filters",children:jsx(Body,{color:"light",paddingLeft:"xs",size:4,tag:"span",text:"No Filter Selected"})}),!isEmpty(filters)&&jsxs("div",{className:"filters",children:[jsx("div",{className:"left_gradient"}),map(displayableFilters,((value,name)=>{const interactiveConfig=interactiveFilters[name];return jsx("div",{className:`filter${interactiveConfig?" interactive":""}`,children:interactiveConfig?jsx(InteractiveFilter,{config:interactiveConfig,dark:dark,editorValue:interactiveConfig.editorValue,name:String(name),value:interactiveConfig.value!==void 0?interactiveConfig.value:value===true?"":value}):value===true?jsx(Title,{dark:dark,size:4,tag:"h4",text:`${name}`}):jsxs("div",{children:[jsx(Caption,{dark:dark,text:`${name}`}),jsx(Title,{dark:dark,size:4,tag:"h4",text:value})]})},`filter-${name}`)})),jsx("div",{className:"right_gradient"})]})]})};const FilterBackground=props=>{const{background:background=true,className:className,children:children,dark:dark,htmlOptions:htmlOptions={}}=props;const htmlProps=buildHtmlProps(htmlOptions);return jsx("div",{...htmlProps,className:classnames(`pb_filter_kit ${className}`,globalProps(props)),children:background?jsx(Card,{dark:dark,padding:"none",children:children}):jsx(Fragment,{children:children})})};const FiltersPopover=({children:children,dark:dark,maxHeight:maxHeight,minWidth:minWidth,placement:placement="bottom-start",popoverProps:popoverProps})=>{const[hide,updateHide]=useState(true);const toggle=()=>updateHide(!hide);const filterButton=jsx(CircleIconButton,{dark:dark,icon:"filter",id:"filter",onClick:toggle,variant:"secondary"});return jsx(PbReactPopover,{closeOnClick:"outside",maxHeight:maxHeight,minWidth:minWidth,placement:placement,reference:filterButton,shouldClosePopover:updateHide,show:!hide,...popoverProps,children:jsx("div",{className:"pb-form",children:typeof children==="function"?children({closePopover:()=>updateHide(true)}):children})})};const TitleCount=props=>{const{align:align="left",aria:aria={},className:className,dark:dark=false,data:data={},htmlOptions:htmlOptions={},count:count,id:id,title:title,size:size="sm"}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const css=classnames(buildCss("pb_title_count_kit",align,size),globalProps(props),className);const formatCount=count.toLocaleString();return jsxs("div",{...ariaProps,...dataProps,...htmlProps,className:css,id:id,children:[jsx(Title,{className:title!==void 0?"pb_title_count_text":"",dark:dark,size:size==="lg"?3:4,text:title}),jsx(Body,{color:"light",dark:dark,children:count&&formatCount})]})};const resultsText=results=>results==1?"Result":"Results";const formatResultsCount=n=>n.toLocaleString();const ResultsCount=({dark:dark,results:results,title:title})=>{const resultTitle=()=>{if(results==null)return null;return jsx(TitleCount,{align:"center",count:results,dark:dark,title:`${resultsText(results)}:`})};const justResults=()=>{if(results==null)return null;return jsx(Caption,{className:"filter-results",dark:dark,size:"xs",text:`${formatResultsCount(results)} ${resultsText(results)}`})};const displayResultsCount=()=>{if(results!=null&&results>=0&&title){return jsx(Fragment,{children:resultTitle()})}else if(results!=null&&results>=0){return jsx(Fragment,{children:justResults()})}else{return jsx("div",{})}};return jsx(Fragment,{children:displayResultsCount()})};const nextValue=(value,name)=>{const current=find(value,{name:name});return{name:name,dir:current&&current.dir=="asc"?"desc":"asc"}};const directionIcon=dir=>dir=="asc"?"arrow-up-wide-short":"arrow-down-short-wide";const renderOptions=(options,value,handleChange)=>map(options,((label,name)=>{const next=nextValue(value,String(name));return jsx(ListItem,{children:jsx(Button,{htmlType:void 0,onClick:partial(handleChange,next),text:` ${label}`,variant:"link"})},`option-${next.name}-${next.dir}`)}));const SortMenu=({dark:dark,options:options,value:value,onChange:onChange})=>{const[hide,updateHide]=useState(true);const toggle=()=>updateHide(!hide);const handleChange=value2=>{updateHide(true);onChange([value2])};const sortButton=jsx(Button,{dark:dark,htmlType:void 0,id:"sort-button",onClick:toggle,paddingRight:"none",variant:"link",children:map(value,(({dir:dir,name:name})=>jsxs("span",{children:[` ${options[name]}`,jsx(Icon,{dark:dark,icon:directionIcon(dir)})]},`current-sort-${name}-${dir}`)))});return jsx(PbReactPopover,{className:"pb_filter_sort_menu",closeOnClick:"outside",padding:"none",placement:"bottom",reference:sortButton,shouldClosePopover:updateHide,show:!hide,children:jsx(List,{children:renderOptions(options,value,handleChange)})})};const FilterSingle=({onSortChange:onSortChange,sortOptions:sortOptions,sortValue:sortValue,filters:filters,interactiveFilters:interactiveFilters,results:results,children:children,dark:dark,maxHeight:maxHeight,minWidth:minWidth,placement:placement,popoverProps:popoverProps,...bgProps})=>jsx(FilterBackground,{dark:dark,...bgProps,children:jsxs(Flex,{orientation:"row",paddingRight:"lg",vertical:"center",children:[children&&jsxs(Fragment,{children:[jsx(FiltersPopover,{dark:dark,maxHeight:maxHeight,minWidth:minWidth,placement:placement,popoverProps:popoverProps,children:children}),jsx(CurrentFilters,{dark:dark,filters:filters,interactiveFilters:interactiveFilters})]}),jsx(ResultsCount,{dark:dark,results:results}),!isEmpty(sortOptions)&&jsx(SortMenu,{dark:dark,onChange:onSortChange,options:sortOptions,value:sortValue})]})});const FilterDouble=({onSortChange:onSortChange,sortOptions:sortOptions,sortValue:sortValue,filters:filters,interactiveFilters:interactiveFilters,results:results,children:children,dark:dark,maxHeight:maxHeight,minWidth:minWidth,placement:placement,popoverProps:popoverProps,...bgProps})=>jsxs(FilterBackground,{dark:dark,...bgProps,children:[jsxs(Flex,{orientation:"row",vertical:"center",children:[jsx(FiltersPopover,{dark:dark,maxHeight:maxHeight,minWidth:minWidth,placement:placement,popoverProps:popoverProps,children:children}),jsx(CurrentFilters,{dark:dark,filters:filters,interactiveFilters:interactiveFilters})]}),jsx(SectionSeparator,{dark:dark}),jsxs(Flex,{className:"filter-bottom",orientation:"row",spacing:"between",vertical:"center",children:[jsx(ResultsCount,{dark:dark,results:results,title:true}),jsxs(Flex,{orientation:"row",vertical:"center",children:[jsx(Caption,{dark:dark,text:"sort by:"}),jsx(SortMenu,{dark:dark,onChange:onSortChange,options:sortOptions,value:sortValue})]})]})]});const FilterResponsive=({children:children,dark:dark,filters:filters,interactiveFilters:interactiveFilters,maxHeight:maxHeight,minWidth:minWidth,onSortChange:onSortChange,placement:placement,popoverProps:popoverProps,results:results,sortOptions:sortOptions,sortValue:sortValue,...bgProps})=>{const showSort=!isEmpty(sortOptions);return jsx(FilterBackground,{dark:dark,...bgProps,children:jsxs("div",{className:"pb_filter_responsive_layout",children:[jsxs("div",{className:"pb_filter_responsive_filters",children:[children&&jsx(FiltersPopover,{dark:dark,maxHeight:maxHeight,minWidth:minWidth,placement:placement,popoverProps:popoverProps,children:children}),jsx(CurrentFilters,{dark:dark,filters:filters,interactiveFilters:interactiveFilters})]}),jsx("div",{className:"pb_filter_responsive_results_inline",children:jsx(ResultsCount,{dark:dark,results:results})}),jsx("div",{className:"pb_filter_responsive_sep",children:jsx(SectionSeparator,{dark:dark})}),jsxs("div",{className:"pb_filter_responsive_bottom filter-bottom",children:[jsx("div",{className:"pb_filter_responsive_results_bar",children:jsx(ResultsCount,{dark:dark,results:results,title:true})}),jsx("div",{className:"pb_filter_responsive_sort",children:showSort&&jsxs(Fragment,{children:[jsx(Caption,{className:"pb_filter_responsive_sort_label",dark:dark,text:"sort by:"}),jsx(SortMenu,{dark:dark,onChange:onSortChange,options:sortOptions,value:sortValue})]})})]})]})})};const FilterSidebar=({onCollapse:onCollapse,onSortChange:onSortChange,sortOptions:sortOptions,sortValue:sortValue,filters:filters,results:results,children:children,dark:dark,isCollapsed:isCollapsed,maxHeight:maxHeight,minWidth:minWidth,placement:placement,popoverProps:popoverProps,...bgProps})=>jsxs(FilterBackground,{dark:dark,...bgProps,children:[jsx(Card.Body,{paddingX:"sm",paddingY:"xs",children:jsxs(Flex,{align:"center",justify:"between",orientation:"row",children:[jsx(ResultsCount,{dark:dark,results:results,title:true}),jsx("div",{onClick:onCollapse,children:jsx(Caption,{color:"link",cursor:"pointer",size:"xs",text:isCollapsed?"Expand All":"Collapse All"})})]})}),jsx(SectionSeparator,{dark:dark}),jsx(Fragment,{children:children})]});const FilterSection=({children:children,collapsible:collapsible=false,collapsed:collapsed=true,headerText:headerText})=>{if(collapsible){return jsxs(Collapsible,{collapsed:collapsed,padding:"none",children:[jsx(Collapsible.Main,{paddingX:"sm",paddingY:"xs",children:jsx(Caption,{children:headerText})}),jsx(Collapsible.Content,{className:"filter_section_collapsible",paddingX:"sm",children:children})]})}return jsx(Body,{paddingTop:"xs",paddingX:"sm",children:jsxs(Fragment,{children:[headerText&&jsx(Caption,{marginBottom:"sm",children:headerText}),children]})})};const Filter=({double:double=false,responsive:responsive,variant:variant,...templateProps})=>{const{children:children,className:className,...layoutProps}=templateProps;const useResponsiveStacked=responsive==="stacked"&&Boolean(children);const mergedClassName=classnames(useResponsiveStacked&&"pb_filter_responsive",className);const displayFilter=()=>{if(variant==="sidebar"){return jsx(FilterSidebar,{className:className,...layoutProps,children:children})}if(useResponsiveStacked){return jsx(FilterResponsive,{...layoutProps,className:mergedClassName,children:children})}if(double===true){return jsx(FilterDouble,{...layoutProps,className:className,children:children})}return jsx(FilterSingle,{...layoutProps,className:className,children:children})};return jsx(Fragment,{children:displayFilter()})};Filter.Section=FilterSection;const LoadingInline=props=>{const{align:align="left",aria:aria={},className:className,color:color="light",data:data={},dark:dark=false,htmlOptions:htmlOptions={},id:id,text:text=" Loading",variant:variant="dotted"}=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,{color:color,dark:dark,children:[jsx(Icon,{aria:{label:"loading icon"},fixedWidth:true,icon:variant==="dotted"?"spinner":variant==="solid"?"circle-notch":void 0,pulse:true}),text]})})};const Nav=props=>{const{aria:aria={},borderless:borderless=false,children:children,className:className,data:data={},dark:dark=false,extendedUnderline:extendedUnderline=false,highlight:highlight=true,htmlOptions:htmlOptions={},id:id,link:link="#",onClick:onClick,orientation:orientation="vertical",title:title="",variant:variant="normal",itemSpacing:itemSpacing}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const cardCss=classnames(buildCss("pb_nav_list",variant,orientation,{highlight:highlight,borderless:borderless}),variant==="normal"&&orientation==="horizontal"&&extendedUnderline&&"pb_nav_extended_underline",globalProps(props),className);const childrenWithProps=React__default.Children.map(children,(child=>{if(React__default.isValidElement(child)){const childProps={orientation:orientation,variant:variant,itemSpacing:itemSpacing};return React__default.cloneElement(child,childProps)}return child}));return jsxs("nav",{...ariaProps,...dataProps,...htmlProps,className:cardCss,id:id,children:[title&&jsx("div",{className:"pb_nav_list_title",children:jsx("a",{className:"pb_nav_list_item_link_text",href:link,onClick:onClick,children:jsx(Caption,{dark:dark,size:"md",text:`${title}`})})}),jsx("div",{className:"pb_nav_wrapper",children:childrenWithProps})]})};const NavItem=props=>{const fontWeightDefault=(orientation2,variant2)=>orientation2==="horizontal"&&variant2==="subtle"?"regular":orientation2==="horizontal"&&variant2==="normal"?"bold":"regular";const{active:active=false,highlighted_border:highlighted_border=true,aria:aria={},orientation:orientation,variant:variant,fontWeight:fontWeight=fontWeightDefault(orientation,variant),children:children,className:className,collapsible:collapsible,data:data={},dark:dark=false,fontSize:fontSize="normal",htmlOptions:htmlOptions={},iconLeft:iconLeft,iconRight:iconRight,onIconRightClick:onIconRightClick,onIconLeftClick:onIconLeftClick,id:id,imageUrl:imageUrl,link:link,onClick:onClick,target:target="_self",text:text="",collapsibleTrail:collapsibleTrail,collapsed:collapsed,itemSpacing:itemSpacing,margin:margin,marginBottom:marginBottom,marginTop:marginTop,marginRight:marginRight,marginLeft:marginLeft,marginX:marginX,marginY:marginY,disabled:disabled=false}=props;const spacingMarginProps={margin:margin,marginBottom:marginBottom,marginTop:marginTop,marginRight:marginRight,marginLeft:marginLeft,marginX:marginX,marginY:marginY};const filterItemSpacing=obj=>{const filteredPadding2={};const filteredMargin2={};for(const key in obj){if(key.startsWith("padding")){filteredPadding2[key]=obj[key]}else if(key.startsWith("margin")){filteredMargin2[key]=obj[key]}}return{filteredPadding:filteredPadding2,filteredMargin:filteredMargin2}};const{filteredPadding:filteredPadding,filteredMargin:filteredMargin}=filterItemSpacing(itemSpacing);const finalItemSpacing={...filteredMargin||{},...Object.entries(spacingMarginProps).reduce(((acc,[prop,value])=>{if(value){acc[prop]=value}return acc}),{})};const filteredProps={...props};filteredProps==null?true:delete filteredProps.margin;filteredProps==null?true:delete filteredProps.marginX;filteredProps==null?true:delete filteredProps.marginY;filteredProps==null?true:delete filteredProps.marginBottom;filteredProps==null?true:delete filteredProps.marginTop;filteredProps==null?true:delete filteredProps.marginRight;filteredProps==null?true:delete filteredProps.marginLeft;const isLink=!!link&&!disabled;const Tag=isLink?"a":"div";const activeClass=active===true?"active":"";const highlightedBorderClass=active===true&&highlighted_border===false?"highlighted_border_none":"";const collapsibleTrailClass=collapsible&&collapsibleTrail?"collapsible_trail":"";const disabledClass=disabled?"pb_nav_item_disabled":"";const fontSizeMapping={small:"font_size_small",normal:"font_size_normal"};const fontWeightMapping={bold:"font_bold",bolder:"font_bolder",regular:"font_regular"};const fontSizeClass=fontSizeMapping[fontSize];const fontWeightClass=fontWeightMapping[fontWeight];const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const tagClasses=classnames(collapsible?"pb_nav_list_item_link_collapsible":"pb_nav_list_item_link");const classes=classnames(buildCss("pb_nav_list_kit_item",activeClass,highlightedBorderClass),collapsible?buildCss("pb_collapsible_nav_item",activeClass,highlightedBorderClass):"",fontSizeClass,fontWeightClass,tagClasses,collapsible?globalProps(filteredProps,{...filteredPadding}):globalProps(props,{...itemSpacing}),disabledClass,className);const handleIconClick=e=>{if(onIconLeftClick){e.stopPropagation();onIconLeftClick()}};const childrenWithProps=React__default.Children.map(children,(child=>{if(React__default.isValidElement(child)){const childProps={itemSpacing:itemSpacing,...disabled&&{disabled:disabled}};return React__default.cloneElement(child,childProps)}return child}));const collapsibleClasses=buildCss("collapsible_nav_wrapper",activeClass,highlightedBorderClass,collapsibleTrailClass,disabledClass);const handleKeyDown=e=>{if(!disabled&&!isLink&&(e.key==="Enter"||e.key===" ")){e.preventDefault();onClick==null?void 0:onClick()}};const handleClick=e=>{if(disabled){e.preventDefault();e.stopPropagation();return}onClick==null?void 0:onClick()};return jsx(Fragment,{children:collapsible?jsx(Fragment,{children:jsxs(Collapsible,{className:collapsibleClasses,collapsed:collapsed,icon:iconRight&&iconRight,iconSize:"xs",id:id,onClick:disabled?void 0:onClick,onIconClick:disabled?void 0:onIconRightClick,children:[jsx(Collapsible.Main,{className:globalProps({...finalItemSpacing}),dark:dark,children:jsxs(Tag,{...ariaProps,...dataProps,...htmlProps,className:classes,href:isLink?link:void 0,id:id,role:!isLink?"button":void 0,tabIndex:!isLink?0:void 0,target:isLink?target:void 0,children:[imageUrl&&jsx("div",{className:"pb_nav_list_item_icon_section_collapsible",onClick:e=>handleIconClick(e),onKeyDown:!isLink?handleKeyDown:void 0,children:jsx(Image,{className:"pb_nav_img_wrapper",url:imageUrl})},imageUrl),iconLeft&&jsx("div",{className:"pb_nav_list_item_icon_section_collapsible",onClick:e=>handleIconClick(e),children:jsx(Icon,{className:"pb_nav_list_item_icon_left_collapsible",fixedWidth:true,icon:iconLeft})},iconLeft),jsx("span",{className:"pb_nav_list_item_text_collapsible",children:text})]})}),jsx(Collapsible.Content,{children:childrenWithProps})]})}):jsxs(Tag,{...ariaProps,...dataProps,...htmlProps,"aria-disabled":disabled,className:classes,href:isLink?link:void 0,id:id,onClick:handleClick,onKeyDown:!isLink?handleKeyDown:void 0,role:!isLink?"button":void 0,tabIndex:disabled?-1:!isLink?0:void 0,target:isLink?target:void 0,children:[imageUrl&&jsx("div",{className:"pb_nav_list_item_icon_section",children:jsx(Image,{className:"pb_nav_img_wrapper",url:imageUrl})},imageUrl),iconLeft&&jsx("div",{className:"pb_nav_list_item_icon_section",children:jsx(Icon,{className:"pb_nav_list_item_icon_left",fixedWidth:true,icon:iconLeft})},iconLeft),jsx("span",{className:"pb_nav_list_item_text",children:text||children}),iconRight&&jsx("div",{className:"pb_nav_list_item_icon_section",children:jsx(Icon,{className:"pb_nav_list_item_icon_right",fixedWidth:true,icon:iconRight})},iconRight)]})})};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[isMobile,setIsMobile]=useState(false);const[isDropdownOpen,setIsDropdownOpen]=useState(false);const[dropdownPosition,setDropdownPosition]=useState("below");const dropdownRef=useRef(null);useEffect((()=>{const checkMobile=()=>{setIsMobile(window.innerWidth<=767)};checkMobile();let timeoutId=null;const throttledCheckMobile=()=>{if(timeoutId===null){timeoutId=setTimeout((()=>{checkMobile();timeoutId=null}),150)}};window.addEventListener("resize",throttledCheckMobile);return()=>{window.removeEventListener("resize",throttledCheckMobile);if(timeoutId)clearTimeout(timeoutId)}}),[]);useEffect((()=>{const handleClickOutside=event=>{if(dropdownRef.current&&!dropdownRef.current.contains(event.target)){setIsDropdownOpen(false)}};if(isDropdownOpen){document.addEventListener("mousedown",handleClickOutside)}return()=>{document.removeEventListener("mousedown",handleClickOutside)}}),[isDropdownOpen]);const checkDropdownPosition=()=>{if(dropdownRef.current){const rect=dropdownRef.current.getBoundingClientRect();const dropdownHeight=200;const spaceBelow=window.innerHeight-rect.bottom;const spaceAbove=rect.top;if(spaceBelow<dropdownHeight&&spaceAbove>spaceBelow){setDropdownPosition("above")}else{setDropdownPosition("below")}}};const handleDropdownToggle=()=>{if(!isDropdownOpen){checkDropdownPosition()}setIsDropdownOpen(!isDropdownOpen)};const handlePageChange=pageNumber=>{if(pageNumber>=1&&pageNumber<=total){setCurrentPage(pageNumber);setIsDropdownOpen(false);if(onChange){onChange(pageNumber)}}};const createPageOptions=()=>{const options=[];for(let pageNumber=1;pageNumber<=total;pageNumber++){options.push({label:String(pageNumber),value:String(pageNumber),id:`page-${pageNumber}`})}return options};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};useEffect((()=>{if(current>=1&&current<=total){setCurrentPage(current)}}),[current,total]);const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_paginate"),globalProps(props),className);if(total<=1){return null}return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:jsx("div",{className:`pb_pagination ${isMobile?"pb_pagination_mobile":""}`,children:isMobile?jsxs(Flex,{alignItems:"center",children:[jsx("li",{className:`pagination-left ${currentPage===1?"disabled":""}`,onClick:()=>handlePageChange(currentPage-1),children:jsxs(Flex,{alignItems:"center",children:[jsx(Icon,{icon:"chevron-left"}),jsx(Detail,{color:"default",marginLeft:"xxs",children:"Prev"})]})}),jsxs("div",{className:"pagination-dropdown",ref:dropdownRef,children:[jsx("div",{className:"pagination-dropdown-trigger",onClick:handleDropdownToggle,children:jsxs(Flex,{alignItems:"center",gap:"xxs",justify:"between",children:[jsx(Detail,{bold:true,color:"default",children:currentPage}),jsxs(Detail,{color:"default",children:["of ",total]}),jsx(Icon,{color:"primary",icon:isDropdownOpen?"chevron-up":"chevron-down",size:"xs"})]})}),isDropdownOpen&&jsx("div",{className:`pagination-dropdown-menu ${dropdownPosition}`,children:createPageOptions().map((option=>jsx("div",{className:`pagination-dropdown-option ${Number(option.value)===currentPage?"active":""}`,onClick:()=>handlePageChange(Number(option.value)),children:jsxs(Body,{children:["Page ",option.label]})},option.id)))})]}),jsx("li",{className:`pagination-right ${currentPage===total?"disabled":""}`,onClick:()=>handlePageChange(currentPage+1),children:jsxs(Flex,{alignItems:"center",children:[jsx(Detail,{color:"default",marginRight:"xxs",children:"Next"}),jsx(Icon,{icon:"chevron-right"})]})})]}):jsxs(Fragment,{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 TableHead=props=>{const{aria:aria={},children:children,className:className,data:data={},headerStyle:headerStyle="default",htmlOptions:htmlOptions={},id:id,tag:tag="table"}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames("pb_table_thead",{pb_table_thead_borderless:headerStyle==="borderless"||headerStyle==="floating",pb_table_thead_floating:headerStyle==="floating"},globalProps(props),className);const isTableTag=tag==="table";return jsx(Fragment,{children:isTableTag?jsx("thead",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:children}):jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:children})})};const isEmptySortMenuItem=item=>Object.keys(item).length===0;const isSortingStyle=sortMenu=>Array.isArray(sortMenu)&&sortMenu.length>0&&!(sortMenu.length===1&&isEmptySortMenuItem(sortMenu[0]));const getActiveItem=sortMenu=>{let activeItem={};sortMenu.forEach((item=>{if(item.active===true){activeItem=item}}));return activeItem};const getSortItems=sortMenu=>[...new Set(sortMenu.map((item=>item.item)).filter(Boolean))];const getSortItemsFor=(sortMenu,sortItem)=>sortMenu.filter((item=>item.item===sortItem));const getActiveOrFirstItem=items=>{const activeItem=items.find((item=>item.active===true));return activeItem||items[0]};const getNextLink=(sortMenu,sortItem="")=>{var _a;const sortMenuFor=sortItem?getSortItemsFor(sortMenu,sortItem):sortMenu;if(sortMenuFor.every((item=>item.active===false))){return((_a=sortMenuFor[0])==null?void 0:_a.link)||""}let link="";sortMenuFor.forEach(((item,index)=>{var _a2;if(item.active===true){const nextIndex=(index+1)%sortMenuFor.length;link=((_a2=sortMenuFor[nextIndex])==null?void 0:_a2.link)||""}}));return link};const getSortIcon=(direction,active)=>{switch(direction){case"asc":return active?"sort-amount-up":"";case"desc":return active?"sort-amount-down":"";default:return"arrow-up-arrow-down"}};const isDropdownSelect=(sortMenu,colSpan,sortDropdown)=>isSortingStyle(sortMenu)&&(sortDropdown===true||sortDropdown!==false&&colSpan!=null&&colSpan>1);const TableHeader=props=>{const{alignContent:alignContent="center",aria:aria={},children:children,className:className,colSpan:colSpan,data:data={},headerStyle:headerStyle="default",htmlOptions:htmlOptions={},id:id,justifySortIcon:justifySortIcon="between",placement:placement="bottom-end",sortDropdown:sortDropdown,sortMenu:sortMenu=[{}],tag:tag="table",text:text}=props;const[showSortPopover,setShowSortPopover]=useState(false);const{colSpan:htmlColSpan,colspan:htmlColspan,...restHtmlOptions}=htmlOptions;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(restHtmlOptions);const classes=classnames("pb_table_th",{pb_table_thead_borderless:headerStyle==="borderless"||headerStyle==="floating",pb_table_thead_floating:headerStyle==="floating"},globalProps(props),className);const isTableTag=tag==="table";const resolvedColSpan=colSpan??htmlColSpan??htmlColspan;const sortingEnabled=isSortingStyle(sortMenu);const dropdownEnabled=isTableTag&&isDropdownSelect(sortMenu,resolvedColSpan,sortDropdown);const activeItem=sortingEnabled?getActiveItem(sortMenu):{};const nextLink=sortingEnabled?getNextLink(sortMenu):"";const sortIconName=sortingEnabled?getSortIcon(activeItem.direction,activeItem.active):"";const isSortActive=Object.keys(activeItem).length>0;const linkStyle=isSortActive?void 0:{color:"#687887"};const headerId=id||(dropdownEnabled?uniqueId("pb-th"):void 0);const closeSortPopover=shouldClose=>{setShowSortPopover(!shouldClose)};const handleSortLinkClick=event=>{if(!dropdownEnabled)return;event.preventDefault();event.stopPropagation();setShowSortPopover((open=>!open))};const sortLink=jsx("a",{href:dropdownEnabled?"#":nextLink,onClick:handleSortLinkClick,style:linkStyle,children:jsx(Flex,{align:alignContent,className:"pb_th_link",justify:justifySortIcon,children:jsxs(Fragment,{children:[text||children,sortIconName!==""&&jsx(Icon,{className:isSortActive?"pb_th_active":"",fixedWidth:true,icon:sortIconName,paddingLeft:"xs"})]})})});const sortDropdownMenu=dropdownEnabled&&jsx(PbReactPopover,{className:"pb_filter_sort_menu",closeOnClick:"outside",padding:"none",placement:placement,reference:sortLink,shouldClosePopover:closeSortPopover,show:showSortPopover,children:jsx(Nav,{className:"pb_table_header_dropdown",data:{"pb-table-header":headerId},children:getSortItems(sortMenu).map((sortItemName=>{const item=getActiveOrFirstItem(getSortItemsFor(sortMenu,sortItemName));return jsx(NavItem,{active:item.active,className:"header_nav_item",highlighted_border:false,iconRight:getSortIcon(item.direction,item.active),link:getNextLink(sortMenu,sortItemName),onClick:()=>setShowSortPopover(false),padding:"xs",text:item.item||""},sortItemName)}))})});const headerContent=(()=>{if(!sortingEnabled)return text||children;if(dropdownEnabled)return sortDropdownMenu;return sortLink})();return jsx(Fragment,{children:isTableTag?jsx("th",{...ariaProps,...dataProps,...htmlProps,className:classes,...resolvedColSpan!=null&&{colSpan:resolvedColSpan},id:headerId,children:headerContent}):jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:headerId,children:headerContent})})};const TableBody=props=>{const{aria:aria={},children:children,className:className,data:data={},draggableContainer:draggableContainer=false,htmlOptions:htmlOptions={},id:id,tag:tag="table"}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames("pb_table_tbody",globalProps(props),className);const isTableTag=tag==="table";return jsx(Fragment,{children:isTableTag?draggableContainer?jsx(Draggable.Container,{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,tag:"tbody",children:children}):jsx("tbody",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:children}):draggableContainer?jsx(Draggable.Container,{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:children}):jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:children})})};const TableRow=props=>{const{aria:aria={},children:children,collapsible:collapsible,collapsibleContent:collapsibleContent,collapsibleSideHighlight:collapsibleSideHighlight=true,className:className,data:data={},dark:dark=false,dragId:dragId,draggableItem:draggableItem=false,headerStyle:headerStyle="default",htmlOptions:htmlOptions={},id:id,toggleCellId:toggleCellId,sideHighlightColor:sideHighlightColor="none",tag:tag="table"}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const sideHighlightClass=sideHighlightColor!=""?`side_highlight_${sideHighlightColor}`:null;const[isCollapsed,setIsCollapsed]=useCollapsible(true);const collapsibleRow=collapsible&&isCollapsed===true?"collapsible_table_row":null;const classes=classnames(buildCss("pb_table_row_kit",sideHighlightClass),"pb_table_tr",{pb_table_tr_borderless_header:headerStyle==="borderless"},collapsibleRow,globalProps(props),className);const isTableTag=tag==="table";const colSpan=React__default.Children.count(children);const handleRowClick=event=>{if(toggleCellId){const target=event.target;const clickedCell=target.closest(`#${toggleCellId}`);const isIconClick=target instanceof SVGElement&&(target.matches("svg.pb_custom_icon")||target.closest("svg.pb_custom_icon"));if(clickedCell||clickedCell&&isIconClick){setIsCollapsed(!isCollapsed)}}else{setIsCollapsed(!isCollapsed)}};return jsx(Fragment,{children:collapsible?isTableTag?jsxs(Fragment,{children:[jsx("tr",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,onClick:e=>handleRowClick(e),style:{cursor:toggleCellId?"default":"pointer"},children:children}),jsx("tr",{children:jsxs(Collapsible,{collapsed:isCollapsed,dark:dark,htmlOptions:{colSpan:colSpan},padding:"none",tag:"td",children:[jsx("tr",{}),jsx(Collapsible.Content,{className:collapsibleSideHighlight?`table_collapsible_side_highlight`:"",dark:dark,margin:"none",padding:"none",children:collapsibleContent})]})})]}):jsxs(Fragment,{children:[jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,onClick:handleRowClick,style:{cursor:"pointer"},children:children}),jsx("tr",{children:jsxs(Collapsible,{collapsed:isCollapsed,dark:dark,htmlOptions:{colSpan:colSpan},padding:"none",tag:"td",children:[jsx("tr",{}),jsx(Collapsible.Content,{className:collapsibleSideHighlight?`table_collapsible_side_highlight`:"",dark:dark,margin:"none",padding:"none",children:collapsibleContent})]})})]}):isTableTag?draggableItem?jsx(Draggable.Item,{...ariaProps,...dataProps,...htmlProps,className:classes,dragId:dragId,tag:"tr",children:children}):jsx("tr",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:children}):draggableItem?jsx(Draggable.Item,{...ariaProps,...dataProps,...htmlProps,className:classes,dragId:dragId,children:children}):jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:children})})};const TableCell=props=>{const{aria:aria={},children:children,className:className,colSpan:colSpan,data:data={},htmlOptions:htmlOptions={},id:id,tag:tag="table",text:text}=props;const{colSpan:htmlColSpan,colspan:htmlColspan,...restHtmlOptions}=htmlOptions;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(restHtmlOptions);const classes=classnames("pb_table_td",globalProps(props),className);const isTableTag=tag==="table";const resolvedColSpan=colSpan??htmlColSpan??htmlColspan;return jsx(Fragment,{children:isTableTag?jsx("td",{...ariaProps,...dataProps,...htmlProps,className:classes,...resolvedColSpan!=null&&{colSpan:resolvedColSpan},id:id,children:text||children}):jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:text||children})})};const addDataTitle=()=>{const tables=document.querySelectorAll(".table-responsive-collapse");[].forEach.call(tables,(table=>{const headers=[];[].forEach.call(table.querySelectorAll("th"),(header=>{const colSpan=header.colSpan;for(let i=0;i<colSpan;i++){headers.push(header.textContent.replace(/\r?\n|\r/,""))}}));[].forEach.call(table.querySelectorAll("tbody tr"),(row=>{[].forEach.call(row.cells,((cell,headerIndex)=>{cell.setAttribute("data-title",headers[headerIndex])}))}))}))};const Table=props=>{const{aria:aria={},variant:variant="default",cardProps:cardProps={},titleProps:titleProps={},children:children,className:className,collapse:collapse=(variant==="withFilter"?"md":"sm"),container:container=true,dark:dark,data:data={},dataTable:dataTable=false,disableHover:disableHover=false,filterProps:filterProps={},filterContent:filterContent,headerStyle:headerStyle="default",htmlOptions:htmlOptions={},id:id,outerPadding:outerPadding="",pagination:pagination,responsive:responsive="collapse",singleLine:singleLine=false,size:size="sm",sticky:sticky=false,stickyLeftColumn:stickyLeftColumn=[],stickyRightColumn:stickyRightColumn=[],striped:striped=false,tag:tag="table",title:title,contrastBorder:contrastBorder=false,verticalBorder:verticalBorder=false}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const tableCollapseCss=responsive==="collapse"?`table-collapse-${collapse}`:"";const contrastBorderCss=contrastBorder?"contrast-border":"";const verticalBorderCss=verticalBorder?"vertical-border":"";const spaceCssName=outerPadding!=="none"?"space_":"";const outerPaddingCss=outerPadding?`outer_padding_${spaceCssName}${outerPadding}`:"";const isTableTag=tag==="table";const dynamicInlineProps=globalInlineProps(props);const stickyRightColumnReversed=stickyRightColumn.reverse();const isFilterVariant=variant==="withFilter";const effectiveContainer=isFilterVariant?false:container;const classNames=classnames("pb_table",`table-${size}`,`table-responsive-${responsive}`,{"table-card":effectiveContainer,"table-dark":dark,data_table:dataTable,"single-line":singleLine,"no-hover":disableHover,"sticky-header":sticky,"sticky-left-column":stickyLeftColumn.length,"sticky-right-column":stickyRightColumn.length,striped:striped,"header-borderless":headerStyle==="borderless","header-floating":headerStyle==="floating",[outerPaddingCss]:outerPadding!==""},globalProps(props),tableCollapseCss,contrastBorderCss,verticalBorderCss,className);useEffect((()=>{const handleStickyLeftColumns=()=>{if(!stickyLeftColumn.length)return;let accumulatedWidth=0;stickyLeftColumn.forEach(((colId,index)=>{const isLastColumn=index===stickyLeftColumn.length-1;const header=document.querySelector(`th[data-sticky-id="${colId}"]`);const cells=document.querySelectorAll(`td[data-sticky-id="${colId}"]`);if(header){header.classList.add("sticky");header.style.left=`${accumulatedWidth}px`;if(!isLastColumn){header.classList.add("with-border-right");header.classList.remove("sticky-left-shadow")}else{header.classList.remove("with-border-right");header.classList.add("sticky-left-shadow")}const headerWidth=header.offsetWidth;accumulatedWidth+=headerWidth;cells.forEach((cell=>{cell.classList.add("sticky");cell.style.left=`${accumulatedWidth-headerWidth}px`;if(!isLastColumn){cell.classList.add("with-border-right");cell.classList.remove("sticky-left-shadow")}else{cell.classList.remove("with-border-right");cell.classList.add("sticky-left-shadow")}}))}}))};setTimeout((()=>{handleStickyLeftColumns()}),10);window.addEventListener("resize",handleStickyLeftColumns);return()=>{window.removeEventListener("resize",handleStickyLeftColumns)}}),[stickyLeftColumn]);useEffect((()=>{const handleStickyRightColumns=()=>{if(!stickyRightColumn.length)return;let accumulatedWidth=0;stickyRightColumnReversed.forEach(((colId,index)=>{const isLastColumn=index===stickyRightColumn.length-1;const header=document.querySelector(`th[data-sticky-id="${colId}"]`);const cells=document.querySelectorAll(`td[data-sticky-id="${colId}"]`);if(header){header.classList.add("sticky");header.style.right=`${accumulatedWidth}px`;if(!isLastColumn){header.classList.add("with-border-left");header.classList.remove("sticky-right-shadow")}else{header.classList.remove("with-border-left");header.classList.add("sticky-right-shadow")}const headerWidth=header.offsetWidth;accumulatedWidth+=headerWidth;cells.forEach((cell=>{cell.classList.add("sticky");cell.style.right=`${accumulatedWidth-headerWidth}px`;if(!isLastColumn){cell.classList.add("with-border-left");cell.classList.remove("sticky-right-shadow")}else{cell.classList.remove("with-border-left");cell.classList.add("sticky-right-shadow")}}))}}))};setTimeout((()=>{handleStickyRightColumns()}),10);window.addEventListener("resize",handleStickyRightColumns);return()=>{window.removeEventListener("resize",handleStickyRightColumns)}}),[stickyRightColumn]);useEffect((()=>{addDataTitle()}),[]);const renderTable=()=>{const tableElement=responsive==="scroll"?jsx("div",{className:"table-responsive-scroll",children:isTableTag?jsx("table",{...ariaProps,...dataProps,...htmlProps,className:classNames,id:id,style:dynamicInlineProps,children:children}):jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classNames,id:id,style:dynamicInlineProps,children:children})}):isTableTag?jsx("table",{...ariaProps,...dataProps,...htmlProps,className:classNames,id:id,style:dynamicInlineProps,children:children}):jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classNames,id:id,style:dynamicInlineProps,children:children});return tableElement};const renderCardVariant=()=>{const tableElement=responsive==="scroll"?jsx("div",{className:"table-responsive-scroll",children:isTableTag?jsx("table",{...ariaProps,...dataProps,...htmlProps,className:classNames,id:id,style:dynamicInlineProps,children:children}):jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classNames,id:id,style:dynamicInlineProps,children:children})}):isTableTag?jsx("table",{...ariaProps,...dataProps,...htmlProps,className:classNames,id:id,style:dynamicInlineProps,children:children}):jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classNames,id:id,style:dynamicInlineProps,children:children});const defaultFilterProps={background:false,maxHeight:"50vh",minWidth:"xs",popoverProps:{width:"350px"}};const mergedFilterProps={...defaultFilterProps,...filterProps};const defaultCardProps={padding:"none"};const mergedCardProps={...defaultCardProps,...cardProps};const defaultTitleProps={size:3,paddingY:"md"};const mergedTitleProps={...defaultTitleProps,...titleProps};return jsxs(Fragment,{children:[title&&jsx(Title,{...mergedTitleProps,text:title}),jsx(Card,{...mergedCardProps,children:jsxs(Flex,{align:"stretch",flexDirection:"column",gap:"none",children:[filterContent&&jsx(Filter,{...mergedFilterProps,children:filterContent}),filterContent&&jsx(SectionSeparator,{}),pagination&&jsxs(Fragment,{children:[pagination,jsx(SectionSeparator,{})]}),tableElement,pagination&&jsx(Fragment,{children:pagination})]})})]})};return jsx(Fragment,{children:isFilterVariant?renderCardVariant():renderTable()})};Table.Head=TableHead;Table.Header=TableHeader;Table.Body=TableBody;Table.Row=TableRow;Table.Cell=TableCell;export{Button as B,Checkbox as C,FlexItem as F,LoadingInline as L,Nav as N,PbReactPopover as P,SectionSeparator as S,Table as T,Pagination as a,CircleIconButton as b,List as c,ListItem as d,NavItem as e,Collapsible as f,getQuickPickOptions as g,Filter as h,TableRow as i,TitleCount as j,requireWarning as r};
@@ -1,4 +1,4 @@
1
- import{B as Body$1,I as Icon,C as Caption,T as Tooltip,d as Title,c as DialogContext,F as Flex,e as Image,D as Detail,a as Card}from"./_detail-BqqzPTNr.js";import{b,f,H}from"./_detail-BqqzPTNr.js";import{a as IconCircle,b as TextInput,F as FormPill,B as Badge,A as Avatar}from"./_typeahead-KNcX62pc.js";import{O,T,U}from"./_typeahead-KNcX62pc.js";import{jsx,jsxs,Fragment}from"react/jsx-runtime";import React__default,{useState,useEffect,useContext,useCallback,createContext,createElement,forwardRef,useMemo,useRef,useLayoutEffect,useImperativeHandle,useReducer,Fragment as Fragment$1}from"react";import{d as classnames,e as buildCss,g as globalProps,f as globalInlineProps,b as buildAriaProps,a as buildDataProps,c as buildHtmlProps,h as domSafeProps,i as camelToSnakeCase,n as noop$1,j as joinPresent,t as titleize}from"./globalProps-K1DCn3il.js";import{b as CircleIconButton,B as Button,F as FlexItem,S as SectionSeparator,r as requireWarning,c as List,d as ListItem,g as getQuickPickOptions,C as Checkbox,P as PbReactPopover,N as Nav,e as NavItem}from"./_table-D7wuBFbb.js";import{f as f2,h,L,a,T as T2,i,j}from"./_table-D7wuBFbb.js";import{U as getAllIcons,a5 as usePBCopy,X as DateTime$1,T as datePickerHelper,c as colors,a6 as getAugmentedNamespace,g as getDefaultExportFromCjs,a7 as PB_MODAL_ABOVE_FULLSCREEN_Z_INDEX,H as PB_FLOATING_OWNER_ATTR,D as setFloatingOwnerAttribute,a8 as useDropdown,C as resolveFloatingOwnerId,B as resolvePortaledKitHost,v as subscribeFloatingKitReposition,u as positionDropdownPortalToWrapper,a9 as ReactDOMServer,a0 as isEmpty,aa as useFullScreen,n as noop$2,E as positionFloatingShellToInput,ab as cloneDeep,R as PbTextarea,p as stripEmojisForPaste,q as applyEmojiMask,F as subscribeFloatingKitOpen,I as resolvePortaledFloatingZIndex,J as nextPortaledFloatingZIndex,K as announceFloatingKitOpen}from"./lib-7vm9BMqp.js";import{M,Q,N,O as O2,ae,ad,S,af,ac,ag,ah,ai,aj,ak,V,t,W}from"./lib-7vm9BMqp.js";import ReactDOM__default,{createPortal}from"react-dom";import{i as intlTelInput,c as parseTimeToMinutes,d as parseTime,s as convertTo24HourFormat,t as convertTo12HourFormat,e as getDisplayTime,g as getHourConstraints,m as generateHourOptions,o as generateMinuteOptions,r as getTimeRangeErrorMessage,q as getTimezoneText,k as getValidInitialMeridiem,f as isTimeInRange,l as get24HourTime,p as processHourInput,n as normalizeHourOnBlur,a as processMinuteInput,b as normalizeMinuteOnBlur,h as isAnyAMTimeValid,j as isAnyPMTimeValid}from"./time_picker_helper-BZutIzB3.js";import"react-is";const breakpoints={xs:"(max-width: 575px)",sm:"(min-width: 576px) and (max-width: 767px)",md:"(min-width: 768px) and (max-width: 991px)",lg:"(min-width: 992px) and (max-width: 1199px)",xl:"(min-width: 1200px)"};const getResponsiveValue=prop=>{if(typeof prop==="string"){return prop}for(const[bp,value]of Object.entries(prop||{})){if(bp!=="default"&&window.matchMedia(breakpoints[bp]).matches){return value}}return(prop==null?void 0:prop.default)||void 0};const Background=props=>{const{alt:alt=void 0,aria:aria={},backgroundColor:backgroundColor="light",backgroundPosition:backgroundPosition="",backgroundRepeat:backgroundRepeat="initial",backgroundSize:backgroundSize="cover",children:children,className:className,customColor:customColor,data:data={},htmlOptions:htmlOptions={},id:id,imageOverlay:imageOverlay,imageUrl:imageUrl="",tag:tag="div",transition:transition=""}=props;const[responsiveProps,setResponsiveProps]=useState({backgroundSize:getResponsiveValue(backgroundSize),backgroundPosition:getResponsiveValue(backgroundPosition),backgroundRepeat:getResponsiveValue(backgroundRepeat),backgroundColor:getResponsiveValue(backgroundColor),imageUrl:getResponsiveValue(imageUrl)});useEffect((()=>{const updateResponsiveProps=()=>{setResponsiveProps({backgroundSize:getResponsiveValue(backgroundSize),backgroundPosition:getResponsiveValue(backgroundPosition),backgroundRepeat:getResponsiveValue(backgroundRepeat),backgroundColor:getResponsiveValue(backgroundColor),imageUrl:getResponsiveValue(imageUrl)})};updateResponsiveProps();window.addEventListener("resize",updateResponsiveProps);return()=>window.removeEventListener("resize",updateResponsiveProps)}),[backgroundSize,backgroundPosition,backgroundRepeat,backgroundColor,imageUrl]);const{backgroundColor:resBackgroundColor,backgroundPosition:resBackgroundPosition,backgroundRepeat:resBackgroundRepeat,backgroundSize:resBackgroundSize,imageUrl:resImageUrl}=responsiveProps;const classes=classnames(buildCss("pb_background_kit"),globalProps(props),transition,{[`pb_background_color_${resBackgroundColor}`]:resBackgroundColor&&!customColor,[`pb_background_custom_color`]:!!customColor},imageOverlay?`imageoverlay_${imageOverlay}`:"",className);const backgroundStyle={backgroundColor:customColor||void 0,...resImageUrl!==""?{backgroundImage:resImageUrl?`url(${resImageUrl})`:void 0,backgroundRepeat:resBackgroundRepeat||void 0,backgroundPosition:resBackgroundPosition||void 0,backgroundSize:resBackgroundSize||void 0}:{}};const dynamicInlineProps=globalInlineProps(props);const combinedStyles={...backgroundStyle,...dynamicInlineProps};const Tag=`${tag}`;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);return jsx(Tag,{...ariaProps,...dataProps,...htmlProps,alt:alt,className:classes,id:id,style:combinedStyles,children:children})};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:text,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||text})};const contactTypeMap={cell:"mobile",email:"envelope",extension:"phone-plus",home:"phone",work:"phone-office","work-cell":"phone-laptop","wrong-phone":"phone-slash",international:"globe"};const envelopeIcon=getAllIcons()["envelope"].icon;const formatContact=(contactString,contactType)=>{if(contactType==="email")return contactString;if(contactType==="international")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={},iconEnabled:iconEnabled=true,id:id,unstyled:unstyled=false}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_contact_kit"),globalProps(props),className);const formattedValue=formatContact(contactValue,contactType);const content=jsxs(Fragment,{children:[iconEnabled&&(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"})),iconEnabled?` ${formattedValue} `:formattedValue,contactDetail&&jsx(Caption,{dark:dark,size:"xs",tag:"span",text:contactDetail})]});if(unstyled){return jsx("span",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:content})}return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:jsx(Body$1,{className:"pb_contact_kit",color:"light",dark:dark,tag:"span",children:content})})};const Container=props=>{const{aria:aria={},children:children,className:className,data:data={},htmlOptions:htmlOptions={},tag:tag="div",id:id}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_container_kit"),globalProps(props),className);const Tag=tag;return jsx(Tag,{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:children})};const CopyButton=props=>{const{aria:aria={},className:className,data:data={},from:from="",htmlOptions:htmlOptions={},id:id,text:text="Copy",timeout:timeout=1e3,tooltipPlacement:tooltipPlacement="bottom",tooltipText:tooltipText="Copied!",value:value="",variant:variant="icon"}=props;const[copied,copy]=usePBCopy({value:value,from:from,timeout:timeout});const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_copy_button_kit"),globalProps(props),className);return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:jsx(Tooltip,{forceOpenTooltip:copied,placement:tooltipPlacement,showTooltip:false,text:tooltipText,children:variant==="icon"?jsx(CircleIconButton,{icon:"copy",onClick:copy,variant:"link"}):jsx(Button,{icon:"copy",onClick:copy,children:text})})})};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 isAmountEmpty=value=>value===""||value==null||typeof value==="string"&&value.trim()==="";const convertAmount=input=>{if(typeof input==="number"){return input.toFixed(2)}return input};const currencyAmount=convertAmount(amount);const emphasizedClass=emphasized?"":"_deemphasized";let variantClass;if(variant==="light"){variantClass="_light"}else if(variant==="bold"){variantClass="_bold"}const[wholePart,decimalPart="00"]=currencyAmount?currencyAmount.split("."):["","00"];const decimal=(decimalPart||"00").padEnd(2,"0").slice(0,2);const whole=currencyAmount===""?"":wholePart===""?"0":wholePart;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"?currencyAmount:whole;const getMatchingDecimalValue=decimals==="matching"?"":`.${decimal}`;const formatAmount=amount2=>{if(!commaSeparator)return amount2;const[wholePart2,decimalPart2]=amount2.split(".");const formattedWhole=new Intl.NumberFormat("en-US").format(parseInt(wholePart2));return decimalPart2?`${formattedWhole}.${decimalPart2}`:formattedWhole};const swapNegative=size==="sm"&&symbol!=="";const handleNegative=currencyAmount.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&&isAmountEmpty(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&&isAmountEmpty(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,showCurrentYear:showCurrentYear=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||showCurrentYear)&&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||showCurrentYear)&&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||showCurrentYear)&&jsx(Fragment,{children:`, ${year}`})]})]})})};function isValidDateInstance(value){return!Number.isNaN(value.getTime())}function normalizeDefaultDate(defaultDate){if(defaultDate instanceof Date){return isValidDateInstance(defaultDate)?defaultDate:""}if(Array.isArray(defaultDate)){const normalized=defaultDate.filter((d=>!(d instanceof Date)||isValidDateInstance(d)));return normalized.length?normalized:""}return defaultDate}function serializeDefaultDateForFilterReset(defaultDate){if(defaultDate===""||defaultDate==null)return void 0;if(Array.isArray(defaultDate)){const parts=defaultDate.map((d=>{if(d==null||d==="")return"";if(d instanceof Date){return isValidDateInstance(d)?d.toISOString():""}return String(d)})).filter(Boolean);return parts.length?parts.join(","):void 0}if(defaultDate instanceof Date){return isValidDateInstance(defaultDate)?defaultDate.toISOString():void 0}return String(defaultDate)}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,requiredIndicator:requiredIndicator,scrollContainer:scrollContainer,selectionType:selectionType="",showTimezone:showTimezone=false,staticPosition:staticPosition=true,thisRangesEndToday:thisRangesEndToday=false,yearAscending:yearAscending=false,yearRange:yearRange=[1900,2100],controlsStartId:controlsStartId,controlsEndId:controlsEndId,syncStartWith:syncStartWith,syncEndWith:syncEndWith}=props;const dialogCtx=useContext(DialogContext);const ariaProps=buildAriaProps(aria);const normalizedDefaultDate=normalizeDefaultDate(defaultDate);const filterResetDefaultSerialized=serializeDefaultDateForFilterReset(normalizedDefaultDate);const dataProps=buildDataProps({...data,...filterResetDefaultSerialized?{"default-value":filterResetDefaultSerialized}:{}});const htmlProps=buildHtmlProps(htmlOptions);const inputAriaProps=buildAriaProps(inputAria);const inputDataProps=buildDataProps(inputData);const getCursorStyle=cursor=>{if(disableInput)return"not-allowed";if(cursor){return camelToSnakeCase(cursor).replace(/_/g,"-")}return"pointer"};useEffect((()=>{datePickerHelper({allowInput:allowInput,customQuickPickDates:customQuickPickDates,defaultDate:normalizedDefaultDate,disableDate:disableDate,disableRange:disableRange,disableWeekdays:disableWeekdays,enableTime:enableTime,format:format,inline:inLine,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,yearAscending:yearAscending,yearRange:yearRange,controlsStartId:controlsStartId,controlsEndId:controlsEndId,syncStartWith:syncStartWith,syncEndWith:syncEndWith,required:false,dialogPortalTarget:(dialogCtx==null?void 0:dialogCtx.selectMenuPortalTarget)??null},scrollContainer);return()=>{var _a,_b;const input=document.getElementById(String(pickerId));(_a=input==null?void 0:input._pbDatePickerOpenUnsub)==null?void 0:_a.call(input);input==null?true:delete input._pbDatePickerOpenUnsub;(_b=input==null?void 0:input._flatpickr)==null?void 0:_b.destroy()}}),initializeOnce?[initializeOnce,dialogCtx==null?void 0:dialogCtx.selectMenuPortalTarget,pickerId]: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,inLine&&"inline-date-picker",className);const iconWrapperClass=()=>{let base="cal_icon_wrapper";if(dark){base+=" dark"}if(hideLabel){base+=" no_label_shift"}if(error){base+=" error"}if(disableInput){base+=" disabled"}return base};const angleDown=getAllIcons()["angleDown"].icon;const errorId=error?`${pickerId}-error`:void 0;return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:jsxs("div",{...inputAriaProps,...inputDataProps,className:"input_wrapper",children:[!hideLabel&&jsx("label",{htmlFor:pickerId,children:requiredIndicator?jsxs(Caption,{className:"pb_date_picker_kit_label",color:"lighter",children:[label," ",jsx("span",{style:{color:`${colors.error}`},children:"*"})]}):jsx(Caption,{className:"pb_date_picker_kit_label",color:"lighter",text:label})}),jsxs(Fragment,{children:[jsxs("div",{className:"date_picker_input_wrapper",children:[jsx("input",{"aria-describedby":errorId,"aria-invalid":!!error,autoComplete:"off",className:"date_picker_input",disabled:disableInput,id:pickerId,name:name,onChange:inputOnChange,placeholder:placeholder,style:{cursor:getCursorStyle(filteredProps.cursor)},value:inputValue}),error&&jsx(Body$1,{aria:{atomic:"true",live:"polite"},htmlOptions:{role:"alert"},id:errorId,status:"negative",text:error,variant:null})]}),!hideIcon&&!inLine&&jsx("div",{className:iconWrapperClass(),id:`cal-icon-${pickerId}`,children:jsx(Icon,{className:"cal_icon",icon:"calendar-alt"})}),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,showCurrentYear:showCurrentYear=false}=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=>{const includeYear=showCurrentYear||!dateInCurrentYear();return jsx("time",{dateTime:dateTimeIso$1(date),children:` ${dateTimestamp$1(date,includeYear)} `})};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",showCurrentYear:showCurrentYear=false}=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||showCurrentYear)&&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||showCurrentYear)&&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:datetime,id:id,showCurrentYear:showCurrentYear=false,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,{showCurrentYear:showCurrentYear,showDayOfWeek:showDayOfWeek,size:size,value:datetime}),jsx(Time,{date:datetime,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:datetime,dark:dark,className:className,htmlOptions:htmlOptions={},timeZone:timeZone="America/New_York",showCurrentYear:showCurrentYear=false}=props;const classes=classnames(buildCss("pb_date_time_stacked_kit"),globalProps(props),className);return jsxs(Flex,{htmlOptions:htmlOptions,inline:false,vertical:"stretch",...props,className:classes,children:[jsx(FlexItem,{children:jsx(DateStacked,{align:"right",bold:true,dark:dark,date:date||datetime,showCurrentYear:showCurrentYear})}),jsx(SectionSeparator,{className:"date-time-padding",orientation:"vertical"}),jsx(FlexItem,{children:jsx(TimeStackedDefault,{dark:dark,date:date||datetime,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;
1
+ import{B as Body$1,I as Icon,C as Caption,T as Tooltip,d as Title,c as DialogContext,F as Flex,e as Image,D as Detail,a as Card}from"./_detail-BqqzPTNr.js";import{b,f,H}from"./_detail-BqqzPTNr.js";import{a as IconCircle,b as TextInput,F as FormPill,B as Badge,A as Avatar}from"./_typeahead-KNcX62pc.js";import{O,T,U}from"./_typeahead-KNcX62pc.js";import{jsx,jsxs,Fragment}from"react/jsx-runtime";import React__default,{useState,useEffect,useContext,useCallback,createContext,createElement,forwardRef,useMemo,useRef,useLayoutEffect,useImperativeHandle,useReducer,Fragment as Fragment$1}from"react";import{d as classnames,e as buildCss,g as globalProps,f as globalInlineProps,b as buildAriaProps,a as buildDataProps,c as buildHtmlProps,h as domSafeProps,i as camelToSnakeCase,n as noop$1,j as joinPresent,t as titleize}from"./globalProps-K1DCn3il.js";import{b as CircleIconButton,B as Button,F as FlexItem,S as SectionSeparator,r as requireWarning,c as List,d as ListItem,g as getQuickPickOptions,C as Checkbox,P as PbReactPopover,N as Nav,e as NavItem}from"./_table-BrYlBrTH.js";import{f as f2,h,L,a,T as T2,i,j}from"./_table-BrYlBrTH.js";import{U as getAllIcons,a5 as usePBCopy,X as DateTime$1,T as datePickerHelper,c as colors,a6 as getAugmentedNamespace,g as getDefaultExportFromCjs,a7 as PB_MODAL_ABOVE_FULLSCREEN_Z_INDEX,H as PB_FLOATING_OWNER_ATTR,D as setFloatingOwnerAttribute,a8 as useDropdown,C as resolveFloatingOwnerId,B as resolvePortaledKitHost,v as subscribeFloatingKitReposition,u as positionDropdownPortalToWrapper,a9 as ReactDOMServer,a0 as isEmpty,aa as useFullScreen,n as noop$2,E as positionFloatingShellToInput,ab as cloneDeep,R as PbTextarea,p as stripEmojisForPaste,q as applyEmojiMask,F as subscribeFloatingKitOpen,I as resolvePortaledFloatingZIndex,J as nextPortaledFloatingZIndex,K as announceFloatingKitOpen}from"./lib-7vm9BMqp.js";import{M,Q,N,O as O2,ae,ad,S,af,ac,ag,ah,ai,aj,ak,V,t,W}from"./lib-7vm9BMqp.js";import ReactDOM__default,{createPortal}from"react-dom";import{i as intlTelInput,c as parseTimeToMinutes,d as parseTime,s as convertTo24HourFormat,t as convertTo12HourFormat,e as getDisplayTime,g as getHourConstraints,m as generateHourOptions,o as generateMinuteOptions,r as getTimeRangeErrorMessage,q as getTimezoneText,k as getValidInitialMeridiem,f as isTimeInRange,l as get24HourTime,p as processHourInput,n as normalizeHourOnBlur,a as processMinuteInput,b as normalizeMinuteOnBlur,h as isAnyAMTimeValid,j as isAnyPMTimeValid}from"./time_picker_helper-BZutIzB3.js";import"react-is";const breakpoints={xs:"(max-width: 575px)",sm:"(min-width: 576px) and (max-width: 767px)",md:"(min-width: 768px) and (max-width: 991px)",lg:"(min-width: 992px) and (max-width: 1199px)",xl:"(min-width: 1200px)"};const getResponsiveValue=prop=>{if(typeof prop==="string"){return prop}for(const[bp,value]of Object.entries(prop||{})){if(bp!=="default"&&window.matchMedia(breakpoints[bp]).matches){return value}}return(prop==null?void 0:prop.default)||void 0};const Background=props=>{const{alt:alt=void 0,aria:aria={},backgroundColor:backgroundColor="light",backgroundPosition:backgroundPosition="",backgroundRepeat:backgroundRepeat="initial",backgroundSize:backgroundSize="cover",children:children,className:className,customColor:customColor,data:data={},htmlOptions:htmlOptions={},id:id,imageOverlay:imageOverlay,imageUrl:imageUrl="",tag:tag="div",transition:transition=""}=props;const[responsiveProps,setResponsiveProps]=useState({backgroundSize:getResponsiveValue(backgroundSize),backgroundPosition:getResponsiveValue(backgroundPosition),backgroundRepeat:getResponsiveValue(backgroundRepeat),backgroundColor:getResponsiveValue(backgroundColor),imageUrl:getResponsiveValue(imageUrl)});useEffect((()=>{const updateResponsiveProps=()=>{setResponsiveProps({backgroundSize:getResponsiveValue(backgroundSize),backgroundPosition:getResponsiveValue(backgroundPosition),backgroundRepeat:getResponsiveValue(backgroundRepeat),backgroundColor:getResponsiveValue(backgroundColor),imageUrl:getResponsiveValue(imageUrl)})};updateResponsiveProps();window.addEventListener("resize",updateResponsiveProps);return()=>window.removeEventListener("resize",updateResponsiveProps)}),[backgroundSize,backgroundPosition,backgroundRepeat,backgroundColor,imageUrl]);const{backgroundColor:resBackgroundColor,backgroundPosition:resBackgroundPosition,backgroundRepeat:resBackgroundRepeat,backgroundSize:resBackgroundSize,imageUrl:resImageUrl}=responsiveProps;const classes=classnames(buildCss("pb_background_kit"),globalProps(props),transition,{[`pb_background_color_${resBackgroundColor}`]:resBackgroundColor&&!customColor,[`pb_background_custom_color`]:!!customColor},imageOverlay?`imageoverlay_${imageOverlay}`:"",className);const backgroundStyle={backgroundColor:customColor||void 0,...resImageUrl!==""?{backgroundImage:resImageUrl?`url(${resImageUrl})`:void 0,backgroundRepeat:resBackgroundRepeat||void 0,backgroundPosition:resBackgroundPosition||void 0,backgroundSize:resBackgroundSize||void 0}:{}};const dynamicInlineProps=globalInlineProps(props);const combinedStyles={...backgroundStyle,...dynamicInlineProps};const Tag=`${tag}`;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);return jsx(Tag,{...ariaProps,...dataProps,...htmlProps,alt:alt,className:classes,id:id,style:combinedStyles,children:children})};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:text,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||text})};const contactTypeMap={cell:"mobile",email:"envelope",extension:"phone-plus",home:"phone",work:"phone-office","work-cell":"phone-laptop","wrong-phone":"phone-slash",international:"globe"};const envelopeIcon=getAllIcons()["envelope"].icon;const formatContact=(contactString,contactType)=>{if(contactType==="email")return contactString;if(contactType==="international")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={},iconEnabled:iconEnabled=true,id:id,unstyled:unstyled=false}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_contact_kit"),globalProps(props),className);const formattedValue=formatContact(contactValue,contactType);const content=jsxs(Fragment,{children:[iconEnabled&&(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"})),iconEnabled?` ${formattedValue} `:formattedValue,contactDetail&&jsx(Caption,{dark:dark,size:"xs",tag:"span",text:contactDetail})]});if(unstyled){return jsx("span",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:content})}return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:jsx(Body$1,{className:"pb_contact_kit",color:"light",dark:dark,tag:"span",children:content})})};const Container=props=>{const{aria:aria={},children:children,className:className,data:data={},htmlOptions:htmlOptions={},tag:tag="div",id:id}=props;const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_container_kit"),globalProps(props),className);const Tag=tag;return jsx(Tag,{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:children})};const CopyButton=props=>{const{aria:aria={},className:className,data:data={},from:from="",htmlOptions:htmlOptions={},id:id,text:text="Copy",timeout:timeout=1e3,tooltipPlacement:tooltipPlacement="bottom",tooltipText:tooltipText="Copied!",value:value="",variant:variant="icon"}=props;const[copied,copy]=usePBCopy({value:value,from:from,timeout:timeout});const ariaProps=buildAriaProps(aria);const dataProps=buildDataProps(data);const htmlProps=buildHtmlProps(htmlOptions);const classes=classnames(buildCss("pb_copy_button_kit"),globalProps(props),className);return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:jsx(Tooltip,{forceOpenTooltip:copied,placement:tooltipPlacement,showTooltip:false,text:tooltipText,children:variant==="icon"?jsx(CircleIconButton,{icon:"copy",onClick:copy,variant:"link"}):jsx(Button,{icon:"copy",onClick:copy,children:text})})})};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 isAmountEmpty=value=>value===""||value==null||typeof value==="string"&&value.trim()==="";const convertAmount=input=>{if(typeof input==="number"){return input.toFixed(2)}return input};const currencyAmount=convertAmount(amount);const emphasizedClass=emphasized?"":"_deemphasized";let variantClass;if(variant==="light"){variantClass="_light"}else if(variant==="bold"){variantClass="_bold"}const[wholePart,decimalPart="00"]=currencyAmount?currencyAmount.split("."):["","00"];const decimal=(decimalPart||"00").padEnd(2,"0").slice(0,2);const whole=currencyAmount===""?"":wholePart===""?"0":wholePart;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"?currencyAmount:whole;const getMatchingDecimalValue=decimals==="matching"?"":`.${decimal}`;const formatAmount=amount2=>{if(!commaSeparator)return amount2;const[wholePart2,decimalPart2]=amount2.split(".");const formattedWhole=new Intl.NumberFormat("en-US").format(parseInt(wholePart2));return decimalPart2?`${formattedWhole}.${decimalPart2}`:formattedWhole};const swapNegative=size==="sm"&&symbol!=="";const handleNegative=currencyAmount.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&&isAmountEmpty(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&&isAmountEmpty(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,showCurrentYear:showCurrentYear=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||showCurrentYear)&&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||showCurrentYear)&&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||showCurrentYear)&&jsx(Fragment,{children:`, ${year}`})]})]})})};function isValidDateInstance(value){return!Number.isNaN(value.getTime())}function normalizeDefaultDate(defaultDate){if(defaultDate instanceof Date){return isValidDateInstance(defaultDate)?defaultDate:""}if(Array.isArray(defaultDate)){const normalized=defaultDate.filter((d=>!(d instanceof Date)||isValidDateInstance(d)));return normalized.length?normalized:""}return defaultDate}function serializeDefaultDateForFilterReset(defaultDate){if(defaultDate===""||defaultDate==null)return void 0;if(Array.isArray(defaultDate)){const parts=defaultDate.map((d=>{if(d==null||d==="")return"";if(d instanceof Date){return isValidDateInstance(d)?d.toISOString():""}return String(d)})).filter(Boolean);return parts.length?parts.join(","):void 0}if(defaultDate instanceof Date){return isValidDateInstance(defaultDate)?defaultDate.toISOString():void 0}return String(defaultDate)}const DatePicker=props=>{if(props.plugins);const{allowInput:allowInput=false,aria:aria={},className:className,closeOnSelect:closeOnSelect=true,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,requiredIndicator:requiredIndicator,scrollContainer:scrollContainer,selectionType:selectionType="",showTimezone:showTimezone=false,staticPosition:staticPosition=true,thisRangesEndToday:thisRangesEndToday=false,yearAscending:yearAscending=false,yearRange:yearRange=[1900,2100],controlsStartId:controlsStartId,controlsEndId:controlsEndId,syncStartWith:syncStartWith,syncEndWith:syncEndWith}=props;const dialogCtx=useContext(DialogContext);const ariaProps=buildAriaProps(aria);const normalizedDefaultDate=normalizeDefaultDate(defaultDate);const filterResetDefaultSerialized=serializeDefaultDateForFilterReset(normalizedDefaultDate);const dataProps=buildDataProps({...data,...filterResetDefaultSerialized?{"default-value":filterResetDefaultSerialized}:{}});const htmlProps=buildHtmlProps(htmlOptions);const inputAriaProps=buildAriaProps(inputAria);const inputDataProps=buildDataProps(inputData);const getCursorStyle=cursor=>{if(disableInput)return"not-allowed";if(cursor){return camelToSnakeCase(cursor).replace(/_/g,"-")}return"pointer"};useEffect((()=>{datePickerHelper({allowInput:allowInput,closeOnSelect:closeOnSelect,customQuickPickDates:customQuickPickDates,defaultDate:normalizedDefaultDate,disableDate:disableDate,disableRange:disableRange,disableWeekdays:disableWeekdays,enableTime:enableTime,format:format,inline:inLine,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,yearAscending:yearAscending,yearRange:yearRange,controlsStartId:controlsStartId,controlsEndId:controlsEndId,syncStartWith:syncStartWith,syncEndWith:syncEndWith,required:false,dialogPortalTarget:(dialogCtx==null?void 0:dialogCtx.selectMenuPortalTarget)??null},scrollContainer);return()=>{var _a,_b;const input=document.getElementById(String(pickerId));(_a=input==null?void 0:input._pbDatePickerOpenUnsub)==null?void 0:_a.call(input);input==null?true:delete input._pbDatePickerOpenUnsub;(_b=input==null?void 0:input._flatpickr)==null?void 0:_b.destroy()}}),initializeOnce?[initializeOnce,dialogCtx==null?void 0:dialogCtx.selectMenuPortalTarget,pickerId]: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,inLine&&"inline-date-picker",className);const iconWrapperClass=()=>{let base="cal_icon_wrapper";if(dark){base+=" dark"}if(hideLabel){base+=" no_label_shift"}if(error){base+=" error"}if(disableInput){base+=" disabled"}return base};const angleDown=getAllIcons()["angleDown"].icon;const errorId=error?`${pickerId}-error`:void 0;return jsx("div",{...ariaProps,...dataProps,...htmlProps,className:classes,id:id,children:jsxs("div",{...inputAriaProps,...inputDataProps,className:"input_wrapper",children:[!hideLabel&&jsx("label",{htmlFor:pickerId,children:requiredIndicator?jsxs(Caption,{className:"pb_date_picker_kit_label",color:"lighter",children:[label," ",jsx("span",{style:{color:`${colors.error}`},children:"*"})]}):jsx(Caption,{className:"pb_date_picker_kit_label",color:"lighter",text:label})}),jsxs(Fragment,{children:[jsxs("div",{className:"date_picker_input_wrapper",children:[jsx("input",{"aria-describedby":errorId,"aria-invalid":!!error,autoComplete:"off",className:"date_picker_input",disabled:disableInput,id:pickerId,name:name,onChange:inputOnChange,placeholder:placeholder,style:{cursor:getCursorStyle(filteredProps.cursor)},value:inputValue}),error&&jsx(Body$1,{aria:{atomic:"true",live:"polite"},htmlOptions:{role:"alert"},id:errorId,status:"negative",text:error,variant:null})]}),!hideIcon&&!inLine&&jsx("div",{className:iconWrapperClass(),id:`cal-icon-${pickerId}`,children:jsx(Icon,{className:"cal_icon",icon:"calendar-alt"})}),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,showCurrentYear:showCurrentYear=false}=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=>{const includeYear=showCurrentYear||!dateInCurrentYear();return jsx("time",{dateTime:dateTimeIso$1(date),children:` ${dateTimestamp$1(date,includeYear)} `})};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",showCurrentYear:showCurrentYear=false}=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||showCurrentYear)&&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||showCurrentYear)&&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:datetime,id:id,showCurrentYear:showCurrentYear=false,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,{showCurrentYear:showCurrentYear,showDayOfWeek:showDayOfWeek,size:size,value:datetime}),jsx(Time,{date:datetime,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:datetime,dark:dark,className:className,htmlOptions:htmlOptions={},timeZone:timeZone="America/New_York",showCurrentYear:showCurrentYear=false}=props;const classes=classnames(buildCss("pb_date_time_stacked_kit"),globalProps(props),className);return jsxs(Flex,{htmlOptions:htmlOptions,inline:false,vertical:"stretch",...props,className:classes,children:[jsx(FlexItem,{children:jsx(DateStacked,{align:"right",bold:true,dark:dark,date:date||datetime,showCurrentYear:showCurrentYear})}),jsx(SectionSeparator,{className:"date-time-padding",orientation:"vertical"}),jsx(FlexItem,{children:jsx(TimeStackedDefault,{dark:dark,date:date||datetime,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;
2
2
  /*!
3
3
  * Adapted from jQuery UI core
4
4
  *
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Playbook
4
4
  PREVIOUS_VERSION = "18.0.0"
5
- VERSION = "18.1.0.pre.rc.3"
5
+ VERSION = "18.1.0.pre.rc.4"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: playbook_ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 18.1.0.pre.rc.3
4
+ version: 18.1.0.pre.rc.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Power UX
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2026-09-29 00:00:00.000000000 Z
12
+ date: 2026-10-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack
@@ -1064,6 +1064,9 @@ files:
1064
1064
  - app/pb_kits/playbook/pb_date_picker/docs/_date_picker_and_dropdown_range.jsx
1065
1065
  - app/pb_kits/playbook/pb_date_picker/docs/_date_picker_and_dropdown_range.md
1066
1066
  - app/pb_kits/playbook/pb_date_picker/docs/_date_picker_anti_patterns.html.erb
1067
+ - app/pb_kits/playbook/pb_date_picker/docs/_date_picker_close_on_select.html.erb
1068
+ - app/pb_kits/playbook/pb_date_picker/docs/_date_picker_close_on_select.jsx
1069
+ - app/pb_kits/playbook/pb_date_picker/docs/_date_picker_close_on_select.md
1067
1070
  - app/pb_kits/playbook/pb_date_picker/docs/_date_picker_default.html.erb
1068
1071
  - app/pb_kits/playbook/pb_date_picker/docs/_date_picker_default.jsx
1069
1072
  - app/pb_kits/playbook/pb_date_picker/docs/_date_picker_default.md
@@ -4726,7 +4729,7 @@ files:
4726
4729
  - dist/chunks/StickyLayoutHelper-DCzCcWUN.js
4727
4730
  - dist/chunks/_detail-BqqzPTNr.js
4728
4731
  - dist/chunks/_pb_line_graph-BGyCJjgG.js
4729
- - dist/chunks/_table-D7wuBFbb.js
4732
+ - dist/chunks/_table-BrYlBrTH.js
4730
4733
  - dist/chunks/_typeahead-KNcX62pc.js
4731
4734
  - dist/chunks/componentRegistry-DRSp5D_e.js
4732
4735
  - dist/chunks/globalProps-K1DCn3il.js