@linzjs/lui 17.11.0 → 17.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/lui.esm.js CHANGED
@@ -757,8 +757,8 @@ function LuiFormikForm(props) {
757
757
  " "))));
758
758
  }
759
759
 
760
- var css_248z$5 = "/**\n @deprecated\n */\n/**\n @deprecated\n */\n/**\n @deprecated\n */\n.LuiError {\n font-family: \"Open Sans\", system-ui, sans-serif;\n font-style: normal;\n font-weight: 600;\n margin-bottom: 0.5rem;\n font-size: 0.875rem;\n line-height: 1.5rem;\n color: #2a292c;\n}\n.LuiError-errorIcon {\n vertical-align: middle;\n display: inline-block;\n}\n.LuiError-errorText {\n margin-left: 0.5rem;\n}";
761
- styleInject(css_248z$5);
760
+ var css_248z$8 = "/**\n @deprecated\n */\n/**\n @deprecated\n */\n/**\n @deprecated\n */\n.LuiError {\n font-family: \"Open Sans\", system-ui, sans-serif;\n font-style: normal;\n font-weight: 600;\n margin-bottom: 0.5rem;\n font-size: 0.875rem;\n line-height: 1.5rem;\n color: #2a292c;\n}\n.LuiError-errorIcon {\n vertical-align: middle;\n display: inline-block;\n}\n.LuiError-errorText {\n margin-left: 0.5rem;\n}";
761
+ styleInject(css_248z$8);
762
762
 
763
763
  const LuiError = ({ error, className }) => (React__default.createElement("div", { className: `LuiError ${className}-error` },
764
764
  React__default.createElement(LuiIcon, { className: `LuiError-errorIcon ${className}-errorIcon`, alt: 'Error', name: "ic_error", size: "md", status: "error" }),
@@ -24907,8 +24907,8 @@ function isChromatic() {
24907
24907
  window?.location.href.match(/chromatic=true/));
24908
24908
  }
24909
24909
 
24910
- var css_248z$4 = ":export {\n charcoal: #2a292c;\n fuscous: #6b6966;\n gray: #989189;\n silver: #beb9b4;\n lily: #eaeaea;\n hint: #f9f9f9;\n snow: #ffffff;\n white: #ffffff;\n teal: #00425d;\n sea: #007198;\n electric: #0096cc;\n spray: #73c8e1;\n polar: #e2f3f7;\n sherpa: #004b50;\n surfie: #017a76;\n persian: #00a599;\n downy: #73cdc8;\n iceberg: #dcf5f0;\n sacramento: #004e32;\n salem: #08814d;\n pigment: #0aa245;\n granny: #9bd79b;\n panache: #e9fae7;\n brand-primary: #004b50;\n brand-secondary: #017a76;\n error: #cc0000;\n error-bg: #f5cccc;\n error-focus: #5a0000;\n warning: #ea6a2e;\n warning-bg: #fbdfd2;\n warning-focus: #b33a01;\n success: #0aa245;\n success-bg: #e9fae7;\n info: #3a7cdf;\n info-bg: #d8e5f9;\n visited: #00425d;\n green-hover: #107c3a;\n green-active: #094a22;\n green-btn: #0aa245;\n txt-link: #0096cc;\n primary-hover-btn: #005678;\n selection: #c7e9f3;\n heading-color: #017a76;\n heading-color--secondary: #2a292c;\n base-type-color: #2a292c;\n input-text: #2a292c;\n input-placeholder: #6b6966;\n input-placeholder-when-disabled: #989189;\n base-icon-color: #007198;\n disabled-color: #989189;\n disabled-color-dark: #6b6966;\n linz-color-primary: #023d48;\n linz-color-primary-hover: #01818a;\n linz-color-tertiary: #e1e44a;\n linz-color-tertiary-hover: #cdcf59;\n color-test-pink: #f09;\n linz-linear-gradient-blue: linear-gradient(70deg, #00425d 12%, #007198 100%);\n linz-linear-gradient-teal: linear-gradient(270deg, #00a599 1%, #73cdc8 100%);\n}";
24911
- styleInject(css_248z$4);
24910
+ var css_248z$7 = ":export {\n charcoal: #2a292c;\n fuscous: #6b6966;\n gray: #989189;\n silver: #beb9b4;\n lily: #eaeaea;\n hint: #f9f9f9;\n snow: #ffffff;\n white: #ffffff;\n teal: #00425d;\n sea: #007198;\n electric: #0096cc;\n spray: #73c8e1;\n polar: #e2f3f7;\n sherpa: #004b50;\n surfie: #017a76;\n persian: #00a599;\n downy: #73cdc8;\n iceberg: #dcf5f0;\n sacramento: #004e32;\n salem: #08814d;\n pigment: #0aa245;\n granny: #9bd79b;\n panache: #e9fae7;\n brand-primary: #004b50;\n brand-secondary: #017a76;\n error: #cc0000;\n error-bg: #f5cccc;\n error-focus: #5a0000;\n warning: #ea6a2e;\n warning-bg: #fbdfd2;\n warning-focus: #b33a01;\n success: #0aa245;\n success-bg: #e9fae7;\n info: #3a7cdf;\n info-bg: #d8e5f9;\n visited: #00425d;\n green-hover: #107c3a;\n green-active: #094a22;\n green-btn: #0aa245;\n txt-link: #0096cc;\n primary-hover-btn: #005678;\n selection: #c7e9f3;\n heading-color: #017a76;\n heading-color--secondary: #2a292c;\n base-type-color: #2a292c;\n input-text: #2a292c;\n input-placeholder: #6b6966;\n input-placeholder-when-disabled: #989189;\n base-icon-color: #007198;\n disabled-color: #989189;\n disabled-color-dark: #6b6966;\n linz-color-primary: #023d48;\n linz-color-primary-hover: #01818a;\n linz-color-tertiary: #e1e44a;\n linz-color-tertiary-hover: #cdcf59;\n color-test-pink: #f09;\n linz-linear-gradient-blue: linear-gradient(70deg, #00425d 12%, #007198 100%);\n linz-linear-gradient-teal: linear-gradient(270deg, #00a599 1%, #73cdc8 100%);\n}";
24911
+ styleInject(css_248z$7);
24912
24912
 
24913
24913
  var _excluded = ["allowCreateWhileLoading", "createOptionPosition", "formatCreateLabel", "isValidNewOption", "getNewOptionData", "onCreateOption", "options", "onChange"];
24914
24914
 
@@ -25038,22 +25038,22 @@ function LuiComboSelectActual(givenProps, ref) {
25038
25038
  ...theme,
25039
25039
  colors: {
25040
25040
  ...theme.colors,
25041
- primary: css_248z$4['sea'],
25042
- primary75: css_248z$4['electric'],
25043
- primary50: css_248z$4['spray'],
25044
- primary25: css_248z$4['polar'],
25045
- neutral90: css_248z$4['charcoal'],
25046
- neutral80: css_248z$4['charcoal'],
25047
- neutral70: css_248z$4['charcoal'],
25048
- neutral60: css_248z$4['fuscous'],
25049
- neutral50: css_248z$4['fuscous'],
25050
- neutral40: css_248z$4['gray'],
25051
- neutral30: css_248z$4['gray'],
25052
- neutral20: css_248z$4['silver'],
25053
- neutral10: css_248z$4['lily'],
25054
- neutral5: css_248z$4['hint'],
25055
- danger: css_248z$4['error'],
25056
- dangerLight: css_248z$4['error-bg'],
25041
+ primary: css_248z$7['sea'],
25042
+ primary75: css_248z$7['electric'],
25043
+ primary50: css_248z$7['spray'],
25044
+ primary25: css_248z$7['polar'],
25045
+ neutral90: css_248z$7['charcoal'],
25046
+ neutral80: css_248z$7['charcoal'],
25047
+ neutral70: css_248z$7['charcoal'],
25048
+ neutral60: css_248z$7['fuscous'],
25049
+ neutral50: css_248z$7['fuscous'],
25050
+ neutral40: css_248z$7['gray'],
25051
+ neutral30: css_248z$7['gray'],
25052
+ neutral20: css_248z$7['silver'],
25053
+ neutral10: css_248z$7['lily'],
25054
+ neutral5: css_248z$7['hint'],
25055
+ danger: css_248z$7['error'],
25056
+ dangerLight: css_248z$7['error-bg'],
25057
25057
  },
25058
25058
  }),
25059
25059
  styles: {
@@ -25068,7 +25068,7 @@ function LuiComboSelectActual(givenProps, ref) {
25068
25068
  }),
25069
25069
  dropdownIndicator: (provided) => ({
25070
25070
  ...provided,
25071
- color: css_248z$4['fuscous'],
25071
+ color: css_248z$7['fuscous'],
25072
25072
  }),
25073
25073
  indicatorSeparator: (provided) => ({
25074
25074
  ...provided,
@@ -25093,12 +25093,12 @@ function LuiComboSelectActual(givenProps, ref) {
25093
25093
  /* please keep this in sync with FormVars.scss/mixin.formPlaceholder */
25094
25094
  fontWeight: 'normal',
25095
25095
  fontStyle: 'italic',
25096
- color: css_248z$4['input-placeholder'],
25096
+ color: css_248z$7['input-placeholder'],
25097
25097
  }),
25098
25098
  option: (provided, { isSelected }) => ({
25099
25099
  ...provided,
25100
- color: css_248z$4['input-text'],
25101
- backgroundColor: isSelected ? css_248z$4['selection'] : css_248z$4['white'],
25100
+ color: css_248z$7['input-text'],
25101
+ backgroundColor: isSelected ? css_248z$7['selection'] : css_248z$7['white'],
25102
25102
  }),
25103
25103
  },
25104
25104
  };
@@ -28050,8 +28050,8 @@ const LuiModalHeader = (props) => {
28050
28050
  React__default.createElement("i", { className: "material-icons-round lui-modal-header-btn-size" }, "close")))))));
28051
28051
  };
28052
28052
 
28053
- var css_248z$3 = "@keyframes react-loading-skeleton {\n 100% {\n transform: translateX(100%);\n }\n}\n\n.react-loading-skeleton {\n --base-color: #ebebeb;\n --highlight-color: #f5f5f5;\n --animation-duration: 1.5s;\n --animation-direction: normal;\n --pseudo-element-display: block; /* Enable animation */\n\n background-color: var(--base-color);\n\n width: 100%;\n border-radius: 0.25rem;\n display: inline-flex;\n line-height: 1;\n\n position: relative;\n overflow: hidden;\n z-index: 1; /* Necessary for overflow: hidden to work correctly in Safari */\n}\n\n.react-loading-skeleton::after {\n content: ' ';\n display: var(--pseudo-element-display);\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n height: 100%;\n background-repeat: no-repeat;\n background-image: linear-gradient(\n 90deg,\n var(--base-color),\n var(--highlight-color),\n var(--base-color)\n );\n transform: translateX(-100%);\n\n animation-name: react-loading-skeleton;\n animation-direction: var(--animation-direction);\n animation-duration: var(--animation-duration);\n animation-timing-function: ease-in-out;\n animation-iteration-count: infinite;\n}\n";
28054
- styleInject(css_248z$3);
28053
+ var css_248z$6 = "@keyframes react-loading-skeleton {\n 100% {\n transform: translateX(100%);\n }\n}\n\n.react-loading-skeleton {\n --base-color: #ebebeb;\n --highlight-color: #f5f5f5;\n --animation-duration: 1.5s;\n --animation-direction: normal;\n --pseudo-element-display: block; /* Enable animation */\n\n background-color: var(--base-color);\n\n width: 100%;\n border-radius: 0.25rem;\n display: inline-flex;\n line-height: 1;\n\n position: relative;\n overflow: hidden;\n z-index: 1; /* Necessary for overflow: hidden to work correctly in Safari */\n}\n\n.react-loading-skeleton::after {\n content: ' ';\n display: var(--pseudo-element-display);\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n height: 100%;\n background-repeat: no-repeat;\n background-image: linear-gradient(\n 90deg,\n var(--base-color),\n var(--highlight-color),\n var(--base-color)\n );\n transform: translateX(-100%);\n\n animation-name: react-loading-skeleton;\n animation-direction: var(--animation-direction);\n animation-duration: var(--animation-duration);\n animation-timing-function: ease-in-out;\n animation-iteration-count: infinite;\n}\n";
28054
+ styleInject(css_248z$6);
28055
28055
 
28056
28056
  /**
28057
28057
  * @internal
@@ -32543,11 +32543,11 @@ tippy.setDefaultProps({
32543
32543
  render: render
32544
32544
  });
32545
32545
 
32546
- var css_248z$2 = ".tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;white-space:normal;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{width:16px;height:16px;color:#333}.tippy-arrow:before{content:\"\";position:absolute;border-color:transparent;border-style:solid}.tippy-content{position:relative;padding:5px 9px;z-index:1}";
32547
- styleInject(css_248z$2);
32546
+ var css_248z$5 = ".tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;white-space:normal;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{width:16px;height:16px;color:#333}.tippy-arrow:before{content:\"\";position:absolute;border-color:transparent;border-style:solid}.tippy-content{position:relative;padding:5px 9px;z-index:1}";
32547
+ styleInject(css_248z$5);
32548
32548
 
32549
- var css_248z$1 = ".tippy-box{border:1px transparent}.tippy-box[data-placement^=top]>.tippy-arrow:after{border-top-color:inherit;border-width:8px 8px 0;bottom:-8px;left:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:after{border-bottom-color:inherit;border-width:0 8px 8px;top:-8px;left:0}.tippy-box[data-placement^=left]>.tippy-arrow:after{border-left-color:inherit;border-width:8px 0 8px 8px;right:-8px;top:0}.tippy-box[data-placement^=right]>.tippy-arrow:after{border-width:8px 8px 8px 0;left:-8px;top:0;border-right-color:inherit}.tippy-box[data-placement^=top]>.tippy-svg-arrow>svg:first-child:not(:last-child){top:17px}.tippy-box[data-placement^=bottom]>.tippy-svg-arrow>svg:first-child:not(:last-child){bottom:17px}.tippy-box[data-placement^=left]>.tippy-svg-arrow>svg:first-child:not(:last-child){left:12px}.tippy-box[data-placement^=right]>.tippy-svg-arrow>svg:first-child:not(:last-child){right:12px}.tippy-arrow{border-color:inherit}.tippy-arrow:after{content:\"\";z-index:-1;position:absolute;border-color:transparent;border-style:solid}";
32550
- styleInject(css_248z$1);
32549
+ var css_248z$4 = ".tippy-box{border:1px transparent}.tippy-box[data-placement^=top]>.tippy-arrow:after{border-top-color:inherit;border-width:8px 8px 0;bottom:-8px;left:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:after{border-bottom-color:inherit;border-width:0 8px 8px;top:-8px;left:0}.tippy-box[data-placement^=left]>.tippy-arrow:after{border-left-color:inherit;border-width:8px 0 8px 8px;right:-8px;top:0}.tippy-box[data-placement^=right]>.tippy-arrow:after{border-width:8px 8px 8px 0;left:-8px;top:0;border-right-color:inherit}.tippy-box[data-placement^=top]>.tippy-svg-arrow>svg:first-child:not(:last-child){top:17px}.tippy-box[data-placement^=bottom]>.tippy-svg-arrow>svg:first-child:not(:last-child){bottom:17px}.tippy-box[data-placement^=left]>.tippy-svg-arrow>svg:first-child:not(:last-child){left:12px}.tippy-box[data-placement^=right]>.tippy-svg-arrow>svg:first-child:not(:last-child){right:12px}.tippy-arrow{border-color:inherit}.tippy-arrow:after{content:\"\";z-index:-1;position:absolute;border-color:transparent;border-style:solid}";
32550
+ styleInject(css_248z$4);
32551
32551
 
32552
32552
  let id = 0;
32553
32553
  const getKey = () => id++;
@@ -32651,8 +32651,8 @@ const LuiSidePanelProvider = ({ children }) => {
32651
32651
  React__default.createElement(LuiSidePanelContainer, { ...props })));
32652
32652
  };
32653
32653
 
32654
- var css_248z = ".lui-switch-checkbox {\n height: 0;\n width: 0;\n visibility: hidden;\n}\n\n.lui-switch-label {\n display: flex;\n align-items: center;\n justify-content: space-between;\n cursor: pointer;\n width: 40px;\n height: 20px;\n background: grey;\n border-radius: 40px;\n position: relative;\n transition: background-color 0.2s;\n}\n\n.lui-switch-label .lui-switch-button {\n content: \"\";\n position: absolute;\n top: 2px;\n left: 2px;\n width: 18px;\n height: 16px;\n border-radius: 18px;\n transition: 0.2s;\n background: #fff;\n box-shadow: 0 0 2px 0 rgba(10, 10, 10, 0.29);\n}\n\n.lui-switch-checkbox:checked + .lui-switch-label .lui-switch-button {\n left: calc(100% - 2px);\n transform: translateX(-100%);\n}\n\n.lui-switch-label:active .lui-switch-button {\n width: 20px;\n}";
32655
- styleInject(css_248z);
32654
+ var css_248z$3 = ".lui-switch-checkbox {\n height: 0;\n width: 0;\n visibility: hidden;\n}\n\n.lui-switch-label {\n display: flex;\n align-items: center;\n justify-content: space-between;\n cursor: pointer;\n width: 40px;\n height: 20px;\n background: grey;\n border-radius: 40px;\n position: relative;\n transition: background-color 0.2s;\n}\n\n.lui-switch-label .lui-switch-button {\n content: \"\";\n position: absolute;\n top: 2px;\n left: 2px;\n width: 18px;\n height: 16px;\n border-radius: 18px;\n transition: 0.2s;\n background: #fff;\n box-shadow: 0 0 2px 0 rgba(10, 10, 10, 0.29);\n}\n\n.lui-switch-checkbox:checked + .lui-switch-label .lui-switch-button {\n left: calc(100% - 2px);\n transform: translateX(-100%);\n}\n\n.lui-switch-label:active .lui-switch-button {\n width: 20px;\n}";
32655
+ styleInject(css_248z$3);
32656
32656
 
32657
32657
  const LuiSwitchButton = (props) => {
32658
32658
  const generatedId = useGenerateOrDefaultId();
@@ -40364,5 +40364,3428 @@ const LuiAccordicardStatic = (props) => {
40364
40364
  React__default.createElement(LuiIcon, { className: clsx('LuiAccordicardStatic-chevron', isOpen ? 'LuiAccordicardStatic-chevron--isOpen' : null), name: 'ic_expand_more', alt: "expand", title: "Expand and collapse panel", size: "md" }))));
40365
40365
  };
40366
40366
 
40367
- export { FIRM_KEY, FIRM_NAME_KEY, GLOBAL_CLIENT_REFERENCE_KEY, LOLActiveFirmMessage, LOLAuthorisedLink, LOLCommonDrawerMenu, LOLCommonDrawerMenuAfterLinks, LOLDrawerMenu, LOLFirmSwitcherMenu, LOLGlobalClientRefContext, LOLGlobalClientRefContextProvider, LOLLogoutLink, LOLSearchBox, LOLUserContext, LOLUserContextProvider, LOLUserLastLogin, LuiAccordicard, LuiAccordicardStatic, LuiAlertModal, LuiAlertModalButtons, LuiBadge, LuiBanner, LuiBannerContent, LuiBearingFormikInput, LuiBearingInput, LuiButton, LuiButtonGroup, LuiCheckboxInput, LuiCloseableHeaderMenuContext, LuiCloseableHeaderMenuItem, LuiComboSelect, LuiControlledMenu, LuiDrawerMenu, LuiDrawerMenuDivider, LuiDrawerMenuOption, LuiDrawerMenuOptions, LuiDrawerMenuSection, LuiDropdownMenu, LuiErrorPage, LuiExpandableBanner, LuiFileInputBox, LuiFilterContainer, LuiFilterMenu, LuiFooter, LuiFormSectionHeader, LuiFormikCheckbox, LuiFormikForm, LuiFormikFormLabel, LuiFormikFormSubmitButton, LuiFormikRadioButton, LuiFormikRadioGroup, LuiFormikSelect, LuiFormikTextInput, LuiHeader, LuiHeaderMenuItem, LuiIcon, LuiLoadingSpinner, LuiLoadingSpinnerChristmas, LuiLoadingSpinnerEaster, LuiMenu, LuiMenuCloseButton, LuiMessagingContextProvider, LuiMiniSpinner, LuiModal, LuiRadioInput, LuiSearchBox, LuiSearchInput, LuiSelectDataMenu, LuiSelectInput, LuiSelectMenu, LuiSelectMenuItem, LuiSelectSubMenuItem, LuiShadow, LuiSidePanel, LuiSidePanelProvider, LuiStaticMessage, LuiStatusSpinner, LuiSwitchButton, LuiTab, LuiTabs, LuiTabsContext, LuiTabsGroup, LuiTabsPanel, LuiTabsPanelSwitch, LuiTextAreaInput, LuiTextInput, LuiToastMessage, LuiTooltip, LuiUpdatesSplashModal, getDefaultSearchMenuOptions, isChromatic, useClickedOutsideElement, useLOLGlobalClientRefContext, useLOLUserContext, useShowLUIMessage };
40367
+ var css_248z$2 = "/**\n @deprecated\n */\n/**\n @deprecated\n */\n/**\n @deprecated\n */\n.LuiListBox {\n padding: 0;\n list-style: none;\n}\n.LuiListBox .LuiListBoxItem {\n font-family: \"Open Sans\", system-ui, sans-serif;\n font-style: normal;\n font-weight: normal;\n user-select: none;\n color: #2a292c;\n line-height: 24px;\n outline: none;\n padding: 0.5rem 0.75rem;\n border: 2px solid transparent;\n}\n.LuiListBox .LuiListBoxItem:focus-visible {\n border-color: #007198;\n}\n.LuiListBox .LuiListBoxItem.LuiListBoxItem-selected {\n background: #e2f3f7;\n}\n.LuiListBox .LuiListBoxItem:hover, .LuiListBox .LuiListBoxItem.LuiListBoxItem-selected:hover {\n background: #d6eef4;\n}\n.LuiListBox .LuiListBoxItem.LuiListBoxItem-disabled {\n background: #eaeaea;\n}\n.LuiListBox .LuiListBox-emptyIndicator, .LuiListBox .LuiListBox-loadingIndicator {\n padding: 0.5rem 0.75rem;\n}";
40368
+ styleInject(css_248z$2);
40369
+
40370
+ function $c1d7fb2ec91bae71$var$Item(props) {
40371
+ return null;
40372
+ }
40373
+ $c1d7fb2ec91bae71$var$Item.getCollectionNode = function* getCollectionNode(props, context) {
40374
+ let { childItems: childItems , title: title , children: children } = props;
40375
+ let rendered = props.title || props.children;
40376
+ let textValue = props.textValue || (typeof rendered === 'string' ? rendered : '') || props['aria-label'] || '';
40377
+ // suppressTextValueWarning is used in components like Tabs, which don't have type to select support.
40378
+ if (!textValue && !(context === null || context === void 0 ? void 0 : context.suppressTextValueWarning)) console.warn('<Item> with non-plain text contents is unsupported by type to select for accessibility. Please add a `textValue` prop.');
40379
+ yield {
40380
+ type: 'item',
40381
+ props: props,
40382
+ rendered: rendered,
40383
+ textValue: textValue,
40384
+ 'aria-label': props['aria-label'],
40385
+ hasChildNodes: $c1d7fb2ec91bae71$var$hasChildItems(props),
40386
+ *childNodes () {
40387
+ if (childItems) for (let child1 of childItems)yield {
40388
+ type: 'item',
40389
+ value: child1
40390
+ };
40391
+ else if (title) {
40392
+ let items = [];
40393
+ React__default.Children.forEach(children, (child)=>{
40394
+ items.push({
40395
+ type: 'item',
40396
+ element: child
40397
+ });
40398
+ });
40399
+ yield* items;
40400
+ }
40401
+ }
40402
+ };
40403
+ };
40404
+ function $c1d7fb2ec91bae71$var$hasChildItems(props) {
40405
+ if (props.hasChildItems != null) return props.hasChildItems;
40406
+ if (props.childItems) return true;
40407
+ if (props.title && React__default.Children.count(props.children) > 0) return true;
40408
+ return false;
40409
+ }
40410
+ // We don't want getCollectionNode to show up in the type definition
40411
+ let $c1d7fb2ec91bae71$export$6d08773d2e66f8f2 = $c1d7fb2ec91bae71$var$Item;
40412
+
40413
+
40414
+
40415
+ class $eb2240fc39a57fa5$export$bf788dd355e3a401 {
40416
+ build(props, context) {
40417
+ this.context = context;
40418
+ return $eb2240fc39a57fa5$var$iterable(()=>this.iterateCollection(props)
40419
+ );
40420
+ }
40421
+ *iterateCollection(props) {
40422
+ let { children: children , items: items } = props;
40423
+ if (typeof children === 'function') {
40424
+ if (!items) throw new Error('props.children was a function but props.items is missing');
40425
+ for (let item of props.items)yield* this.getFullNode({
40426
+ value: item
40427
+ }, {
40428
+ renderer: children
40429
+ });
40430
+ } else {
40431
+ let items = [];
40432
+ React__default.Children.forEach(children, (child)=>{
40433
+ items.push(child);
40434
+ });
40435
+ let index = 0;
40436
+ for (let item of items){
40437
+ let nodes = this.getFullNode({
40438
+ element: item,
40439
+ index: index
40440
+ }, {
40441
+ });
40442
+ for (let node of nodes){
40443
+ index++;
40444
+ yield node;
40445
+ }
40446
+ }
40447
+ }
40448
+ }
40449
+ getKey(item, partialNode, state, parentKey) {
40450
+ if (item.key != null) return item.key;
40451
+ if (partialNode.type === 'cell' && partialNode.key != null) return `${parentKey}${partialNode.key}`;
40452
+ let v = partialNode.value;
40453
+ if (v != null) {
40454
+ var _key;
40455
+ let key = (_key = v.key) !== null && _key !== void 0 ? _key : v.id;
40456
+ if (key == null) throw new Error('No key found for item');
40457
+ return key;
40458
+ }
40459
+ return parentKey ? `${parentKey}.${partialNode.index}` : `$.${partialNode.index}`;
40460
+ }
40461
+ getChildState(state, partialNode) {
40462
+ return {
40463
+ renderer: partialNode.renderer || state.renderer
40464
+ };
40465
+ }
40466
+ *getFullNode(partialNode, state, parentKey, parentNode) {
40467
+ // If there's a value instead of an element on the node, and a parent renderer function is available,
40468
+ // use it to render an element for the value.
40469
+ let element = partialNode.element;
40470
+ if (!element && partialNode.value && state && state.renderer) {
40471
+ let cached = this.cache.get(partialNode.value);
40472
+ if (cached && (!cached.shouldInvalidate || !cached.shouldInvalidate(this.context))) {
40473
+ cached.index = partialNode.index;
40474
+ cached.parentKey = parentNode ? parentNode.key : null;
40475
+ yield cached;
40476
+ return;
40477
+ }
40478
+ element = state.renderer(partialNode.value);
40479
+ }
40480
+ // If there's an element with a getCollectionNode function on its type, then it's a supported component.
40481
+ // Call this function to get a partial node, and recursively build a full node from there.
40482
+ if (React__default.isValidElement(element)) {
40483
+ let type = element.type;
40484
+ if (typeof type !== 'function' && typeof type.getCollectionNode !== 'function') {
40485
+ let name = typeof element.type === 'function' ? element.type.name : element.type;
40486
+ throw new Error(`Unknown element <${name}> in collection.`);
40487
+ }
40488
+ let childNodes = type.getCollectionNode(element.props, this.context);
40489
+ let index = partialNode.index;
40490
+ let result = childNodes.next();
40491
+ while(!result.done && result.value){
40492
+ let childNode = result.value;
40493
+ partialNode.index = index;
40494
+ let nodeKey = childNode.key;
40495
+ if (!nodeKey) nodeKey = childNode.element ? null : this.getKey(element, partialNode, state, parentKey);
40496
+ let nodes = this.getFullNode({
40497
+ ...childNode,
40498
+ key: nodeKey,
40499
+ index: index,
40500
+ wrapper: $eb2240fc39a57fa5$var$compose(partialNode.wrapper, childNode.wrapper)
40501
+ }, this.getChildState(state, childNode), parentKey ? `${parentKey}${element.key}` : element.key, parentNode);
40502
+ let children = [
40503
+ ...nodes
40504
+ ];
40505
+ for (let node of children){
40506
+ // Cache the node based on its value
40507
+ node.value = childNode.value || partialNode.value;
40508
+ if (node.value) this.cache.set(node.value, node);
40509
+ // The partial node may have specified a type for the child in order to specify a constraint.
40510
+ // Verify that the full node that was built recursively matches this type.
40511
+ if (partialNode.type && node.type !== partialNode.type) throw new Error(`Unsupported type <${$eb2240fc39a57fa5$var$capitalize(node.type)}> in <${$eb2240fc39a57fa5$var$capitalize(parentNode.type)}>. Only <${$eb2240fc39a57fa5$var$capitalize(partialNode.type)}> is supported.`);
40512
+ index++;
40513
+ yield node;
40514
+ }
40515
+ result = childNodes.next(children);
40516
+ }
40517
+ return;
40518
+ }
40519
+ // Ignore invalid elements
40520
+ if (partialNode.key == null) return;
40521
+ // Create full node
40522
+ let builder = this;
40523
+ let node = {
40524
+ type: partialNode.type,
40525
+ props: partialNode.props,
40526
+ key: partialNode.key,
40527
+ parentKey: parentNode ? parentNode.key : null,
40528
+ value: partialNode.value,
40529
+ level: parentNode ? parentNode.level + 1 : 0,
40530
+ index: partialNode.index,
40531
+ rendered: partialNode.rendered,
40532
+ textValue: partialNode.textValue,
40533
+ 'aria-label': partialNode['aria-label'],
40534
+ wrapper: partialNode.wrapper,
40535
+ shouldInvalidate: partialNode.shouldInvalidate,
40536
+ hasChildNodes: partialNode.hasChildNodes,
40537
+ childNodes: $eb2240fc39a57fa5$var$iterable(function*() {
40538
+ if (!partialNode.hasChildNodes) return;
40539
+ let index = 0;
40540
+ for (let child of partialNode.childNodes()){
40541
+ // Ensure child keys are globally unique by prepending the parent node's key
40542
+ if (child.key != null) // TODO: Remove this line entirely and enforce that users always provide unique keys.
40543
+ // Currently this line will have issues when a parent has a key `a` and a child with key `bc`
40544
+ // but another parent has key `ab` and its child has a key `c`. The combined keys would result in both
40545
+ // children having a key of `abc`.
40546
+ child.key = `${node.key}${child.key}`;
40547
+ child.index = index;
40548
+ let nodes = builder.getFullNode(child, builder.getChildState(state, child), node.key, node);
40549
+ for (let node1 of nodes){
40550
+ index++;
40551
+ yield node1;
40552
+ }
40553
+ }
40554
+ })
40555
+ };
40556
+ yield node;
40557
+ }
40558
+ constructor(){
40559
+ this.cache = new WeakMap();
40560
+ }
40561
+ }
40562
+ // Wraps an iterator function as an iterable object, and caches the results.
40563
+ function $eb2240fc39a57fa5$var$iterable(iterator) {
40564
+ let cache = [];
40565
+ let iterable = null;
40566
+ return {
40567
+ *[Symbol.iterator] () {
40568
+ for (let item of cache)yield item;
40569
+ if (!iterable) iterable = iterator();
40570
+ for (let item1 of iterable){
40571
+ cache.push(item1);
40572
+ yield item1;
40573
+ }
40574
+ }
40575
+ };
40576
+ }
40577
+ function $eb2240fc39a57fa5$var$compose(outer, inner) {
40578
+ if (outer && inner) return (element)=>outer(inner(element))
40579
+ ;
40580
+ if (outer) return outer;
40581
+ if (inner) return inner;
40582
+ }
40583
+ function $eb2240fc39a57fa5$var$capitalize(str) {
40584
+ return str[0].toUpperCase() + str.slice(1);
40585
+ }
40586
+
40587
+
40588
+
40589
+ function $7613b1592d41b092$export$6cd28814d92fa9c9(props, factory, context, invalidators = []) {
40590
+ let builder = useMemo(()=>new $eb2240fc39a57fa5$export$bf788dd355e3a401()
40591
+ , []);
40592
+ let prev = useRef(null);
40593
+ return useMemo(()=>{
40594
+ let nodes = builder.build(props, context);
40595
+ prev.current = factory(nodes, prev.current);
40596
+ return prev.current;
40597
+ // Don't invalidate when any prop changes, just the two we care about.
40598
+ // eslint-disable-next-line react-hooks/exhaustive-deps
40599
+ }, [
40600
+ builder,
40601
+ props.children,
40602
+ props.items,
40603
+ context,
40604
+ ...invalidators
40605
+ ]);
40606
+ }
40607
+
40608
+
40609
+ const $453cc9f0df89c0a5$var$cache = new WeakMap();
40610
+ function $453cc9f0df89c0a5$export$77d5aafae4e095b2(collection) {
40611
+ let count = $453cc9f0df89c0a5$var$cache.get(collection);
40612
+ if (count != null) return count;
40613
+ count = 0;
40614
+ for (let item of collection)if (item.type === 'section') count += $453cc9f0df89c0a5$export$77d5aafae4e095b2(item.childNodes);
40615
+ else count++;
40616
+ $453cc9f0df89c0a5$var$cache.set(collection, count);
40617
+ return count;
40618
+ }
40619
+
40620
+ function mapToAriaListBoxProps({ selectionMode, selectionBehavior, items = [], value, onChange, ariaProps, getKey = (item) => {
40621
+ if (!item.hasOwnProperty('key')) {
40622
+ throw Error('Could not find `key` property on item, please provide a custom `getKey` function');
40623
+ }
40624
+ return item.key;
40625
+ }, }) {
40626
+ return {
40627
+ ...ariaProps,
40628
+ items: items?.map((item) => {
40629
+ if (item.hasOwnProperty('key')) {
40630
+ return item;
40631
+ }
40632
+ return { ...item, key: getKey(item) };
40633
+ }),
40634
+ selectionMode,
40635
+ selectionBehavior,
40636
+ selectedKeys: (Array.isArray(value) ? value : [value]).filter(Boolean),
40637
+ children: (item) => React__default.createElement($c1d7fb2ec91bae71$export$6d08773d2e66f8f2, null, String(item.key)),
40638
+ ...(onChange
40639
+ ? {
40640
+ onSelectionChange: (keys) => {
40641
+ const selectedItems = keys === 'all'
40642
+ ? items
40643
+ : items.filter((item) => keys.has(getKey(item)));
40644
+ const selectedKeys = keys === 'all'
40645
+ ? items.map((item) => getKey(item))
40646
+ : Array.from(keys);
40647
+ onChange(selectedKeys, selectedItems);
40648
+ },
40649
+ }
40650
+ : {}),
40651
+ };
40652
+ }
40653
+
40654
+ function $458b0a5536c1a7cf$export$40bfa8c7b0832715(value1, defaultValue, onChange) {
40655
+ let [stateValue, setStateValue] = useState(value1 || defaultValue);
40656
+ let ref = useRef(value1 !== undefined);
40657
+ let wasControlled = ref.current;
40658
+ let isControlled = value1 !== undefined;
40659
+ // Internal state reference for useCallback
40660
+ let stateRef = useRef(stateValue);
40661
+ if (wasControlled !== isControlled) console.warn(`WARN: A component changed from ${wasControlled ? 'controlled' : 'uncontrolled'} to ${isControlled ? 'controlled' : 'uncontrolled'}.`);
40662
+ ref.current = isControlled;
40663
+ let setValue = useCallback((value2, ...args)=>{
40664
+ let onChangeCaller = (value, ...onChangeArgs)=>{
40665
+ if (onChange) {
40666
+ if (!Object.is(stateRef.current, value)) onChange(value, ...onChangeArgs);
40667
+ }
40668
+ if (!isControlled) stateRef.current = value;
40669
+ };
40670
+ if (typeof value2 === 'function') {
40671
+ console.warn('We can not support a function callback. See Github Issues for details https://github.com/adobe/react-spectrum/issues/2320');
40672
+ // this supports functional updates https://reactjs.org/docs/hooks-reference.html#functional-updates
40673
+ // when someone using useControlledState calls setControlledState(myFunc)
40674
+ // this will call our useState setState with a function as well which invokes myFunc and calls onChange with the value from myFunc
40675
+ // if we're in an uncontrolled state, then we also return the value of myFunc which to setState looks as though it was just called with myFunc from the beginning
40676
+ // otherwise we just return the controlled value, which won't cause a rerender because React knows to bail out when the value is the same
40677
+ let updateFunction = (oldValue, ...functionArgs)=>{
40678
+ let interceptedValue = value2(isControlled ? stateRef.current : oldValue, ...functionArgs);
40679
+ onChangeCaller(interceptedValue, ...args);
40680
+ if (!isControlled) return interceptedValue;
40681
+ return oldValue;
40682
+ };
40683
+ setStateValue(updateFunction);
40684
+ } else {
40685
+ if (!isControlled) setStateValue(value2);
40686
+ onChangeCaller(value2, ...args);
40687
+ }
40688
+ }, [
40689
+ isControlled,
40690
+ onChange
40691
+ ]);
40692
+ // If a controlled component's value prop changes, we need to update stateRef
40693
+ if (isControlled) stateRef.current = value1;
40694
+ else value1 = stateValue;
40695
+ return [
40696
+ value1,
40697
+ setValue
40698
+ ];
40699
+ }
40700
+
40701
+ // Default context value to use in case there is no SSRProvider. This is fine for
40702
+ // client-only apps. In order to support multiple copies of React Aria potentially
40703
+ // being on the page at once, the prefix is set to a random number. SSRProvider
40704
+ // will reset this to zero for consistency between server and client, so in the
40705
+ // SSR case multiple copies of React Aria is not supported.
40706
+ const $704cf1d3b684cc5c$var$defaultContext = {
40707
+ prefix: String(Math.round(Math.random() * 10000000000)),
40708
+ current: 0
40709
+ };
40710
+ const $704cf1d3b684cc5c$var$SSRContext = /*#__PURE__*/ React__default.createContext($704cf1d3b684cc5c$var$defaultContext);
40711
+ let $704cf1d3b684cc5c$var$canUseDOM = Boolean(typeof window !== 'undefined' && window.document && window.document.createElement);
40712
+ function $704cf1d3b684cc5c$export$619500959fc48b26(defaultId) {
40713
+ let ctx = useContext($704cf1d3b684cc5c$var$SSRContext);
40714
+ // If we are rendering in a non-DOM environment, and there's no SSRProvider,
40715
+ // provide a warning to hint to the developer to add one.
40716
+ if (ctx === $704cf1d3b684cc5c$var$defaultContext && !$704cf1d3b684cc5c$var$canUseDOM) console.warn('When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.');
40717
+ return useMemo(()=>defaultId || `react-aria${ctx.prefix}-${++ctx.current}`
40718
+ , [
40719
+ defaultId
40720
+ ]);
40721
+ }
40722
+ function $704cf1d3b684cc5c$export$535bd6ca7f90a273() {
40723
+ let cur = useContext($704cf1d3b684cc5c$var$SSRContext);
40724
+ let isInSSRContext = cur !== $704cf1d3b684cc5c$var$defaultContext;
40725
+ let [isSSR, setIsSSR] = useState(isInSSRContext);
40726
+ // If on the client, and the component was initially server rendered,
40727
+ // then schedule a layout effect to update the component after hydration.
40728
+ if (typeof window !== 'undefined' && isInSSRContext) // This if statement technically breaks the rules of hooks, but is safe
40729
+ // because the condition never changes after mounting.
40730
+ // eslint-disable-next-line react-hooks/rules-of-hooks
40731
+ useLayoutEffect(()=>{
40732
+ setIsSSR(false);
40733
+ }, []);
40734
+ return isSSR;
40735
+ }
40736
+
40737
+ const $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c = typeof window !== 'undefined' ? React__default.useLayoutEffect : ()=>{
40738
+ };
40739
+
40740
+
40741
+
40742
+
40743
+ let $bdb11010cef70236$var$idsUpdaterMap = new Map();
40744
+ function $bdb11010cef70236$export$f680877a34711e37(defaultId) {
40745
+ let [value, setValue] = useState(defaultId);
40746
+ let nextId = useRef(null);
40747
+ let res = $704cf1d3b684cc5c$export$619500959fc48b26(value);
40748
+ let updateValue = useCallback((val)=>{
40749
+ nextId.current = val;
40750
+ }, []);
40751
+ $bdb11010cef70236$var$idsUpdaterMap.set(res, updateValue);
40752
+ $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(()=>{
40753
+ let r = res;
40754
+ return ()=>{
40755
+ $bdb11010cef70236$var$idsUpdaterMap.delete(r);
40756
+ };
40757
+ }, [
40758
+ res
40759
+ ]);
40760
+ // This cannot cause an infinite loop because the ref is updated first.
40761
+ // eslint-disable-next-line
40762
+ useEffect(()=>{
40763
+ let newId = nextId.current;
40764
+ if (newId) {
40765
+ nextId.current = null;
40766
+ setValue(newId);
40767
+ }
40768
+ });
40769
+ return res;
40770
+ }
40771
+ function $bdb11010cef70236$export$cd8c9cb68f842629(idA, idB) {
40772
+ if (idA === idB) return idA;
40773
+ let setIdA = $bdb11010cef70236$var$idsUpdaterMap.get(idA);
40774
+ if (setIdA) {
40775
+ setIdA(idB);
40776
+ return idB;
40777
+ }
40778
+ let setIdB = $bdb11010cef70236$var$idsUpdaterMap.get(idB);
40779
+ if (setIdB) {
40780
+ setIdB(idA);
40781
+ return idA;
40782
+ }
40783
+ return idB;
40784
+ }
40785
+ function $bdb11010cef70236$export$b4cc09c592e8fdb8(depArray = []) {
40786
+ let id = $bdb11010cef70236$export$f680877a34711e37();
40787
+ let [resolvedId, setResolvedId] = $1dbecbe27a04f9af$export$14d238f342723f25(id);
40788
+ let updateId = useCallback(()=>{
40789
+ setResolvedId(function*() {
40790
+ yield id;
40791
+ yield document.getElementById(id) ? id : null;
40792
+ });
40793
+ }, [
40794
+ id,
40795
+ setResolvedId
40796
+ ]);
40797
+ $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(updateId, [
40798
+ id,
40799
+ updateId,
40800
+ ...depArray
40801
+ ]);
40802
+ return resolvedId;
40803
+ }
40804
+
40805
+
40806
+ function $ff5963eb1fccf552$export$e08e3b67e392101e(...callbacks) {
40807
+ return (...args)=>{
40808
+ for (let callback of callbacks)if (typeof callback === 'function') callback(...args);
40809
+ };
40810
+ }
40811
+
40812
+
40813
+
40814
+
40815
+
40816
+ function $3ef42575df84b30b$export$9d1611c77c2fe928(...args) {
40817
+ // Start with a base clone of the first argument. This is a lot faster than starting
40818
+ // with an empty object and adding properties as we go.
40819
+ let result = {
40820
+ ...args[0]
40821
+ };
40822
+ for(let i = 1; i < args.length; i++){
40823
+ let props = args[i];
40824
+ for(let key in props){
40825
+ let a = result[key];
40826
+ let b = props[key];
40827
+ // Chain events
40828
+ if (typeof a === 'function' && typeof b === 'function' && // This is a lot faster than a regex.
40829
+ key[0] === 'o' && key[1] === 'n' && key.charCodeAt(2) >= /* 'A' */ 65 && key.charCodeAt(2) <= /* 'Z' */ 90) result[key] = $ff5963eb1fccf552$export$e08e3b67e392101e(a, b);
40830
+ else if ((key === 'className' || key === 'UNSAFE_className') && typeof a === 'string' && typeof b === 'string') result[key] = clsx(a, b);
40831
+ else if (key === 'id' && a && b) result.id = $bdb11010cef70236$export$cd8c9cb68f842629(a, b);
40832
+ else result[key] = b !== undefined ? b : a;
40833
+ }
40834
+ }
40835
+ return result;
40836
+ }
40837
+
40838
+
40839
+ const $65484d02dcb7eb3e$var$DOMPropNames = new Set([
40840
+ 'id'
40841
+ ]);
40842
+ const $65484d02dcb7eb3e$var$labelablePropNames = new Set([
40843
+ 'aria-label',
40844
+ 'aria-labelledby',
40845
+ 'aria-describedby',
40846
+ 'aria-details'
40847
+ ]);
40848
+ const $65484d02dcb7eb3e$var$propRe = /^(data-.*)$/;
40849
+ function $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, opts = {
40850
+ }) {
40851
+ let { labelable: labelable , propNames: propNames } = opts;
40852
+ let filteredProps = {
40853
+ };
40854
+ for(const prop in props)if (Object.prototype.hasOwnProperty.call(props, prop) && ($65484d02dcb7eb3e$var$DOMPropNames.has(prop) || labelable && $65484d02dcb7eb3e$var$labelablePropNames.has(prop) || (propNames === null || propNames === void 0 ? void 0 : propNames.has(prop)) || $65484d02dcb7eb3e$var$propRe.test(prop))) filteredProps[prop] = props[prop];
40855
+ return filteredProps;
40856
+ }
40857
+
40858
+
40859
+ function $7215afc6de606d6b$export$de79e2c695e052f3(element) {
40860
+ if ($7215afc6de606d6b$var$supportsPreventScroll()) element.focus({
40861
+ preventScroll: true
40862
+ });
40863
+ else {
40864
+ let scrollableElements = $7215afc6de606d6b$var$getScrollableElements(element);
40865
+ element.focus();
40866
+ $7215afc6de606d6b$var$restoreScrollPosition(scrollableElements);
40867
+ }
40868
+ }
40869
+ let $7215afc6de606d6b$var$supportsPreventScrollCached = null;
40870
+ function $7215afc6de606d6b$var$supportsPreventScroll() {
40871
+ if ($7215afc6de606d6b$var$supportsPreventScrollCached == null) {
40872
+ $7215afc6de606d6b$var$supportsPreventScrollCached = false;
40873
+ try {
40874
+ var focusElem = document.createElement('div');
40875
+ focusElem.focus({
40876
+ get preventScroll () {
40877
+ $7215afc6de606d6b$var$supportsPreventScrollCached = true;
40878
+ return true;
40879
+ }
40880
+ });
40881
+ } catch (e) {
40882
+ // Ignore
40883
+ }
40884
+ }
40885
+ return $7215afc6de606d6b$var$supportsPreventScrollCached;
40886
+ }
40887
+ function $7215afc6de606d6b$var$getScrollableElements(element) {
40888
+ var parent = element.parentNode;
40889
+ var scrollableElements = [];
40890
+ var rootScrollingElement = document.scrollingElement || document.documentElement;
40891
+ while(parent instanceof HTMLElement && parent !== rootScrollingElement){
40892
+ if (parent.offsetHeight < parent.scrollHeight || parent.offsetWidth < parent.scrollWidth) scrollableElements.push({
40893
+ element: parent,
40894
+ scrollTop: parent.scrollTop,
40895
+ scrollLeft: parent.scrollLeft
40896
+ });
40897
+ parent = parent.parentNode;
40898
+ }
40899
+ if (rootScrollingElement instanceof HTMLElement) scrollableElements.push({
40900
+ element: rootScrollingElement,
40901
+ scrollTop: rootScrollingElement.scrollTop,
40902
+ scrollLeft: rootScrollingElement.scrollLeft
40903
+ });
40904
+ return scrollableElements;
40905
+ }
40906
+ function $7215afc6de606d6b$var$restoreScrollPosition(scrollableElements) {
40907
+ for (let { element: element , scrollTop: scrollTop , scrollLeft: scrollLeft } of scrollableElements){
40908
+ element.scrollTop = scrollTop;
40909
+ element.scrollLeft = scrollLeft;
40910
+ }
40911
+ }
40912
+
40913
+
40914
+ /*
40915
+ * Copyright 2020 Adobe. All rights reserved.
40916
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
40917
+ * you may not use this file except in compliance with the License. You may obtain a copy
40918
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
40919
+ *
40920
+ * Unless required by applicable law or agreed to in writing, software distributed under
40921
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
40922
+ * OF ANY KIND, either express or implied. See the License for the specific language
40923
+ * governing permissions and limitations under the License.
40924
+ */ // We store a global list of elements that are currently transitioning,
40925
+ // mapped to a set of CSS properties that are transitioning for that element.
40926
+ // This is necessary rather than a simple count of transitions because of browser
40927
+ // bugs, e.g. Chrome sometimes fires both transitionend and transitioncancel rather
40928
+ // than one or the other. So we need to track what's actually transitioning so that
40929
+ // we can ignore these duplicate events.
40930
+ let $bbed8b41f857bcc0$var$transitionsByElement = new Map();
40931
+ // A list of callbacks to call once there are no transitioning elements.
40932
+ let $bbed8b41f857bcc0$var$transitionCallbacks = new Set();
40933
+ function $bbed8b41f857bcc0$var$setupGlobalEvents() {
40934
+ if (typeof window === 'undefined') return;
40935
+ let onTransitionStart = (e)=>{
40936
+ // Add the transitioning property to the list for this element.
40937
+ let transitions = $bbed8b41f857bcc0$var$transitionsByElement.get(e.target);
40938
+ if (!transitions) {
40939
+ transitions = new Set();
40940
+ $bbed8b41f857bcc0$var$transitionsByElement.set(e.target, transitions);
40941
+ // The transitioncancel event must be registered on the element itself, rather than as a global
40942
+ // event. This enables us to handle when the node is deleted from the document while it is transitioning.
40943
+ // In that case, the cancel event would have nowhere to bubble to so we need to handle it directly.
40944
+ e.target.addEventListener('transitioncancel', onTransitionEnd);
40945
+ }
40946
+ transitions.add(e.propertyName);
40947
+ };
40948
+ let onTransitionEnd = (e)=>{
40949
+ // Remove property from list of transitioning properties.
40950
+ let properties = $bbed8b41f857bcc0$var$transitionsByElement.get(e.target);
40951
+ if (!properties) return;
40952
+ properties.delete(e.propertyName);
40953
+ // If empty, remove transitioncancel event, and remove the element from the list of transitioning elements.
40954
+ if (properties.size === 0) {
40955
+ e.target.removeEventListener('transitioncancel', onTransitionEnd);
40956
+ $bbed8b41f857bcc0$var$transitionsByElement.delete(e.target);
40957
+ }
40958
+ // If no transitioning elements, call all of the queued callbacks.
40959
+ if ($bbed8b41f857bcc0$var$transitionsByElement.size === 0) {
40960
+ for (let cb of $bbed8b41f857bcc0$var$transitionCallbacks)cb();
40961
+ $bbed8b41f857bcc0$var$transitionCallbacks.clear();
40962
+ }
40963
+ };
40964
+ document.body.addEventListener('transitionrun', onTransitionStart);
40965
+ document.body.addEventListener('transitionend', onTransitionEnd);
40966
+ }
40967
+ if (typeof document !== 'undefined') {
40968
+ if (document.readyState !== 'loading') $bbed8b41f857bcc0$var$setupGlobalEvents();
40969
+ else document.addEventListener('DOMContentLoaded', $bbed8b41f857bcc0$var$setupGlobalEvents);
40970
+ }
40971
+ function $bbed8b41f857bcc0$export$24490316f764c430(fn) {
40972
+ // Wait one frame to see if an animation starts, e.g. a transition on mount.
40973
+ requestAnimationFrame(()=>{
40974
+ // If no transitions are running, call the function immediately.
40975
+ // Otherwise, add it to a list of callbacks to run at the end of the animation.
40976
+ if ($bbed8b41f857bcc0$var$transitionsByElement.size === 0) fn();
40977
+ else $bbed8b41f857bcc0$var$transitionCallbacks.add(fn);
40978
+ });
40979
+ }
40980
+
40981
+
40982
+
40983
+ function $03deb23ff14920c4$export$4eaf04e54aa8eed6() {
40984
+ let globalListeners = useRef(new Map());
40985
+ let addGlobalListener = useCallback((eventTarget, type, listener, options)=>{
40986
+ // Make sure we remove the listener after it is called with the `once` option.
40987
+ let fn = (options === null || options === void 0 ? void 0 : options.once) ? (...args)=>{
40988
+ globalListeners.current.delete(listener);
40989
+ listener(...args);
40990
+ } : listener;
40991
+ globalListeners.current.set(listener, {
40992
+ type: type,
40993
+ eventTarget: eventTarget,
40994
+ fn: fn,
40995
+ options: options
40996
+ });
40997
+ eventTarget.addEventListener(type, listener, options);
40998
+ }, []);
40999
+ let removeGlobalListener = useCallback((eventTarget, type, listener, options)=>{
41000
+ var ref;
41001
+ let fn = ((ref = globalListeners.current.get(listener)) === null || ref === void 0 ? void 0 : ref.fn) || listener;
41002
+ eventTarget.removeEventListener(type, fn, options);
41003
+ globalListeners.current.delete(listener);
41004
+ }, []);
41005
+ let removeAllGlobalListeners = useCallback(()=>{
41006
+ globalListeners.current.forEach((value, key)=>{
41007
+ removeGlobalListener(value.eventTarget, value.type, key, value.options);
41008
+ });
41009
+ }, [
41010
+ removeGlobalListener
41011
+ ]);
41012
+ // eslint-disable-next-line arrow-body-style
41013
+ useEffect(()=>{
41014
+ return removeAllGlobalListeners;
41015
+ }, [
41016
+ removeAllGlobalListeners
41017
+ ]);
41018
+ return {
41019
+ addGlobalListener: addGlobalListener,
41020
+ removeGlobalListener: removeGlobalListener,
41021
+ removeAllGlobalListeners: removeAllGlobalListeners
41022
+ };
41023
+ }
41024
+
41025
+
41026
+
41027
+ function $313b98861ee5dd6c$export$d6875122194c7b44(props, defaultLabel) {
41028
+ let { id: id , 'aria-label': label , 'aria-labelledby': labelledBy } = props;
41029
+ // If there is both an aria-label and aria-labelledby,
41030
+ // combine them by pointing to the element itself.
41031
+ id = $bdb11010cef70236$export$f680877a34711e37(id);
41032
+ if (labelledBy && label) {
41033
+ let ids = new Set([
41034
+ ...labelledBy.trim().split(/\s+/),
41035
+ id
41036
+ ]);
41037
+ labelledBy = [
41038
+ ...ids
41039
+ ].join(' ');
41040
+ } else if (labelledBy) labelledBy = labelledBy.trim().split(/\s+/).join(' ');
41041
+ // If no labels are provided, use the default
41042
+ if (!label && !labelledBy && defaultLabel) label = defaultLabel;
41043
+ return {
41044
+ id: id,
41045
+ 'aria-label': label,
41046
+ 'aria-labelledby': labelledBy
41047
+ };
41048
+ }
41049
+
41050
+
41051
+
41052
+ function $e7801be82b4b2a53$export$4debdb1a3f0fa79e(context, ref) {
41053
+ $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(()=>{
41054
+ if (context && context.ref && ref) {
41055
+ context.ref.current = ref.current;
41056
+ return ()=>{
41057
+ context.ref.current = null;
41058
+ };
41059
+ }
41060
+ }, [
41061
+ context,
41062
+ ref
41063
+ ]);
41064
+ }
41065
+
41066
+
41067
+
41068
+
41069
+ let $ef06256079686ba0$var$descriptionId = 0;
41070
+ const $ef06256079686ba0$var$descriptionNodes = new Map();
41071
+ function $ef06256079686ba0$export$f8aeda7b10753fa1(description) {
41072
+ let [id1, setId] = useState(null);
41073
+ $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(()=>{
41074
+ if (!description) return;
41075
+ let desc = $ef06256079686ba0$var$descriptionNodes.get(description);
41076
+ if (!desc) {
41077
+ let id = `react-aria-description-${$ef06256079686ba0$var$descriptionId++}`;
41078
+ setId(id);
41079
+ let node = document.createElement('div');
41080
+ node.id = id;
41081
+ node.style.display = 'none';
41082
+ node.textContent = description;
41083
+ document.body.appendChild(node);
41084
+ desc = {
41085
+ refCount: 0,
41086
+ element: node
41087
+ };
41088
+ $ef06256079686ba0$var$descriptionNodes.set(description, desc);
41089
+ } else setId(desc.element.id);
41090
+ desc.refCount++;
41091
+ return ()=>{
41092
+ if (--desc.refCount === 0) {
41093
+ desc.element.remove();
41094
+ $ef06256079686ba0$var$descriptionNodes.delete(description);
41095
+ }
41096
+ };
41097
+ }, [
41098
+ description
41099
+ ]);
41100
+ return {
41101
+ 'aria-describedby': description ? id1 : undefined
41102
+ };
41103
+ }
41104
+
41105
+
41106
+ /*
41107
+ * Copyright 2020 Adobe. All rights reserved.
41108
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
41109
+ * you may not use this file except in compliance with the License. You may obtain a copy
41110
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
41111
+ *
41112
+ * Unless required by applicable law or agreed to in writing, software distributed under
41113
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
41114
+ * OF ANY KIND, either express or implied. See the License for the specific language
41115
+ * governing permissions and limitations under the License.
41116
+ */ function $c87311424ea30a05$var$testUserAgent(re) {
41117
+ var ref;
41118
+ if (typeof window === 'undefined' || window.navigator == null) return false;
41119
+ return ((ref = window.navigator['userAgentData']) === null || ref === void 0 ? void 0 : ref.brands.some((brand)=>re.test(brand.brand)
41120
+ )) || re.test(window.navigator.userAgent);
41121
+ }
41122
+ function $c87311424ea30a05$var$testPlatform(re) {
41123
+ var ref;
41124
+ return typeof window !== 'undefined' && window.navigator != null ? re.test(((ref = window.navigator['userAgentData']) === null || ref === void 0 ? void 0 : ref.platform) || window.navigator.platform) : false;
41125
+ }
41126
+ function $c87311424ea30a05$export$9ac100e40613ea10() {
41127
+ return $c87311424ea30a05$var$testPlatform(/^Mac/i);
41128
+ }
41129
+ function $c87311424ea30a05$export$186c6964ca17d99() {
41130
+ return $c87311424ea30a05$var$testPlatform(/^iPhone/i);
41131
+ }
41132
+ function $c87311424ea30a05$export$7bef049ce92e4224() {
41133
+ return $c87311424ea30a05$var$testPlatform(/^iPad/i) || $c87311424ea30a05$export$9ac100e40613ea10() && navigator.maxTouchPoints > 1;
41134
+ }
41135
+ function $c87311424ea30a05$export$fedb369cb70207f1() {
41136
+ return $c87311424ea30a05$export$186c6964ca17d99() || $c87311424ea30a05$export$7bef049ce92e4224();
41137
+ }
41138
+ function $c87311424ea30a05$export$e1865c3bedcd822b() {
41139
+ return $c87311424ea30a05$export$9ac100e40613ea10() || $c87311424ea30a05$export$fedb369cb70207f1();
41140
+ }
41141
+ function $c87311424ea30a05$export$78551043582a6a98() {
41142
+ return $c87311424ea30a05$var$testUserAgent(/AppleWebKit/i) && !$c87311424ea30a05$export$6446a186d09e379e();
41143
+ }
41144
+ function $c87311424ea30a05$export$6446a186d09e379e() {
41145
+ return $c87311424ea30a05$var$testUserAgent(/Chrome/i);
41146
+ }
41147
+
41148
+
41149
+
41150
+ function $e9faafb641e167db$export$90fc3a17d93f704c(ref, event, handler1, options) {
41151
+ let handlerRef = useRef(handler1);
41152
+ handlerRef.current = handler1;
41153
+ let isDisabled = handler1 == null;
41154
+ useEffect(()=>{
41155
+ if (isDisabled) return;
41156
+ let element = ref.current;
41157
+ let handler = (e)=>handlerRef.current.call(this, e)
41158
+ ;
41159
+ element.addEventListener(event, handler, options);
41160
+ return ()=>{
41161
+ element.removeEventListener(event, handler, options);
41162
+ };
41163
+ }, [
41164
+ ref,
41165
+ event,
41166
+ options,
41167
+ isDisabled
41168
+ ]);
41169
+ }
41170
+
41171
+
41172
+
41173
+
41174
+ function $1dbecbe27a04f9af$export$14d238f342723f25(defaultValue) {
41175
+ let [value, setValue] = useState(defaultValue);
41176
+ let valueRef = useRef(value);
41177
+ let effect = useRef(null);
41178
+ valueRef.current = value;
41179
+ // Store the function in a ref so we can always access the current version
41180
+ // which has the proper `value` in scope.
41181
+ let nextRef = useRef(null);
41182
+ nextRef.current = ()=>{
41183
+ // Run the generator to the next yield.
41184
+ let newValue = effect.current.next();
41185
+ // If the generator is done, reset the effect.
41186
+ if (newValue.done) {
41187
+ effect.current = null;
41188
+ return;
41189
+ }
41190
+ // If the value is the same as the current value,
41191
+ // then continue to the next yield. Otherwise,
41192
+ // set the value in state and wait for the next layout effect.
41193
+ if (value === newValue.value) nextRef.current();
41194
+ else setValue(newValue.value);
41195
+ };
41196
+ $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(()=>{
41197
+ // If there is an effect currently running, continue to the next yield.
41198
+ if (effect.current) nextRef.current();
41199
+ });
41200
+ let queue = useCallback((fn)=>{
41201
+ effect.current = fn(valueRef.current);
41202
+ nextRef.current();
41203
+ }, [
41204
+ effect,
41205
+ nextRef
41206
+ ]);
41207
+ return [
41208
+ value,
41209
+ queue
41210
+ ];
41211
+ }
41212
+
41213
+
41214
+ function $2f04cbc44ee30ce0$export$53a0910f038337bd(scrollView, element) {
41215
+ let offsetX = $2f04cbc44ee30ce0$var$relativeOffset(scrollView, element, 'left');
41216
+ let offsetY = $2f04cbc44ee30ce0$var$relativeOffset(scrollView, element, 'top');
41217
+ let width = element.offsetWidth;
41218
+ let height = element.offsetHeight;
41219
+ let x = scrollView.scrollLeft;
41220
+ let y = scrollView.scrollTop;
41221
+ let maxX = x + scrollView.offsetWidth;
41222
+ let maxY = y + scrollView.offsetHeight;
41223
+ if (offsetX <= x) x = offsetX;
41224
+ else if (offsetX + width > maxX) x += offsetX + width - maxX;
41225
+ if (offsetY <= y) y = offsetY;
41226
+ else if (offsetY + height > maxY) y += offsetY + height - maxY;
41227
+ scrollView.scrollLeft = x;
41228
+ scrollView.scrollTop = y;
41229
+ }
41230
+ /**
41231
+ * Computes the offset left or top from child to ancestor by accumulating
41232
+ * offsetLeft or offsetTop through intervening offsetParents.
41233
+ */ function $2f04cbc44ee30ce0$var$relativeOffset(ancestor, child, axis) {
41234
+ const prop = axis === 'left' ? 'offsetLeft' : 'offsetTop';
41235
+ let sum = 0;
41236
+ while(child.offsetParent){
41237
+ sum += child[prop];
41238
+ if (child.offsetParent === ancestor) break;
41239
+ else if (child.offsetParent.contains(ancestor)) {
41240
+ // If the ancestor is not `position:relative`, then we stop at
41241
+ // _its_ offset parent, and we subtract off _its_ offset, so that
41242
+ // we end up with the proper offset from child to ancestor.
41243
+ sum -= ancestor[prop];
41244
+ break;
41245
+ }
41246
+ child = child.offsetParent;
41247
+ }
41248
+ return sum;
41249
+ }
41250
+
41251
+ // Note that state only matters here for iOS. Non-iOS gets user-select: none applied to the target element
41252
+ // rather than at the document level so we just need to apply/remove user-select: none for each pressed element individually
41253
+ let $14c0b72509d70225$var$state = 'default';
41254
+ let $14c0b72509d70225$var$savedUserSelect = '';
41255
+ let $14c0b72509d70225$var$modifiedElementMap = new WeakMap();
41256
+ function $14c0b72509d70225$export$16a4697467175487(target) {
41257
+ if ($c87311424ea30a05$export$fedb369cb70207f1()) {
41258
+ if ($14c0b72509d70225$var$state === 'default') {
41259
+ $14c0b72509d70225$var$savedUserSelect = document.documentElement.style.webkitUserSelect;
41260
+ document.documentElement.style.webkitUserSelect = 'none';
41261
+ }
41262
+ $14c0b72509d70225$var$state = 'disabled';
41263
+ } else if (target instanceof HTMLElement || target instanceof SVGElement) {
41264
+ // If not iOS, store the target's original user-select and change to user-select: none
41265
+ // Ignore state since it doesn't apply for non iOS
41266
+ $14c0b72509d70225$var$modifiedElementMap.set(target, target.style.userSelect);
41267
+ target.style.userSelect = 'none';
41268
+ }
41269
+ }
41270
+ function $14c0b72509d70225$export$b0d6fa1ab32e3295(target) {
41271
+ if ($c87311424ea30a05$export$fedb369cb70207f1()) {
41272
+ // If the state is already default, there's nothing to do.
41273
+ // If it is restoring, then there's no need to queue a second restore.
41274
+ if ($14c0b72509d70225$var$state !== 'disabled') return;
41275
+ $14c0b72509d70225$var$state = 'restoring';
41276
+ // There appears to be a delay on iOS where selection still might occur
41277
+ // after pointer up, so wait a bit before removing user-select.
41278
+ setTimeout(()=>{
41279
+ // Wait for any CSS transitions to complete so we don't recompute style
41280
+ // for the whole page in the middle of the animation and cause jank.
41281
+ $bbed8b41f857bcc0$export$24490316f764c430(()=>{
41282
+ // Avoid race conditions
41283
+ if ($14c0b72509d70225$var$state === 'restoring') {
41284
+ if (document.documentElement.style.webkitUserSelect === 'none') document.documentElement.style.webkitUserSelect = $14c0b72509d70225$var$savedUserSelect || '';
41285
+ $14c0b72509d70225$var$savedUserSelect = '';
41286
+ $14c0b72509d70225$var$state = 'default';
41287
+ }
41288
+ });
41289
+ }, 300);
41290
+ } else if (target instanceof HTMLElement || target instanceof SVGElement) // If not iOS, restore the target's original user-select if any
41291
+ // Ignore state since it doesn't apply for non iOS
41292
+ {
41293
+ if (target && $14c0b72509d70225$var$modifiedElementMap.has(target)) {
41294
+ let targetOldUserSelect = $14c0b72509d70225$var$modifiedElementMap.get(target);
41295
+ if (target.style.userSelect === 'none') target.style.userSelect = targetOldUserSelect;
41296
+ if (target.getAttribute('style') === '') target.removeAttribute('style');
41297
+ $14c0b72509d70225$var$modifiedElementMap.delete(target);
41298
+ }
41299
+ }
41300
+ }
41301
+
41302
+
41303
+
41304
+
41305
+
41306
+ function $8a9cb279dc87e130$export$60278871457622de(event) {
41307
+ // JAWS/NVDA with Firefox.
41308
+ if (event.mozInputSource === 0 && event.isTrusted) return true;
41309
+ return event.detail === 0 && !event.pointerType;
41310
+ }
41311
+ class $8a9cb279dc87e130$export$905e7fc544a71f36 {
41312
+ isDefaultPrevented() {
41313
+ return this.nativeEvent.defaultPrevented;
41314
+ }
41315
+ preventDefault() {
41316
+ this.defaultPrevented = true;
41317
+ this.nativeEvent.preventDefault();
41318
+ }
41319
+ stopPropagation() {
41320
+ this.nativeEvent.stopPropagation();
41321
+ this.isPropagationStopped = ()=>true
41322
+ ;
41323
+ }
41324
+ isPropagationStopped() {
41325
+ return false;
41326
+ }
41327
+ persist() {
41328
+ }
41329
+ constructor(type, nativeEvent){
41330
+ this.nativeEvent = nativeEvent;
41331
+ this.target = nativeEvent.target;
41332
+ this.currentTarget = nativeEvent.currentTarget;
41333
+ this.relatedTarget = nativeEvent.relatedTarget;
41334
+ this.bubbles = nativeEvent.bubbles;
41335
+ this.cancelable = nativeEvent.cancelable;
41336
+ this.defaultPrevented = nativeEvent.defaultPrevented;
41337
+ this.eventPhase = nativeEvent.eventPhase;
41338
+ this.isTrusted = nativeEvent.isTrusted;
41339
+ this.timeStamp = nativeEvent.timeStamp;
41340
+ this.type = type;
41341
+ }
41342
+ }
41343
+ function $8a9cb279dc87e130$export$715c682d09d639cc(onBlur) {
41344
+ let stateRef = useRef({
41345
+ isFocused: false,
41346
+ onBlur: onBlur,
41347
+ observer: null
41348
+ });
41349
+ stateRef.current.onBlur = onBlur;
41350
+ // Clean up MutationObserver on unmount. See below.
41351
+ // eslint-disable-next-line arrow-body-style
41352
+ $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(()=>{
41353
+ const state = stateRef.current;
41354
+ return ()=>{
41355
+ if (state.observer) {
41356
+ state.observer.disconnect();
41357
+ state.observer = null;
41358
+ }
41359
+ };
41360
+ }, []);
41361
+ // This function is called during a React onFocus event.
41362
+ return useCallback((e1)=>{
41363
+ // React does not fire onBlur when an element is disabled. https://github.com/facebook/react/issues/9142
41364
+ // Most browsers fire a native focusout event in this case, except for Firefox. In that case, we use a
41365
+ // MutationObserver to watch for the disabled attribute, and dispatch these events ourselves.
41366
+ // For browsers that do, focusout fires before the MutationObserver, so onBlur should not fire twice.
41367
+ if (e1.target instanceof HTMLButtonElement || e1.target instanceof HTMLInputElement || e1.target instanceof HTMLTextAreaElement || e1.target instanceof HTMLSelectElement) {
41368
+ stateRef.current.isFocused = true;
41369
+ let target = e1.target;
41370
+ let onBlurHandler = (e)=>{
41371
+ var // For backward compatibility, dispatch a (fake) React synthetic event.
41372
+ _current, ref;
41373
+ stateRef.current.isFocused = false;
41374
+ if (target.disabled) (ref = (_current = stateRef.current).onBlur) === null || ref === void 0 ? void 0 : ref.call(_current, new $8a9cb279dc87e130$export$905e7fc544a71f36('blur', e));
41375
+ // We no longer need the MutationObserver once the target is blurred.
41376
+ if (stateRef.current.observer) {
41377
+ stateRef.current.observer.disconnect();
41378
+ stateRef.current.observer = null;
41379
+ }
41380
+ };
41381
+ target.addEventListener('focusout', onBlurHandler, {
41382
+ once: true
41383
+ });
41384
+ stateRef.current.observer = new MutationObserver(()=>{
41385
+ if (stateRef.current.isFocused && target.disabled) {
41386
+ stateRef.current.observer.disconnect();
41387
+ target.dispatchEvent(new FocusEvent('blur'));
41388
+ target.dispatchEvent(new FocusEvent('focusout', {
41389
+ bubbles: true
41390
+ }));
41391
+ }
41392
+ });
41393
+ stateRef.current.observer.observe(target, {
41394
+ attributes: true,
41395
+ attributeFilter: [
41396
+ 'disabled'
41397
+ ]
41398
+ });
41399
+ }
41400
+ }, []);
41401
+ }
41402
+
41403
+
41404
+
41405
+ const $ae1eeba8b9eafd08$export$5165eccb35aaadb5 = React__default.createContext(null);
41406
+ $ae1eeba8b9eafd08$export$5165eccb35aaadb5.displayName = 'PressResponderContext';
41407
+
41408
+
41409
+
41410
+ function $f6c31cce2adf654f$var$usePressResponderContext(props) {
41411
+ // Consume context from <PressResponder> and merge with props.
41412
+ let context = useContext($ae1eeba8b9eafd08$export$5165eccb35aaadb5);
41413
+ if (context) {
41414
+ let { register: register , ...contextProps } = context;
41415
+ props = $3ef42575df84b30b$export$9d1611c77c2fe928(contextProps, props);
41416
+ register();
41417
+ }
41418
+ $e7801be82b4b2a53$export$4debdb1a3f0fa79e(context, props.ref);
41419
+ return props;
41420
+ }
41421
+ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
41422
+ let { onPress: onPress1 , onPressChange: onPressChange1 , onPressStart: onPressStart1 , onPressEnd: onPressEnd1 , onPressUp: onPressUp1 , isDisabled: isDisabled1 , isPressed: isPressedProp , preventFocusOnPress: preventFocusOnPress , shouldCancelOnPointerExit: shouldCancelOnPointerExit , allowTextSelectionOnPress: allowTextSelectionOnPress , // eslint-disable-next-line @typescript-eslint/no-unused-vars
41423
+ ref: _ , ...domProps } = $f6c31cce2adf654f$var$usePressResponderContext(props);
41424
+ let propsRef = useRef(null);
41425
+ propsRef.current = {
41426
+ onPress: onPress1,
41427
+ onPressChange: onPressChange1,
41428
+ onPressStart: onPressStart1,
41429
+ onPressEnd: onPressEnd1,
41430
+ onPressUp: onPressUp1,
41431
+ isDisabled: isDisabled1,
41432
+ shouldCancelOnPointerExit: shouldCancelOnPointerExit
41433
+ };
41434
+ let [isPressed, setPressed] = useState(false);
41435
+ let ref = useRef({
41436
+ isPressed: false,
41437
+ ignoreEmulatedMouseEvents: false,
41438
+ ignoreClickAfterPress: false,
41439
+ didFirePressStart: false,
41440
+ activePointerId: null,
41441
+ target: null,
41442
+ isOverTarget: false,
41443
+ pointerType: null
41444
+ });
41445
+ let { addGlobalListener: addGlobalListener , removeAllGlobalListeners: removeAllGlobalListeners } = $03deb23ff14920c4$export$4eaf04e54aa8eed6();
41446
+ let pressProps1 = useMemo(()=>{
41447
+ let state = ref.current;
41448
+ let triggerPressStart = (originalEvent, pointerType)=>{
41449
+ let { onPressStart: onPressStart , onPressChange: onPressChange , isDisabled: isDisabled } = propsRef.current;
41450
+ if (isDisabled || state.didFirePressStart) return;
41451
+ if (onPressStart) onPressStart({
41452
+ type: 'pressstart',
41453
+ pointerType: pointerType,
41454
+ target: originalEvent.currentTarget,
41455
+ shiftKey: originalEvent.shiftKey,
41456
+ metaKey: originalEvent.metaKey,
41457
+ ctrlKey: originalEvent.ctrlKey,
41458
+ altKey: originalEvent.altKey
41459
+ });
41460
+ if (onPressChange) onPressChange(true);
41461
+ state.didFirePressStart = true;
41462
+ setPressed(true);
41463
+ };
41464
+ let triggerPressEnd = (originalEvent, pointerType, wasPressed = true)=>{
41465
+ let { onPressEnd: onPressEnd , onPressChange: onPressChange , onPress: onPress , isDisabled: isDisabled } = propsRef.current;
41466
+ if (!state.didFirePressStart) return;
41467
+ state.ignoreClickAfterPress = true;
41468
+ state.didFirePressStart = false;
41469
+ if (onPressEnd) onPressEnd({
41470
+ type: 'pressend',
41471
+ pointerType: pointerType,
41472
+ target: originalEvent.currentTarget,
41473
+ shiftKey: originalEvent.shiftKey,
41474
+ metaKey: originalEvent.metaKey,
41475
+ ctrlKey: originalEvent.ctrlKey,
41476
+ altKey: originalEvent.altKey
41477
+ });
41478
+ if (onPressChange) onPressChange(false);
41479
+ setPressed(false);
41480
+ if (onPress && wasPressed && !isDisabled) onPress({
41481
+ type: 'press',
41482
+ pointerType: pointerType,
41483
+ target: originalEvent.currentTarget,
41484
+ shiftKey: originalEvent.shiftKey,
41485
+ metaKey: originalEvent.metaKey,
41486
+ ctrlKey: originalEvent.ctrlKey,
41487
+ altKey: originalEvent.altKey
41488
+ });
41489
+ };
41490
+ let triggerPressUp = (originalEvent, pointerType)=>{
41491
+ let { onPressUp: onPressUp , isDisabled: isDisabled } = propsRef.current;
41492
+ if (isDisabled) return;
41493
+ if (onPressUp) onPressUp({
41494
+ type: 'pressup',
41495
+ pointerType: pointerType,
41496
+ target: originalEvent.currentTarget,
41497
+ shiftKey: originalEvent.shiftKey,
41498
+ metaKey: originalEvent.metaKey,
41499
+ ctrlKey: originalEvent.ctrlKey,
41500
+ altKey: originalEvent.altKey
41501
+ });
41502
+ };
41503
+ let cancel = (e)=>{
41504
+ if (state.isPressed) {
41505
+ if (state.isOverTarget) triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e), state.pointerType, false);
41506
+ state.isPressed = false;
41507
+ state.isOverTarget = false;
41508
+ state.activePointerId = null;
41509
+ state.pointerType = null;
41510
+ removeAllGlobalListeners();
41511
+ if (!allowTextSelectionOnPress) $14c0b72509d70225$export$b0d6fa1ab32e3295(state.target);
41512
+ }
41513
+ };
41514
+ let pressProps = {
41515
+ onKeyDown (e) {
41516
+ if ($f6c31cce2adf654f$var$isValidKeyboardEvent(e.nativeEvent) && e.currentTarget.contains(e.target)) {
41517
+ if ($f6c31cce2adf654f$var$shouldPreventDefaultKeyboard(e.target)) e.preventDefault();
41518
+ e.stopPropagation();
41519
+ // If the event is repeating, it may have started on a different element
41520
+ // after which focus moved to the current element. Ignore these events and
41521
+ // only handle the first key down event.
41522
+ if (!state.isPressed && !e.repeat) {
41523
+ state.target = e.currentTarget;
41524
+ state.isPressed = true;
41525
+ triggerPressStart(e, 'keyboard');
41526
+ // Focus may move before the key up event, so register the event on the document
41527
+ // instead of the same element where the key down event occurred.
41528
+ addGlobalListener(document, 'keyup', onKeyUp, false);
41529
+ }
41530
+ }
41531
+ },
41532
+ onKeyUp (e) {
41533
+ if ($f6c31cce2adf654f$var$isValidKeyboardEvent(e.nativeEvent) && !e.repeat && e.currentTarget.contains(e.target)) triggerPressUp($f6c31cce2adf654f$var$createEvent(state.target, e), 'keyboard');
41534
+ },
41535
+ onClick (e) {
41536
+ if (e && !e.currentTarget.contains(e.target)) return;
41537
+ if (e && e.button === 0) {
41538
+ e.stopPropagation();
41539
+ if (isDisabled1) e.preventDefault();
41540
+ // If triggered from a screen reader or by using element.click(),
41541
+ // trigger as if it were a keyboard click.
41542
+ if (!state.ignoreClickAfterPress && !state.ignoreEmulatedMouseEvents && (state.pointerType === 'virtual' || $8a9cb279dc87e130$export$60278871457622de(e.nativeEvent))) {
41543
+ // Ensure the element receives focus (VoiceOver on iOS does not do this)
41544
+ if (!isDisabled1 && !preventFocusOnPress) $7215afc6de606d6b$export$de79e2c695e052f3(e.currentTarget);
41545
+ triggerPressStart(e, 'virtual');
41546
+ triggerPressUp(e, 'virtual');
41547
+ triggerPressEnd(e, 'virtual');
41548
+ }
41549
+ state.ignoreEmulatedMouseEvents = false;
41550
+ state.ignoreClickAfterPress = false;
41551
+ }
41552
+ }
41553
+ };
41554
+ let onKeyUp = (e)=>{
41555
+ if (state.isPressed && $f6c31cce2adf654f$var$isValidKeyboardEvent(e)) {
41556
+ if ($f6c31cce2adf654f$var$shouldPreventDefaultKeyboard(e.target)) e.preventDefault();
41557
+ e.stopPropagation();
41558
+ state.isPressed = false;
41559
+ let target = e.target;
41560
+ triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e), 'keyboard', state.target.contains(target));
41561
+ removeAllGlobalListeners();
41562
+ // If the target is a link, trigger the click method to open the URL,
41563
+ // but defer triggering pressEnd until onClick event handler.
41564
+ if (state.target instanceof HTMLElement && (state.target.contains(target) && $f6c31cce2adf654f$var$isHTMLAnchorLink(state.target) || state.target.getAttribute('role') === 'link')) state.target.click();
41565
+ }
41566
+ };
41567
+ if (typeof PointerEvent !== 'undefined') {
41568
+ pressProps.onPointerDown = (e)=>{
41569
+ // Only handle left clicks, and ignore events that bubbled through portals.
41570
+ if (e.button !== 0 || !e.currentTarget.contains(e.target)) return;
41571
+ // iOS safari fires pointer events from VoiceOver with incorrect coordinates/target.
41572
+ // Ignore and let the onClick handler take care of it instead.
41573
+ // https://bugs.webkit.org/show_bug.cgi?id=222627
41574
+ // https://bugs.webkit.org/show_bug.cgi?id=223202
41575
+ if ($f6c31cce2adf654f$var$isVirtualPointerEvent(e.nativeEvent)) {
41576
+ state.pointerType = 'virtual';
41577
+ return;
41578
+ }
41579
+ // Due to browser inconsistencies, especially on mobile browsers, we prevent
41580
+ // default on pointer down and handle focusing the pressable element ourselves.
41581
+ if ($f6c31cce2adf654f$var$shouldPreventDefault(e.currentTarget)) e.preventDefault();
41582
+ state.pointerType = e.pointerType;
41583
+ e.stopPropagation();
41584
+ if (!state.isPressed) {
41585
+ state.isPressed = true;
41586
+ state.isOverTarget = true;
41587
+ state.activePointerId = e.pointerId;
41588
+ state.target = e.currentTarget;
41589
+ if (!isDisabled1 && !preventFocusOnPress) $7215afc6de606d6b$export$de79e2c695e052f3(e.currentTarget);
41590
+ if (!allowTextSelectionOnPress) $14c0b72509d70225$export$16a4697467175487(state.target);
41591
+ triggerPressStart(e, state.pointerType);
41592
+ addGlobalListener(document, 'pointermove', onPointerMove, false);
41593
+ addGlobalListener(document, 'pointerup', onPointerUp, false);
41594
+ addGlobalListener(document, 'pointercancel', onPointerCancel, false);
41595
+ }
41596
+ };
41597
+ pressProps.onMouseDown = (e)=>{
41598
+ if (!e.currentTarget.contains(e.target)) return;
41599
+ if (e.button === 0) {
41600
+ // Chrome and Firefox on touch Windows devices require mouse down events
41601
+ // to be canceled in addition to pointer events, or an extra asynchronous
41602
+ // focus event will be fired.
41603
+ if ($f6c31cce2adf654f$var$shouldPreventDefault(e.currentTarget)) e.preventDefault();
41604
+ e.stopPropagation();
41605
+ }
41606
+ };
41607
+ pressProps.onPointerUp = (e)=>{
41608
+ // iOS fires pointerup with zero width and height, so check the pointerType recorded during pointerdown.
41609
+ if (!e.currentTarget.contains(e.target) || state.pointerType === 'virtual') return;
41610
+ // Only handle left clicks
41611
+ // Safari on iOS sometimes fires pointerup events, even
41612
+ // when the touch isn't over the target, so double check.
41613
+ if (e.button === 0 && $f6c31cce2adf654f$var$isOverTarget(e, e.currentTarget)) triggerPressUp(e, state.pointerType || e.pointerType);
41614
+ };
41615
+ // Safari on iOS < 13.2 does not implement pointerenter/pointerleave events correctly.
41616
+ // Use pointer move events instead to implement our own hit testing.
41617
+ // See https://bugs.webkit.org/show_bug.cgi?id=199803
41618
+ let onPointerMove = (e)=>{
41619
+ if (e.pointerId !== state.activePointerId) return;
41620
+ if ($f6c31cce2adf654f$var$isOverTarget(e, state.target)) {
41621
+ if (!state.isOverTarget) {
41622
+ state.isOverTarget = true;
41623
+ triggerPressStart($f6c31cce2adf654f$var$createEvent(state.target, e), state.pointerType);
41624
+ }
41625
+ } else if (state.isOverTarget) {
41626
+ state.isOverTarget = false;
41627
+ triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e), state.pointerType, false);
41628
+ if (propsRef.current.shouldCancelOnPointerExit) cancel(e);
41629
+ }
41630
+ };
41631
+ let onPointerUp = (e)=>{
41632
+ if (e.pointerId === state.activePointerId && state.isPressed && e.button === 0) {
41633
+ if ($f6c31cce2adf654f$var$isOverTarget(e, state.target)) triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e), state.pointerType);
41634
+ else if (state.isOverTarget) triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e), state.pointerType, false);
41635
+ state.isPressed = false;
41636
+ state.isOverTarget = false;
41637
+ state.activePointerId = null;
41638
+ state.pointerType = null;
41639
+ removeAllGlobalListeners();
41640
+ if (!allowTextSelectionOnPress) $14c0b72509d70225$export$b0d6fa1ab32e3295(state.target);
41641
+ }
41642
+ };
41643
+ let onPointerCancel = (e)=>{
41644
+ cancel(e);
41645
+ };
41646
+ pressProps.onDragStart = (e)=>{
41647
+ if (!e.currentTarget.contains(e.target)) return;
41648
+ // Safari does not call onPointerCancel when a drag starts, whereas Chrome and Firefox do.
41649
+ cancel(e);
41650
+ };
41651
+ } else {
41652
+ pressProps.onMouseDown = (e)=>{
41653
+ // Only handle left clicks
41654
+ if (e.button !== 0 || !e.currentTarget.contains(e.target)) return;
41655
+ // Due to browser inconsistencies, especially on mobile browsers, we prevent
41656
+ // default on mouse down and handle focusing the pressable element ourselves.
41657
+ if ($f6c31cce2adf654f$var$shouldPreventDefault(e.currentTarget)) e.preventDefault();
41658
+ e.stopPropagation();
41659
+ if (state.ignoreEmulatedMouseEvents) return;
41660
+ state.isPressed = true;
41661
+ state.isOverTarget = true;
41662
+ state.target = e.currentTarget;
41663
+ state.pointerType = $8a9cb279dc87e130$export$60278871457622de(e.nativeEvent) ? 'virtual' : 'mouse';
41664
+ if (!isDisabled1 && !preventFocusOnPress) $7215afc6de606d6b$export$de79e2c695e052f3(e.currentTarget);
41665
+ triggerPressStart(e, state.pointerType);
41666
+ addGlobalListener(document, 'mouseup', onMouseUp, false);
41667
+ };
41668
+ pressProps.onMouseEnter = (e)=>{
41669
+ if (!e.currentTarget.contains(e.target)) return;
41670
+ e.stopPropagation();
41671
+ if (state.isPressed && !state.ignoreEmulatedMouseEvents) {
41672
+ state.isOverTarget = true;
41673
+ triggerPressStart(e, state.pointerType);
41674
+ }
41675
+ };
41676
+ pressProps.onMouseLeave = (e)=>{
41677
+ if (!e.currentTarget.contains(e.target)) return;
41678
+ e.stopPropagation();
41679
+ if (state.isPressed && !state.ignoreEmulatedMouseEvents) {
41680
+ state.isOverTarget = false;
41681
+ triggerPressEnd(e, state.pointerType, false);
41682
+ if (propsRef.current.shouldCancelOnPointerExit) cancel(e);
41683
+ }
41684
+ };
41685
+ pressProps.onMouseUp = (e)=>{
41686
+ if (!e.currentTarget.contains(e.target)) return;
41687
+ if (!state.ignoreEmulatedMouseEvents && e.button === 0) triggerPressUp(e, state.pointerType);
41688
+ };
41689
+ let onMouseUp = (e)=>{
41690
+ // Only handle left clicks
41691
+ if (e.button !== 0) return;
41692
+ state.isPressed = false;
41693
+ removeAllGlobalListeners();
41694
+ if (state.ignoreEmulatedMouseEvents) {
41695
+ state.ignoreEmulatedMouseEvents = false;
41696
+ return;
41697
+ }
41698
+ if ($f6c31cce2adf654f$var$isOverTarget(e, state.target)) triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e), state.pointerType);
41699
+ else if (state.isOverTarget) triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e), state.pointerType, false);
41700
+ state.isOverTarget = false;
41701
+ };
41702
+ pressProps.onTouchStart = (e)=>{
41703
+ if (!e.currentTarget.contains(e.target)) return;
41704
+ e.stopPropagation();
41705
+ let touch = $f6c31cce2adf654f$var$getTouchFromEvent(e.nativeEvent);
41706
+ if (!touch) return;
41707
+ state.activePointerId = touch.identifier;
41708
+ state.ignoreEmulatedMouseEvents = true;
41709
+ state.isOverTarget = true;
41710
+ state.isPressed = true;
41711
+ state.target = e.currentTarget;
41712
+ state.pointerType = 'touch';
41713
+ // Due to browser inconsistencies, especially on mobile browsers, we prevent default
41714
+ // on the emulated mouse event and handle focusing the pressable element ourselves.
41715
+ if (!isDisabled1 && !preventFocusOnPress) $7215afc6de606d6b$export$de79e2c695e052f3(e.currentTarget);
41716
+ if (!allowTextSelectionOnPress) $14c0b72509d70225$export$16a4697467175487(state.target);
41717
+ triggerPressStart(e, state.pointerType);
41718
+ addGlobalListener(window, 'scroll', onScroll, true);
41719
+ };
41720
+ pressProps.onTouchMove = (e)=>{
41721
+ if (!e.currentTarget.contains(e.target)) return;
41722
+ e.stopPropagation();
41723
+ if (!state.isPressed) return;
41724
+ let touch = $f6c31cce2adf654f$var$getTouchById(e.nativeEvent, state.activePointerId);
41725
+ if (touch && $f6c31cce2adf654f$var$isOverTarget(touch, e.currentTarget)) {
41726
+ if (!state.isOverTarget) {
41727
+ state.isOverTarget = true;
41728
+ triggerPressStart(e, state.pointerType);
41729
+ }
41730
+ } else if (state.isOverTarget) {
41731
+ state.isOverTarget = false;
41732
+ triggerPressEnd(e, state.pointerType, false);
41733
+ if (propsRef.current.shouldCancelOnPointerExit) cancel(e);
41734
+ }
41735
+ };
41736
+ pressProps.onTouchEnd = (e)=>{
41737
+ if (!e.currentTarget.contains(e.target)) return;
41738
+ e.stopPropagation();
41739
+ if (!state.isPressed) return;
41740
+ let touch = $f6c31cce2adf654f$var$getTouchById(e.nativeEvent, state.activePointerId);
41741
+ if (touch && $f6c31cce2adf654f$var$isOverTarget(touch, e.currentTarget)) {
41742
+ triggerPressUp(e, state.pointerType);
41743
+ triggerPressEnd(e, state.pointerType);
41744
+ } else if (state.isOverTarget) triggerPressEnd(e, state.pointerType, false);
41745
+ state.isPressed = false;
41746
+ state.activePointerId = null;
41747
+ state.isOverTarget = false;
41748
+ state.ignoreEmulatedMouseEvents = true;
41749
+ if (!allowTextSelectionOnPress) $14c0b72509d70225$export$b0d6fa1ab32e3295(state.target);
41750
+ removeAllGlobalListeners();
41751
+ };
41752
+ pressProps.onTouchCancel = (e)=>{
41753
+ if (!e.currentTarget.contains(e.target)) return;
41754
+ e.stopPropagation();
41755
+ if (state.isPressed) cancel(e);
41756
+ };
41757
+ let onScroll = (e)=>{
41758
+ if (state.isPressed && e.target.contains(state.target)) cancel({
41759
+ currentTarget: state.target,
41760
+ shiftKey: false,
41761
+ ctrlKey: false,
41762
+ metaKey: false,
41763
+ altKey: false
41764
+ });
41765
+ };
41766
+ pressProps.onDragStart = (e)=>{
41767
+ if (!e.currentTarget.contains(e.target)) return;
41768
+ cancel(e);
41769
+ };
41770
+ }
41771
+ return pressProps;
41772
+ }, [
41773
+ addGlobalListener,
41774
+ isDisabled1,
41775
+ preventFocusOnPress,
41776
+ removeAllGlobalListeners,
41777
+ allowTextSelectionOnPress
41778
+ ]);
41779
+ // Remove user-select: none in case component unmounts immediately after pressStart
41780
+ // eslint-disable-next-line arrow-body-style
41781
+ useEffect(()=>{
41782
+ return ()=>{
41783
+ if (!allowTextSelectionOnPress) $14c0b72509d70225$export$b0d6fa1ab32e3295(ref.current.target);
41784
+ };
41785
+ }, [
41786
+ allowTextSelectionOnPress
41787
+ ]);
41788
+ return {
41789
+ isPressed: isPressedProp || isPressed,
41790
+ pressProps: $3ef42575df84b30b$export$9d1611c77c2fe928(domProps, pressProps1)
41791
+ };
41792
+ }
41793
+ function $f6c31cce2adf654f$var$isHTMLAnchorLink(target) {
41794
+ return target.tagName === 'A' && target.hasAttribute('href');
41795
+ }
41796
+ function $f6c31cce2adf654f$var$isValidKeyboardEvent(event) {
41797
+ const { key: key , code: code , target: target } = event;
41798
+ const element = target;
41799
+ const { tagName: tagName , isContentEditable: isContentEditable } = element;
41800
+ const role = element.getAttribute('role');
41801
+ // Accessibility for keyboards. Space and Enter only.
41802
+ // "Spacebar" is for IE 11
41803
+ return (key === 'Enter' || key === ' ' || key === 'Spacebar' || code === 'Space') && tagName !== 'INPUT' && tagName !== 'TEXTAREA' && isContentEditable !== true && (!$f6c31cce2adf654f$var$isHTMLAnchorLink(element) || role === 'button' && key !== 'Enter') && // An element with role='link' should only trigger with Enter key
41804
+ !(role === 'link' && key !== 'Enter');
41805
+ }
41806
+ function $f6c31cce2adf654f$var$getTouchFromEvent(event) {
41807
+ const { targetTouches: targetTouches } = event;
41808
+ if (targetTouches.length > 0) return targetTouches[0];
41809
+ return null;
41810
+ }
41811
+ function $f6c31cce2adf654f$var$getTouchById(event, pointerId) {
41812
+ const changedTouches = event.changedTouches;
41813
+ for(let i = 0; i < changedTouches.length; i++){
41814
+ const touch = changedTouches[i];
41815
+ if (touch.identifier === pointerId) return touch;
41816
+ }
41817
+ return null;
41818
+ }
41819
+ function $f6c31cce2adf654f$var$createEvent(target, e) {
41820
+ return {
41821
+ currentTarget: target,
41822
+ shiftKey: e.shiftKey,
41823
+ ctrlKey: e.ctrlKey,
41824
+ metaKey: e.metaKey,
41825
+ altKey: e.altKey
41826
+ };
41827
+ }
41828
+ function $f6c31cce2adf654f$var$getPointClientRect(point) {
41829
+ let offsetX = point.width / 2 || point.radiusX || 0;
41830
+ let offsetY = point.height / 2 || point.radiusY || 0;
41831
+ return {
41832
+ top: point.clientY - offsetY,
41833
+ right: point.clientX + offsetX,
41834
+ bottom: point.clientY + offsetY,
41835
+ left: point.clientX - offsetX
41836
+ };
41837
+ }
41838
+ function $f6c31cce2adf654f$var$areRectanglesOverlapping(a, b) {
41839
+ // check if they cannot overlap on x axis
41840
+ if (a.left > b.right || b.left > a.right) return false;
41841
+ // check if they cannot overlap on y axis
41842
+ if (a.top > b.bottom || b.top > a.bottom) return false;
41843
+ return true;
41844
+ }
41845
+ function $f6c31cce2adf654f$var$isOverTarget(point, target) {
41846
+ let rect = target.getBoundingClientRect();
41847
+ let pointRect = $f6c31cce2adf654f$var$getPointClientRect(point);
41848
+ return $f6c31cce2adf654f$var$areRectanglesOverlapping(rect, pointRect);
41849
+ }
41850
+ function $f6c31cce2adf654f$var$shouldPreventDefault(target) {
41851
+ // We cannot prevent default if the target is a draggable element.
41852
+ return !(target instanceof HTMLElement) || !target.draggable;
41853
+ }
41854
+ function $f6c31cce2adf654f$var$shouldPreventDefaultKeyboard(target) {
41855
+ return !((target.tagName === 'INPUT' || target.tagName === 'BUTTON') && target.type === 'submit');
41856
+ }
41857
+ function $f6c31cce2adf654f$var$isVirtualPointerEvent(event) {
41858
+ // If the pointer size is zero, then we assume it's from a screen reader.
41859
+ // Android TalkBack double tap will sometimes return a event with width and height of 1
41860
+ // and pointerType === 'mouse' so we need to check for a specific combination of event attributes.
41861
+ // Cannot use "event.pressure === 0" as the sole check due to Safari pointer events always returning pressure === 0
41862
+ // instead of .5, see https://bugs.webkit.org/show_bug.cgi?id=206216. event.pointerType === 'mouse' is to distingush
41863
+ // Talkback double tap from Windows Firefox touch screen press
41864
+ return event.width === 0 && event.height === 0 || event.width === 1 && event.height === 1 && event.pressure === 0 && event.detail === 0 && event.pointerType === 'mouse';
41865
+ }
41866
+
41867
+
41868
+
41869
+
41870
+ function $a1ea59d68270f0dd$export$f8168d8dd8fd66e6(props) {
41871
+ let { isDisabled: isDisabled , onFocus: onFocusProp , onBlur: onBlurProp , onFocusChange: onFocusChange } = props;
41872
+ const onBlur = useCallback((e)=>{
41873
+ if (e.target === e.currentTarget) {
41874
+ if (onBlurProp) onBlurProp(e);
41875
+ if (onFocusChange) onFocusChange(false);
41876
+ return true;
41877
+ }
41878
+ }, [
41879
+ onBlurProp,
41880
+ onFocusChange
41881
+ ]);
41882
+ const onSyntheticFocus = $8a9cb279dc87e130$export$715c682d09d639cc(onBlur);
41883
+ const onFocus = useCallback((e)=>{
41884
+ if (e.target === e.currentTarget) {
41885
+ if (onFocusProp) onFocusProp(e);
41886
+ if (onFocusChange) onFocusChange(true);
41887
+ onSyntheticFocus(e);
41888
+ }
41889
+ }, [
41890
+ onFocusChange,
41891
+ onFocusProp,
41892
+ onSyntheticFocus
41893
+ ]);
41894
+ return {
41895
+ focusProps: {
41896
+ onFocus: !isDisabled && (onFocusProp || onFocusChange || onBlurProp) ? onFocus : undefined,
41897
+ onBlur: !isDisabled && (onBlurProp || onFocusChange) ? onBlur : null
41898
+ }
41899
+ };
41900
+ }
41901
+
41902
+
41903
+
41904
+
41905
+
41906
+ let $507fabe10e71c6fb$var$currentModality = null;
41907
+ let $507fabe10e71c6fb$var$changeHandlers = new Set();
41908
+ let $507fabe10e71c6fb$var$hasSetupGlobalListeners = false;
41909
+ let $507fabe10e71c6fb$var$hasEventBeforeFocus = false;
41910
+ let $507fabe10e71c6fb$var$hasBlurredWindowRecently = false;
41911
+ // Only Tab or Esc keys will make focus visible on text input elements
41912
+ const $507fabe10e71c6fb$var$FOCUS_VISIBLE_INPUT_KEYS = {
41913
+ Tab: true,
41914
+ Escape: true
41915
+ };
41916
+ function $507fabe10e71c6fb$var$triggerChangeHandlers(modality, e) {
41917
+ for (let handler of $507fabe10e71c6fb$var$changeHandlers)handler(modality, e);
41918
+ }
41919
+ /**
41920
+ * Helper function to determine if a KeyboardEvent is unmodified and could make keyboard focus styles visible.
41921
+ */ function $507fabe10e71c6fb$var$isValidKey(e) {
41922
+ // Control and Shift keys trigger when navigating back to the tab with keyboard.
41923
+ return !(e.metaKey || !$c87311424ea30a05$export$9ac100e40613ea10() && e.altKey || e.ctrlKey || e.key === 'Control' || e.key === 'Shift' || e.key === 'Meta');
41924
+ }
41925
+ function $507fabe10e71c6fb$var$handleKeyboardEvent(e) {
41926
+ $507fabe10e71c6fb$var$hasEventBeforeFocus = true;
41927
+ if ($507fabe10e71c6fb$var$isValidKey(e)) {
41928
+ $507fabe10e71c6fb$var$currentModality = 'keyboard';
41929
+ $507fabe10e71c6fb$var$triggerChangeHandlers('keyboard', e);
41930
+ }
41931
+ }
41932
+ function $507fabe10e71c6fb$var$handlePointerEvent(e) {
41933
+ $507fabe10e71c6fb$var$currentModality = 'pointer';
41934
+ if (e.type === 'mousedown' || e.type === 'pointerdown') {
41935
+ $507fabe10e71c6fb$var$hasEventBeforeFocus = true;
41936
+ $507fabe10e71c6fb$var$triggerChangeHandlers('pointer', e);
41937
+ }
41938
+ }
41939
+ function $507fabe10e71c6fb$var$handleClickEvent(e) {
41940
+ if ($8a9cb279dc87e130$export$60278871457622de(e)) {
41941
+ $507fabe10e71c6fb$var$hasEventBeforeFocus = true;
41942
+ $507fabe10e71c6fb$var$currentModality = 'virtual';
41943
+ }
41944
+ }
41945
+ function $507fabe10e71c6fb$var$handleFocusEvent(e) {
41946
+ // Firefox fires two extra focus events when the user first clicks into an iframe:
41947
+ // first on the window, then on the document. We ignore these events so they don't
41948
+ // cause keyboard focus rings to appear.
41949
+ if (e.target === window || e.target === document) return;
41950
+ // If a focus event occurs without a preceding keyboard or pointer event, switch to virtual modality.
41951
+ // This occurs, for example, when navigating a form with the next/previous buttons on iOS.
41952
+ if (!$507fabe10e71c6fb$var$hasEventBeforeFocus && !$507fabe10e71c6fb$var$hasBlurredWindowRecently) {
41953
+ $507fabe10e71c6fb$var$currentModality = 'virtual';
41954
+ $507fabe10e71c6fb$var$triggerChangeHandlers('virtual', e);
41955
+ }
41956
+ $507fabe10e71c6fb$var$hasEventBeforeFocus = false;
41957
+ $507fabe10e71c6fb$var$hasBlurredWindowRecently = false;
41958
+ }
41959
+ function $507fabe10e71c6fb$var$handleWindowBlur() {
41960
+ // When the window is blurred, reset state. This is necessary when tabbing out of the window,
41961
+ // for example, since a subsequent focus event won't be fired.
41962
+ $507fabe10e71c6fb$var$hasEventBeforeFocus = false;
41963
+ $507fabe10e71c6fb$var$hasBlurredWindowRecently = true;
41964
+ }
41965
+ /**
41966
+ * Setup global event listeners to control when keyboard focus style should be visible.
41967
+ */ function $507fabe10e71c6fb$var$setupGlobalFocusEvents() {
41968
+ if (typeof window === 'undefined' || $507fabe10e71c6fb$var$hasSetupGlobalListeners) return;
41969
+ // Programmatic focus() calls shouldn't affect the current input modality.
41970
+ // However, we need to detect other cases when a focus event occurs without
41971
+ // a preceding user event (e.g. screen reader focus). Overriding the focus
41972
+ // method on HTMLElement.prototype is a bit hacky, but works.
41973
+ let focus = HTMLElement.prototype.focus;
41974
+ HTMLElement.prototype.focus = function() {
41975
+ $507fabe10e71c6fb$var$hasEventBeforeFocus = true;
41976
+ focus.apply(this, arguments);
41977
+ };
41978
+ document.addEventListener('keydown', $507fabe10e71c6fb$var$handleKeyboardEvent, true);
41979
+ document.addEventListener('keyup', $507fabe10e71c6fb$var$handleKeyboardEvent, true);
41980
+ document.addEventListener('click', $507fabe10e71c6fb$var$handleClickEvent, true);
41981
+ // Register focus events on the window so they are sure to happen
41982
+ // before React's event listeners (registered on the document).
41983
+ window.addEventListener('focus', $507fabe10e71c6fb$var$handleFocusEvent, true);
41984
+ window.addEventListener('blur', $507fabe10e71c6fb$var$handleWindowBlur, false);
41985
+ if (typeof PointerEvent !== 'undefined') {
41986
+ document.addEventListener('pointerdown', $507fabe10e71c6fb$var$handlePointerEvent, true);
41987
+ document.addEventListener('pointermove', $507fabe10e71c6fb$var$handlePointerEvent, true);
41988
+ document.addEventListener('pointerup', $507fabe10e71c6fb$var$handlePointerEvent, true);
41989
+ } else {
41990
+ document.addEventListener('mousedown', $507fabe10e71c6fb$var$handlePointerEvent, true);
41991
+ document.addEventListener('mousemove', $507fabe10e71c6fb$var$handlePointerEvent, true);
41992
+ document.addEventListener('mouseup', $507fabe10e71c6fb$var$handlePointerEvent, true);
41993
+ }
41994
+ $507fabe10e71c6fb$var$hasSetupGlobalListeners = true;
41995
+ }
41996
+ if (typeof document !== 'undefined') {
41997
+ if (document.readyState !== 'loading') $507fabe10e71c6fb$var$setupGlobalFocusEvents();
41998
+ else document.addEventListener('DOMContentLoaded', $507fabe10e71c6fb$var$setupGlobalFocusEvents);
41999
+ }
42000
+ function $507fabe10e71c6fb$export$b9b3dfddab17db27() {
42001
+ return $507fabe10e71c6fb$var$currentModality !== 'pointer';
42002
+ }
42003
+ function $507fabe10e71c6fb$export$630ff653c5ada6a9() {
42004
+ return $507fabe10e71c6fb$var$currentModality;
42005
+ }
42006
+ /**
42007
+ * If this is attached to text input component, return if the event is a focus event (Tab/Escape keys pressed) so that
42008
+ * focus visible style can be properly set.
42009
+ */ function $507fabe10e71c6fb$var$isKeyboardFocusEvent(isTextInput, modality, e) {
42010
+ return !(isTextInput && modality === 'keyboard' && e instanceof KeyboardEvent && !$507fabe10e71c6fb$var$FOCUS_VISIBLE_INPUT_KEYS[e.key]);
42011
+ }
42012
+ function $507fabe10e71c6fb$export$ec71b4b83ac08ec3(fn, deps, opts) {
42013
+ $507fabe10e71c6fb$var$setupGlobalFocusEvents();
42014
+ useEffect(()=>{
42015
+ let handler = (modality, e)=>{
42016
+ if (!$507fabe10e71c6fb$var$isKeyboardFocusEvent(opts === null || opts === void 0 ? void 0 : opts.isTextInput, modality, e)) return;
42017
+ fn($507fabe10e71c6fb$export$b9b3dfddab17db27());
42018
+ };
42019
+ $507fabe10e71c6fb$var$changeHandlers.add(handler);
42020
+ return ()=>{
42021
+ $507fabe10e71c6fb$var$changeHandlers.delete(handler);
42022
+ };
42023
+ }, deps);
42024
+ }
42025
+
42026
+
42027
+
42028
+
42029
+ function $9ab94262bd0047c7$export$420e68273165f4ec(props) {
42030
+ let { isDisabled: isDisabled , onBlurWithin: onBlurWithin , onFocusWithin: onFocusWithin , onFocusWithinChange: onFocusWithinChange } = props;
42031
+ let state = useRef({
42032
+ isFocusWithin: false
42033
+ });
42034
+ let onBlur = useCallback((e)=>{
42035
+ // We don't want to trigger onBlurWithin and then immediately onFocusWithin again
42036
+ // when moving focus inside the element. Only trigger if the currentTarget doesn't
42037
+ // include the relatedTarget (where focus is moving).
42038
+ if (state.current.isFocusWithin && !e.currentTarget.contains(e.relatedTarget)) {
42039
+ state.current.isFocusWithin = false;
42040
+ if (onBlurWithin) onBlurWithin(e);
42041
+ if (onFocusWithinChange) onFocusWithinChange(false);
42042
+ }
42043
+ }, [
42044
+ onBlurWithin,
42045
+ onFocusWithinChange,
42046
+ state
42047
+ ]);
42048
+ let onSyntheticFocus = $8a9cb279dc87e130$export$715c682d09d639cc(onBlur);
42049
+ let onFocus = useCallback((e)=>{
42050
+ if (!state.current.isFocusWithin) {
42051
+ if (onFocusWithin) onFocusWithin(e);
42052
+ if (onFocusWithinChange) onFocusWithinChange(true);
42053
+ state.current.isFocusWithin = true;
42054
+ onSyntheticFocus(e);
42055
+ }
42056
+ }, [
42057
+ onFocusWithin,
42058
+ onFocusWithinChange,
42059
+ onSyntheticFocus
42060
+ ]);
42061
+ if (isDisabled) return {
42062
+ focusWithinProps: {
42063
+ onFocus: null,
42064
+ onBlur: null
42065
+ }
42066
+ };
42067
+ return {
42068
+ focusWithinProps: {
42069
+ onFocus: onFocus,
42070
+ onBlur: onBlur
42071
+ }
42072
+ };
42073
+ }
42074
+
42075
+
42076
+
42077
+ // iOS fires onPointerEnter twice: once with pointerType="touch" and again with pointerType="mouse".
42078
+ // We want to ignore these emulated events so they do not trigger hover behavior.
42079
+ // See https://bugs.webkit.org/show_bug.cgi?id=214609.
42080
+ let $6179b936705e76d3$var$globalIgnoreEmulatedMouseEvents = false;
42081
+ let $6179b936705e76d3$var$hoverCount = 0;
42082
+ function $6179b936705e76d3$var$setGlobalIgnoreEmulatedMouseEvents() {
42083
+ $6179b936705e76d3$var$globalIgnoreEmulatedMouseEvents = true;
42084
+ // Clear globalIgnoreEmulatedMouseEvents after a short timeout. iOS fires onPointerEnter
42085
+ // with pointerType="mouse" immediately after onPointerUp and before onFocus. On other
42086
+ // devices that don't have this quirk, we don't want to ignore a mouse hover sometime in
42087
+ // the distant future because a user previously touched the element.
42088
+ setTimeout(()=>{
42089
+ $6179b936705e76d3$var$globalIgnoreEmulatedMouseEvents = false;
42090
+ }, 50);
42091
+ }
42092
+ function $6179b936705e76d3$var$handleGlobalPointerEvent(e) {
42093
+ if (e.pointerType === 'touch') $6179b936705e76d3$var$setGlobalIgnoreEmulatedMouseEvents();
42094
+ }
42095
+ function $6179b936705e76d3$var$setupGlobalTouchEvents() {
42096
+ if (typeof document === 'undefined') return;
42097
+ if (typeof PointerEvent !== 'undefined') document.addEventListener('pointerup', $6179b936705e76d3$var$handleGlobalPointerEvent);
42098
+ else document.addEventListener('touchend', $6179b936705e76d3$var$setGlobalIgnoreEmulatedMouseEvents);
42099
+ $6179b936705e76d3$var$hoverCount++;
42100
+ return ()=>{
42101
+ $6179b936705e76d3$var$hoverCount--;
42102
+ if ($6179b936705e76d3$var$hoverCount > 0) return;
42103
+ if (typeof PointerEvent !== 'undefined') document.removeEventListener('pointerup', $6179b936705e76d3$var$handleGlobalPointerEvent);
42104
+ else document.removeEventListener('touchend', $6179b936705e76d3$var$setGlobalIgnoreEmulatedMouseEvents);
42105
+ };
42106
+ }
42107
+ function $6179b936705e76d3$export$ae780daf29e6d456(props) {
42108
+ let { onHoverStart: onHoverStart , onHoverChange: onHoverChange , onHoverEnd: onHoverEnd , isDisabled: isDisabled } = props;
42109
+ let [isHovered, setHovered] = useState(false);
42110
+ let state = useRef({
42111
+ isHovered: false,
42112
+ ignoreEmulatedMouseEvents: false,
42113
+ pointerType: '',
42114
+ target: null
42115
+ }).current;
42116
+ useEffect($6179b936705e76d3$var$setupGlobalTouchEvents, []);
42117
+ let { hoverProps: hoverProps1 , triggerHoverEnd: triggerHoverEnd1 } = useMemo(()=>{
42118
+ let triggerHoverStart = (event, pointerType)=>{
42119
+ state.pointerType = pointerType;
42120
+ if (isDisabled || pointerType === 'touch' || state.isHovered || !event.currentTarget.contains(event.target)) return;
42121
+ state.isHovered = true;
42122
+ let target = event.currentTarget;
42123
+ state.target = target;
42124
+ if (onHoverStart) onHoverStart({
42125
+ type: 'hoverstart',
42126
+ target: target,
42127
+ pointerType: pointerType
42128
+ });
42129
+ if (onHoverChange) onHoverChange(true);
42130
+ setHovered(true);
42131
+ };
42132
+ let triggerHoverEnd = (event, pointerType)=>{
42133
+ state.pointerType = '';
42134
+ state.target = null;
42135
+ if (pointerType === 'touch' || !state.isHovered) return;
42136
+ state.isHovered = false;
42137
+ let target = event.currentTarget;
42138
+ if (onHoverEnd) onHoverEnd({
42139
+ type: 'hoverend',
42140
+ target: target,
42141
+ pointerType: pointerType
42142
+ });
42143
+ if (onHoverChange) onHoverChange(false);
42144
+ setHovered(false);
42145
+ };
42146
+ let hoverProps = {
42147
+ };
42148
+ if (typeof PointerEvent !== 'undefined') {
42149
+ hoverProps.onPointerEnter = (e)=>{
42150
+ if ($6179b936705e76d3$var$globalIgnoreEmulatedMouseEvents && e.pointerType === 'mouse') return;
42151
+ triggerHoverStart(e, e.pointerType);
42152
+ };
42153
+ hoverProps.onPointerLeave = (e)=>{
42154
+ if (!isDisabled && e.currentTarget.contains(e.target)) triggerHoverEnd(e, e.pointerType);
42155
+ };
42156
+ } else {
42157
+ hoverProps.onTouchStart = ()=>{
42158
+ state.ignoreEmulatedMouseEvents = true;
42159
+ };
42160
+ hoverProps.onMouseEnter = (e)=>{
42161
+ if (!state.ignoreEmulatedMouseEvents && !$6179b936705e76d3$var$globalIgnoreEmulatedMouseEvents) triggerHoverStart(e, 'mouse');
42162
+ state.ignoreEmulatedMouseEvents = false;
42163
+ };
42164
+ hoverProps.onMouseLeave = (e)=>{
42165
+ if (!isDisabled && e.currentTarget.contains(e.target)) triggerHoverEnd(e, 'mouse');
42166
+ };
42167
+ }
42168
+ return {
42169
+ hoverProps: hoverProps,
42170
+ triggerHoverEnd: triggerHoverEnd
42171
+ };
42172
+ }, [
42173
+ onHoverStart,
42174
+ onHoverChange,
42175
+ onHoverEnd,
42176
+ isDisabled,
42177
+ state
42178
+ ]);
42179
+ useEffect(()=>{
42180
+ // Call the triggerHoverEnd as soon as isDisabled changes to true
42181
+ // Safe to call triggerHoverEnd, it will early return if we aren't currently hovering
42182
+ if (isDisabled) triggerHoverEnd1({
42183
+ currentTarget: state.target
42184
+ }, state.pointerType);
42185
+ }, [
42186
+ isDisabled
42187
+ ]);
42188
+ return {
42189
+ hoverProps: hoverProps1,
42190
+ isHovered: isHovered
42191
+ };
42192
+ }
42193
+
42194
+
42195
+
42196
+
42197
+
42198
+ const $8a26561d2877236e$var$DEFAULT_THRESHOLD = 500;
42199
+ function $8a26561d2877236e$export$c24ed0104d07eab9(props) {
42200
+ let { isDisabled: isDisabled , onLongPressStart: onLongPressStart , onLongPressEnd: onLongPressEnd , onLongPress: onLongPress , threshold: threshold = $8a26561d2877236e$var$DEFAULT_THRESHOLD , accessibilityDescription: accessibilityDescription } = props;
42201
+ const timeRef = useRef(null);
42202
+ let { addGlobalListener: addGlobalListener , removeGlobalListener: removeGlobalListener } = $03deb23ff14920c4$export$4eaf04e54aa8eed6();
42203
+ let { pressProps: pressProps } = $f6c31cce2adf654f$export$45712eceda6fad21({
42204
+ isDisabled: isDisabled,
42205
+ onPressStart (e1) {
42206
+ if (e1.pointerType === 'mouse' || e1.pointerType === 'touch') {
42207
+ if (onLongPressStart) onLongPressStart({
42208
+ ...e1,
42209
+ type: 'longpressstart'
42210
+ });
42211
+ timeRef.current = setTimeout(()=>{
42212
+ // Prevent other usePress handlers from also handling this event.
42213
+ e1.target.dispatchEvent(new PointerEvent('pointercancel', {
42214
+ bubbles: true
42215
+ }));
42216
+ if (onLongPress) onLongPress({
42217
+ ...e1,
42218
+ type: 'longpress'
42219
+ });
42220
+ timeRef.current = null;
42221
+ }, threshold);
42222
+ // Prevent context menu, which may be opened on long press on touch devices
42223
+ if (e1.pointerType === 'touch') {
42224
+ let onContextMenu = (e)=>{
42225
+ e.preventDefault();
42226
+ };
42227
+ addGlobalListener(e1.target, 'contextmenu', onContextMenu, {
42228
+ once: true
42229
+ });
42230
+ addGlobalListener(window, 'pointerup', ()=>{
42231
+ // If no contextmenu event is fired quickly after pointerup, remove the handler
42232
+ // so future context menu events outside a long press are not prevented.
42233
+ setTimeout(()=>{
42234
+ removeGlobalListener(e1.target, 'contextmenu', onContextMenu);
42235
+ }, 30);
42236
+ }, {
42237
+ once: true
42238
+ });
42239
+ }
42240
+ }
42241
+ },
42242
+ onPressEnd (e) {
42243
+ if (timeRef.current) clearTimeout(timeRef.current);
42244
+ if (onLongPressEnd && (e.pointerType === 'mouse' || e.pointerType === 'touch')) onLongPressEnd({
42245
+ ...e,
42246
+ type: 'longpressend'
42247
+ });
42248
+ }
42249
+ });
42250
+ let descriptionProps = $ef06256079686ba0$export$f8aeda7b10753fa1(onLongPress && !isDisabled ? accessibilityDescription : null);
42251
+ return {
42252
+ longPressProps: $3ef42575df84b30b$export$9d1611c77c2fe928(pressProps, descriptionProps)
42253
+ };
42254
+ }
42255
+
42256
+ function $d191a55c9702f145$export$8467354a121f1b9f(props) {
42257
+ let { id: id , label: label , 'aria-labelledby': ariaLabelledby , 'aria-label': ariaLabel , labelElementType: labelElementType = 'label' } = props;
42258
+ id = $bdb11010cef70236$export$f680877a34711e37(id);
42259
+ let labelId = $bdb11010cef70236$export$f680877a34711e37();
42260
+ let labelProps = {
42261
+ };
42262
+ if (label) {
42263
+ ariaLabelledby = ariaLabelledby ? `${ariaLabelledby} ${labelId}` : labelId;
42264
+ labelProps = {
42265
+ id: labelId,
42266
+ htmlFor: labelElementType === 'label' ? id : undefined
42267
+ };
42268
+ } else if (!ariaLabelledby && !ariaLabel) console.warn('If you do not provide a visible label, you must specify an aria-label or aria-labelledby attribute for accessibility');
42269
+ let fieldProps = $313b98861ee5dd6c$export$d6875122194c7b44({
42270
+ id: id,
42271
+ 'aria-label': ariaLabel,
42272
+ 'aria-labelledby': ariaLabelledby
42273
+ });
42274
+ return {
42275
+ labelProps: labelProps,
42276
+ fieldProps: fieldProps
42277
+ };
42278
+ }
42279
+
42280
+ function $6a99195332edec8b$export$80f3e147d781571c(element) {
42281
+ // If the user is interacting with a virtual cursor, e.g. screen reader, then
42282
+ // wait until after any animated transitions that are currently occurring on
42283
+ // the page before shifting focus. This avoids issues with VoiceOver on iOS
42284
+ // causing the page to scroll when moving focus if the element is transitioning
42285
+ // from off the screen.
42286
+ if ($507fabe10e71c6fb$export$630ff653c5ada6a9() === 'virtual') {
42287
+ let lastFocusedElement = document.activeElement;
42288
+ $bbed8b41f857bcc0$export$24490316f764c430(()=>{
42289
+ // If focus did not move and the element is still in the document, focus it.
42290
+ if (document.activeElement === lastFocusedElement && document.contains(element)) $7215afc6de606d6b$export$de79e2c695e052f3(element);
42291
+ });
42292
+ } else $7215afc6de606d6b$export$de79e2c695e052f3(element);
42293
+ }
42294
+
42295
+
42296
+ /*
42297
+ * Copyright 2021 Adobe. All rights reserved.
42298
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
42299
+ * you may not use this file except in compliance with the License. You may obtain a copy
42300
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
42301
+ *
42302
+ * Unless required by applicable law or agreed to in writing, software distributed under
42303
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
42304
+ * OF ANY KIND, either express or implied. See the License for the specific language
42305
+ * governing permissions and limitations under the License.
42306
+ */ function $645f2e67b85a24c9$var$isStyleVisible(element) {
42307
+ if (!(element instanceof HTMLElement) && !(element instanceof SVGElement)) return false;
42308
+ let { display: display , visibility: visibility } = element.style;
42309
+ let isVisible = display !== 'none' && visibility !== 'hidden' && visibility !== 'collapse';
42310
+ if (isVisible) {
42311
+ const { getComputedStyle: getComputedStyle } = element.ownerDocument.defaultView;
42312
+ let { display: computedDisplay , visibility: computedVisibility } = getComputedStyle(element);
42313
+ isVisible = computedDisplay !== 'none' && computedVisibility !== 'hidden' && computedVisibility !== 'collapse';
42314
+ }
42315
+ return isVisible;
42316
+ }
42317
+ function $645f2e67b85a24c9$var$isAttributeVisible(element, childElement) {
42318
+ return !element.hasAttribute('hidden') && (element.nodeName === 'DETAILS' && childElement && childElement.nodeName !== 'SUMMARY' ? element.hasAttribute('open') : true);
42319
+ }
42320
+ function $645f2e67b85a24c9$export$e989c0fffaa6b27a(element, childElement) {
42321
+ return element.nodeName !== '#comment' && $645f2e67b85a24c9$var$isStyleVisible(element) && $645f2e67b85a24c9$var$isAttributeVisible(element, childElement) && (!element.parentElement || $645f2e67b85a24c9$export$e989c0fffaa6b27a(element.parentElement, element));
42322
+ }
42323
+ const $9bf71ea28793e738$var$focusableElements = [
42324
+ 'input:not([disabled]):not([type=hidden])',
42325
+ 'select:not([disabled])',
42326
+ 'textarea:not([disabled])',
42327
+ 'button:not([disabled])',
42328
+ 'a[href]',
42329
+ 'area[href]',
42330
+ 'summary',
42331
+ 'iframe',
42332
+ 'object',
42333
+ 'embed',
42334
+ 'audio[controls]',
42335
+ 'video[controls]',
42336
+ '[contenteditable]'
42337
+ ];
42338
+ const $9bf71ea28793e738$var$FOCUSABLE_ELEMENT_SELECTOR = $9bf71ea28793e738$var$focusableElements.join(':not([hidden]),') + ',[tabindex]:not([disabled]):not([hidden])';
42339
+ $9bf71ea28793e738$var$focusableElements.push('[tabindex]:not([tabindex="-1"]):not([disabled])');
42340
+ const $9bf71ea28793e738$var$TABBABLE_ELEMENT_SELECTOR = $9bf71ea28793e738$var$focusableElements.join(':not([hidden]):not([tabindex="-1"]),');
42341
+ function $9bf71ea28793e738$var$isElementInScope(element, scope) {
42342
+ return scope.some((node)=>node.contains(element)
42343
+ );
42344
+ }
42345
+ function $9bf71ea28793e738$export$2d6ec8fc375ceafa(root, opts, scope) {
42346
+ let selector = (opts === null || opts === void 0 ? void 0 : opts.tabbable) ? $9bf71ea28793e738$var$TABBABLE_ELEMENT_SELECTOR : $9bf71ea28793e738$var$FOCUSABLE_ELEMENT_SELECTOR;
42347
+ let walker = document.createTreeWalker(root, NodeFilter.SHOW_ELEMENT, {
42348
+ acceptNode (node) {
42349
+ var ref;
42350
+ // Skip nodes inside the starting node.
42351
+ if (opts === null || opts === void 0 ? void 0 : (ref = opts.from) === null || ref === void 0 ? void 0 : ref.contains(node)) return NodeFilter.FILTER_REJECT;
42352
+ if (node.matches(selector) && $645f2e67b85a24c9$export$e989c0fffaa6b27a(node) && (!scope || $9bf71ea28793e738$var$isElementInScope(node, scope)) && (!(opts === null || opts === void 0 ? void 0 : opts.accept) || opts.accept(node))) return NodeFilter.FILTER_ACCEPT;
42353
+ return NodeFilter.FILTER_SKIP;
42354
+ }
42355
+ });
42356
+ if (opts === null || opts === void 0 ? void 0 : opts.from) walker.currentNode = opts.from;
42357
+ return walker;
42358
+ }
42359
+
42360
+
42361
+
42362
+
42363
+
42364
+
42365
+
42366
+
42367
+ function $f7dceffc5ad7768b$export$4e328f61c538687f(props = {
42368
+ }) {
42369
+ let { autoFocus: autoFocus = false , isTextInput: isTextInput , within: within } = props;
42370
+ let state = useRef({
42371
+ isFocused: false,
42372
+ isFocusVisible: autoFocus || $507fabe10e71c6fb$export$b9b3dfddab17db27()
42373
+ });
42374
+ let [isFocused1, setFocused] = useState(false);
42375
+ let [isFocusVisibleState, setFocusVisible] = useState(()=>state.current.isFocused && state.current.isFocusVisible
42376
+ );
42377
+ let updateState = useCallback(()=>setFocusVisible(state.current.isFocused && state.current.isFocusVisible)
42378
+ , []);
42379
+ let onFocusChange = useCallback((isFocused)=>{
42380
+ state.current.isFocused = isFocused;
42381
+ setFocused(isFocused);
42382
+ updateState();
42383
+ }, [
42384
+ updateState
42385
+ ]);
42386
+ $507fabe10e71c6fb$export$ec71b4b83ac08ec3((isFocusVisible)=>{
42387
+ state.current.isFocusVisible = isFocusVisible;
42388
+ updateState();
42389
+ }, [], {
42390
+ isTextInput: isTextInput
42391
+ });
42392
+ let { focusProps: focusProps } = $a1ea59d68270f0dd$export$f8168d8dd8fd66e6({
42393
+ isDisabled: within,
42394
+ onFocusChange: onFocusChange
42395
+ });
42396
+ let { focusWithinProps: focusWithinProps } = $9ab94262bd0047c7$export$420e68273165f4ec({
42397
+ isDisabled: !within,
42398
+ onFocusWithinChange: onFocusChange
42399
+ });
42400
+ return {
42401
+ isFocused: isFocused1,
42402
+ isFocusVisible: state.current.isFocused && isFocusVisibleState,
42403
+ focusProps: within ? focusWithinProps : focusProps
42404
+ };
42405
+ }
42406
+
42407
+ /*
42408
+ * Copyright 2020 Adobe. All rights reserved.
42409
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
42410
+ * you may not use this file except in compliance with the License. You may obtain a copy
42411
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
42412
+ *
42413
+ * Unless required by applicable law or agreed to in writing, software distributed under
42414
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
42415
+ * OF ANY KIND, either express or implied. See the License for the specific language
42416
+ * governing permissions and limitations under the License.
42417
+ */ // https://en.wikipedia.org/wiki/Right-to-left
42418
+ const $148a7a147e38ea7f$var$RTL_SCRIPTS = new Set([
42419
+ 'Arab',
42420
+ 'Syrc',
42421
+ 'Samr',
42422
+ 'Mand',
42423
+ 'Thaa',
42424
+ 'Mend',
42425
+ 'Nkoo',
42426
+ 'Adlm',
42427
+ 'Rohg',
42428
+ 'Hebr'
42429
+ ]);
42430
+ const $148a7a147e38ea7f$var$RTL_LANGS = new Set([
42431
+ 'ae',
42432
+ 'ar',
42433
+ 'arc',
42434
+ 'bcc',
42435
+ 'bqi',
42436
+ 'ckb',
42437
+ 'dv',
42438
+ 'fa',
42439
+ 'glk',
42440
+ 'he',
42441
+ 'ku',
42442
+ 'mzn',
42443
+ 'nqo',
42444
+ 'pnb',
42445
+ 'ps',
42446
+ 'sd',
42447
+ 'ug',
42448
+ 'ur',
42449
+ 'yi'
42450
+ ]);
42451
+ function $148a7a147e38ea7f$export$702d680b21cbd764(locale) {
42452
+ // If the Intl.Locale API is available, use it to get the script for the locale.
42453
+ // This is more accurate than guessing by language, since languages can be written in multiple scripts.
42454
+ // @ts-ignore
42455
+ if (Intl.Locale) {
42456
+ // @ts-ignore
42457
+ let script = new Intl.Locale(locale).maximize().script;
42458
+ return $148a7a147e38ea7f$var$RTL_SCRIPTS.has(script);
42459
+ }
42460
+ // If not, just guess by the language (first part of the locale)
42461
+ let lang = locale.split('-')[0];
42462
+ return $148a7a147e38ea7f$var$RTL_LANGS.has(lang);
42463
+ }
42464
+
42465
+
42466
+
42467
+
42468
+
42469
+ function $1e5a04cdaf7d1af8$export$f09106e7c6677ec5() {
42470
+ // @ts-ignore
42471
+ let locale = typeof navigator !== 'undefined' && (navigator.language || navigator.userLanguage) || 'en-US';
42472
+ try {
42473
+ // @ts-ignore
42474
+ Intl.DateTimeFormat.supportedLocalesOf([
42475
+ locale
42476
+ ]);
42477
+ } catch (_err) {
42478
+ locale = 'en-US';
42479
+ }
42480
+ return {
42481
+ locale: locale,
42482
+ direction: $148a7a147e38ea7f$export$702d680b21cbd764(locale) ? 'rtl' : 'ltr'
42483
+ };
42484
+ }
42485
+ let $1e5a04cdaf7d1af8$var$currentLocale = $1e5a04cdaf7d1af8$export$f09106e7c6677ec5();
42486
+ let $1e5a04cdaf7d1af8$var$listeners = new Set();
42487
+ function $1e5a04cdaf7d1af8$var$updateLocale() {
42488
+ $1e5a04cdaf7d1af8$var$currentLocale = $1e5a04cdaf7d1af8$export$f09106e7c6677ec5();
42489
+ for (let listener of $1e5a04cdaf7d1af8$var$listeners)listener($1e5a04cdaf7d1af8$var$currentLocale);
42490
+ }
42491
+ function $1e5a04cdaf7d1af8$export$188ec29ebc2bdc3a() {
42492
+ let isSSR = $704cf1d3b684cc5c$export$535bd6ca7f90a273();
42493
+ let [defaultLocale, setDefaultLocale] = useState($1e5a04cdaf7d1af8$var$currentLocale);
42494
+ useEffect(()=>{
42495
+ if ($1e5a04cdaf7d1af8$var$listeners.size === 0) window.addEventListener('languagechange', $1e5a04cdaf7d1af8$var$updateLocale);
42496
+ $1e5a04cdaf7d1af8$var$listeners.add(setDefaultLocale);
42497
+ return ()=>{
42498
+ $1e5a04cdaf7d1af8$var$listeners.delete(setDefaultLocale);
42499
+ if ($1e5a04cdaf7d1af8$var$listeners.size === 0) window.removeEventListener('languagechange', $1e5a04cdaf7d1af8$var$updateLocale);
42500
+ };
42501
+ }, []);
42502
+ // We cannot determine the browser's language on the server, so default to
42503
+ // en-US. This will be updated after hydration on the client to the correct value.
42504
+ if (isSSR) return {
42505
+ locale: 'en-US',
42506
+ direction: 'ltr'
42507
+ };
42508
+ return defaultLocale;
42509
+ }
42510
+
42511
+
42512
+
42513
+ const $18f2051aff69b9bf$var$I18nContext = /*#__PURE__*/ React__default.createContext(null);
42514
+ function $18f2051aff69b9bf$export$43bb16f9c6d9e3f7() {
42515
+ let defaultLocale = $1e5a04cdaf7d1af8$export$188ec29ebc2bdc3a();
42516
+ let context = useContext($18f2051aff69b9bf$var$I18nContext);
42517
+ return context || defaultLocale;
42518
+ }
42519
+
42520
+
42521
+
42522
+ let $325a3faab7a68acd$var$cache = new Map();
42523
+ function $325a3faab7a68acd$export$a16aca283550c30d(options) {
42524
+ let { locale: locale } = $18f2051aff69b9bf$export$43bb16f9c6d9e3f7();
42525
+ let cacheKey = locale + (options ? Object.entries(options).sort((a, b)=>a[0] < b[0] ? -1 : 1
42526
+ ).join() : '');
42527
+ if ($325a3faab7a68acd$var$cache.has(cacheKey)) return $325a3faab7a68acd$var$cache.get(cacheKey);
42528
+ let formatter = new Intl.Collator(locale, options);
42529
+ $325a3faab7a68acd$var$cache.set(cacheKey, formatter);
42530
+ return formatter;
42531
+ }
42532
+
42533
+ function $feb5ffebff200149$export$d3e3bd3e26688c04(e) {
42534
+ // Ctrl + Arrow Up/Arrow Down has a system wide meaning on macOS, so use Alt instead.
42535
+ // On Windows and Ubuntu, Alt + Space has a system wide meaning.
42536
+ return $c87311424ea30a05$export$e1865c3bedcd822b() ? e.altKey : e.ctrlKey;
42537
+ }
42538
+ function $feb5ffebff200149$export$16792effe837dba3(e) {
42539
+ if ($c87311424ea30a05$export$9ac100e40613ea10()) return e.metaKey;
42540
+ return e.ctrlKey;
42541
+ }
42542
+
42543
+
42544
+
42545
+
42546
+ function $fb3050f43d946246$export$e32c88dfddc6e1d8(options) {
42547
+ let { keyboardDelegate: keyboardDelegate , selectionManager: selectionManager , onTypeSelect: onTypeSelect } = options;
42548
+ let state = useRef({
42549
+ search: '',
42550
+ timeout: null
42551
+ }).current;
42552
+ let onKeyDown = (e)=>{
42553
+ let character = $fb3050f43d946246$var$getStringForKey(e.key);
42554
+ if (!character || e.ctrlKey || e.metaKey) return;
42555
+ // Do not propagate the Spacebar event if it's meant to be part of the search.
42556
+ // When we time out, the search term becomes empty, hence the check on length.
42557
+ // Trimming is to account for the case of pressing the Spacebar more than once,
42558
+ // which should cycle through the selection/deselection of the focused item.
42559
+ if (character === ' ' && state.search.trim().length > 0) {
42560
+ e.preventDefault();
42561
+ if (!('continuePropagation' in e)) e.stopPropagation();
42562
+ }
42563
+ state.search += character;
42564
+ // Use the delegate to find a key to focus.
42565
+ // Prioritize items after the currently focused item, falling back to searching the whole list.
42566
+ let key = keyboardDelegate.getKeyForSearch(state.search, selectionManager.focusedKey);
42567
+ // If no key found, search from the top.
42568
+ if (key == null) key = keyboardDelegate.getKeyForSearch(state.search);
42569
+ if (key != null) {
42570
+ selectionManager.setFocusedKey(key);
42571
+ if (onTypeSelect) onTypeSelect(key);
42572
+ }
42573
+ clearTimeout(state.timeout);
42574
+ state.timeout = setTimeout(()=>{
42575
+ state.search = '';
42576
+ }, 500);
42577
+ };
42578
+ return {
42579
+ typeSelectProps: {
42580
+ // Using a capturing listener to catch the keydown event before
42581
+ // other hooks in order to handle the Spacebar event.
42582
+ onKeyDownCapture: keyboardDelegate.getKeyForSearch ? onKeyDown : null
42583
+ }
42584
+ };
42585
+ }
42586
+ function $fb3050f43d946246$var$getStringForKey(key) {
42587
+ // If the key is of length 1, it is an ASCII value.
42588
+ // Otherwise, if there are no ASCII characters in the key name,
42589
+ // it is a Unicode character.
42590
+ // See https://www.w3.org/TR/uievents-key/
42591
+ if (key.length === 1 || !/^[A-Z]/i.test(key)) return key;
42592
+ return '';
42593
+ }
42594
+
42595
+
42596
+ function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
42597
+ let { selectionManager: manager , keyboardDelegate: delegate , ref: ref , autoFocus: autoFocus = false , shouldFocusWrap: shouldFocusWrap = false , disallowEmptySelection: disallowEmptySelection = false , disallowSelectAll: disallowSelectAll = false , selectOnFocus: selectOnFocus = manager.selectionBehavior === 'replace' , disallowTypeAhead: disallowTypeAhead = false , shouldUseVirtualFocus: shouldUseVirtualFocus , allowsTabNavigation: allowsTabNavigation = false , isVirtualized: isVirtualized , scrollRef: // If no scrollRef is provided, assume the collection ref is the scrollable region
42598
+ scrollRef = ref } = options;
42599
+ let { direction: direction } = $18f2051aff69b9bf$export$43bb16f9c6d9e3f7();
42600
+ let onKeyDown = (e)=>{
42601
+ // Prevent option + tab from doing anything since it doesn't move focus to the cells, only buttons/checkboxes
42602
+ if (e.altKey && e.key === 'Tab') e.preventDefault();
42603
+ // Keyboard events bubble through portals. Don't handle keyboard events
42604
+ // for elements outside the collection (e.g. menus).
42605
+ if (!ref.current.contains(e.target)) return;
42606
+ const navigateToKey = (key, childFocus)=>{
42607
+ if (key != null) {
42608
+ manager.setFocusedKey(key, childFocus);
42609
+ if (e.shiftKey && manager.selectionMode === 'multiple') manager.extendSelection(key);
42610
+ else if (selectOnFocus && !$feb5ffebff200149$export$d3e3bd3e26688c04(e)) manager.replaceSelection(key);
42611
+ }
42612
+ };
42613
+ switch(e.key){
42614
+ case 'ArrowDown':
42615
+ if (delegate.getKeyBelow) {
42616
+ var ref4, ref1;
42617
+ e.preventDefault();
42618
+ let nextKey = manager.focusedKey != null ? delegate.getKeyBelow(manager.focusedKey) : (ref4 = delegate.getFirstKey) === null || ref4 === void 0 ? void 0 : ref4.call(delegate);
42619
+ if (nextKey == null && shouldFocusWrap) nextKey = (ref1 = delegate.getFirstKey) === null || ref1 === void 0 ? void 0 : ref1.call(delegate, manager.focusedKey);
42620
+ navigateToKey(nextKey);
42621
+ }
42622
+ break;
42623
+ case 'ArrowUp':
42624
+ if (delegate.getKeyAbove) {
42625
+ var ref2, ref3;
42626
+ e.preventDefault();
42627
+ let nextKey = manager.focusedKey != null ? delegate.getKeyAbove(manager.focusedKey) : (ref2 = delegate.getLastKey) === null || ref2 === void 0 ? void 0 : ref2.call(delegate);
42628
+ if (nextKey == null && shouldFocusWrap) nextKey = (ref3 = delegate.getLastKey) === null || ref3 === void 0 ? void 0 : ref3.call(delegate, manager.focusedKey);
42629
+ navigateToKey(nextKey);
42630
+ }
42631
+ break;
42632
+ case 'ArrowLeft':
42633
+ if (delegate.getKeyLeftOf) {
42634
+ e.preventDefault();
42635
+ let nextKey = delegate.getKeyLeftOf(manager.focusedKey);
42636
+ navigateToKey(nextKey, direction === 'rtl' ? 'first' : 'last');
42637
+ }
42638
+ break;
42639
+ case 'ArrowRight':
42640
+ if (delegate.getKeyRightOf) {
42641
+ e.preventDefault();
42642
+ let nextKey = delegate.getKeyRightOf(manager.focusedKey);
42643
+ navigateToKey(nextKey, direction === 'rtl' ? 'last' : 'first');
42644
+ }
42645
+ break;
42646
+ case 'Home':
42647
+ if (delegate.getFirstKey) {
42648
+ e.preventDefault();
42649
+ let firstKey = delegate.getFirstKey(manager.focusedKey, $feb5ffebff200149$export$16792effe837dba3(e));
42650
+ manager.setFocusedKey(firstKey);
42651
+ if ($feb5ffebff200149$export$16792effe837dba3(e) && e.shiftKey && manager.selectionMode === 'multiple') manager.extendSelection(firstKey);
42652
+ else if (selectOnFocus) manager.replaceSelection(firstKey);
42653
+ }
42654
+ break;
42655
+ case 'End':
42656
+ if (delegate.getLastKey) {
42657
+ e.preventDefault();
42658
+ let lastKey = delegate.getLastKey(manager.focusedKey, $feb5ffebff200149$export$16792effe837dba3(e));
42659
+ manager.setFocusedKey(lastKey);
42660
+ if ($feb5ffebff200149$export$16792effe837dba3(e) && e.shiftKey && manager.selectionMode === 'multiple') manager.extendSelection(lastKey);
42661
+ else if (selectOnFocus) manager.replaceSelection(lastKey);
42662
+ }
42663
+ break;
42664
+ case 'PageDown':
42665
+ if (delegate.getKeyPageBelow) {
42666
+ e.preventDefault();
42667
+ let nextKey = delegate.getKeyPageBelow(manager.focusedKey);
42668
+ navigateToKey(nextKey);
42669
+ }
42670
+ break;
42671
+ case 'PageUp':
42672
+ if (delegate.getKeyPageAbove) {
42673
+ e.preventDefault();
42674
+ let nextKey = delegate.getKeyPageAbove(manager.focusedKey);
42675
+ navigateToKey(nextKey);
42676
+ }
42677
+ break;
42678
+ case 'a':
42679
+ if ($feb5ffebff200149$export$16792effe837dba3(e) && manager.selectionMode === 'multiple' && disallowSelectAll !== true) {
42680
+ e.preventDefault();
42681
+ manager.selectAll();
42682
+ }
42683
+ break;
42684
+ case 'Escape':
42685
+ e.preventDefault();
42686
+ if (!disallowEmptySelection) manager.clearSelection();
42687
+ break;
42688
+ case 'Tab':
42689
+ if (!allowsTabNavigation) {
42690
+ // There may be elements that are "tabbable" inside a collection (e.g. in a grid cell).
42691
+ // However, collections should be treated as a single tab stop, with arrow key navigation internally.
42692
+ // We don't control the rendering of these, so we can't override the tabIndex to prevent tabbing.
42693
+ // Instead, we handle the Tab key, and move focus manually to the first/last tabbable element
42694
+ // in the collection, so that the browser default behavior will apply starting from that element
42695
+ // rather than the currently focused one.
42696
+ if (e.shiftKey) ref.current.focus();
42697
+ else {
42698
+ let walker = $9bf71ea28793e738$export$2d6ec8fc375ceafa(ref.current, {
42699
+ tabbable: true
42700
+ });
42701
+ let next;
42702
+ let last;
42703
+ do {
42704
+ last = walker.lastChild();
42705
+ if (last) next = last;
42706
+ }while (last)
42707
+ if (next && !next.contains(document.activeElement)) $7215afc6de606d6b$export$de79e2c695e052f3(next);
42708
+ }
42709
+ break;
42710
+ }
42711
+ }
42712
+ };
42713
+ // Store the scroll position so we can restore it later.
42714
+ let scrollPos = useRef({
42715
+ top: 0,
42716
+ left: 0
42717
+ });
42718
+ $e9faafb641e167db$export$90fc3a17d93f704c(scrollRef, 'scroll', isVirtualized ? null : ()=>{
42719
+ scrollPos.current = {
42720
+ top: scrollRef.current.scrollTop,
42721
+ left: scrollRef.current.scrollLeft
42722
+ };
42723
+ });
42724
+ let onFocus = (e)=>{
42725
+ if (manager.isFocused) {
42726
+ // If a focus event bubbled through a portal, reset focus state.
42727
+ if (!e.currentTarget.contains(e.target)) manager.setFocused(false);
42728
+ return;
42729
+ }
42730
+ // Focus events can bubble through portals. Ignore these events.
42731
+ if (!e.currentTarget.contains(e.target)) return;
42732
+ manager.setFocused(true);
42733
+ if (manager.focusedKey == null) {
42734
+ let navigateToFirstKey = (key)=>{
42735
+ if (key != null) {
42736
+ manager.setFocusedKey(key);
42737
+ if (selectOnFocus) manager.replaceSelection(key);
42738
+ }
42739
+ };
42740
+ // If the user hasn't yet interacted with the collection, there will be no focusedKey set.
42741
+ // Attempt to detect whether the user is tabbing forward or backward into the collection
42742
+ // and either focus the first or last item accordingly.
42743
+ let relatedTarget = e.relatedTarget;
42744
+ var _lastSelectedKey, _firstSelectedKey;
42745
+ if (relatedTarget && e.currentTarget.compareDocumentPosition(relatedTarget) & Node.DOCUMENT_POSITION_FOLLOWING) navigateToFirstKey((_lastSelectedKey = manager.lastSelectedKey) !== null && _lastSelectedKey !== void 0 ? _lastSelectedKey : delegate.getLastKey());
42746
+ else navigateToFirstKey((_firstSelectedKey = manager.firstSelectedKey) !== null && _firstSelectedKey !== void 0 ? _firstSelectedKey : delegate.getFirstKey());
42747
+ } else if (!isVirtualized) {
42748
+ // Restore the scroll position to what it was before.
42749
+ scrollRef.current.scrollTop = scrollPos.current.top;
42750
+ scrollRef.current.scrollLeft = scrollPos.current.left;
42751
+ // Refocus and scroll the focused item into view if it exists within the scrollable region.
42752
+ let element = scrollRef.current.querySelector(`[data-key="${manager.focusedKey}"]`);
42753
+ if (element) {
42754
+ // This prevents a flash of focus on the first/last element in the collection
42755
+ $7215afc6de606d6b$export$de79e2c695e052f3(element);
42756
+ $2f04cbc44ee30ce0$export$53a0910f038337bd(scrollRef.current, element);
42757
+ }
42758
+ }
42759
+ };
42760
+ let onBlur = (e)=>{
42761
+ // Don't set blurred and then focused again if moving focus within the collection.
42762
+ if (!e.currentTarget.contains(e.relatedTarget)) manager.setFocused(false);
42763
+ };
42764
+ const autoFocusRef = useRef(autoFocus);
42765
+ useEffect(()=>{
42766
+ if (autoFocusRef.current) {
42767
+ let focusedKey = null;
42768
+ // Check focus strategy to determine which item to focus
42769
+ if (autoFocus === 'first') focusedKey = delegate.getFirstKey();
42770
+ if (autoFocus === 'last') focusedKey = delegate.getLastKey();
42771
+ // If there are any selected keys, make the first one the new focus target
42772
+ let selectedKeys = manager.selectedKeys;
42773
+ if (selectedKeys.size) focusedKey = selectedKeys.values().next().value;
42774
+ manager.setFocused(true);
42775
+ manager.setFocusedKey(focusedKey);
42776
+ // If no default focus key is selected, focus the collection itself.
42777
+ if (focusedKey == null && !shouldUseVirtualFocus) $6a99195332edec8b$export$80f3e147d781571c(ref.current);
42778
+ }
42779
+ autoFocusRef.current = false;
42780
+ // eslint-disable-next-line react-hooks/exhaustive-deps
42781
+ }, []);
42782
+ // If not virtualized, scroll the focused element into view when the focusedKey changes.
42783
+ // When virtualized, Virtualizer handles this internally.
42784
+ useEffect(()=>{
42785
+ if (!isVirtualized && manager.focusedKey && (scrollRef === null || scrollRef === void 0 ? void 0 : scrollRef.current)) {
42786
+ let element = scrollRef.current.querySelector(`[data-key="${manager.focusedKey}"]`);
42787
+ if (element) $2f04cbc44ee30ce0$export$53a0910f038337bd(scrollRef.current, element);
42788
+ }
42789
+ }, [
42790
+ isVirtualized,
42791
+ scrollRef,
42792
+ manager.focusedKey
42793
+ ]);
42794
+ let handlers = {
42795
+ onKeyDown: onKeyDown,
42796
+ onFocus: onFocus,
42797
+ onBlur: onBlur,
42798
+ onMouseDown (e) {
42799
+ // Ignore events that bubbled through portals.
42800
+ if (e.currentTarget.contains(e.target)) // Prevent focus going to the collection when clicking on the scrollbar.
42801
+ e.preventDefault();
42802
+ }
42803
+ };
42804
+ let { typeSelectProps: typeSelectProps } = $fb3050f43d946246$export$e32c88dfddc6e1d8({
42805
+ keyboardDelegate: delegate,
42806
+ selectionManager: manager
42807
+ });
42808
+ if (!disallowTypeAhead) handlers = $3ef42575df84b30b$export$9d1611c77c2fe928(typeSelectProps, handlers);
42809
+ // If nothing is focused within the collection, make the collection itself tabbable.
42810
+ // This will be marshalled to either the first or last item depending on where focus came from.
42811
+ // If using virtual focus, don't set a tabIndex at all so that VoiceOver on iOS 14 doesn't try
42812
+ // to move real DOM focus to the element anyway.
42813
+ let tabIndex;
42814
+ if (!shouldUseVirtualFocus) tabIndex = manager.focusedKey == null ? 0 : -1;
42815
+ return {
42816
+ collectionProps: {
42817
+ ...handlers,
42818
+ tabIndex: tabIndex
42819
+ }
42820
+ };
42821
+ }
42822
+
42823
+
42824
+
42825
+
42826
+
42827
+
42828
+
42829
+ function $880e95eb8b93ba9a$export$ecf600387e221c37(options) {
42830
+ let { selectionManager: manager , key: key , ref: ref , shouldSelectOnPressUp: shouldSelectOnPressUp , isVirtualized: isVirtualized , shouldUseVirtualFocus: shouldUseVirtualFocus , focus: focus , isDisabled: isDisabled , onAction: onAction , allowsDifferentPressOrigin: allowsDifferentPressOrigin } = options;
42831
+ let onSelect = (e)=>{
42832
+ if (e.pointerType === 'keyboard' && $feb5ffebff200149$export$d3e3bd3e26688c04(e)) manager.toggleSelection(key);
42833
+ else {
42834
+ if (manager.selectionMode === 'none') return;
42835
+ if (manager.selectionMode === 'single') {
42836
+ if (manager.isSelected(key) && !manager.disallowEmptySelection) manager.toggleSelection(key);
42837
+ else manager.replaceSelection(key);
42838
+ } else if (e && e.shiftKey) manager.extendSelection(key);
42839
+ else if (manager.selectionBehavior === 'toggle' || e && ($feb5ffebff200149$export$16792effe837dba3(e) || e.pointerType === 'touch' || e.pointerType === 'virtual')) // if touch or virtual (VO) then we just want to toggle, otherwise it's impossible to multi select because they don't have modifier keys
42840
+ manager.toggleSelection(key);
42841
+ else manager.replaceSelection(key);
42842
+ }
42843
+ };
42844
+ // Focus the associated DOM node when this item becomes the focusedKey
42845
+ useEffect(()=>{
42846
+ let isFocused = key === manager.focusedKey;
42847
+ if (isFocused && manager.isFocused && !shouldUseVirtualFocus && document.activeElement !== ref.current) {
42848
+ if (focus) focus();
42849
+ else $6a99195332edec8b$export$80f3e147d781571c(ref.current);
42850
+ }
42851
+ }, [
42852
+ ref,
42853
+ key,
42854
+ manager.focusedKey,
42855
+ manager.childFocusStrategy,
42856
+ manager.isFocused,
42857
+ shouldUseVirtualFocus
42858
+ ]);
42859
+ // Set tabIndex to 0 if the element is focused, or -1 otherwise so that only the last focused
42860
+ // item is tabbable. If using virtual focus, don't set a tabIndex at all so that VoiceOver
42861
+ // on iOS 14 doesn't try to move real DOM focus to the item anyway.
42862
+ let itemProps = {
42863
+ };
42864
+ if (!shouldUseVirtualFocus) itemProps = {
42865
+ tabIndex: key === manager.focusedKey ? 0 : -1,
42866
+ onFocus (e) {
42867
+ if (e.target === ref.current) manager.setFocusedKey(key);
42868
+ }
42869
+ };
42870
+ // With checkbox selection, onAction (i.e. navigation) becomes primary, and occurs on a single click of the row.
42871
+ // Clicking the checkbox enters selection mode, after which clicking anywhere on any row toggles selection for that row.
42872
+ // With highlight selection, onAction is secondary, and occurs on double click. Single click selects the row.
42873
+ // With touch, onAction occurs on single tap, and long press enters selection mode.
42874
+ isDisabled = isDisabled || manager.isDisabled(key);
42875
+ let allowsSelection = !isDisabled && manager.canSelectItem(key);
42876
+ let allowsActions = onAction && !isDisabled;
42877
+ let hasPrimaryAction = allowsActions && (manager.selectionBehavior === 'replace' ? !allowsSelection : manager.isEmpty);
42878
+ let hasSecondaryAction = allowsActions && allowsSelection && manager.selectionBehavior === 'replace';
42879
+ let hasAction = hasPrimaryAction || hasSecondaryAction;
42880
+ let modality = useRef(null);
42881
+ let longPressEnabled = hasAction && allowsSelection;
42882
+ let longPressEnabledOnPressStart = useRef(false);
42883
+ let hadPrimaryActionOnPressStart = useRef(false);
42884
+ // By default, selection occurs on pointer down. This can be strange if selecting an
42885
+ // item causes the UI to disappear immediately (e.g. menus).
42886
+ // If shouldSelectOnPressUp is true, we use onPressUp instead of onPressStart.
42887
+ // onPress requires a pointer down event on the same element as pointer up. For menus,
42888
+ // we want to be able to have the pointer down on the trigger that opens the menu and
42889
+ // the pointer up on the menu item rather than requiring a separate press.
42890
+ // For keyboard events, selection still occurs on key down.
42891
+ let itemPressProps = {
42892
+ };
42893
+ if (shouldSelectOnPressUp) {
42894
+ itemPressProps.onPressStart = (e)=>{
42895
+ modality.current = e.pointerType;
42896
+ longPressEnabledOnPressStart.current = longPressEnabled;
42897
+ if (e.pointerType === 'keyboard' && (!hasAction || $880e95eb8b93ba9a$var$isSelectionKey())) onSelect(e);
42898
+ };
42899
+ // If allowsDifferentPressOrigin, make selection happen on pressUp (e.g. open menu on press down, selection on menu item happens on press up.)
42900
+ // Otherwise, have selection happen onPress (prevents listview row selection when clicking on interactable elements in the row)
42901
+ if (!allowsDifferentPressOrigin) itemPressProps.onPress = (e)=>{
42902
+ if (hasPrimaryAction || hasSecondaryAction && e.pointerType !== 'mouse') {
42903
+ if (e.pointerType === 'keyboard' && !$880e95eb8b93ba9a$var$isActionKey()) return;
42904
+ onAction();
42905
+ } else if (e.pointerType !== 'keyboard') onSelect(e);
42906
+ };
42907
+ else {
42908
+ itemPressProps.onPressUp = (e)=>{
42909
+ if (e.pointerType !== 'keyboard') onSelect(e);
42910
+ };
42911
+ itemPressProps.onPress = hasPrimaryAction ? ()=>onAction()
42912
+ : null;
42913
+ }
42914
+ } else {
42915
+ itemPressProps.onPressStart = (e)=>{
42916
+ modality.current = e.pointerType;
42917
+ longPressEnabledOnPressStart.current = longPressEnabled;
42918
+ hadPrimaryActionOnPressStart.current = hasPrimaryAction;
42919
+ // Select on mouse down unless there is a primary action which will occur on mouse up.
42920
+ // For keyboard, select on key down. If there is an action, the Space key selects on key down,
42921
+ // and the Enter key performs onAction on key up.
42922
+ if (e.pointerType === 'mouse' && !hasPrimaryAction || e.pointerType === 'keyboard' && (!onAction || $880e95eb8b93ba9a$var$isSelectionKey())) onSelect(e);
42923
+ };
42924
+ itemPressProps.onPress = (e)=>{
42925
+ // Selection occurs on touch up. Primary actions always occur on pointer up.
42926
+ // Both primary and secondary actions occur on Enter key up. The only exception
42927
+ // is secondary actions, which occur on double click with a mouse.
42928
+ if (e.pointerType === 'touch' || e.pointerType === 'pen' || e.pointerType === 'virtual' || e.pointerType === 'keyboard' && hasAction && $880e95eb8b93ba9a$var$isActionKey() || e.pointerType === 'mouse' && hadPrimaryActionOnPressStart.current) {
42929
+ if (hasAction) onAction();
42930
+ else onSelect(e);
42931
+ }
42932
+ };
42933
+ }
42934
+ if (!isVirtualized) itemProps['data-key'] = key;
42935
+ itemPressProps.preventFocusOnPress = shouldUseVirtualFocus;
42936
+ let { pressProps: pressProps , isPressed: isPressed } = $f6c31cce2adf654f$export$45712eceda6fad21(itemPressProps);
42937
+ // Double clicking with a mouse with selectionBehavior = 'replace' performs an action.
42938
+ let onDoubleClick = hasSecondaryAction ? (e)=>{
42939
+ if (modality.current === 'mouse') {
42940
+ e.stopPropagation();
42941
+ e.preventDefault();
42942
+ onAction();
42943
+ }
42944
+ } : undefined;
42945
+ // Long pressing an item with touch when selectionBehavior = 'replace' switches the selection behavior
42946
+ // to 'toggle'. This changes the single tap behavior from performing an action (i.e. navigating) to
42947
+ // selecting, and may toggle the appearance of a UI affordance like checkboxes on each item.
42948
+ let { longPressProps: longPressProps } = $8a26561d2877236e$export$c24ed0104d07eab9({
42949
+ isDisabled: !longPressEnabled,
42950
+ onLongPress (e) {
42951
+ if (e.pointerType === 'touch') {
42952
+ onSelect(e);
42953
+ manager.setSelectionBehavior('toggle');
42954
+ }
42955
+ }
42956
+ });
42957
+ // Prevent native drag and drop on long press if we also select on long press.
42958
+ // Once the user is in selection mode, they can long press again to drag.
42959
+ let onDragStart = (e)=>{
42960
+ if (modality.current === 'touch' && longPressEnabledOnPressStart.current) e.preventDefault();
42961
+ };
42962
+ return {
42963
+ itemProps: $3ef42575df84b30b$export$9d1611c77c2fe928(itemProps, allowsSelection || hasPrimaryAction ? pressProps : {
42964
+ }, longPressEnabled ? longPressProps : {
42965
+ }, {
42966
+ onDoubleClick: onDoubleClick,
42967
+ onDragStart: onDragStart
42968
+ }),
42969
+ isPressed: isPressed,
42970
+ isSelected: manager.isSelected(key),
42971
+ isDisabled: isDisabled,
42972
+ allowsSelection: allowsSelection,
42973
+ hasAction: hasAction
42974
+ };
42975
+ }
42976
+ function $880e95eb8b93ba9a$var$isActionKey() {
42977
+ let event = window.event;
42978
+ return (event === null || event === void 0 ? void 0 : event.key) === 'Enter';
42979
+ }
42980
+ function $880e95eb8b93ba9a$var$isSelectionKey() {
42981
+ let event = window.event;
42982
+ return (event === null || event === void 0 ? void 0 : event.key) === ' ' || (event === null || event === void 0 ? void 0 : event.code) === 'Space';
42983
+ }
42984
+
42985
+
42986
+
42987
+ class $2a25aae57d74318e$export$a05409b8bb224a5a {
42988
+ getKeyBelow(key) {
42989
+ key = this.collection.getKeyAfter(key);
42990
+ while(key != null){
42991
+ let item = this.collection.getItem(key);
42992
+ if (item.type === 'item' && !this.disabledKeys.has(key)) return key;
42993
+ key = this.collection.getKeyAfter(key);
42994
+ }
42995
+ }
42996
+ getKeyAbove(key) {
42997
+ key = this.collection.getKeyBefore(key);
42998
+ while(key != null){
42999
+ let item = this.collection.getItem(key);
43000
+ if (item.type === 'item' && !this.disabledKeys.has(key)) return key;
43001
+ key = this.collection.getKeyBefore(key);
43002
+ }
43003
+ }
43004
+ getFirstKey() {
43005
+ let key = this.collection.getFirstKey();
43006
+ while(key != null){
43007
+ let item = this.collection.getItem(key);
43008
+ if (item.type === 'item' && !this.disabledKeys.has(key)) return key;
43009
+ key = this.collection.getKeyAfter(key);
43010
+ }
43011
+ }
43012
+ getLastKey() {
43013
+ let key = this.collection.getLastKey();
43014
+ while(key != null){
43015
+ let item = this.collection.getItem(key);
43016
+ if (item.type === 'item' && !this.disabledKeys.has(key)) return key;
43017
+ key = this.collection.getKeyBefore(key);
43018
+ }
43019
+ }
43020
+ getItem(key) {
43021
+ return this.ref.current.querySelector(`[data-key="${key}"]`);
43022
+ }
43023
+ getKeyPageAbove(key) {
43024
+ let menu = this.ref.current;
43025
+ let item = this.getItem(key);
43026
+ if (!item) return null;
43027
+ let pageY = Math.max(0, item.offsetTop + item.offsetHeight - menu.offsetHeight);
43028
+ while(item && item.offsetTop > pageY){
43029
+ key = this.getKeyAbove(key);
43030
+ item = this.getItem(key);
43031
+ }
43032
+ return key;
43033
+ }
43034
+ getKeyPageBelow(key) {
43035
+ let menu = this.ref.current;
43036
+ let item = this.getItem(key);
43037
+ if (!item) return null;
43038
+ let pageY = Math.min(menu.scrollHeight, item.offsetTop - item.offsetHeight + menu.offsetHeight);
43039
+ while(item && item.offsetTop < pageY){
43040
+ key = this.getKeyBelow(key);
43041
+ item = this.getItem(key);
43042
+ }
43043
+ return key;
43044
+ }
43045
+ getKeyForSearch(search, fromKey) {
43046
+ if (!this.collator) return null;
43047
+ let collection = this.collection;
43048
+ let key = fromKey || this.getFirstKey();
43049
+ while(key != null){
43050
+ let item = collection.getItem(key);
43051
+ let substring = item.textValue.slice(0, search.length);
43052
+ if (item.textValue && this.collator.compare(substring, search) === 0) return key;
43053
+ key = this.getKeyBelow(key);
43054
+ }
43055
+ return null;
43056
+ }
43057
+ constructor(collection, disabledKeys, ref, collator){
43058
+ this.collection = collection;
43059
+ this.disabledKeys = disabledKeys;
43060
+ this.ref = ref;
43061
+ this.collator = collator;
43062
+ }
43063
+ }
43064
+
43065
+
43066
+
43067
+
43068
+ function $982254629710d113$export$b95089534ab7c1fd(props) {
43069
+ let { selectionManager: selectionManager , collection: collection , disabledKeys: disabledKeys , ref: ref , keyboardDelegate: keyboardDelegate , autoFocus: autoFocus , shouldFocusWrap: shouldFocusWrap , isVirtualized: isVirtualized , disallowEmptySelection: disallowEmptySelection , selectOnFocus: selectOnFocus = selectionManager.selectionBehavior === 'replace' , disallowTypeAhead: disallowTypeAhead , shouldUseVirtualFocus: shouldUseVirtualFocus , allowsTabNavigation: allowsTabNavigation } = props;
43070
+ // By default, a KeyboardDelegate is provided which uses the DOM to query layout information (e.g. for page up/page down).
43071
+ // When virtualized, the layout object will be passed in as a prop and override this.
43072
+ let collator = $325a3faab7a68acd$export$a16aca283550c30d({
43073
+ usage: 'search',
43074
+ sensitivity: 'base'
43075
+ });
43076
+ let delegate = useMemo(()=>keyboardDelegate || new $2a25aae57d74318e$export$a05409b8bb224a5a(collection, disabledKeys, ref, collator)
43077
+ , [
43078
+ keyboardDelegate,
43079
+ collection,
43080
+ disabledKeys,
43081
+ ref,
43082
+ collator
43083
+ ]);
43084
+ let { collectionProps: collectionProps } = $ae20dd8cbca75726$export$d6daf82dcd84e87c({
43085
+ ref: ref,
43086
+ selectionManager: selectionManager,
43087
+ keyboardDelegate: delegate,
43088
+ autoFocus: autoFocus,
43089
+ shouldFocusWrap: shouldFocusWrap,
43090
+ disallowEmptySelection: disallowEmptySelection,
43091
+ selectOnFocus: selectOnFocus,
43092
+ disallowTypeAhead: disallowTypeAhead,
43093
+ shouldUseVirtualFocus: shouldUseVirtualFocus,
43094
+ allowsTabNavigation: allowsTabNavigation,
43095
+ isVirtualized: isVirtualized,
43096
+ scrollRef: ref
43097
+ });
43098
+ return {
43099
+ listProps: collectionProps
43100
+ };
43101
+ }
43102
+
43103
+ const $b1f0cad8af73213b$export$3585ede4d035bf14 = new WeakMap();
43104
+ function $b1f0cad8af73213b$var$normalizeKey(key) {
43105
+ if (typeof key === 'string') return key.replace(/\s*/g, '');
43106
+ return '' + key;
43107
+ }
43108
+ function $b1f0cad8af73213b$export$9145995848b05025(state, itemKey) {
43109
+ let data = $b1f0cad8af73213b$export$3585ede4d035bf14.get(state);
43110
+ if (!data) throw new Error('Unknown list');
43111
+ return `${data.id}-option-${$b1f0cad8af73213b$var$normalizeKey(itemKey)}`;
43112
+ }
43113
+
43114
+
43115
+
43116
+
43117
+
43118
+
43119
+ function $c132121280ec012d$export$50eacbbf140a3141(props, state, ref) {
43120
+ let domProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, {
43121
+ labelable: true
43122
+ });
43123
+ let { listProps: listProps } = $982254629710d113$export$b95089534ab7c1fd({
43124
+ ...props,
43125
+ ref: ref,
43126
+ selectionManager: state.selectionManager,
43127
+ collection: state.collection,
43128
+ disabledKeys: state.disabledKeys
43129
+ });
43130
+ let { focusWithinProps: focusWithinProps } = $9ab94262bd0047c7$export$420e68273165f4ec({
43131
+ onFocusWithin: props.onFocus,
43132
+ onBlurWithin: props.onBlur,
43133
+ onFocusWithinChange: props.onFocusChange
43134
+ });
43135
+ // Share list id and some props with child options.
43136
+ let id = $bdb11010cef70236$export$f680877a34711e37(props.id);
43137
+ $b1f0cad8af73213b$export$3585ede4d035bf14.set(state, {
43138
+ id: id,
43139
+ shouldUseVirtualFocus: props.shouldUseVirtualFocus,
43140
+ shouldSelectOnPressUp: props.shouldSelectOnPressUp,
43141
+ shouldFocusOnHover: props.shouldFocusOnHover,
43142
+ isVirtualized: props.isVirtualized
43143
+ });
43144
+ let { labelProps: labelProps , fieldProps: fieldProps } = $d191a55c9702f145$export$8467354a121f1b9f({
43145
+ ...props,
43146
+ id: id,
43147
+ // listbox is not an HTML input element so it
43148
+ // shouldn't be labeled by a <label> element.
43149
+ labelElementType: 'span'
43150
+ });
43151
+ return {
43152
+ labelProps: labelProps,
43153
+ listBoxProps: $3ef42575df84b30b$export$9d1611c77c2fe928(domProps, focusWithinProps, state.selectionManager.selectionMode === 'multiple' ? {
43154
+ 'aria-multiselectable': 'true'
43155
+ } : {
43156
+ }, {
43157
+ role: 'listbox',
43158
+ ...$3ef42575df84b30b$export$9d1611c77c2fe928(fieldProps, listProps)
43159
+ })
43160
+ };
43161
+ }
43162
+
43163
+
43164
+
43165
+
43166
+
43167
+
43168
+
43169
+ function $293f70390ea03370$export$497855f14858aa34(props, state, ref) {
43170
+ let { key: key } = props;
43171
+ let data = $b1f0cad8af73213b$export$3585ede4d035bf14.get(state);
43172
+ var _isDisabled;
43173
+ let isDisabled = (_isDisabled = props.isDisabled) !== null && _isDisabled !== void 0 ? _isDisabled : state.disabledKeys.has(key);
43174
+ var _isSelected;
43175
+ let isSelected = (_isSelected = props.isSelected) !== null && _isSelected !== void 0 ? _isSelected : state.selectionManager.isSelected(key);
43176
+ let isFocused = state.selectionManager.focusedKey === key;
43177
+ var _shouldSelectOnPressUp;
43178
+ let shouldSelectOnPressUp = (_shouldSelectOnPressUp = props.shouldSelectOnPressUp) !== null && _shouldSelectOnPressUp !== void 0 ? _shouldSelectOnPressUp : data.shouldSelectOnPressUp;
43179
+ var _shouldFocusOnHover;
43180
+ let shouldFocusOnHover = (_shouldFocusOnHover = props.shouldFocusOnHover) !== null && _shouldFocusOnHover !== void 0 ? _shouldFocusOnHover : data.shouldFocusOnHover;
43181
+ var _shouldUseVirtualFocus;
43182
+ let shouldUseVirtualFocus = (_shouldUseVirtualFocus = props.shouldUseVirtualFocus) !== null && _shouldUseVirtualFocus !== void 0 ? _shouldUseVirtualFocus : data.shouldUseVirtualFocus;
43183
+ var _isVirtualized;
43184
+ let isVirtualized = (_isVirtualized = props.isVirtualized) !== null && _isVirtualized !== void 0 ? _isVirtualized : data.isVirtualized;
43185
+ let labelId = $bdb11010cef70236$export$b4cc09c592e8fdb8();
43186
+ let descriptionId = $bdb11010cef70236$export$b4cc09c592e8fdb8();
43187
+ let optionProps = {
43188
+ role: 'option',
43189
+ 'aria-disabled': isDisabled,
43190
+ 'aria-selected': state.selectionManager.selectionMode !== 'none' ? isSelected : undefined
43191
+ };
43192
+ // Safari with VoiceOver on macOS misreads options with aria-labelledby or aria-label as simply "text".
43193
+ // We should not map slots to the label and description on Safari and instead just have VoiceOver read the textContent.
43194
+ // https://bugs.webkit.org/show_bug.cgi?id=209279
43195
+ if (!($c87311424ea30a05$export$9ac100e40613ea10() && $c87311424ea30a05$export$78551043582a6a98())) {
43196
+ optionProps['aria-label'] = props['aria-label'];
43197
+ optionProps['aria-labelledby'] = labelId;
43198
+ optionProps['aria-describedby'] = descriptionId;
43199
+ }
43200
+ if (isVirtualized) {
43201
+ optionProps['aria-posinset'] = state.collection.getItem(key).index + 1;
43202
+ optionProps['aria-setsize'] = $453cc9f0df89c0a5$export$77d5aafae4e095b2(state.collection);
43203
+ }
43204
+ let { itemProps: itemProps , isPressed: isPressed } = $880e95eb8b93ba9a$export$ecf600387e221c37({
43205
+ selectionManager: state.selectionManager,
43206
+ key: key,
43207
+ ref: ref,
43208
+ shouldSelectOnPressUp: shouldSelectOnPressUp,
43209
+ allowsDifferentPressOrigin: shouldSelectOnPressUp,
43210
+ isVirtualized: isVirtualized,
43211
+ shouldUseVirtualFocus: shouldUseVirtualFocus,
43212
+ isDisabled: isDisabled
43213
+ });
43214
+ let { hoverProps: hoverProps } = $6179b936705e76d3$export$ae780daf29e6d456({
43215
+ isDisabled: isDisabled || !shouldFocusOnHover,
43216
+ onHoverStart () {
43217
+ if (!$507fabe10e71c6fb$export$b9b3dfddab17db27()) {
43218
+ state.selectionManager.setFocused(true);
43219
+ state.selectionManager.setFocusedKey(key);
43220
+ }
43221
+ }
43222
+ });
43223
+ return {
43224
+ optionProps: {
43225
+ ...optionProps,
43226
+ ...$3ef42575df84b30b$export$9d1611c77c2fe928(itemProps, hoverProps),
43227
+ id: $b1f0cad8af73213b$export$9145995848b05025(state, key)
43228
+ },
43229
+ labelProps: {
43230
+ id: labelId
43231
+ },
43232
+ descriptionProps: {
43233
+ id: descriptionId
43234
+ },
43235
+ isFocused: isFocused,
43236
+ isSelected: isSelected,
43237
+ isDisabled: isDisabled,
43238
+ isPressed: isPressed
43239
+ };
43240
+ }
43241
+
43242
+ function LuiListBoxItem({ node, state, renderer, }) {
43243
+ const ref = useRef(null);
43244
+ const { optionProps, isSelected, isDisabled } = $293f70390ea03370$export$497855f14858aa34({ key: node.key }, state, ref);
43245
+ const { isFocusVisible, focusProps } = $f7dceffc5ad7768b$export$4e328f61c538687f();
43246
+ return (React__default.createElement("li", { ref: ref, ...$3ef42575df84b30b$export$9d1611c77c2fe928(optionProps, focusProps), className: clsx('LuiListBoxItem', isSelected && 'LuiListBoxItem-selected', isDisabled && 'LuiListBoxItem-disabled') }, renderer
43247
+ ? renderer({ item: node.value, isDisabled, isSelected, isFocusVisible })
43248
+ : node.rendered));
43249
+ }
43250
+
43251
+ function DefaultItemRenderer({ item, }) {
43252
+ if (!item.hasOwnProperty('label')) {
43253
+ throw Error('Could not find `label` property on item, please provide a custom `itemRenderer`');
43254
+ }
43255
+ return React__default.createElement(React__default.Fragment, null, item.label);
43256
+ }
43257
+
43258
+ class $e40ea825a81a3709$export$52baac22726c72bf extends Set {
43259
+ constructor(keys, anchorKey, currentKey){
43260
+ super(keys);
43261
+ if (keys instanceof $e40ea825a81a3709$export$52baac22726c72bf) {
43262
+ this.anchorKey = anchorKey || keys.anchorKey;
43263
+ this.currentKey = currentKey || keys.currentKey;
43264
+ } else {
43265
+ this.anchorKey = anchorKey;
43266
+ this.currentKey = currentKey;
43267
+ }
43268
+ }
43269
+ }
43270
+
43271
+
43272
+
43273
+ function $7af3f5b51489e0b5$var$equalSets(setA, setB) {
43274
+ if (setA.size !== setB.size) return false;
43275
+ for (let item of setA){
43276
+ if (!setB.has(item)) return false;
43277
+ }
43278
+ return true;
43279
+ }
43280
+ function $7af3f5b51489e0b5$export$253fe78d46329472(props) {
43281
+ let { selectionMode: selectionMode = 'none' , disallowEmptySelection: disallowEmptySelection , allowDuplicateSelectionEvents: allowDuplicateSelectionEvents , selectionBehavior: selectionBehaviorProp = 'toggle' , disabledBehavior: disabledBehavior = 'all' } = props;
43282
+ // We want synchronous updates to `isFocused` and `focusedKey` after their setters are called.
43283
+ // But we also need to trigger a react re-render. So, we have both a ref (sync) and state (async).
43284
+ let isFocusedRef = useRef(false);
43285
+ let [, setFocused] = useState(false);
43286
+ let focusedKeyRef = useRef(null);
43287
+ let childFocusStrategyRef = useRef(null);
43288
+ let [, setFocusedKey] = useState(null);
43289
+ let selectedKeysProp = useMemo(()=>$7af3f5b51489e0b5$var$convertSelection(props.selectedKeys)
43290
+ , [
43291
+ props.selectedKeys
43292
+ ]);
43293
+ let defaultSelectedKeys = useMemo(()=>$7af3f5b51489e0b5$var$convertSelection(props.defaultSelectedKeys, new $e40ea825a81a3709$export$52baac22726c72bf())
43294
+ , [
43295
+ props.defaultSelectedKeys
43296
+ ]);
43297
+ let [selectedKeys, setSelectedKeys] = $458b0a5536c1a7cf$export$40bfa8c7b0832715(selectedKeysProp, defaultSelectedKeys, props.onSelectionChange);
43298
+ let disabledKeysProp = useMemo(()=>props.disabledKeys ? new Set(props.disabledKeys) : new Set()
43299
+ , [
43300
+ props.disabledKeys
43301
+ ]);
43302
+ let [selectionBehavior, setSelectionBehavior] = useState(selectionBehaviorProp);
43303
+ // If the selectionBehavior prop is set to replace, but the current state is toggle (e.g. due to long press
43304
+ // to enter selection mode on touch), and the selection becomes empty, reset the selection behavior.
43305
+ if (selectionBehaviorProp === 'replace' && selectionBehavior === 'toggle' && typeof selectedKeys === 'object' && selectedKeys.size === 0) setSelectionBehavior('replace');
43306
+ // If the selectionBehavior prop changes, update the state as well.
43307
+ let lastSelectionBehavior = useRef(selectionBehaviorProp);
43308
+ useEffect(()=>{
43309
+ if (selectionBehaviorProp !== lastSelectionBehavior.current) {
43310
+ setSelectionBehavior(selectionBehaviorProp);
43311
+ lastSelectionBehavior.current = selectionBehaviorProp;
43312
+ }
43313
+ }, [
43314
+ selectionBehaviorProp
43315
+ ]);
43316
+ return {
43317
+ selectionMode: selectionMode,
43318
+ disallowEmptySelection: disallowEmptySelection,
43319
+ selectionBehavior: selectionBehavior,
43320
+ setSelectionBehavior: setSelectionBehavior,
43321
+ get isFocused () {
43322
+ return isFocusedRef.current;
43323
+ },
43324
+ setFocused (f) {
43325
+ isFocusedRef.current = f;
43326
+ setFocused(f);
43327
+ },
43328
+ get focusedKey () {
43329
+ return focusedKeyRef.current;
43330
+ },
43331
+ get childFocusStrategy () {
43332
+ return childFocusStrategyRef.current;
43333
+ },
43334
+ setFocusedKey (k, childFocusStrategy = 'first') {
43335
+ focusedKeyRef.current = k;
43336
+ childFocusStrategyRef.current = childFocusStrategy;
43337
+ setFocusedKey(k);
43338
+ },
43339
+ selectedKeys: selectedKeys,
43340
+ setSelectedKeys (keys) {
43341
+ if (allowDuplicateSelectionEvents || !$7af3f5b51489e0b5$var$equalSets(keys, selectedKeys)) setSelectedKeys(keys);
43342
+ },
43343
+ disabledKeys: disabledKeysProp,
43344
+ disabledBehavior: disabledBehavior
43345
+ };
43346
+ }
43347
+ function $7af3f5b51489e0b5$var$convertSelection(selection, defaultValue) {
43348
+ if (!selection) return defaultValue;
43349
+ return selection === 'all' ? 'all' : new $e40ea825a81a3709$export$52baac22726c72bf(selection);
43350
+ }
43351
+
43352
+
43353
+
43354
+ class $d496c0a20b6e58ec$export$6c8a5aaad13c9852 {
43355
+ /**
43356
+ * The type of selection that is allowed in the collection.
43357
+ */ get selectionMode() {
43358
+ return this.state.selectionMode;
43359
+ }
43360
+ /**
43361
+ * Whether the collection allows empty selection.
43362
+ */ get disallowEmptySelection() {
43363
+ return this.state.disallowEmptySelection;
43364
+ }
43365
+ /**
43366
+ * The selection behavior for the collection.
43367
+ */ get selectionBehavior() {
43368
+ return this.state.selectionBehavior;
43369
+ }
43370
+ /**
43371
+ * Sets the selection behavior for the collection.
43372
+ */ setSelectionBehavior(selectionBehavior) {
43373
+ this.state.setSelectionBehavior(selectionBehavior);
43374
+ }
43375
+ /**
43376
+ * Whether the collection is currently focused.
43377
+ */ get isFocused() {
43378
+ return this.state.isFocused;
43379
+ }
43380
+ /**
43381
+ * Sets whether the collection is focused.
43382
+ */ setFocused(isFocused) {
43383
+ this.state.setFocused(isFocused);
43384
+ }
43385
+ /**
43386
+ * The current focused key in the collection.
43387
+ */ get focusedKey() {
43388
+ return this.state.focusedKey;
43389
+ }
43390
+ /** Whether the first or last child of the focused key should receive focus. */ get childFocusStrategy() {
43391
+ return this.state.childFocusStrategy;
43392
+ }
43393
+ /**
43394
+ * Sets the focused key.
43395
+ */ setFocusedKey(key, childFocusStrategy) {
43396
+ this.state.setFocusedKey(key, childFocusStrategy);
43397
+ }
43398
+ /**
43399
+ * The currently selected keys in the collection.
43400
+ */ get selectedKeys() {
43401
+ return this.state.selectedKeys === 'all' ? new Set(this.getSelectAllKeys()) : this.state.selectedKeys;
43402
+ }
43403
+ /**
43404
+ * The raw selection value for the collection.
43405
+ * Either 'all' for select all, or a set of keys.
43406
+ */ get rawSelection() {
43407
+ return this.state.selectedKeys;
43408
+ }
43409
+ /**
43410
+ * Returns whether a key is selected.
43411
+ */ isSelected(key) {
43412
+ if (this.state.selectionMode === 'none') return false;
43413
+ key = this.getKey(key);
43414
+ return this.state.selectedKeys === 'all' ? this.canSelectItem(key) : this.state.selectedKeys.has(key);
43415
+ }
43416
+ /**
43417
+ * Whether the selection is empty.
43418
+ */ get isEmpty() {
43419
+ return this.state.selectedKeys !== 'all' && this.state.selectedKeys.size === 0;
43420
+ }
43421
+ /**
43422
+ * Whether all items in the collection are selected.
43423
+ */ get isSelectAll() {
43424
+ if (this.isEmpty) return false;
43425
+ if (this.state.selectedKeys === 'all') return true;
43426
+ if (this._isSelectAll != null) return this._isSelectAll;
43427
+ let allKeys = this.getSelectAllKeys();
43428
+ let selectedKeys = this.state.selectedKeys;
43429
+ this._isSelectAll = allKeys.every((k)=>selectedKeys.has(k)
43430
+ );
43431
+ return this._isSelectAll;
43432
+ }
43433
+ get firstSelectedKey() {
43434
+ let first = null;
43435
+ for (let key of this.state.selectedKeys){
43436
+ let item = this.collection.getItem(key);
43437
+ if (!first || (item === null || item === void 0 ? void 0 : item.index) < first.index) first = item;
43438
+ }
43439
+ return first === null || first === void 0 ? void 0 : first.key;
43440
+ }
43441
+ get lastSelectedKey() {
43442
+ let last = null;
43443
+ for (let key of this.state.selectedKeys){
43444
+ let item = this.collection.getItem(key);
43445
+ if (!last || (item === null || item === void 0 ? void 0 : item.index) > last.index) last = item;
43446
+ }
43447
+ return last === null || last === void 0 ? void 0 : last.key;
43448
+ }
43449
+ get disabledKeys() {
43450
+ return this.state.disabledKeys;
43451
+ }
43452
+ get disabledBehavior() {
43453
+ return this.state.disabledBehavior;
43454
+ }
43455
+ /**
43456
+ * Extends the selection to the given key.
43457
+ */ extendSelection(toKey) {
43458
+ if (this.selectionMode === 'none') return;
43459
+ if (this.selectionMode === 'single') {
43460
+ this.replaceSelection(toKey);
43461
+ return;
43462
+ }
43463
+ toKey = this.getKey(toKey);
43464
+ let selection;
43465
+ // Only select the one key if coming from a select all.
43466
+ if (this.state.selectedKeys === 'all') selection = new $e40ea825a81a3709$export$52baac22726c72bf([
43467
+ toKey
43468
+ ], toKey, toKey);
43469
+ else {
43470
+ let selectedKeys = this.state.selectedKeys;
43471
+ let anchorKey = selectedKeys.anchorKey || toKey;
43472
+ selection = new $e40ea825a81a3709$export$52baac22726c72bf(selectedKeys, anchorKey, toKey);
43473
+ for (let key of this.getKeyRange(anchorKey, selectedKeys.currentKey || toKey))selection.delete(key);
43474
+ for (let key1 of this.getKeyRange(toKey, anchorKey))if (this.canSelectItem(key1)) selection.add(key1);
43475
+ }
43476
+ this.state.setSelectedKeys(selection);
43477
+ }
43478
+ getKeyRange(from, to) {
43479
+ let fromItem = this.collection.getItem(from);
43480
+ let toItem = this.collection.getItem(to);
43481
+ if (fromItem && toItem) {
43482
+ if (fromItem.index <= toItem.index) return this.getKeyRangeInternal(from, to);
43483
+ return this.getKeyRangeInternal(to, from);
43484
+ }
43485
+ return [];
43486
+ }
43487
+ getKeyRangeInternal(from, to) {
43488
+ let keys = [];
43489
+ let key = from;
43490
+ while(key){
43491
+ let item = this.collection.getItem(key);
43492
+ if (item && item.type === 'item' || item.type === 'cell' && this.allowsCellSelection) keys.push(key);
43493
+ if (key === to) return keys;
43494
+ key = this.collection.getKeyAfter(key);
43495
+ }
43496
+ return [];
43497
+ }
43498
+ getKey(key) {
43499
+ let item = this.collection.getItem(key);
43500
+ if (!item) // ¯\_(ツ)_/¯
43501
+ return key;
43502
+ // If cell selection is allowed, just return the key.
43503
+ if (item.type === 'cell' && this.allowsCellSelection) return key;
43504
+ // Find a parent item to select
43505
+ while(item.type !== 'item' && item.parentKey != null)item = this.collection.getItem(item.parentKey);
43506
+ if (!item || item.type !== 'item') return null;
43507
+ return item.key;
43508
+ }
43509
+ /**
43510
+ * Toggles whether the given key is selected.
43511
+ */ toggleSelection(key) {
43512
+ if (this.selectionMode === 'none') return;
43513
+ if (this.selectionMode === 'single' && !this.isSelected(key)) {
43514
+ this.replaceSelection(key);
43515
+ return;
43516
+ }
43517
+ key = this.getKey(key);
43518
+ if (key == null) return;
43519
+ let keys = new $e40ea825a81a3709$export$52baac22726c72bf(this.state.selectedKeys === 'all' ? this.getSelectAllKeys() : this.state.selectedKeys);
43520
+ if (keys.has(key)) keys.delete(key);
43521
+ else if (this.canSelectItem(key)) {
43522
+ keys.add(key);
43523
+ keys.anchorKey = key;
43524
+ keys.currentKey = key;
43525
+ }
43526
+ if (this.disallowEmptySelection && keys.size === 0) return;
43527
+ this.state.setSelectedKeys(keys);
43528
+ }
43529
+ /**
43530
+ * Replaces the selection with only the given key.
43531
+ */ replaceSelection(key) {
43532
+ if (this.selectionMode === 'none') return;
43533
+ key = this.getKey(key);
43534
+ if (key == null) return;
43535
+ let selection = this.canSelectItem(key) ? new $e40ea825a81a3709$export$52baac22726c72bf([
43536
+ key
43537
+ ], key, key) : new $e40ea825a81a3709$export$52baac22726c72bf();
43538
+ this.state.setSelectedKeys(selection);
43539
+ }
43540
+ /**
43541
+ * Replaces the selection with the given keys.
43542
+ */ setSelectedKeys(keys) {
43543
+ if (this.selectionMode === 'none') return;
43544
+ let selection = new $e40ea825a81a3709$export$52baac22726c72bf();
43545
+ for (let key of keys){
43546
+ key = this.getKey(key);
43547
+ if (key != null) {
43548
+ selection.add(key);
43549
+ if (this.selectionMode === 'single') break;
43550
+ }
43551
+ }
43552
+ this.state.setSelectedKeys(selection);
43553
+ }
43554
+ getSelectAllKeys() {
43555
+ let keys = [];
43556
+ let addKeys = (key)=>{
43557
+ while(key){
43558
+ if (this.canSelectItem(key)) {
43559
+ let item = this.collection.getItem(key);
43560
+ if (item.type === 'item') keys.push(key);
43561
+ // Add child keys. If cell selection is allowed, then include item children too.
43562
+ if (item.hasChildNodes && (this.allowsCellSelection || item.type !== 'item')) addKeys([
43563
+ ...item.childNodes
43564
+ ][0].key);
43565
+ }
43566
+ key = this.collection.getKeyAfter(key);
43567
+ }
43568
+ };
43569
+ addKeys(this.collection.getFirstKey());
43570
+ return keys;
43571
+ }
43572
+ /**
43573
+ * Selects all items in the collection.
43574
+ */ selectAll() {
43575
+ if (this.selectionMode === 'multiple') this.state.setSelectedKeys('all');
43576
+ }
43577
+ /**
43578
+ * Removes all keys from the selection.
43579
+ */ clearSelection() {
43580
+ if (!this.disallowEmptySelection && (this.state.selectedKeys === 'all' || this.state.selectedKeys.size > 0)) this.state.setSelectedKeys(new $e40ea825a81a3709$export$52baac22726c72bf());
43581
+ }
43582
+ /**
43583
+ * Toggles between select all and an empty selection.
43584
+ */ toggleSelectAll() {
43585
+ if (this.isSelectAll) this.clearSelection();
43586
+ else this.selectAll();
43587
+ }
43588
+ select(key, e) {
43589
+ if (this.selectionMode === 'none') return;
43590
+ if (this.selectionMode === 'single') {
43591
+ if (this.isSelected(key) && !this.disallowEmptySelection) this.toggleSelection(key);
43592
+ else this.replaceSelection(key);
43593
+ } else if (this.selectionBehavior === 'toggle' || e && (e.pointerType === 'touch' || e.pointerType === 'virtual')) // if touch or virtual (VO) then we just want to toggle, otherwise it's impossible to multi select because they don't have modifier keys
43594
+ this.toggleSelection(key);
43595
+ else this.replaceSelection(key);
43596
+ }
43597
+ /**
43598
+ * Returns whether the current selection is equal to the given selection.
43599
+ */ isSelectionEqual(selection) {
43600
+ if (selection === this.state.selectedKeys) return true;
43601
+ // Check if the set of keys match.
43602
+ let selectedKeys = this.selectedKeys;
43603
+ if (selection.size !== selectedKeys.size) return false;
43604
+ for (let key of selection){
43605
+ if (!selectedKeys.has(key)) return false;
43606
+ }
43607
+ for (let key2 of selectedKeys){
43608
+ if (!selection.has(key2)) return false;
43609
+ }
43610
+ return true;
43611
+ }
43612
+ canSelectItem(key) {
43613
+ if (this.state.selectionMode === 'none' || this.state.disabledKeys.has(key)) return false;
43614
+ let item = this.collection.getItem(key);
43615
+ if (!item || item.type === 'cell' && !this.allowsCellSelection) return false;
43616
+ return true;
43617
+ }
43618
+ isDisabled(key) {
43619
+ return this.state.disabledKeys.has(key) && this.state.disabledBehavior === 'all';
43620
+ }
43621
+ constructor(collection, state, options){
43622
+ this.collection = collection;
43623
+ this.state = state;
43624
+ var ref;
43625
+ this.allowsCellSelection = (ref = options === null || options === void 0 ? void 0 : options.allowsCellSelection) !== null && ref !== void 0 ? ref : false;
43626
+ this._isSelectAll = null;
43627
+ }
43628
+ }
43629
+
43630
+ var tmp = Symbol.iterator;
43631
+ class $a02d57049d202695$export$d085fb9e920b5ca7 {
43632
+ *[tmp]() {
43633
+ yield* this.iterable;
43634
+ }
43635
+ get size() {
43636
+ return this.keyMap.size;
43637
+ }
43638
+ getKeys() {
43639
+ return this.keyMap.keys();
43640
+ }
43641
+ getKeyBefore(key) {
43642
+ let node = this.keyMap.get(key);
43643
+ return node ? node.prevKey : null;
43644
+ }
43645
+ getKeyAfter(key) {
43646
+ let node = this.keyMap.get(key);
43647
+ return node ? node.nextKey : null;
43648
+ }
43649
+ getFirstKey() {
43650
+ return this.firstKey;
43651
+ }
43652
+ getLastKey() {
43653
+ return this.lastKey;
43654
+ }
43655
+ getItem(key) {
43656
+ return this.keyMap.get(key);
43657
+ }
43658
+ at(idx) {
43659
+ const keys = [
43660
+ ...this.getKeys()
43661
+ ];
43662
+ return this.getItem(keys[idx]);
43663
+ }
43664
+ constructor(nodes){
43665
+ this.keyMap = new Map();
43666
+ this.iterable = nodes;
43667
+ let visit = (node)=>{
43668
+ this.keyMap.set(node.key, node);
43669
+ if (node.childNodes && node.type === 'section') for (let child of node.childNodes)visit(child);
43670
+ };
43671
+ for (let node2 of nodes)visit(node2);
43672
+ let last;
43673
+ let index = 0;
43674
+ for (let [key, node1] of this.keyMap){
43675
+ if (last) {
43676
+ last.nextKey = key;
43677
+ node1.prevKey = last.key;
43678
+ } else {
43679
+ this.firstKey = key;
43680
+ node1.prevKey = undefined;
43681
+ }
43682
+ if (node1.type === 'item') node1.index = index++;
43683
+ last = node1;
43684
+ // Set nextKey as undefined since this might be the last node
43685
+ // If it isn't the last node, last.nextKey will properly set at start of new loop
43686
+ last.nextKey = undefined;
43687
+ }
43688
+ this.lastKey = last === null || last === void 0 ? void 0 : last.key;
43689
+ }
43690
+ }
43691
+
43692
+
43693
+
43694
+
43695
+ function $e72dd72e1c76a225$export$2f645645f7bca764(props) {
43696
+ let { filter: filter } = props;
43697
+ let selectionState = $7af3f5b51489e0b5$export$253fe78d46329472(props);
43698
+ let disabledKeys = useMemo(()=>props.disabledKeys ? new Set(props.disabledKeys) : new Set()
43699
+ , [
43700
+ props.disabledKeys
43701
+ ]);
43702
+ let factory = (nodes)=>filter ? new $a02d57049d202695$export$d085fb9e920b5ca7(filter(nodes)) : new $a02d57049d202695$export$d085fb9e920b5ca7(nodes)
43703
+ ;
43704
+ let context = useMemo(()=>({
43705
+ suppressTextValueWarning: props.suppressTextValueWarning
43706
+ })
43707
+ , [
43708
+ props.suppressTextValueWarning
43709
+ ]);
43710
+ let collection = $7613b1592d41b092$export$6cd28814d92fa9c9(props, factory, context, [
43711
+ filter
43712
+ ]);
43713
+ // Reset focused key if that item is deleted from the collection.
43714
+ useEffect(()=>{
43715
+ if (selectionState.focusedKey != null && !collection.getItem(selectionState.focusedKey)) selectionState.setFocusedKey(null);
43716
+ }, [
43717
+ collection,
43718
+ selectionState.focusedKey
43719
+ ]);
43720
+ return {
43721
+ collection: collection,
43722
+ disabledKeys: disabledKeys,
43723
+ selectionManager: new $d496c0a20b6e58ec$export$6c8a5aaad13c9852(collection, selectionState)
43724
+ };
43725
+ }
43726
+
43727
+ function LuiListBox({ ariaLabel, ariaLabelledBy, itemRenderer = DefaultItemRenderer, loadingIndicator = DefaultLoadingIndicator, emptyIndicator = DefaultEmptyIndicator, selectionMode = 'single', selectionBehavior = 'toggle', disabled = false, items, value, onChange = () => {
43728
+ /* noop */
43729
+ }, getKey, ariaProps, className, ...ulProps }) {
43730
+ const listProps = useMemo(() => mapToAriaListBoxProps({
43731
+ selectionMode,
43732
+ selectionBehavior,
43733
+ items,
43734
+ value,
43735
+ onChange,
43736
+ getKey,
43737
+ ariaProps,
43738
+ disabled,
43739
+ }), [
43740
+ selectionMode,
43741
+ selectionBehavior,
43742
+ items,
43743
+ value,
43744
+ onChange,
43745
+ getKey,
43746
+ ariaProps,
43747
+ ]);
43748
+ const ariaListBoxProps = useMemo(() => ({
43749
+ 'aria-label': ariaLabel,
43750
+ 'aria-labelledby': ariaLabelledBy,
43751
+ ...listProps,
43752
+ }), [listProps, ariaLabel, ariaLabelledBy]);
43753
+ const ref = useRef(null);
43754
+ const state = $e72dd72e1c76a225$export$2f645645f7bca764(listProps);
43755
+ const { listBoxProps } = $c132121280ec012d$export$50eacbbf140a3141(ariaListBoxProps, state, ref);
43756
+ return (React__default.createElement("ul", { ...ulProps, ...listBoxProps, ref: ref, className: clsx('LuiListBox', className) },
43757
+ !items && loadingIndicator(),
43758
+ items?.length === 0 && emptyIndicator(),
43759
+ [...state.collection].map((node) => (React__default.createElement(LuiListBoxItem, { key: node.key, node: node, state: state, renderer: itemRenderer })))));
43760
+ }
43761
+ function DefaultLoadingIndicator() {
43762
+ return (React__default.createElement(React__default.Fragment, null,
43763
+ React__default.createElement("li", { className: "LuiListBox-loadingIndicator" },
43764
+ React__default.createElement(Skeleton, null)),
43765
+ React__default.createElement("li", { className: "LuiListBox-loadingIndicator" },
43766
+ React__default.createElement(Skeleton, null)),
43767
+ React__default.createElement("li", { className: "LuiListBox-loadingIndicator" },
43768
+ React__default.createElement(Skeleton, null))));
43769
+ }
43770
+ function DefaultEmptyIndicator() {
43771
+ return React__default.createElement("li", { className: "LuiListBox-emptyIndicator" }, "Nothing to Display");
43772
+ }
43773
+
43774
+ var css_248z$1 = "/**\n @deprecated\n */\n/**\n @deprecated\n */\n/**\n @deprecated\n */\n.RadioItemRenderer {\n display: flex;\n align-items: center;\n position: relative;\n padding: 0 0 0 2rem;\n}\n.RadioItemRenderer::before {\n content: \"\";\n height: 1.5rem;\n min-width: 1.5rem;\n width: 1.5rem;\n border: 2px solid #007198;\n border-radius: 50%;\n background-color: transparent;\n position: absolute;\n left: 0;\n top: 0;\n margin-right: 0.75rem;\n}\n.RadioItemRenderer:after {\n content: \"\";\n position: absolute;\n left: 5px;\n top: 5px;\n background-color: #007198;\n height: 14px;\n min-width: 14px;\n width: 14px;\n border-radius: 50%;\n opacity: 0;\n transition: opacity 0.3s ease-in-out;\n}\n.RadioItemRenderer-isSelected:after {\n opacity: 1;\n}";
43775
+ styleInject(css_248z$1);
43776
+
43777
+ function RadioItemRenderer({ item, isSelected, }) {
43778
+ return (React__default.createElement("div", { className: `RadioItemRenderer ${isSelected ? 'RadioItemRenderer-isSelected' : ''}` }, item.label));
43779
+ }
43780
+
43781
+ var css_248z = ".CheckboxRenderer {\n display: flex;\n align-items: center;\n}";
43782
+ styleInject(css_248z);
43783
+
43784
+ function CheckboxItemRenderer({ item, isSelected, }) {
43785
+ return (React__default.createElement("div", { className: `CheckboxRenderer ${isSelected ? 'LuiCheckboxInput--isChecked' : ''}`, style: {} },
43786
+ React__default.createElement(LuiIcon, { size: "md", name: isSelected ? 'ic_check' : 'ic_zoom_out', alt: isSelected ? 'Checked' : 'Indeterminate Check', className: `LuiCheckboxInput-labelCheck ${isSelected ? 'LuiCheckboxInput--isChecked' : ''}` }),
43787
+ item.label));
43788
+ }
43789
+
43790
+ export { CheckboxItemRenderer, FIRM_KEY, FIRM_NAME_KEY, GLOBAL_CLIENT_REFERENCE_KEY, LOLActiveFirmMessage, LOLAuthorisedLink, LOLCommonDrawerMenu, LOLCommonDrawerMenuAfterLinks, LOLDrawerMenu, LOLFirmSwitcherMenu, LOLGlobalClientRefContext, LOLGlobalClientRefContextProvider, LOLLogoutLink, LOLSearchBox, LOLUserContext, LOLUserContextProvider, LOLUserLastLogin, LuiAccordicard, LuiAccordicardStatic, LuiAlertModal, LuiAlertModalButtons, LuiBadge, LuiBanner, LuiBannerContent, LuiBearingFormikInput, LuiBearingInput, LuiButton, LuiButtonGroup, LuiCheckboxInput, LuiCloseableHeaderMenuContext, LuiCloseableHeaderMenuItem, LuiComboSelect, LuiControlledMenu, LuiDrawerMenu, LuiDrawerMenuDivider, LuiDrawerMenuOption, LuiDrawerMenuOptions, LuiDrawerMenuSection, LuiDropdownMenu, LuiErrorPage, LuiExpandableBanner, LuiFileInputBox, LuiFilterContainer, LuiFilterMenu, LuiFooter, LuiFormSectionHeader, LuiFormikCheckbox, LuiFormikForm, LuiFormikFormLabel, LuiFormikFormSubmitButton, LuiFormikRadioButton, LuiFormikRadioGroup, LuiFormikSelect, LuiFormikTextInput, LuiHeader, LuiHeaderMenuItem, LuiIcon, LuiListBox, LuiLoadingSpinner, LuiLoadingSpinnerChristmas, LuiLoadingSpinnerEaster, LuiMenu, LuiMenuCloseButton, LuiMessagingContextProvider, LuiMiniSpinner, LuiModal, LuiRadioInput, LuiSearchBox, LuiSearchInput, LuiSelectDataMenu, LuiSelectInput, LuiSelectMenu, LuiSelectMenuItem, LuiSelectSubMenuItem, LuiShadow, LuiSidePanel, LuiSidePanelProvider, LuiStaticMessage, LuiStatusSpinner, LuiSwitchButton, LuiTab, LuiTabs, LuiTabsContext, LuiTabsGroup, LuiTabsPanel, LuiTabsPanelSwitch, LuiTextAreaInput, LuiTextInput, LuiToastMessage, LuiTooltip, LuiUpdatesSplashModal, RadioItemRenderer, getDefaultSearchMenuOptions, isChromatic, useClickedOutsideElement, useLOLGlobalClientRefContext, useLOLUserContext, useShowLUIMessage };
40368
43791
  //# sourceMappingURL=lui.esm.js.map