From d34b2cf104427c4d14bc9fe8268848a0ee970d31 Mon Sep 17 00:00:00 2001 From: Mark Ross Date: Mon, 20 Jan 2025 17:47:14 +0000 Subject: [PATCH] models table and buttons --- .../@cloudscape-design_collection-hooks.js | 9 + ...@cloudscape-design_collection-hooks.js.map | 7 + .../deps/@cloudscape-design_components.js | 28076 ++++++++++++++++ .../deps/@cloudscape-design_components.js.map | 7 + .../deps/@cloudscape-design_components_box.js | 12 + .../@cloudscape-design_components_box.js.map | 7 + .../@cloudscape-design_components_button.js | 16 + ...cloudscape-design_components_button.js.map | 7 + ...esign_components_collection-preferences.js | 28 + ...n_components_collection-preferences.js.map | 7 + ...loudscape-design_components_file-upload.js | 25 + ...scape-design_components_file-upload.js.map | 7 + ...cloudscape-design_components_form-field.js | 19 + ...dscape-design_components_form-field.js.map | 7 + .../@cloudscape-design_components_header.js | 15 + ...cloudscape-design_components_header.js.map | 7 + ...cloudscape-design_components_pagination.js | 14 + ...dscape-design_components_pagination.js.map | 7 + ...udscape-design_components_space-between.js | 13 + ...ape-design_components_space-between.js.map | 7 + .../@cloudscape-design_components_table.js | 26 + ...@cloudscape-design_components_table.js.map | 7 + ...loudscape-design_components_text-filter.js | 19 + ...scape-design_components_text-filter.js.map | 7 + .../deps/@cloudscape-design_global-styles.js | 59 + .../@cloudscape-design_global-styles.js.map | 7 + new/node_modules/.vite/deps/_metadata.json | 232 + new/node_modules/.vite/deps/axios.js | 2519 ++ new/node_modules/.vite/deps/axios.js.map | 7 + new/node_modules/.vite/deps/chunk-2CDOTOCN.js | 33 + .../.vite/deps/chunk-2CDOTOCN.js.map | 7 + new/node_modules/.vite/deps/chunk-2STP5MNB.js | 364 + .../.vite/deps/chunk-2STP5MNB.js.map | 7 + new/node_modules/.vite/deps/chunk-3NFHZQPK.js | 1237 + .../.vite/deps/chunk-3NFHZQPK.js.map | 7 + new/node_modules/.vite/deps/chunk-42BEG66H.js | 42 + .../.vite/deps/chunk-42BEG66H.js.map | 7 + new/node_modules/.vite/deps/chunk-4F2L5DKU.js | 30 + .../.vite/deps/chunk-4F2L5DKU.js.map | 7 + new/node_modules/.vite/deps/chunk-53RIJVDW.js | 30 + .../.vite/deps/chunk-53RIJVDW.js.map | 7 + new/node_modules/.vite/deps/chunk-6KI6MNLX.js | 5452 +++ .../.vite/deps/chunk-6KI6MNLX.js.map | 7 + new/node_modules/.vite/deps/chunk-7I72EAPF.js | 385 + .../.vite/deps/chunk-7I72EAPF.js.map | 7 + new/node_modules/.vite/deps/chunk-7ZAPJIOA.js | 38 + .../.vite/deps/chunk-7ZAPJIOA.js.map | 7 + new/node_modules/.vite/deps/chunk-ATFH3LQM.js | 311 + .../.vite/deps/chunk-ATFH3LQM.js.map | 7 + new/node_modules/.vite/deps/chunk-EKTGMWG5.js | 4219 +++ .../.vite/deps/chunk-EKTGMWG5.js.map | 7 + new/node_modules/.vite/deps/chunk-F4YVK7EK.js | 245 + .../.vite/deps/chunk-F4YVK7EK.js.map | 7 + new/node_modules/.vite/deps/chunk-G3PMV62Z.js | 36 + .../.vite/deps/chunk-G3PMV62Z.js.map | 7 + new/node_modules/.vite/deps/chunk-HKXRFMQU.js | 21585 ++++++++++++ .../.vite/deps/chunk-HKXRFMQU.js.map | 7 + new/node_modules/.vite/deps/chunk-I2FJYNPN.js | 3828 +++ .../.vite/deps/chunk-I2FJYNPN.js.map | 7 + new/node_modules/.vite/deps/chunk-IE27NT7Q.js | 224 + .../.vite/deps/chunk-IE27NT7Q.js.map | 7 + new/node_modules/.vite/deps/chunk-MKRUABPM.js | 206 + .../.vite/deps/chunk-MKRUABPM.js.map | 7 + new/node_modules/.vite/deps/chunk-MRK32EYN.js | 481 + .../.vite/deps/chunk-MRK32EYN.js.map | 7 + new/node_modules/.vite/deps/chunk-OD24TJP5.js | 41 + .../.vite/deps/chunk-OD24TJP5.js.map | 7 + new/node_modules/.vite/deps/chunk-ODZSV7SK.js | 28 + .../.vite/deps/chunk-ODZSV7SK.js.map | 7 + new/node_modules/.vite/deps/chunk-OWJLRPM7.js | 250 + .../.vite/deps/chunk-OWJLRPM7.js.map | 7 + new/node_modules/.vite/deps/chunk-PM64MP4D.js | 62 + .../.vite/deps/chunk-PM64MP4D.js.map | 7 + new/node_modules/.vite/deps/chunk-QCYBYQ2L.js | 29 + .../.vite/deps/chunk-QCYBYQ2L.js.map | 7 + new/node_modules/.vite/deps/chunk-QVWK6MQK.js | 4327 +++ .../.vite/deps/chunk-QVWK6MQK.js.map | 7 + new/node_modules/.vite/deps/chunk-SHTTXLUR.js | 18 + .../.vite/deps/chunk-SHTTXLUR.js.map | 7 + new/node_modules/.vite/deps/chunk-T3BYYNEM.js | 67 + .../.vite/deps/chunk-T3BYYNEM.js.map | 7 + new/node_modules/.vite/deps/chunk-TVECJW2U.js | 317 + .../.vite/deps/chunk-TVECJW2U.js.map | 7 + new/node_modules/.vite/deps/chunk-U74SLQDB.js | 426 + .../.vite/deps/chunk-U74SLQDB.js.map | 7 + new/node_modules/.vite/deps/chunk-WHMHD7EJ.js | 1905 ++ .../.vite/deps/chunk-WHMHD7EJ.js.map | 7 + new/node_modules/.vite/deps/chunk-XK7AHEC7.js | 166 + .../.vite/deps/chunk-XK7AHEC7.js.map | 7 + new/node_modules/.vite/deps/chunk-XTPUGG63.js | 53 + .../.vite/deps/chunk-XTPUGG63.js.map | 7 + new/node_modules/.vite/deps/chunk-XYTAOB5V.js | 41 + .../.vite/deps/chunk-XYTAOB5V.js.map | 7 + new/node_modules/.vite/deps/chunk-YL662TD3.js | 259 + .../.vite/deps/chunk-YL662TD3.js.map | 7 + new/node_modules/.vite/deps/chunk-ZZKH6ZWQ.js | 85 + .../.vite/deps/chunk-ZZKH6ZWQ.js.map | 7 + new/node_modules/.vite/deps/package.json | 3 + .../.vite/deps/react-dom_client.js | 39 + .../.vite/deps/react-dom_client.js.map | 7 + .../.vite/deps/react-router-dom.js | 1302 + .../.vite/deps/react-router-dom.js.map | 7 + new/node_modules/.vite/deps/react-router.js | 114 + .../.vite/deps/react-router.js.map | 7 + new/node_modules/.vite/deps/react.js | 6 + new/node_modules/.vite/deps/react.js.map | 7 + .../.vite/deps/react_jsx-dev-runtime.js | 898 + .../.vite/deps/react_jsx-dev-runtime.js.map | 7 + .../.vite/deps/react_jsx-runtime.js | 910 + .../.vite/deps/react_jsx-runtime.js.map | 7 + new/src/common/constants.ts | 2 + new/src/pages/models.tsx | 131 +- 112 files changed, 81675 insertions(+), 10 deletions(-) create mode 100644 new/node_modules/.vite/deps/@cloudscape-design_collection-hooks.js create mode 100644 new/node_modules/.vite/deps/@cloudscape-design_collection-hooks.js.map create mode 100644 new/node_modules/.vite/deps/@cloudscape-design_components.js create mode 100644 new/node_modules/.vite/deps/@cloudscape-design_components.js.map create mode 100644 new/node_modules/.vite/deps/@cloudscape-design_components_box.js create mode 100644 new/node_modules/.vite/deps/@cloudscape-design_components_box.js.map create mode 100644 new/node_modules/.vite/deps/@cloudscape-design_components_button.js create mode 100644 new/node_modules/.vite/deps/@cloudscape-design_components_button.js.map create mode 100644 new/node_modules/.vite/deps/@cloudscape-design_components_collection-preferences.js create mode 100644 new/node_modules/.vite/deps/@cloudscape-design_components_collection-preferences.js.map create mode 100644 new/node_modules/.vite/deps/@cloudscape-design_components_file-upload.js create mode 100644 new/node_modules/.vite/deps/@cloudscape-design_components_file-upload.js.map create mode 100644 new/node_modules/.vite/deps/@cloudscape-design_components_form-field.js create mode 100644 new/node_modules/.vite/deps/@cloudscape-design_components_form-field.js.map create mode 100644 new/node_modules/.vite/deps/@cloudscape-design_components_header.js create mode 100644 new/node_modules/.vite/deps/@cloudscape-design_components_header.js.map create mode 100644 new/node_modules/.vite/deps/@cloudscape-design_components_pagination.js create mode 100644 new/node_modules/.vite/deps/@cloudscape-design_components_pagination.js.map create mode 100644 new/node_modules/.vite/deps/@cloudscape-design_components_space-between.js create mode 100644 new/node_modules/.vite/deps/@cloudscape-design_components_space-between.js.map create mode 100644 new/node_modules/.vite/deps/@cloudscape-design_components_table.js create mode 100644 new/node_modules/.vite/deps/@cloudscape-design_components_table.js.map create mode 100644 new/node_modules/.vite/deps/@cloudscape-design_components_text-filter.js create mode 100644 new/node_modules/.vite/deps/@cloudscape-design_components_text-filter.js.map create mode 100644 new/node_modules/.vite/deps/@cloudscape-design_global-styles.js create mode 100644 new/node_modules/.vite/deps/@cloudscape-design_global-styles.js.map create mode 100644 new/node_modules/.vite/deps/_metadata.json create mode 100644 new/node_modules/.vite/deps/axios.js create mode 100644 new/node_modules/.vite/deps/axios.js.map create mode 100644 new/node_modules/.vite/deps/chunk-2CDOTOCN.js create mode 100644 new/node_modules/.vite/deps/chunk-2CDOTOCN.js.map create mode 100644 new/node_modules/.vite/deps/chunk-2STP5MNB.js create mode 100644 new/node_modules/.vite/deps/chunk-2STP5MNB.js.map create mode 100644 new/node_modules/.vite/deps/chunk-3NFHZQPK.js create mode 100644 new/node_modules/.vite/deps/chunk-3NFHZQPK.js.map create mode 100644 new/node_modules/.vite/deps/chunk-42BEG66H.js create mode 100644 new/node_modules/.vite/deps/chunk-42BEG66H.js.map create mode 100644 new/node_modules/.vite/deps/chunk-4F2L5DKU.js create mode 100644 new/node_modules/.vite/deps/chunk-4F2L5DKU.js.map create mode 100644 new/node_modules/.vite/deps/chunk-53RIJVDW.js create mode 100644 new/node_modules/.vite/deps/chunk-53RIJVDW.js.map create mode 100644 new/node_modules/.vite/deps/chunk-6KI6MNLX.js create mode 100644 new/node_modules/.vite/deps/chunk-6KI6MNLX.js.map create mode 100644 new/node_modules/.vite/deps/chunk-7I72EAPF.js create mode 100644 new/node_modules/.vite/deps/chunk-7I72EAPF.js.map create mode 100644 new/node_modules/.vite/deps/chunk-7ZAPJIOA.js create mode 100644 new/node_modules/.vite/deps/chunk-7ZAPJIOA.js.map create mode 100644 new/node_modules/.vite/deps/chunk-ATFH3LQM.js create mode 100644 new/node_modules/.vite/deps/chunk-ATFH3LQM.js.map create mode 100644 new/node_modules/.vite/deps/chunk-EKTGMWG5.js create mode 100644 new/node_modules/.vite/deps/chunk-EKTGMWG5.js.map create mode 100644 new/node_modules/.vite/deps/chunk-F4YVK7EK.js create mode 100644 new/node_modules/.vite/deps/chunk-F4YVK7EK.js.map create mode 100644 new/node_modules/.vite/deps/chunk-G3PMV62Z.js create mode 100644 new/node_modules/.vite/deps/chunk-G3PMV62Z.js.map create mode 100644 new/node_modules/.vite/deps/chunk-HKXRFMQU.js create mode 100644 new/node_modules/.vite/deps/chunk-HKXRFMQU.js.map create mode 100644 new/node_modules/.vite/deps/chunk-I2FJYNPN.js create mode 100644 new/node_modules/.vite/deps/chunk-I2FJYNPN.js.map create mode 100644 new/node_modules/.vite/deps/chunk-IE27NT7Q.js create mode 100644 new/node_modules/.vite/deps/chunk-IE27NT7Q.js.map create mode 100644 new/node_modules/.vite/deps/chunk-MKRUABPM.js create mode 100644 new/node_modules/.vite/deps/chunk-MKRUABPM.js.map create mode 100644 new/node_modules/.vite/deps/chunk-MRK32EYN.js create mode 100644 new/node_modules/.vite/deps/chunk-MRK32EYN.js.map create mode 100644 new/node_modules/.vite/deps/chunk-OD24TJP5.js create mode 100644 new/node_modules/.vite/deps/chunk-OD24TJP5.js.map create mode 100644 new/node_modules/.vite/deps/chunk-ODZSV7SK.js create mode 100644 new/node_modules/.vite/deps/chunk-ODZSV7SK.js.map create mode 100644 new/node_modules/.vite/deps/chunk-OWJLRPM7.js create mode 100644 new/node_modules/.vite/deps/chunk-OWJLRPM7.js.map create mode 100644 new/node_modules/.vite/deps/chunk-PM64MP4D.js create mode 100644 new/node_modules/.vite/deps/chunk-PM64MP4D.js.map create mode 100644 new/node_modules/.vite/deps/chunk-QCYBYQ2L.js create mode 100644 new/node_modules/.vite/deps/chunk-QCYBYQ2L.js.map create mode 100644 new/node_modules/.vite/deps/chunk-QVWK6MQK.js create mode 100644 new/node_modules/.vite/deps/chunk-QVWK6MQK.js.map create mode 100644 new/node_modules/.vite/deps/chunk-SHTTXLUR.js create mode 100644 new/node_modules/.vite/deps/chunk-SHTTXLUR.js.map create mode 100644 new/node_modules/.vite/deps/chunk-T3BYYNEM.js create mode 100644 new/node_modules/.vite/deps/chunk-T3BYYNEM.js.map create mode 100644 new/node_modules/.vite/deps/chunk-TVECJW2U.js create mode 100644 new/node_modules/.vite/deps/chunk-TVECJW2U.js.map create mode 100644 new/node_modules/.vite/deps/chunk-U74SLQDB.js create mode 100644 new/node_modules/.vite/deps/chunk-U74SLQDB.js.map create mode 100644 new/node_modules/.vite/deps/chunk-WHMHD7EJ.js create mode 100644 new/node_modules/.vite/deps/chunk-WHMHD7EJ.js.map create mode 100644 new/node_modules/.vite/deps/chunk-XK7AHEC7.js create mode 100644 new/node_modules/.vite/deps/chunk-XK7AHEC7.js.map create mode 100644 new/node_modules/.vite/deps/chunk-XTPUGG63.js create mode 100644 new/node_modules/.vite/deps/chunk-XTPUGG63.js.map create mode 100644 new/node_modules/.vite/deps/chunk-XYTAOB5V.js create mode 100644 new/node_modules/.vite/deps/chunk-XYTAOB5V.js.map create mode 100644 new/node_modules/.vite/deps/chunk-YL662TD3.js create mode 100644 new/node_modules/.vite/deps/chunk-YL662TD3.js.map create mode 100644 new/node_modules/.vite/deps/chunk-ZZKH6ZWQ.js create mode 100644 new/node_modules/.vite/deps/chunk-ZZKH6ZWQ.js.map create mode 100644 new/node_modules/.vite/deps/package.json create mode 100644 new/node_modules/.vite/deps/react-dom_client.js create mode 100644 new/node_modules/.vite/deps/react-dom_client.js.map create mode 100644 new/node_modules/.vite/deps/react-router-dom.js create mode 100644 new/node_modules/.vite/deps/react-router-dom.js.map create mode 100644 new/node_modules/.vite/deps/react-router.js create mode 100644 new/node_modules/.vite/deps/react-router.js.map create mode 100644 new/node_modules/.vite/deps/react.js create mode 100644 new/node_modules/.vite/deps/react.js.map create mode 100644 new/node_modules/.vite/deps/react_jsx-dev-runtime.js create mode 100644 new/node_modules/.vite/deps/react_jsx-dev-runtime.js.map create mode 100644 new/node_modules/.vite/deps/react_jsx-runtime.js create mode 100644 new/node_modules/.vite/deps/react_jsx-runtime.js.map diff --git a/new/node_modules/.vite/deps/@cloudscape-design_collection-hooks.js b/new/node_modules/.vite/deps/@cloudscape-design_collection-hooks.js new file mode 100644 index 00000000..3375b325 --- /dev/null +++ b/new/node_modules/.vite/deps/@cloudscape-design_collection-hooks.js @@ -0,0 +1,9 @@ +import { + useCollection +} from "./chunk-MRK32EYN.js"; +import "./chunk-WHMHD7EJ.js"; +import "./chunk-G3PMV62Z.js"; +export { + useCollection +}; +//# sourceMappingURL=@cloudscape-design_collection-hooks.js.map diff --git a/new/node_modules/.vite/deps/@cloudscape-design_collection-hooks.js.map b/new/node_modules/.vite/deps/@cloudscape-design_collection-hooks.js.map new file mode 100644 index 00000000..98652118 --- /dev/null +++ b/new/node_modules/.vite/deps/@cloudscape-design_collection-hooks.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": [], + "sourcesContent": [], + "mappings": "", + "names": [] +} diff --git a/new/node_modules/.vite/deps/@cloudscape-design_components.js b/new/node_modules/.vite/deps/@cloudscape-design_components.js new file mode 100644 index 00000000..ecdd9035 --- /dev/null +++ b/new/node_modules/.vite/deps/@cloudscape-design_components.js @@ -0,0 +1,28076 @@ +import { + Header +} from "./chunk-53RIJVDW.js"; +import { + InternalPagination, + Pagination +} from "./chunk-XK7AHEC7.js"; +import { + CollectionPreferences, + ColumnLayout, + InternalModal, + internal_default as internal_default6, + internal_default2 as internal_default7, + reset_contexts_for_modal_default, + useRadioGroupForwardFocus +} from "./chunk-6KI6MNLX.js"; +import { + Description, + InternalHeader +} from "./chunk-ZZKH6ZWQ.js"; +import { + useCollection +} from "./chunk-MRK32EYN.js"; +import { + AnalyticsFunnel, + AnalyticsFunnelStep, + AnalyticsFunnelSubStep, + AsyncStore, + DynamicOverlapContext, + InternalContainer, + InternalContainerAsSubstep, + PopoverBody, + PopoverContainer, + SelectionControl, + StatusIndicator, + ToolsHeader, + VisualContext, + arrow_default, + focusMarkers, + getContentHeaderClassName, + getGlobalFlag, + getItemKey, + getLogicalBoundingClientRect, + getScrollInlineStart, + getVisualContextClassname, + internal_default as internal_default8, + isRtl, + shouldRemoveHighContrastHeader, + stickyScrolling, + styles_css_default as styles_css_default2, + table_default, + useDynamicOverlap, + useHiddenDescription, + useMouseDownTarget, + usePortalModeClasses, + usePrevious, + useReaction, + useSelection, + useSelectionFocusMove, + useSelector +} from "./chunk-EKTGMWG5.js"; +import { + LinkDefaultVariantContext, + Portal, + TabTrap, + checkbox_icon_default, + focus_lock_default, + internal_default as internal_default5, + radio_button_default +} from "./chunk-U74SLQDB.js"; +import { + AppLayoutContext, + CollectionLabelContext, + custom_css_properties_default, + getOverflowParentDimensions, + getOverflowParents, + scrollElementIntoView, + styles_css_default as styles_css_default4, + useMobile +} from "./chunk-ATFH3LQM.js"; +import { + Box +} from "./chunk-7ZAPJIOA.js"; +import { + SpaceBetween +} from "./chunk-4F2L5DKU.js"; +import { + SearchResults, + convertAutoComplete, + internal_default as internal_default4, + internal_default2 as internal_default9, + styles_css_default as styles_css_default3, + text_filter_default +} from "./chunk-OWJLRPM7.js"; +import { + debounce, + useDebounceCallback +} from "./chunk-XYTAOB5V.js"; +import { + Token, + TokenList, + _assertThisInitialized, + _defineProperty, + _setPrototypeOf, + add, + addDays, + addMinutes, + addMonths, + addWeeks, + addYears, + differenceInDays, + differenceInYears, + displayToIso, + endOfDay, + file_upload_default, + formatDate, + formatDateRange, + formatDateTime, + formatTimeOffsetISO, + getDaysInMonth, + getExternalProps, + isAfter, + isBefore, + isIsoDateOnly, + isLastDayOfMonth, + isSameDay, + isSameMonth, + isSameYear, + isToday, + isoToDisplay, + joinDateTime, + max, + min, + normalizeTimeString, + parseDate, + parseTimezoneOffset, + shiftTimezoneOffset, + splitDateTime, + startOfDay, + startOfMonth, + startOfYear, + styles_css_default +} from "./chunk-I2FJYNPN.js"; +import { + checkControlled +} from "./chunk-SHTTXLUR.js"; +import { + getFirstFocusable, + getLastFocusable +} from "./chunk-OD24TJP5.js"; +import { + InternalBox +} from "./chunk-F4YVK7EK.js"; +import { + InternalSpaceBetween +} from "./chunk-PM64MP4D.js"; +import { + FormField +} from "./chunk-QCYBYQ2L.js"; +import { + FormFieldError, + InternalFormField, + internal_default as internal_default3, + isDevelopment, + useContainerBreakpoints, + useContainerQuery +} from "./chunk-2STP5MNB.js"; +import { + InfoLinkLabelContext, + getBreakpointValue +} from "./chunk-XTPUGG63.js"; +import { + require_react_is +} from "./chunk-IE27NT7Q.js"; +import { + joinStrings, + padLeftZeros, + useFormFieldContext +} from "./chunk-42BEG66H.js"; +import { + useInternalI18n, + useLocale +} from "./chunk-ODZSV7SK.js"; +import { + button_default +} from "./chunk-2CDOTOCN.js"; +import { + ButtonContext, + InternalButton, + InternalSpinner, + checkSafeUrl, + internal_default as internal_default2, + useEffectOnUpdate, + useForwardFocus, + useSingleTabStopNavigation +} from "./chunk-7I72EAPF.js"; +import { + fireCancelableEvent, + fireKeyboardEvent, + fireNonCancelableEvent, + hasModifierKeys, + isPlainLeftClick +} from "./chunk-T3BYYNEM.js"; +import { + FunnelMetrics, + ScreenreaderOnly, + live_region_default, + nodeBelongs, + useFunnel, + useFunnelNameSelector, + useFunnelStep, + useFunnelSubStep +} from "./chunk-TVECJW2U.js"; +import { + DATA_ATTR_ANALYTICS_ALERT, + DATA_ATTR_ANALYTICS_FLASHBAR, + DATA_ATTR_FUNNEL_KEY, + DATA_ATTR_FUNNEL_VALUE, + FUNNEL_KEY_FUNNEL_NAME, + FUNNEL_KEY_STEP_NAME, + findUpUntil, + getFunnelValueSelector, + getNameFromSelector, + getSubStepAllSelector, + parseCssVariable, + supportsStickyPosition, + useUniqueId +} from "./chunk-MKRUABPM.js"; +import { + internal_default, + useMergeRefs +} from "./chunk-YL662TD3.js"; +import { + KeyCode, + Metrics, + PACKAGE_SOURCE, + PACKAGE_VERSION, + __rest, + applyDisplayName, + clsx_m_default, + getAnalyticsMetadataProps, + getBaseProps, + isModifierKey, + isMotionDisabled, + nodeContains, + useBaseComponent, + useComponentMetadata, + useCurrentMode, + useDensityMode, + useReducedMotion, + useResizeObserver, + useStableCallback, + useTelemetry, + useVisualRefresh, + warnOnce +} from "./chunk-3NFHZQPK.js"; +import { + require_react_dom +} from "./chunk-HKXRFMQU.js"; +import { + require_react +} from "./chunk-WHMHD7EJ.js"; +import { + __commonJS, + __toESM +} from "./chunk-G3PMV62Z.js"; + +// node_modules/object-assign/index.js +var require_object_assign = __commonJS({ + "node_modules/object-assign/index.js"(exports, module) { + "use strict"; + var getOwnPropertySymbols = Object.getOwnPropertySymbols; + var hasOwnProperty = Object.prototype.hasOwnProperty; + var propIsEnumerable = Object.prototype.propertyIsEnumerable; + function toObject(val) { + if (val === null || val === void 0) { + throw new TypeError("Object.assign cannot be called with null or undefined"); + } + return Object(val); + } + function shouldUseNative() { + try { + if (!Object.assign) { + return false; + } + var test1 = new String("abc"); + test1[5] = "de"; + if (Object.getOwnPropertyNames(test1)[0] === "5") { + return false; + } + var test2 = {}; + for (var i = 0; i < 10; i++) { + test2["_" + String.fromCharCode(i)] = i; + } + var order2 = Object.getOwnPropertyNames(test2).map(function(n) { + return test2[n]; + }); + if (order2.join("") !== "0123456789") { + return false; + } + var test3 = {}; + "abcdefghijklmnopqrst".split("").forEach(function(letter) { + test3[letter] = letter; + }); + if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") { + return false; + } + return true; + } catch (err) { + return false; + } + } + module.exports = shouldUseNative() ? Object.assign : function(target, source) { + var from; + var to = toObject(target); + var symbols2; + for (var s2 = 1; s2 < arguments.length; s2++) { + from = Object(arguments[s2]); + for (var key in from) { + if (hasOwnProperty.call(from, key)) { + to[key] = from[key]; + } + } + if (getOwnPropertySymbols) { + symbols2 = getOwnPropertySymbols(from); + for (var i = 0; i < symbols2.length; i++) { + if (propIsEnumerable.call(from, symbols2[i])) { + to[symbols2[i]] = from[symbols2[i]]; + } + } + } + } + return to; + }; + } +}); + +// node_modules/prop-types/lib/ReactPropTypesSecret.js +var require_ReactPropTypesSecret = __commonJS({ + "node_modules/prop-types/lib/ReactPropTypesSecret.js"(exports, module) { + "use strict"; + var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"; + module.exports = ReactPropTypesSecret; + } +}); + +// node_modules/prop-types/lib/has.js +var require_has = __commonJS({ + "node_modules/prop-types/lib/has.js"(exports, module) { + module.exports = Function.call.bind(Object.prototype.hasOwnProperty); + } +}); + +// node_modules/prop-types/checkPropTypes.js +var require_checkPropTypes = __commonJS({ + "node_modules/prop-types/checkPropTypes.js"(exports, module) { + "use strict"; + var printWarning = function() { + }; + if (true) { + ReactPropTypesSecret = require_ReactPropTypesSecret(); + loggedTypeFailures = {}; + has = require_has(); + printWarning = function(text) { + var message = "Warning: " + text; + if (typeof console !== "undefined") { + console.error(message); + } + try { + throw new Error(message); + } catch (x2) { + } + }; + } + var ReactPropTypesSecret; + var loggedTypeFailures; + var has; + function checkPropTypes(typeSpecs, values2, location, componentName2, getStack) { + if (true) { + for (var typeSpecName in typeSpecs) { + if (has(typeSpecs, typeSpecName)) { + var error; + try { + if (typeof typeSpecs[typeSpecName] !== "function") { + var err = Error( + (componentName2 || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`." + ); + err.name = "Invariant Violation"; + throw err; + } + error = typeSpecs[typeSpecName](values2, typeSpecName, componentName2, location, null, ReactPropTypesSecret); + } catch (ex) { + error = ex; + } + if (error && !(error instanceof Error)) { + printWarning( + (componentName2 || "React class") + ": type specification of " + location + " `" + typeSpecName + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof error + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)." + ); + } + if (error instanceof Error && !(error.message in loggedTypeFailures)) { + loggedTypeFailures[error.message] = true; + var stack = getStack ? getStack() : ""; + printWarning( + "Failed " + location + " type: " + error.message + (stack != null ? stack : "") + ); + } + } + } + } + } + checkPropTypes.resetWarningCache = function() { + if (true) { + loggedTypeFailures = {}; + } + }; + module.exports = checkPropTypes; + } +}); + +// node_modules/prop-types/factoryWithTypeCheckers.js +var require_factoryWithTypeCheckers = __commonJS({ + "node_modules/prop-types/factoryWithTypeCheckers.js"(exports, module) { + "use strict"; + var ReactIs = require_react_is(); + var assign = require_object_assign(); + var ReactPropTypesSecret = require_ReactPropTypesSecret(); + var has = require_has(); + var checkPropTypes = require_checkPropTypes(); + var printWarning = function() { + }; + if (true) { + printWarning = function(text) { + var message = "Warning: " + text; + if (typeof console !== "undefined") { + console.error(message); + } + try { + throw new Error(message); + } catch (x2) { + } + }; + } + function emptyFunctionThatReturnsNull() { + return null; + } + module.exports = function(isValidElement2, throwOnDirectAccess) { + var ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator; + var FAUX_ITERATOR_SYMBOL = "@@iterator"; + function getIteratorFn(maybeIterable) { + var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); + if (typeof iteratorFn === "function") { + return iteratorFn; + } + } + var ANONYMOUS = "<>"; + var ReactPropTypes = { + array: createPrimitiveTypeChecker("array"), + bigint: createPrimitiveTypeChecker("bigint"), + bool: createPrimitiveTypeChecker("boolean"), + func: createPrimitiveTypeChecker("function"), + number: createPrimitiveTypeChecker("number"), + object: createPrimitiveTypeChecker("object"), + string: createPrimitiveTypeChecker("string"), + symbol: createPrimitiveTypeChecker("symbol"), + any: createAnyTypeChecker(), + arrayOf: createArrayOfTypeChecker, + element: createElementTypeChecker(), + elementType: createElementTypeTypeChecker(), + instanceOf: createInstanceTypeChecker, + node: createNodeChecker(), + objectOf: createObjectOfTypeChecker, + oneOf: createEnumTypeChecker, + oneOfType: createUnionTypeChecker, + shape: createShapeTypeChecker, + exact: createStrictShapeTypeChecker + }; + function is(x2, y2) { + if (x2 === y2) { + return x2 !== 0 || 1 / x2 === 1 / y2; + } else { + return x2 !== x2 && y2 !== y2; + } + } + function PropTypeError(message, data) { + this.message = message; + this.data = data && typeof data === "object" ? data : {}; + this.stack = ""; + } + PropTypeError.prototype = Error.prototype; + function createChainableTypeChecker(validate3) { + if (true) { + var manualPropTypeCallCache = {}; + var manualPropTypeWarningCount = 0; + } + function checkType(isRequired, props2, propName, componentName2, location, propFullName, secret) { + componentName2 = componentName2 || ANONYMOUS; + propFullName = propFullName || propName; + if (secret !== ReactPropTypesSecret) { + if (throwOnDirectAccess) { + var err = new Error( + "Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types" + ); + err.name = "Invariant Violation"; + throw err; + } else if (typeof console !== "undefined") { + var cacheKey = componentName2 + ":" + propName; + if (!manualPropTypeCallCache[cacheKey] && // Avoid spamming the console because they are often not actionable except for lib authors + manualPropTypeWarningCount < 3) { + printWarning( + "You are manually calling a React.PropTypes validation function for the `" + propFullName + "` prop on `" + componentName2 + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details." + ); + manualPropTypeCallCache[cacheKey] = true; + manualPropTypeWarningCount++; + } + } + } + if (props2[propName] == null) { + if (isRequired) { + if (props2[propName] === null) { + return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required " + ("in `" + componentName2 + "`, but its value is `null`.")); + } + return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required in " + ("`" + componentName2 + "`, but its value is `undefined`.")); + } + return null; + } else { + return validate3(props2, propName, componentName2, location, propFullName); + } + } + var chainedCheckType = checkType.bind(null, false); + chainedCheckType.isRequired = checkType.bind(null, true); + return chainedCheckType; + } + function createPrimitiveTypeChecker(expectedType) { + function validate3(props2, propName, componentName2, location, propFullName, secret) { + var propValue = props2[propName]; + var propType = getPropType(propValue); + if (propType !== expectedType) { + var preciseType = getPreciseType(propValue); + return new PropTypeError( + "Invalid " + location + " `" + propFullName + "` of type " + ("`" + preciseType + "` supplied to `" + componentName2 + "`, expected ") + ("`" + expectedType + "`."), + { expectedType } + ); + } + return null; + } + return createChainableTypeChecker(validate3); + } + function createAnyTypeChecker() { + return createChainableTypeChecker(emptyFunctionThatReturnsNull); + } + function createArrayOfTypeChecker(typeChecker) { + function validate3(props2, propName, componentName2, location, propFullName) { + if (typeof typeChecker !== "function") { + return new PropTypeError("Property `" + propFullName + "` of component `" + componentName2 + "` has invalid PropType notation inside arrayOf."); + } + var propValue = props2[propName]; + if (!Array.isArray(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName2 + "`, expected an array.")); + } + for (var i = 0; i < propValue.length; i++) { + var error = typeChecker(propValue, i, componentName2, location, propFullName + "[" + i + "]", ReactPropTypesSecret); + if (error instanceof Error) { + return error; + } + } + return null; + } + return createChainableTypeChecker(validate3); + } + function createElementTypeChecker() { + function validate3(props2, propName, componentName2, location, propFullName) { + var propValue = props2[propName]; + if (!isValidElement2(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName2 + "`, expected a single ReactElement.")); + } + return null; + } + return createChainableTypeChecker(validate3); + } + function createElementTypeTypeChecker() { + function validate3(props2, propName, componentName2, location, propFullName) { + var propValue = props2[propName]; + if (!ReactIs.isValidElementType(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName2 + "`, expected a single ReactElement type.")); + } + return null; + } + return createChainableTypeChecker(validate3); + } + function createInstanceTypeChecker(expectedClass) { + function validate3(props2, propName, componentName2, location, propFullName) { + if (!(props2[propName] instanceof expectedClass)) { + var expectedClassName = expectedClass.name || ANONYMOUS; + var actualClassName = getClassName2(props2[propName]); + return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + actualClassName + "` supplied to `" + componentName2 + "`, expected ") + ("instance of `" + expectedClassName + "`.")); + } + return null; + } + return createChainableTypeChecker(validate3); + } + function createEnumTypeChecker(expectedValues) { + if (!Array.isArray(expectedValues)) { + if (true) { + if (arguments.length > 1) { + printWarning( + "Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])." + ); + } else { + printWarning("Invalid argument supplied to oneOf, expected an array."); + } + } + return emptyFunctionThatReturnsNull; + } + function validate3(props2, propName, componentName2, location, propFullName) { + var propValue = props2[propName]; + for (var i = 0; i < expectedValues.length; i++) { + if (is(propValue, expectedValues[i])) { + return null; + } + } + var valuesString = JSON.stringify(expectedValues, function replacer(key, value) { + var type = getPreciseType(value); + if (type === "symbol") { + return String(value); + } + return value; + }); + return new PropTypeError("Invalid " + location + " `" + propFullName + "` of value `" + String(propValue) + "` " + ("supplied to `" + componentName2 + "`, expected one of " + valuesString + ".")); + } + return createChainableTypeChecker(validate3); + } + function createObjectOfTypeChecker(typeChecker) { + function validate3(props2, propName, componentName2, location, propFullName) { + if (typeof typeChecker !== "function") { + return new PropTypeError("Property `" + propFullName + "` of component `" + componentName2 + "` has invalid PropType notation inside objectOf."); + } + var propValue = props2[propName]; + var propType = getPropType(propValue); + if (propType !== "object") { + return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName2 + "`, expected an object.")); + } + for (var key in propValue) { + if (has(propValue, key)) { + var error = typeChecker(propValue, key, componentName2, location, propFullName + "." + key, ReactPropTypesSecret); + if (error instanceof Error) { + return error; + } + } + } + return null; + } + return createChainableTypeChecker(validate3); + } + function createUnionTypeChecker(arrayOfTypeCheckers) { + if (!Array.isArray(arrayOfTypeCheckers)) { + true ? printWarning("Invalid argument supplied to oneOfType, expected an instance of array.") : void 0; + return emptyFunctionThatReturnsNull; + } + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { + var checker = arrayOfTypeCheckers[i]; + if (typeof checker !== "function") { + printWarning( + "Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + getPostfixForTypeWarning(checker) + " at index " + i + "." + ); + return emptyFunctionThatReturnsNull; + } + } + function validate3(props2, propName, componentName2, location, propFullName) { + var expectedTypes = []; + for (var i2 = 0; i2 < arrayOfTypeCheckers.length; i2++) { + var checker2 = arrayOfTypeCheckers[i2]; + var checkerResult = checker2(props2, propName, componentName2, location, propFullName, ReactPropTypesSecret); + if (checkerResult == null) { + return null; + } + if (checkerResult.data && has(checkerResult.data, "expectedType")) { + expectedTypes.push(checkerResult.data.expectedType); + } + } + var expectedTypesMessage = expectedTypes.length > 0 ? ", expected one of type [" + expectedTypes.join(", ") + "]" : ""; + return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName2 + "`" + expectedTypesMessage + ".")); + } + return createChainableTypeChecker(validate3); + } + function createNodeChecker() { + function validate3(props2, propName, componentName2, location, propFullName) { + if (!isNode(props2[propName])) { + return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName2 + "`, expected a ReactNode.")); + } + return null; + } + return createChainableTypeChecker(validate3); + } + function invalidValidatorError(componentName2, location, propFullName, key, type) { + return new PropTypeError( + (componentName2 || "React class") + ": " + location + " type `" + propFullName + "." + key + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + type + "`." + ); + } + function createShapeTypeChecker(shapeTypes) { + function validate3(props2, propName, componentName2, location, propFullName) { + var propValue = props2[propName]; + var propType = getPropType(propValue); + if (propType !== "object") { + return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName2 + "`, expected `object`.")); + } + for (var key in shapeTypes) { + var checker = shapeTypes[key]; + if (typeof checker !== "function") { + return invalidValidatorError(componentName2, location, propFullName, key, getPreciseType(checker)); + } + var error = checker(propValue, key, componentName2, location, propFullName + "." + key, ReactPropTypesSecret); + if (error) { + return error; + } + } + return null; + } + return createChainableTypeChecker(validate3); + } + function createStrictShapeTypeChecker(shapeTypes) { + function validate3(props2, propName, componentName2, location, propFullName) { + var propValue = props2[propName]; + var propType = getPropType(propValue); + if (propType !== "object") { + return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName2 + "`, expected `object`.")); + } + var allKeys = assign({}, props2[propName], shapeTypes); + for (var key in allKeys) { + var checker = shapeTypes[key]; + if (has(shapeTypes, key) && typeof checker !== "function") { + return invalidValidatorError(componentName2, location, propFullName, key, getPreciseType(checker)); + } + if (!checker) { + return new PropTypeError( + "Invalid " + location + " `" + propFullName + "` key `" + key + "` supplied to `" + componentName2 + "`.\nBad object: " + JSON.stringify(props2[propName], null, " ") + "\nValid keys: " + JSON.stringify(Object.keys(shapeTypes), null, " ") + ); + } + var error = checker(propValue, key, componentName2, location, propFullName + "." + key, ReactPropTypesSecret); + if (error) { + return error; + } + } + return null; + } + return createChainableTypeChecker(validate3); + } + function isNode(propValue) { + switch (typeof propValue) { + case "number": + case "string": + case "undefined": + return true; + case "boolean": + return !propValue; + case "object": + if (Array.isArray(propValue)) { + return propValue.every(isNode); + } + if (propValue === null || isValidElement2(propValue)) { + return true; + } + var iteratorFn = getIteratorFn(propValue); + if (iteratorFn) { + var iterator = iteratorFn.call(propValue); + var step2; + if (iteratorFn !== propValue.entries) { + while (!(step2 = iterator.next()).done) { + if (!isNode(step2.value)) { + return false; + } + } + } else { + while (!(step2 = iterator.next()).done) { + var entry = step2.value; + if (entry) { + if (!isNode(entry[1])) { + return false; + } + } + } + } + } else { + return false; + } + return true; + default: + return false; + } + } + function isSymbol(propType, propValue) { + if (propType === "symbol") { + return true; + } + if (!propValue) { + return false; + } + if (propValue["@@toStringTag"] === "Symbol") { + return true; + } + if (typeof Symbol === "function" && propValue instanceof Symbol) { + return true; + } + return false; + } + function getPropType(propValue) { + var propType = typeof propValue; + if (Array.isArray(propValue)) { + return "array"; + } + if (propValue instanceof RegExp) { + return "object"; + } + if (isSymbol(propType, propValue)) { + return "symbol"; + } + return propType; + } + function getPreciseType(propValue) { + if (typeof propValue === "undefined" || propValue === null) { + return "" + propValue; + } + var propType = getPropType(propValue); + if (propType === "object") { + if (propValue instanceof Date) { + return "date"; + } else if (propValue instanceof RegExp) { + return "regexp"; + } + } + return propType; + } + function getPostfixForTypeWarning(value) { + var type = getPreciseType(value); + switch (type) { + case "array": + case "object": + return "an " + type; + case "boolean": + case "date": + case "regexp": + return "a " + type; + default: + return type; + } + } + function getClassName2(propValue) { + if (!propValue.constructor || !propValue.constructor.name) { + return ANONYMOUS; + } + return propValue.constructor.name; + } + ReactPropTypes.checkPropTypes = checkPropTypes; + ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache; + ReactPropTypes.PropTypes = ReactPropTypes; + return ReactPropTypes; + }; + } +}); + +// node_modules/prop-types/index.js +var require_prop_types = __commonJS({ + "node_modules/prop-types/index.js"(exports, module) { + if (true) { + ReactIs = require_react_is(); + throwOnDirectAccess = true; + module.exports = require_factoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess); + } else { + module.exports = null(); + } + var ReactIs; + var throwOnDirectAccess; + } +}); + +// node_modules/@cloudscape-design/components/alert/index.js +var import_react5 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/alert/internal.js +var import_react4 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/alert/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/alert/styles.scoped.css"; +var styles_css_default5 = { + "alert": "awsui_alert_mx3cw_ipfn3_99", + "awsui-motion-fade-in": "awsui_awsui-motion-fade-in_mx3cw_ipfn3_1", + "root": "awsui_root_mx3cw_ipfn3_125", + "hidden": "awsui_hidden_mx3cw_ipfn3_163", + "with-dismiss": "awsui_with-dismiss_mx3cw_ipfn3_213", + "with-action": "awsui_with-action_mx3cw_ipfn3_213", + "breakpoint-default": "awsui_breakpoint-default_mx3cw_ipfn3_219", + "header": "awsui_header_mx3cw_ipfn3_226", + "action": "awsui_action_mx3cw_ipfn3_230", + "action-slot": "awsui_action-slot_mx3cw_ipfn3_235", + "action-button": "awsui_action-button_mx3cw_ipfn3_236", + "alert-focus-wrapper": "awsui_alert-focus-wrapper_mx3cw_ipfn3_240", + "text": "awsui_text_mx3cw_ipfn3_269", + "icon": "awsui_icon_mx3cw_ipfn3_276", + "message": "awsui_message_mx3cw_ipfn3_279", + "icon-size-medium": "awsui_icon-size-medium_mx3cw_ipfn3_287", + "icon-size-big": "awsui_icon-size-big_mx3cw_ipfn3_290", + "icon-size-normal": "awsui_icon-size-normal_mx3cw_ipfn3_293", + "content": "awsui_content_mx3cw_ipfn3_297", + "dismiss": "awsui_dismiss_mx3cw_ipfn3_301", + "dismiss-button": "awsui_dismiss-button_mx3cw_ipfn3_306", + "type-error": "awsui_type-error_mx3cw_ipfn3_310", + "type-warning": "awsui_type-warning_mx3cw_ipfn3_318", + "type-success": "awsui_type-success_mx3cw_ipfn3_326", + "type-info": "awsui_type-info_mx3cw_ipfn3_334" +}; + +// node_modules/@cloudscape-design/components/internal/plugins/helpers/runtime-content-wrapper.js +var import_react = __toESM(require_react()); +function RuntimeContentWrapper({ mountContent, unmountContent }) { + const ref = (0, import_react.useRef)(null); + (0, import_react.useEffect)(() => { + const container = ref.current; + mountContent(container); + return () => unmountContent(container); + }, []); + return import_react.default.createElement("div", { ref }); +} + +// node_modules/@cloudscape-design/components/internal/plugins/helpers/use-discovered-action.js +var import_react2 = __toESM(require_react()); +function convertRuntimeAction(action, context) { + if (!action) { + return null; + } + return import_react2.default.createElement(RuntimeContentWrapper, { key: action.id + "-" + context.type, mountContent: (container) => action.mountContent(container, context), unmountContent: (container) => action.unmountContent(container) }); +} +function createUseDiscoveredAction(onActionRegistered) { + return function useDiscoveredAction3(type) { + const [discoveredActions, setDiscoveredActions] = (0, import_react2.useState)([]); + const headerRef = (0, import_react2.useRef)(null); + const contentRef = (0, import_react2.useRef)(null); + (0, import_react2.useEffect)(() => { + return onActionRegistered((actions) => { + setDiscoveredActions(actions.map((action) => convertRuntimeAction(action, { type, headerRef, contentRef }))); + }); + }, [type]); + return { discoveredActions, headerRef, contentRef }; + }; +} + +// node_modules/@cloudscape-design/components/internal/plugins/controllers/drawers.js +var DrawersController = class { + constructor() { + this.drawers = []; + this.drawersRegistrationListener = null; + this.scheduleUpdate = debounce(() => { + var _a; + (_a = this.drawersRegistrationListener) === null || _a === void 0 ? void 0 : _a.call(this, this.drawers); + }, 0); + this.registerDrawer = (config) => { + this.drawers = this.drawers.concat(config); + this.scheduleUpdate(); + }; + this.onDrawersRegistered = (listener) => { + if (this.drawersRegistrationListener !== null) { + console.warn("[AwsUi] [runtime drawers] multiple app layout instances detected"); + } + this.drawersRegistrationListener = listener; + this.scheduleUpdate(); + return () => { + this.drawersRegistrationListener = null; + }; + }; + this.clearRegisteredDrawers = () => { + this.drawers = []; + }; + } + installPublic(api = {}) { + var _a; + (_a = api.registerDrawer) !== null && _a !== void 0 ? _a : api.registerDrawer = this.registerDrawer; + return api; + } + installInternal(internalApi = {}) { + var _a, _b; + (_a = internalApi.clearRegisteredDrawers) !== null && _a !== void 0 ? _a : internalApi.clearRegisteredDrawers = this.clearRegisteredDrawers; + (_b = internalApi.onDrawersRegistered) !== null && _b !== void 0 ? _b : internalApi.onDrawersRegistered = this.onDrawersRegistered; + return internalApi; + } +}; + +// node_modules/@cloudscape-design/components/internal/plugins/helpers/utils.js +function sortByPriority(items) { + return items.slice().sort((a2, b) => { + var _a, _b; + if (b.orderPriority !== a2.orderPriority) { + return Math.sign(((_a = b.orderPriority) !== null && _a !== void 0 ? _a : 0) - ((_b = a2.orderPriority) !== null && _b !== void 0 ? _b : 0)); + } + return b.id < a2.id ? 1 : -1; + }); +} + +// node_modules/@cloudscape-design/components/internal/plugins/controllers/action-buttons.js +var ActionButtonsController = class { + constructor() { + this.listeners = []; + this.actions = []; + this.scheduleUpdate = debounce(() => { + this.listeners.forEach((listener) => listener(this.actions)); + }, 0); + this.registerAction = (action) => { + this.actions.push(action); + this.actions = sortByPriority(this.actions); + this.scheduleUpdate(); + }; + this.clearRegisteredActions = () => { + this.actions = []; + }; + this.onActionRegistered = (listener) => { + this.listeners.push(listener); + this.scheduleUpdate(); + return () => { + this.listeners = this.listeners.filter((item) => item !== listener); + }; + }; + } + installPublic(api = {}) { + var _a; + (_a = api.registerAction) !== null && _a !== void 0 ? _a : api.registerAction = this.registerAction; + return api; + } + installInternal(internalApi = {}) { + var _a, _b; + (_a = internalApi.clearRegisteredActions) !== null && _a !== void 0 ? _a : internalApi.clearRegisteredActions = this.clearRegisteredActions; + (_b = internalApi.onActionRegistered) !== null && _b !== void 0 ? _b : internalApi.onActionRegistered = this.onActionRegistered; + return internalApi; + } +}; + +// node_modules/@cloudscape-design/components/internal/plugins/api.js +var storageKey = Symbol.for("awsui-plugin-api"); +function findUpApi(currentWindow) { + try { + if (currentWindow === null || currentWindow === void 0 ? void 0 : currentWindow[storageKey]) { + return currentWindow[storageKey]; + } + if (!currentWindow || currentWindow.parent === currentWindow) { + return void 0; + } + return findUpApi(currentWindow.parent); + } catch (ex) { + return void 0; + } +} +function loadApi() { + if (typeof window === "undefined") { + return installApi({}); + } + const win = window; + const existingApi = findUpApi(win); + win[storageKey] = installApi(existingApi !== null && existingApi !== void 0 ? existingApi : {}); + return win[storageKey]; +} +var { awsuiPlugins, awsuiPluginsInternal } = loadApi(); +function installApi(api) { + var _a, _b; + (_a = api.awsuiPlugins) !== null && _a !== void 0 ? _a : api.awsuiPlugins = {}; + (_b = api.awsuiPluginsInternal) !== null && _b !== void 0 ? _b : api.awsuiPluginsInternal = {}; + const appLayoutDrawers = new DrawersController(); + api.awsuiPlugins.appLayout = appLayoutDrawers.installPublic(api.awsuiPlugins.appLayout); + api.awsuiPluginsInternal.appLayout = appLayoutDrawers.installInternal(api.awsuiPluginsInternal.appLayout); + const alertActions = new ActionButtonsController(); + api.awsuiPlugins.alert = alertActions.installPublic(api.awsuiPlugins.alert); + api.awsuiPluginsInternal.alert = alertActions.installInternal(api.awsuiPluginsInternal.alert); + const flashbarActions = new ActionButtonsController(); + api.awsuiPlugins.flashbar = flashbarActions.installPublic(api.awsuiPlugins.flashbar); + api.awsuiPluginsInternal.flashbar = flashbarActions.installInternal(api.awsuiPluginsInternal.flashbar); + return api; +} + +// node_modules/@cloudscape-design/components/alert/actions-wrapper/index.js +var import_react3 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/alert/actions-wrapper/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/alert/actions-wrapper/styles.scoped.css"; +var styles_css_default6 = { + "root": "awsui_root_37gf8_14wux_9" +}; + +// node_modules/@cloudscape-design/components/alert/actions-wrapper/index.js +function createActionButton(testUtilClasses, action, buttonText, onButtonClick) { + if (!action && buttonText) { + action = import_react3.default.createElement(internal_default2, { className: testUtilClasses.actionButton, onClick: onButtonClick, formAction: "none" }, buttonText); + } + return action ? import_react3.default.createElement("div", { className: testUtilClasses.actionSlot }, action) : null; +} +function ActionsWrapper({ className, testUtilClasses, action, discoveredActions, buttonText, onButtonClick }) { + const actionButton = createActionButton(testUtilClasses, action, buttonText, onButtonClick); + if (!actionButton && discoveredActions.length === 0) { + return null; + } + return import_react3.default.createElement( + "div", + { className: clsx_m_default(styles_css_default6.root, className) }, + actionButton, + discoveredActions + ); +} + +// node_modules/@cloudscape-design/components/alert/internal.js +var typeToIcon = { + error: "status-negative", + warning: "status-warning", + success: "status-positive", + info: "status-info" +}; +var useDiscoveredAction = createUseDiscoveredAction(awsuiPluginsInternal.alert.onActionRegistered); +var InternalAlert = import_react4.default.forwardRef((_a, ref) => { + var { type, statusIconAriaLabel, visible = true, dismissible, dismissAriaLabel, children: children2, header, buttonText, action, onDismiss, onButtonClick, __internalRootRef = null } = _a, rest = __rest(_a, ["type", "statusIconAriaLabel", "visible", "dismissible", "dismissAriaLabel", "children", "header", "buttonText", "action", "onDismiss", "onButtonClick", "__internalRootRef"]); + const baseProps = getBaseProps(rest); + const i18n = useInternalI18n("alert"); + const focusRef = (0, import_react4.useRef)(null); + useForwardFocus(ref, focusRef); + const [breakpoint, breakpointRef] = useContainerBreakpoints(["xs"]); + const mergedRef = useMergeRefs(breakpointRef, __internalRootRef); + const isRefresh = useVisualRefresh(); + const size = isRefresh ? "normal" : header && children2 ? "big" : "normal"; + const { discoveredActions, headerRef, contentRef } = useDiscoveredAction(type); + const hasAction = Boolean(action || buttonText || discoveredActions.length); + const analyticsAttributes = { + [DATA_ATTR_ANALYTICS_ALERT]: type + }; + return import_react4.default.createElement( + "div", + Object.assign({}, baseProps, analyticsAttributes, { "aria-hidden": !visible, className: clsx_m_default(styles_css_default5.root, { [styles_css_default5.hidden]: !visible }, baseProps.className), ref: mergedRef }), + import_react4.default.createElement( + LinkDefaultVariantContext.Provider, + { value: { defaultVariant: "primary" } }, + import_react4.default.createElement( + VisualContext, + { contextName: "alert" }, + import_react4.default.createElement( + "div", + { className: clsx_m_default(styles_css_default5.alert, styles_css_default5[`type-${type}`], styles_css_default5[`icon-size-${size}`], hasAction && styles_css_default5["with-action"], dismissible && styles_css_default5["with-dismiss"], styles_css_default5[`breakpoint-${breakpoint}`]) }, + import_react4.default.createElement( + "div", + { className: styles_css_default5["alert-focus-wrapper"], tabIndex: -1, ref: focusRef }, + import_react4.default.createElement( + "div", + { className: clsx_m_default(styles_css_default5.icon, styles_css_default5.text), role: "img", "aria-label": statusIconAriaLabel }, + import_react4.default.createElement(internal_default, { name: typeToIcon[type], size }) + ), + import_react4.default.createElement( + "div", + { className: clsx_m_default(styles_css_default5.message, styles_css_default5.text) }, + header && import_react4.default.createElement("div", { className: styles_css_default5.header, ref: headerRef }, header), + import_react4.default.createElement("div", { className: styles_css_default5.content, ref: contentRef }, children2) + ) + ), + import_react4.default.createElement(ActionsWrapper, { className: styles_css_default5.action, testUtilClasses: { + actionSlot: styles_css_default5["action-slot"], + actionButton: styles_css_default5["action-button"] + }, action, discoveredActions, buttonText, onButtonClick: () => fireNonCancelableEvent(onButtonClick) }), + dismissible && import_react4.default.createElement( + "div", + { className: styles_css_default5.dismiss }, + import_react4.default.createElement(InternalButton, { className: styles_css_default5["dismiss-button"], variant: "icon", iconName: "close", formAction: "none", ariaLabel: i18n("dismissAriaLabel", dismissAriaLabel), onClick: () => fireNonCancelableEvent(onDismiss) }) + ) + ) + ) + ) + ); +}); +var internal_default10 = InternalAlert; + +// node_modules/@cloudscape-design/components/alert/index.js +var Alert = import_react5.default.forwardRef((_a, ref) => { + var { type = "info", visible = true } = _a, props2 = __rest(_a, ["type", "visible"]); + const analyticsMetadata = getAnalyticsMetadataProps(props2); + const baseComponentProps = useBaseComponent("Alert", { + props: { type, visible, dismissible: props2.dismissible } + }, analyticsMetadata); + const { funnelInteractionId, submissionAttempt, funnelState, errorCount } = useFunnel(); + const { stepNumber, stepNameSelector } = useFunnelStep(); + const { subStepSelector, subStepNameSelector } = useFunnelSubStep(); + (0, import_react5.useEffect)(() => { + var _a2, _b, _c; + if (funnelInteractionId && visible && type === "error" && funnelState.current !== "complete") { + const stepName = getNameFromSelector(stepNameSelector); + const subStepName = getNameFromSelector(subStepNameSelector); + errorCount.current++; + const errorIsVisible = ((_c = (_b = (_a2 = baseComponentProps.__internalRootRef.current) === null || _a2 === void 0 ? void 0 : _a2.getBoundingClientRect()) === null || _b === void 0 ? void 0 : _b.width) !== null && _c !== void 0 ? _c : 0) > 0; + if (errorIsVisible) { + if (subStepSelector) { + FunnelMetrics.funnelSubStepError({ + funnelInteractionId, + subStepSelector, + subStepName, + subStepNameSelector, + stepNumber, + stepName, + stepNameSelector, + subStepAllSelector: getSubStepAllSelector(), + instanceIdentifier: analyticsMetadata === null || analyticsMetadata === void 0 ? void 0 : analyticsMetadata.instanceIdentifier, + errorContext: analyticsMetadata === null || analyticsMetadata === void 0 ? void 0 : analyticsMetadata.errorContext + }); + } else { + FunnelMetrics.funnelError({ + funnelInteractionId + }); + } + } + return () => { + errorCount.current--; + }; + } + }, [funnelInteractionId, visible, submissionAttempt, errorCount]); + return import_react5.default.createElement(internal_default10, Object.assign({ type, visible }, props2, baseComponentProps, { ref })); +}); +applyDisplayName(Alert, "Alert"); +var alert_default = Alert; + +// node_modules/@cloudscape-design/components/anchor-navigation/index.js +var import_react8 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/anchor-navigation/internal.js +var import_react7 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/anchor-navigation/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/anchor-navigation/styles.scoped.css"; +var styles_css_default7 = { + "root": "awsui_root_swimc_yjm0c_99", + "anchor-list": "awsui_anchor-list_swimc_yjm0c_134", + "anchor-item": "awsui_anchor-item_swimc_yjm0c_157", + "anchor-item--active": "awsui_anchor-item--active_swimc_yjm0c_177", + "anchor-link": "awsui_anchor-link_swimc_yjm0c_194", + "anchor-link--active": "awsui_anchor-link--active_swimc_yjm0c_236", + "anchor-link-text": "awsui_anchor-link-text_swimc_yjm0c_243", + "anchor-link-info": "awsui_anchor-link-info_swimc_yjm0c_247" +}; + +// node_modules/@cloudscape-design/components/anchor-navigation/test-classes/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/anchor-navigation/test-classes/styles.scoped.css"; +var styles_css_default8 = { + "root": "awsui_root_17oho_5eh15_5", + "anchor-list": "awsui_anchor-list_17oho_5eh15_9", + "anchor-item--active": "awsui_anchor-item--active_17oho_5eh15_13", + "anchor-link": "awsui_anchor-link_17oho_5eh15_17", + "anchor-link-text": "awsui_anchor-link-text_17oho_5eh15_21", + "anchor-link-info": "awsui_anchor-link-info_17oho_5eh15_25" +}; + +// node_modules/@cloudscape-design/components/anchor-navigation/use-scroll-spy.js +var import_react6 = __toESM(require_react()); +var isBrowser = typeof window !== "undefined"; +function useScrollSpy({ hrefs, scrollSpyOffset, activeHref }) { + const [currentHref, setCurrentHref] = (0, import_react6.useState)(activeHref); + const [lastAnchorExists, setLastAnchorExists] = (0, import_react6.useState)(false); + (0, import_react6.useEffect)(() => { + setCurrentHref(activeHref); + }, [activeHref]); + (0, import_react6.useEffect)(() => { + var _a; + setLastAnchorExists(isBrowser && !!document.getElementById((_a = hrefs[hrefs.length - 1]) === null || _a === void 0 ? void 0 : _a.slice(1))); + }, [hrefs]); + const getRectByHref = (0, import_react6.useCallback)((href) => { + var _a; + return (_a = document.getElementById(href.slice(1))) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect(); + }, []); + const isPageBottom = (0, import_react6.useCallback)(() => { + return lastAnchorExists && Math.ceil(window.scrollY) >= Math.floor(document.body.scrollHeight - window.innerHeight); + }, [lastAnchorExists]); + const findHrefInView = (0, import_react6.useCallback)(() => { + return hrefs.find((href) => { + const rect = getRectByHref(href); + return rect && rect.bottom <= window.innerHeight && rect.top >= scrollSpyOffset; + }); + }, [getRectByHref, scrollSpyOffset, hrefs]); + const findLastHrefInView = (0, import_react6.useCallback)(() => { + return [...hrefs].reverse().find((href) => { + const rect = getRectByHref(href); + return rect && rect.bottom <= window.innerHeight; + }); + }, [getRectByHref, hrefs]); + const handleScroll = (0, import_react6.useCallback)(() => { + if (activeHref || !isBrowser) { + return; + } + const { scrollY } = window; + if (document.body.scrollHeight > window.innerHeight && isPageBottom()) { + setCurrentHref(hrefs[hrefs.length - 1]); + } else { + setCurrentHref(findHrefInView() || (scrollY > 0 ? findLastHrefInView() : void 0)); + } + }, [activeHref, isPageBottom, findHrefInView, findLastHrefInView, hrefs]); + (0, import_react6.useEffect)(() => { + if (isBrowser) { + handleScroll(); + window.addEventListener("scroll", handleScroll, { passive: true }); + return () => { + window.removeEventListener("scroll", handleScroll); + }; + } + }, [handleScroll]); + return currentHref; +} + +// node_modules/@cloudscape-design/components/anchor-navigation/internal.js +function InternalAnchorNavigation(_a) { + var { anchors, ariaLabelledby, onFollow, onActiveHrefChange, activeHref = "", __internalRootRef = null, scrollSpyOffset = 0 } = _a, props2 = __rest(_a, ["anchors", "ariaLabelledby", "onFollow", "onActiveHrefChange", "activeHref", "__internalRootRef", "scrollSpyOffset"]); + const baseProps = getBaseProps(props2); + const hrefs = (0, import_react7.useMemo)(() => anchors.map((anchor) => anchor.href), [anchors]); + const onFollowHandler = (0, import_react7.useCallback)((anchor, sourceEvent) => { + fireCancelableEvent(onFollow, anchor, sourceEvent); + }, [onFollow]); + const currentActiveHref = useScrollSpy({ + hrefs, + scrollSpyOffset, + activeHref + }); + (0, import_react7.useEffect)(() => { + if (currentActiveHref) { + const newActiveAnchor = anchors.find((anchor) => anchor.href === currentActiveHref); + fireNonCancelableEvent(onActiveHrefChange, newActiveAnchor); + } + }, [onActiveHrefChange, anchors, currentActiveHref]); + return import_react7.default.createElement( + "nav", + Object.assign({}, baseProps, { ref: __internalRootRef, "aria-labelledby": ariaLabelledby, className: clsx_m_default(baseProps.className, styles_css_default7.root, styles_css_default8.root) }), + import_react7.default.createElement("ol", { className: clsx_m_default(styles_css_default7["anchor-list"], styles_css_default8["anchor-list"]) }, anchors.map((anchor, index) => { + return import_react7.default.createElement(Anchor, { onFollow: onFollowHandler, isActive: anchor.href === currentActiveHref, key: index, index, anchor }); + })) + ); +} +var Anchor = ({ anchor, onFollow, isActive, index }) => { + checkSafeUrl("AnchorNavigation", anchor.href); + const onClick = (0, import_react7.useCallback)((event) => { + if (isPlainLeftClick(event)) { + onFollow(anchor, event); + } + }, [onFollow, anchor]); + const activeItemClasses = clsx_m_default(styles_css_default7["anchor-item--active"], styles_css_default8["anchor-item--active"]); + return import_react7.default.createElement( + "li", + { "data-itemid": `anchor-item-${index + 1}`, className: clsx_m_default(styles_css_default7["anchor-item"], isActive && activeItemClasses) }, + import_react7.default.createElement( + "a", + Object.assign({ onClick, className: clsx_m_default(styles_css_default7["anchor-link"], styles_css_default8["anchor-link"], isActive && styles_css_default7["anchor-link--active"]) }, isActive ? { "aria-current": true } : {}, { href: anchor.href }), + import_react7.default.createElement("span", { className: clsx_m_default(styles_css_default7["anchor-link-text"], styles_css_default8["anchor-link-text"]), style: { paddingInlineStart: `${anchor.level * 16 + 2}px` } }, anchor.text), + anchor.info && import_react7.default.createElement("span", { className: clsx_m_default(styles_css_default7["anchor-link-info"], styles_css_default8["anchor-link-info"]) }, anchor.info) + ) + ); +}; + +// node_modules/@cloudscape-design/components/anchor-navigation/index.js +function AnchorNavigation(_a) { + var { scrollSpyOffset = 0 } = _a, props2 = __rest(_a, ["scrollSpyOffset"]); + const baseComponentProps = useBaseComponent("AnchorNavigation"); + return import_react8.default.createElement(InternalAnchorNavigation, Object.assign({ scrollSpyOffset }, props2, baseComponentProps)); +} +applyDisplayName(AnchorNavigation, "AnchorNavigation"); + +// node_modules/@cloudscape-design/components/annotation-context/index.js +var import_react15 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/annotation-context/annotation/open-annotation.js +var import_react12 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/annotation-context/annotation/annotation-trigger.js +var import_react10 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/annotation-context/annotation/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/annotation-context/annotation/styles.scoped.css"; +var styles_css_default9 = { + "arrow": "awsui_arrow_1hpp3_10w1c_99", + "arrow-outer": "awsui_arrow-outer_1hpp3_10w1c_103", + "arrow-inner": "awsui_arrow-inner_1hpp3_10w1c_103", + "arrow-position-right-top": "awsui_arrow-position-right-top_1hpp3_10w1c_144", + "arrow-position-right-bottom": "awsui_arrow-position-right-bottom_1hpp3_10w1c_144", + "arrow-position-left-top": "awsui_arrow-position-left-top_1hpp3_10w1c_147", + "arrow-position-left-bottom": "awsui_arrow-position-left-bottom_1hpp3_10w1c_147", + "arrow-position-top-center": "awsui_arrow-position-top-center_1hpp3_10w1c_150", + "arrow-position-top-responsive": "awsui_arrow-position-top-responsive_1hpp3_10w1c_150", + "arrow-position-bottom-center": "awsui_arrow-position-bottom-center_1hpp3_10w1c_153", + "arrow-position-bottom-responsive": "awsui_arrow-position-bottom-responsive_1hpp3_10w1c_153", + "annotation": "awsui_annotation_1hpp3_10w1c_161", + "next-button": "awsui_next-button_1hpp3_10w1c_162", + "previous-button": "awsui_previous-button_1hpp3_10w1c_163", + "finish-button": "awsui_finish-button_1hpp3_10w1c_164", + "header": "awsui_header_1hpp3_10w1c_165", + "step-counter-content": "awsui_step-counter-content_1hpp3_10w1c_166", + "content": "awsui_content_1hpp3_10w1c_167", + "description": "awsui_description_1hpp3_10w1c_171", + "actionBar": "awsui_actionBar_1hpp3_10w1c_176", + "stepCounter": "awsui_stepCounter_1hpp3_10w1c_183", + "divider": "awsui_divider_1hpp3_10w1c_187", + "hotspot": "awsui_hotspot_1hpp3_10w1c_191", + "icon": "awsui_icon_1hpp3_10w1c_258" +}; + +// node_modules/@cloudscape-design/components/annotation-context/annotation/annotation-icon.js +var import_react9 = __toESM(require_react()); +var AnnotationIcon = ({ open }) => { + if (open) { + return import_react9.default.createElement( + "svg", + { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", focusable: "false", "aria-hidden": "true", className: styles_css_default9.icon }, + import_react9.default.createElement( + "g", + { fill: "none", fillRule: "evenodd", transform: "translate(1 1)" }, + import_react9.default.createElement("circle", { cx: "7", cy: "7", r: "7", strokeWidth: "2" }), + import_react9.default.createElement("path", { strokeLinecap: "square", strokeWidth: "2.2", d: "M2.5,-1 L2.5,3", transform: "rotate(90 1.75 6.25)" }) + ) + ); + } else { + return import_react9.default.createElement( + "svg", + { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", focusable: "false", "aria-hidden": "true", className: styles_css_default9.icon }, + import_react9.default.createElement( + "g", + { fill: "none", fillRule: "evenodd", transform: "translate(1 1)" }, + import_react9.default.createElement("circle", { cx: "7", cy: "7", r: "7", strokeWidth: "2" }), + import_react9.default.createElement( + "g", + { strokeLinecap: "square", strokeWidth: "2.2", transform: "translate(4.5 5)" }, + import_react9.default.createElement("path", { d: "M2.5,0 L2.5,4", transform: "rotate(90 2.5 2)" }), + import_react9.default.createElement("path", { d: "M2.5,0 L2.5,4" }) + ) + ) + ); + } +}; + +// node_modules/@cloudscape-design/components/annotation-context/annotation/annotation-trigger.js +var annotation_trigger_default = import_react10.default.forwardRef(function AnnotationTrigger({ open, onClick: onClickHandler, i18nStrings, taskLocalStepIndex, totalLocalSteps }, ref) { + const onClick = (0, import_react10.useCallback)((event) => { + event.preventDefault(); + onClickHandler(); + }, [onClickHandler]); + return import_react10.default.createElement( + "button", + { ref, className: styles_css_default9.hotspot, "aria-haspopup": "dialog", "aria-label": i18nStrings.labelHotspot(open, taskLocalStepIndex !== null && taskLocalStepIndex !== void 0 ? taskLocalStepIndex : 0, totalLocalSteps !== null && totalLocalSteps !== void 0 ? totalLocalSteps : 0), onClick }, + import_react10.default.createElement(AnnotationIcon, { open }) + ); +}); + +// node_modules/@cloudscape-design/components/annotation-context/annotation/annotation-popover.js +var import_react11 = __toESM(require_react()); +var arrow = (position) => import_react11.default.createElement( + "div", + { className: clsx_m_default(styles_css_default9.arrow, styles_css_default9[`arrow-position-${position}`]) }, + import_react11.default.createElement("div", { className: styles_css_default9["arrow-outer"] }), + import_react11.default.createElement("div", { className: styles_css_default9["arrow-inner"] }) +); +function AnnotationPopover({ title, content, alert, direction = "top", taskLocalStepIndex, totalLocalSteps, showPreviousButton, showFinishButton, onDismiss, nextButtonEnabled, onNextButtonClick, onFinish, trackRef, previousButtonEnabled, onPreviousButtonClick, i18nStrings }) { + (0, import_react11.useEffect)(() => { + var _a; + scrollElementIntoView((_a = trackRef.current) !== null && _a !== void 0 ? _a : void 0); + }, [trackRef]); + const popoverHeaderId = useUniqueId("poppver-header-"); + const stepCounterId = useUniqueId("step-counter-"); + return import_react11.default.createElement( + PopoverContainer, + { size: "medium", fixedWidth: false, position: direction, trackRef, trackKey: taskLocalStepIndex, variant: "annotation", arrow, zIndex: 1e3 }, + import_react11.default.createElement( + PopoverBody, + { + dismissButton: true, + dismissAriaLabel: i18nStrings.labelDismissAnnotation, + header: import_react11.default.createElement(InternalBox, { id: popoverHeaderId, color: "text-body-secondary", fontSize: "body-s", margin: { top: "xxxs" }, className: styles_css_default9.header }, title), + onDismiss, + className: styles_css_default9.annotation, + variant: "annotation", + overflowVisible: "content", + // create new dialog to have the native dialog behavior of the screen readers + key: taskLocalStepIndex, + ariaLabelledby: joinStrings(popoverHeaderId, stepCounterId) + }, + import_react11.default.createElement( + InternalSpaceBetween, + { size: "s" }, + import_react11.default.createElement( + "div", + { className: styles_css_default9.description }, + import_react11.default.createElement(InternalBox, { className: styles_css_default9.content }, content) + ), + alert && import_react11.default.createElement(internal_default10, { type: "warning" }, alert), + import_react11.default.createElement( + InternalSpaceBetween, + { size: "s" }, + import_react11.default.createElement("div", { className: styles_css_default9.divider }), + import_react11.default.createElement( + "div", + { className: styles_css_default9.actionBar }, + import_react11.default.createElement( + "div", + { className: styles_css_default9.stepCounter }, + import_react11.default.createElement(InternalBox, { id: stepCounterId, className: styles_css_default9["step-counter-content"], color: "text-body-secondary", fontSize: "body-s" }, i18nStrings.stepCounterText(taskLocalStepIndex !== null && taskLocalStepIndex !== void 0 ? taskLocalStepIndex : 0, totalLocalSteps !== null && totalLocalSteps !== void 0 ? totalLocalSteps : 0)) + ), + import_react11.default.createElement( + InternalSpaceBetween, + { size: "xs", direction: "horizontal" }, + showPreviousButton && import_react11.default.createElement(InternalButton, { variant: "link", onClick: onPreviousButtonClick, disabled: !previousButtonEnabled, formAction: "none", ariaLabel: i18nStrings.previousButtonText, className: styles_css_default9["previous-button"] }, i18nStrings.previousButtonText), + showFinishButton ? import_react11.default.createElement(InternalButton, { onClick: onFinish, formAction: "none", ariaLabel: i18nStrings.finishButtonText, className: styles_css_default9["finish-button"] }, i18nStrings.finishButtonText) : import_react11.default.createElement(InternalButton, { onClick: onNextButtonClick, disabled: !nextButtonEnabled, formAction: "none", ariaLabel: i18nStrings.nextButtonText, className: styles_css_default9["next-button"] }, i18nStrings.nextButtonText) + ) + ) + ) + ) + ) + ); +} + +// node_modules/@cloudscape-design/components/annotation-context/annotation/open-annotation.js +function OpenAnnotation({ title, content, alert, direction, showPreviousButton, showFinishButton, taskLocalStepIndex, totalLocalSteps, onDismiss, nextButtonEnabled, onNextButtonClick, onFinish, previousButtonEnabled, onPreviousButtonClick, i18nStrings }) { + const trackRef = (0, import_react12.useRef)(null); + return import_react12.default.createElement( + import_react12.default.Fragment, + null, + import_react12.default.createElement(annotation_trigger_default, { open: true, onClick: onDismiss, i18nStrings, ref: trackRef, totalLocalSteps, taskLocalStepIndex }), + import_react12.default.createElement(AnnotationPopover, { trackRef, previousButtonEnabled, showPreviousButton, showFinishButton, totalLocalSteps, i18nStrings, nextButtonEnabled, onDismiss, onFinish, onNextButtonClick, onPreviousButtonClick, taskLocalStepIndex, direction, title, content, alert }) + ); +} + +// node_modules/@cloudscape-design/components/annotation-context/annotation/closed-annotation.js +var import_react13 = __toESM(require_react()); +function ClosedAnnotation({ globalStepIndex, onOpen, i18nStrings, focusOnRender, totalLocalSteps, taskLocalStepIndex }) { + const [hotspotRef, setHotspotRef] = (0, import_react13.useState)(null); + const onClick = (0, import_react13.useCallback)(() => { + onOpen(globalStepIndex); + }, [globalStepIndex, onOpen]); + (0, import_react13.useEffect)(() => { + if (focusOnRender && hotspotRef) { + hotspotRef.focus(); + } + }, [focusOnRender, hotspotRef]); + return import_react13.default.createElement(annotation_trigger_default, { open: false, onClick, i18nStrings, ref: setHotspotRef, totalLocalSteps, taskLocalStepIndex }); +} + +// node_modules/@cloudscape-design/components/annotation-context/context.js +var import_react14 = __toESM(require_react()); +var defaultContext = { + getContentForId: () => null, + registerHotspot() { + }, + unregisterHotspot() { + }, + currentStepIndex: 0, + currentTutorial: null, + onStartTutorial() { + }, + onExitTutorial() { + } +}; +var hotspotContext = import_react14.default.createContext(defaultContext); + +// node_modules/@cloudscape-design/components/annotation-context/utils.js +function getStepInfo(annotations, index) { + if (index >= 0) { + let taskIndex = 0; + for (const task of annotations) { + if (task.steps.length <= index) { + index -= task.steps.length; + taskIndex++; + continue; + } + return { task, step: task.steps[index], localIndex: index, taskIndex }; + } + } + return { task: void 0, step: void 0, localIndex: 0, taskIndex: 0 }; +} + +// node_modules/@cloudscape-design/components/annotation-context/index.js +var emptyTasks = []; +function AnnotationContext({ currentTutorial, children: children2, onStepChange, onFinish: onFinishHandler, onStartTutorial, onExitTutorial, i18nStrings }) { + var _a, _b, _c, _d; + useTelemetry("AnnotationContext"); + const [open, setOpen] = (0, import_react15.useState)(true); + const [currentStepIndex, setCurrentStepIndex] = (0, import_react15.useState)(0); + (0, import_react15.useEffect)(() => { + setCurrentStepIndex(0); + setOpen(true); + }, [currentTutorial, setOpen]); + const [availableHotspots, setAvailableHotspots] = (0, import_react15.useState)({}); + const availableHotspotsRef = (0, import_react15.useRef)(availableHotspots); + const annotations = currentTutorial ? currentTutorial.tasks : emptyTasks; + const { task, step: step2, localIndex, taskIndex } = getStepInfo(annotations, currentStepIndex); + const currentId = step2 === null || step2 === void 0 ? void 0 : step2.hotspotId; + const totalStepCount = annotations.map((a2) => a2.steps.length).reduce((a2, b) => a2 + b, 0); + const id2index = (0, import_react15.useMemo)(() => { + const mapping = {}; + let counter = 0; + for (const annotation of annotations) { + for (const step3 of annotation.steps) { + if (mapping[step3.hotspotId] === void 0) { + mapping[step3.hotspotId] = counter; + } + counter++; + } + } + return mapping; + }, [annotations]); + const openNextStep = (0, import_react15.useCallback)(() => { + const newStepIndex = Math.min(currentStepIndex + 1, totalStepCount); + setCurrentStepIndex(newStepIndex); + fireNonCancelableEvent(onStepChange, { step: newStepIndex, reason: "next" }); + }, [currentStepIndex, onStepChange, totalStepCount]); + const openPreviousStep = (0, import_react15.useCallback)(() => { + const newStepIndex = Math.max(currentStepIndex - 1, 0); + setCurrentStepIndex(newStepIndex); + fireNonCancelableEvent(onStepChange, { step: newStepIndex, reason: "previous" }); + }, [onStepChange, currentStepIndex]); + const onFinish = (0, import_react15.useCallback)(() => fireNonCancelableEvent(onFinishHandler), [onFinishHandler]); + const isCurrentHotspotAvailable = currentId ? availableHotspots[currentId] : null; + (0, import_react15.useEffect)(() => { + if (!currentId || availableHotspotsRef.current[currentId]) { + return; + } + const findNearestHotspot = () => { + let nearestHotspot2 = void 0; + let nearestDistance = Infinity; + for (const hotspotId of Object.keys(availableHotspotsRef.current)) { + const distanceFromCurrentHotspot = Math.abs(id2index[hotspotId] - currentStepIndex); + if (distanceFromCurrentHotspot < nearestDistance) { + nearestDistance = distanceFromCurrentHotspot; + nearestHotspot2 = hotspotId; + } + } + return nearestHotspot2; + }; + const nearestHotspot = findNearestHotspot(); + if (nearestHotspot) { + const newStepIndex = id2index[nearestHotspot]; + setCurrentStepIndex(newStepIndex); + setOpen(true); + fireNonCancelableEvent(onStepChange, { step: newStepIndex, reason: "auto-fallback" }); + } + }, [annotations, isCurrentHotspotAvailable, currentId, currentStepIndex, id2index, onStepChange]); + const onDismiss = (0, import_react15.useCallback)(() => { + setOpen(false); + }, [setOpen]); + const onOpen = (0, import_react15.useCallback)((stepIndex) => { + setCurrentStepIndex(stepIndex); + fireNonCancelableEvent(onStepChange, { step: stepIndex, reason: "open" }); + setOpen(true); + }, [onStepChange, setOpen]); + const idOfPreviousHotspot = (_a = getStepInfo(annotations, currentStepIndex - 1).step) === null || _a === void 0 ? void 0 : _a.hotspotId; + const idOfNextHotspot = (_b = getStepInfo(annotations, currentStepIndex + 1).step) === null || _b === void 0 ? void 0 : _b.hotspotId; + const previousHotspotIsAvailable = (_c = idOfPreviousHotspot !== void 0 && availableHotspots[idOfPreviousHotspot]) !== null && _c !== void 0 ? _c : false; + const nextHotspotIsAvailable = (_d = idOfNextHotspot !== void 0 && availableHotspots[idOfNextHotspot]) !== null && _d !== void 0 ? _d : false; + const getContentForId = (0, import_react15.useCallback)((id, direction) => { + if (currentTutorial === null || currentTutorial === void 0 ? void 0 : currentTutorial.completed) { + return null; + } + const globalStepIndex = id2index[id]; + if (globalStepIndex === void 0) { + return null; + } + if (!task || !step2 || !open || id !== currentId) { + const { task: currentTask, localIndex: currentStepIndex2 } = getStepInfo(annotations, globalStepIndex); + return import_react15.default.createElement(ClosedAnnotation, { globalStepIndex, i18nStrings, onOpen, focusOnRender: id === currentId, totalLocalSteps: currentTask ? currentTask.steps.length : 0, taskLocalStepIndex: currentStepIndex2 }); + } + return import_react15.default.createElement(OpenAnnotation, { i18nStrings, direction, title: i18nStrings.taskTitle(taskIndex, task.title), content: step2.content, alert: step2.warningAlert, showPreviousButton: currentStepIndex !== 0, showFinishButton: currentStepIndex + 1 === totalStepCount, taskLocalStepIndex: localIndex, totalLocalSteps: task.steps.length, nextButtonEnabled: nextHotspotIsAvailable, onNextButtonClick: openNextStep, onFinish, previousButtonEnabled: previousHotspotIsAvailable, onPreviousButtonClick: openPreviousStep, onDismiss }); + }, [ + id2index, + currentTutorial, + task, + step2, + open, + currentId, + currentStepIndex, + i18nStrings, + taskIndex, + localIndex, + totalStepCount, + nextHotspotIsAvailable, + openNextStep, + onFinish, + previousHotspotIsAvailable, + openPreviousStep, + onDismiss, + onOpen, + annotations + ]); + const registerHotspot = (0, import_react15.useCallback)( + (id) => { + if (!id2index || id2index[id] === void 0) { + return; + } + availableHotspotsRef.current = Object.assign(Object.assign({}, availableHotspotsRef.current), { [id]: true }); + setAvailableHotspots((availableHotspots2) => { + if (availableHotspots2[id]) { + return availableHotspots2; + } + return Object.assign(Object.assign({}, availableHotspots2), { [id]: true }); + }); + }, + // We need to react on id2index changes for registering new hotspots when the map changes. + // eslint-disable-next-line react-hooks/exhaustive-deps + [id2index] + ); + const unregisterHotspot = (0, import_react15.useCallback)((id) => { + if (!availableHotspotsRef.current[id]) { + return; + } + availableHotspotsRef.current = removeKey(id, availableHotspotsRef.current); + setAvailableHotspots((availableHotspots2) => { + if (!availableHotspots2[id]) { + return availableHotspots2; + } + return removeKey(id, availableHotspots2); + }); + }, []); + const context = { + getContentForId, + registerHotspot, + unregisterHotspot, + onStartTutorial, + onExitTutorial, + currentStepIndex, + currentTutorial + }; + return import_react15.default.createElement(hotspotContext.Provider, { value: context }, children2); +} +applyDisplayName(AnnotationContext, "AnnotationContext"); +function removeKey(key, object2) { + const _a = object2, _b = key, _ = _a[_b], remainingObject = __rest(_a, [typeof _b === "symbol" ? _b : _b + ""]); + return remainingObject; +} + +// node_modules/@cloudscape-design/components/app-layout/index.js +var import_react75 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/app-layout/widget.js +var import_react72 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/app-layout/implementation.js +var import_react71 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/app-layout/classic.js +var import_react54 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/internal/hooks/use-controllable/index.js +var React15 = __toESM(require_react()); +function useControllable(controlledValue, handler, defaultValue, { componentName: componentName2, changeHandler, controlledProp }) { + const isControlled = React15.useState(controlledValue !== void 0)[0]; + if (isDevelopment) { + React15.useEffect(() => { + if (isControlled && handler === void 0) { + warnOnce(componentName2, `You provided a \`${controlledProp}\` prop without an \`${changeHandler}\` handler. This will render a non-interactive component.`); + } + }, [handler, isControlled, componentName2, changeHandler, controlledProp]); + React15.useEffect(() => { + const isControlledNow = controlledValue !== void 0; + if (isControlled !== isControlledNow) { + const initialMode = isControlled ? "controlled" : "uncontrolled"; + const modeNow = isControlledNow ? "controlled" : "uncontrolled"; + warnOnce(componentName2, `A component tried to change ${initialMode} '${controlledProp}' property to be ${modeNow}. This is not supported. Properties should not switch from ${initialMode} to ${modeNow} (or vice versa). Decide between using a controlled or uncontrolled mode for the lifetime of the component. More info: https://fb.me/react-controlled-components`); + } + }, [isControlled, controlledProp, componentName2, controlledValue]); + } + const [valueState, setValue] = React15.useState(defaultValue); + const [valueHasBeenSet, setValueHasBeenSet] = React15.useState(false); + const currentUncontrolledValue = valueHasBeenSet ? valueState : defaultValue; + const setUncontrolledValue = React15.useCallback((newValue) => { + setValue(newValue); + setValueHasBeenSet(true); + }, [setValue, setValueHasBeenSet]); + if (isControlled) { + return [controlledValue, defaultCallback]; + } else { + return [currentUncontrolledValue, setUncontrolledValue]; + } +} +function defaultCallback() { + return void 0; +} + +// node_modules/@cloudscape-design/components/app-layout/notifications/index.js +var import_react16 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/app-layout/notifications/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/app-layout/notifications/styles.scoped.css"; +var styles_css_default10 = { + "notifications": "awsui_notifications_1hmm4_1xs0q_9", + "notifications-sticky": "awsui_notifications-sticky_1hmm4_1xs0q_10", + "no-content-paddings": "awsui_no-content-paddings_1hmm4_1xs0q_25" +}; + +// node_modules/@cloudscape-design/components/app-layout/notifications/index.js +var Notifications = import_react16.default.forwardRef((_a, ref) => { + var _b, _c; + var { sticky, disableContentPaddings } = _a, props2 = __rest(_a, ["sticky", "disableContentPaddings"]); + return sticky ? import_react16.default.createElement( + "div", + { ref, className: styles_css_default10["notifications-sticky"], style: { top: props2.topOffset } }, + import_react16.default.createElement("div", { role: "region", className: clsx_m_default(props2.testUtilsClassName, disableContentPaddings && styles_css_default10["no-content-paddings"]), "aria-label": (_b = props2.labels) === null || _b === void 0 ? void 0 : _b.notifications }, props2.children) + ) : import_react16.default.createElement("div", { role: "region", ref, className: clsx_m_default(props2.testUtilsClassName, styles_css_default10.notifications, disableContentPaddings && styles_css_default10["no-content-paddings"]), "aria-label": (_c = props2.labels) === null || _c === void 0 ? void 0 : _c.notifications }, props2.children); +}); + +// node_modules/@cloudscape-design/components/app-layout/mobile-toolbar/index.js +var import_react43 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/app-layout/toggles/index.js +var import_react17 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/app-layout/toggles/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/app-layout/toggles/styles.scoped.css"; +var styles_css_default11 = { + "toggle-button": "awsui_toggle-button_16w0h_1lkgf_99", + "close-button": "awsui_close-button_16w0h_1lkgf_134" +}; + +// node_modules/@cloudscape-design/components/app-layout/toggles/index.js +var togglesConfig = { + navigation: { + TagName: "nav", + iconName: "menu", + getLabels: (labels = {}) => ({ + mainLabel: labels.navigation, + openLabel: labels.navigationToggle, + closeLabel: labels.navigationClose + }) + }, + tools: { + TagName: "aside", + iconName: "status-info", + getLabels: (labels = {}) => ({ + mainLabel: labels.tools, + openLabel: labels.toolsToggle, + closeLabel: labels.toolsClose + }) + } +}; +var ToggleButton = import_react17.default.forwardRef(({ className, ariaLabel, ariaExpanded, ariaControls, iconName, iconSvg, disabled, testId, onClick, badge }, ref) => { + return import_react17.default.createElement( + "button", + { ref, className: clsx_m_default(className, styles_css_default11["toggle-button"]), "aria-label": ariaLabel, type: "button", onClick, disabled, "aria-expanded": ariaExpanded, "aria-haspopup": ariaExpanded ? void 0 : true, "aria-controls": ariaControls, "data-testid": testId }, + import_react17.default.createElement(internal_default, { svg: iconSvg, name: iconName, badge }) + ); +}); +var CloseButton = import_react17.default.forwardRef(({ className, ariaLabel, onClick }, ref) => { + return import_react17.default.createElement( + "span", + { className: styles_css_default11["close-button"] }, + import_react17.default.createElement(InternalButton, { ref, className, ariaLabel, variant: "icon", formAction: "none", iconName: "close", onClick }) + ); +}); + +// node_modules/@cloudscape-design/components/app-layout/drawer/overflow-menu.js +var import_react40 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/button-dropdown/internal.js +var import_react39 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/button-dropdown/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/button-dropdown/styles.scoped.css"; +var styles_css_default12 = { + "button-dropdown": "awsui_button-dropdown_sne0l_17rq9_99", + "items-list-container": "awsui_items-list-container_sne0l_17rq9_103", + "awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-0_sne0l_17rq9_1", + "rotate-up": "awsui_rotate-up_sne0l_17rq9_122", + "rotate-down": "awsui_rotate-down_sne0l_17rq9_137", + "header": "awsui_header_sne0l_17rq9_152", + "title": "awsui_title_sne0l_17rq9_163", + "description": "awsui_description_sne0l_17rq9_164", + "split-trigger-wrapper": "awsui_split-trigger-wrapper_sne0l_17rq9_168", + "trigger-item": "awsui_trigger-item_sne0l_17rq9_171", + "trigger-button": "awsui_trigger-button_sne0l_17rq9_174", + "visual-refresh": "awsui_visual-refresh_sne0l_17rq9_185", + "split-trigger": "awsui_split-trigger_sne0l_17rq9_168", + "dropdown-trigger": "awsui_dropdown-trigger_sne0l_17rq9_193", + "test-utils-button-trigger": "awsui_test-utils-button-trigger_sne0l_17rq9_197" +}; + +// node_modules/@cloudscape-design/components/internal/components/dropdown/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/internal/components/dropdown/styles.scoped.css"; +var styles_css_default13 = { + "dropdown-content-wrapper": "awsui_dropdown-content-wrapper_qwoo0_3gt2b_99", + "awsui-motion-fade-in-dropdown": "awsui_awsui-motion-fade-in-dropdown_qwoo0_3gt2b_1", + "refresh": "awsui_refresh_qwoo0_3gt2b_120", + "awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-0_qwoo0_3gt2b_1", + "root": "awsui_root_qwoo0_3gt2b_149", + "interior": "awsui_interior_qwoo0_3gt2b_185", + "dropdown": "awsui_dropdown_qwoo0_3gt2b_99", + "use-portal": "awsui_use-portal_qwoo0_3gt2b_196", + "is-empty": "awsui_is-empty_qwoo0_3gt2b_248", + "dropdown-drop-up": "awsui_dropdown-drop-up_qwoo0_3gt2b_255", + "with-limited-width": "awsui_with-limited-width_qwoo0_3gt2b_259", + "dropdown-drop-left": "awsui_dropdown-drop-left_qwoo0_3gt2b_262", + "dropdown-drop-right": "awsui_dropdown-drop-right_qwoo0_3gt2b_268", + "occupy-entire-width": "awsui_occupy-entire-width_qwoo0_3gt2b_274", + "stretch-beyond-trigger-width": "awsui_stretch-beyond-trigger-width_qwoo0_3gt2b_277", + "hide-block-border": "awsui_hide-block-border_qwoo0_3gt2b_281", + "open": "awsui_open_qwoo0_3gt2b_287", + "nowrap": "awsui_nowrap_qwoo0_3gt2b_296", + "dropdown-content": "awsui_dropdown-content_qwoo0_3gt2b_99", + "stretch-trigger-height": "awsui_stretch-trigger-height_qwoo0_3gt2b_307" +}; + +// node_modules/@cloudscape-design/components/internal/components/dropdown/index.js +var import_react28 = __toESM(require_react()); +var import_react_dom3 = __toESM(require_react_dom()); + +// node_modules/@cloudscape-design/components/internal/components/dropdown/dropdown-fit-handler.js +var AVAILABLE_SPACE_RESERVE_DEFAULT = 50; +var AVAILABLE_SPACE_RESERVE_MOBILE_VERTICAL = 19; +var AVAILABLE_SPACE_RESERVE_MOBILE_HORIZONTAL = 20; +var getClosestParentDimensions = (element) => { + const parents = getOverflowParents(element).map((element2) => { + const { blockSize, inlineSize, insetBlockStart, insetInlineStart } = getLogicalBoundingClientRect(element2); + return { + blockSize, + inlineSize, + insetBlockStart, + insetInlineStart + }; + }); + return parents.shift(); +}; +var defaultMaxDropdownWidth = getBreakpointValue("xxs"); +var getAvailableSpace = ({ trigger, overflowParents, stretchWidth = false, stretchHeight = false, isMobile }) => { + const availableSpaceReserveVertical = stretchHeight ? 0 : isMobile ? AVAILABLE_SPACE_RESERVE_MOBILE_VERTICAL : AVAILABLE_SPACE_RESERVE_DEFAULT; + const availableSpaceReserveHorizontal = stretchWidth ? 0 : isMobile ? AVAILABLE_SPACE_RESERVE_MOBILE_HORIZONTAL : AVAILABLE_SPACE_RESERVE_DEFAULT; + const { insetBlockEnd: triggerBlockEnd, insetInlineStart: triggerInlineStart, insetInlineEnd: triggerInlineEnd } = getLogicalBoundingClientRect(trigger); + return overflowParents.reduce(({ blockStart, blockEnd, inlineStart, inlineEnd }, overflowParent) => { + const offsetTop = triggerBlockEnd - overflowParent.insetBlockStart; + const currentBlockStart = offsetTop - trigger.offsetHeight - availableSpaceReserveVertical; + const currentBlockEnd = overflowParent.blockSize - offsetTop - availableSpaceReserveVertical; + const currentInlineStart = triggerInlineEnd - overflowParent.insetInlineStart - availableSpaceReserveHorizontal; + const currentInlineEnd = overflowParent.insetInlineStart + overflowParent.inlineSize - triggerInlineStart - availableSpaceReserveHorizontal; + return { + blockStart: Math.min(blockStart, currentBlockStart), + blockEnd: Math.min(blockEnd, currentBlockEnd), + inlineStart: Math.min(inlineStart, currentInlineStart), + inlineEnd: Math.min(inlineEnd, currentInlineEnd) + }; + }, { + blockStart: Number.MAX_VALUE, + blockEnd: Number.MAX_VALUE, + inlineStart: Number.MAX_VALUE, + inlineEnd: Number.MAX_VALUE + }); +}; +var getInteriorAvailableSpace = ({ trigger, overflowParents, isMobile }) => { + const AVAILABLE_SPACE_RESERVE_VERTICAL = isMobile ? AVAILABLE_SPACE_RESERVE_MOBILE_VERTICAL : AVAILABLE_SPACE_RESERVE_DEFAULT; + const AVAILABLE_SPACE_RESERVE_HORIZONTAL = isMobile ? AVAILABLE_SPACE_RESERVE_MOBILE_HORIZONTAL : AVAILABLE_SPACE_RESERVE_DEFAULT; + const { insetBlockEnd: triggerBlockEnd, insetBlockStart: triggerBlockStart, insetInlineStart: triggerInlineStart, insetInlineEnd: triggerInlineEnd } = getLogicalBoundingClientRect(trigger); + return overflowParents.reduce(({ blockStart, blockEnd, inlineStart, inlineEnd }, overflowParent) => { + const currentBlockStart = triggerBlockEnd - overflowParent.insetBlockStart - AVAILABLE_SPACE_RESERVE_VERTICAL; + const currentBlockEnd = overflowParent.blockSize - triggerBlockStart + overflowParent.insetBlockStart - AVAILABLE_SPACE_RESERVE_VERTICAL; + const currentInlineStart = triggerInlineStart - overflowParent.insetInlineStart - AVAILABLE_SPACE_RESERVE_HORIZONTAL; + const currentInlineEnd = overflowParent.insetInlineStart + overflowParent.inlineSize - triggerInlineEnd - AVAILABLE_SPACE_RESERVE_HORIZONTAL; + return { + blockStart: Math.min(blockStart, currentBlockStart), + blockEnd: Math.min(blockEnd, currentBlockEnd), + inlineStart: Math.min(inlineStart, currentInlineStart), + inlineEnd: Math.min(inlineEnd, currentInlineEnd) + }; + }, { + blockStart: Number.MAX_VALUE, + blockEnd: Number.MAX_VALUE, + inlineStart: Number.MAX_VALUE, + inlineEnd: Number.MAX_VALUE + }); +}; +var getWidths = ({ triggerElement, dropdownElement, desiredMinWidth, stretchBeyondTriggerWidth = false }) => { + const { inlineSize: triggerInlineSize } = getLogicalBoundingClientRect(triggerElement); + const minWidth = desiredMinWidth ? Math.min(triggerInlineSize, desiredMinWidth) : triggerInlineSize; + const maxWidth = stretchBeyondTriggerWidth ? Math.max(defaultMaxDropdownWidth, triggerInlineSize) : Number.MAX_VALUE; + const { inlineSize: requiredWidth } = getLogicalBoundingClientRect(dropdownElement); + const idealWidth = Math.min(Math.max(requiredWidth, minWidth), maxWidth); + return { idealWidth, minWidth, triggerInlineSize }; +}; +var hasEnoughSpaceToStretchBeyondTriggerWidth = ({ triggerElement, dropdownElement, desiredMinWidth, expandToViewport, stretchWidth, stretchHeight, isMobile }) => { + const overflowParents = getOverflowParentDimensions({ + element: dropdownElement, + excludeClosestParent: false, + expandToViewport, + canExpandOutsideViewport: stretchHeight + }); + const { idealWidth } = getWidths({ + triggerElement, + dropdownElement, + desiredMinWidth, + stretchBeyondTriggerWidth: true + }); + const availableSpace = getAvailableSpace({ + trigger: triggerElement, + overflowParents, + stretchWidth, + stretchHeight, + isMobile + }); + return idealWidth <= availableSpace.inlineStart || idealWidth <= availableSpace.inlineEnd; +}; +var getDropdownPosition = ({ triggerElement, dropdownElement, overflowParents, minWidth: desiredMinWidth, preferCenter = false, stretchWidth = false, stretchHeight = false, isMobile = false, stretchBeyondTriggerWidth = false }) => { + const availableSpace = getAvailableSpace({ + trigger: triggerElement, + overflowParents, + stretchWidth, + stretchHeight, + isMobile + }); + const { idealWidth, minWidth, triggerInlineSize } = getWidths({ + triggerElement, + dropdownElement, + desiredMinWidth, + stretchBeyondTriggerWidth + }); + let dropInlineStart; + let insetInlineStart = null; + let inlineSize = idealWidth; + if (idealWidth <= availableSpace.inlineEnd) { + dropInlineStart = false; + } else if (idealWidth <= availableSpace.inlineStart) { + dropInlineStart = true; + } else { + dropInlineStart = availableSpace.inlineStart > availableSpace.inlineEnd; + inlineSize = Math.max(availableSpace.inlineStart, availableSpace.inlineEnd, minWidth); + } + if (preferCenter) { + const spillOver = (idealWidth - triggerInlineSize) / 2; + const availableOutsideLeft = availableSpace.inlineStart - triggerInlineSize; + const availableOutsideRight = availableSpace.inlineEnd - triggerInlineSize; + const fitsInCenter = availableOutsideLeft >= spillOver && availableOutsideRight >= spillOver; + if (fitsInCenter) { + insetInlineStart = -spillOver; + } + } + const dropBlockStart = availableSpace.blockEnd < dropdownElement.offsetHeight && availableSpace.blockStart > availableSpace.blockEnd; + const availableHeight = dropBlockStart ? availableSpace.blockStart : availableSpace.blockEnd; + const croppedHeight = stretchHeight ? availableHeight : Math.floor(availableHeight / 31) * 31 + 16; + return { + dropBlockStart, + dropInlineStart, + insetInlineStart: insetInlineStart === null ? "auto" : `${insetInlineStart}px`, + blockSize: `${croppedHeight}px`, + inlineSize: `${inlineSize}px` + }; +}; +var getInteriorDropdownPosition = (trigger, dropdown, overflowParents, isMobile) => { + const availableSpace = getInteriorAvailableSpace({ trigger, overflowParents, isMobile }); + const { insetBlockEnd: triggerBlockEnd, insetBlockStart: triggerBlockStart, inlineSize: triggerInlineSize } = getLogicalBoundingClientRect(trigger); + const { insetBlockStart: parentDropdownBlockStart, blockSize: parentDropdownHeight } = getClosestParentDimensions(trigger); + let dropInlineStart; + let { inlineSize } = getLogicalBoundingClientRect(dropdown); + const insetBlockStart = triggerBlockStart - parentDropdownBlockStart; + if (inlineSize <= availableSpace.inlineEnd) { + dropInlineStart = false; + } else if (inlineSize <= availableSpace.inlineStart) { + dropInlineStart = true; + } else { + dropInlineStart = availableSpace.inlineStart > availableSpace.inlineEnd; + inlineSize = Math.max(availableSpace.inlineStart, availableSpace.inlineEnd); + } + const insetInlineStart = dropInlineStart ? 0 - inlineSize : triggerInlineSize; + const dropBlockStart = availableSpace.blockEnd < dropdown.offsetHeight && availableSpace.blockStart > availableSpace.blockEnd; + const insetBlockEnd = dropBlockStart ? parentDropdownBlockStart + parentDropdownHeight - triggerBlockEnd : 0; + const availableHeight = dropBlockStart ? availableSpace.blockStart : availableSpace.blockEnd; + const croppedHeight = Math.floor(availableHeight / 31) * 31 + 16; + return { + dropBlockStart, + dropInlineStart, + blockSize: `${croppedHeight}px`, + inlineSize: `${inlineSize}px`, + insetBlockStart: `${insetBlockStart}px`, + insetBlockEnd: `${insetBlockEnd}px`, + insetInlineStart: `${insetInlineStart}px` + }; +}; +var calculatePosition = (dropdownElement, triggerElement, verticalContainerElement, interior, expandToViewport, preferCenter, stretchWidth, stretchHeight, isMobile, minWidth, stretchBeyondTriggerWidth) => { + verticalContainerElement.style.maxBlockSize = ""; + dropdownElement.style.inlineSize = ""; + dropdownElement.style.insetBlockStart = ""; + dropdownElement.style.insetBlockEnd = ""; + dropdownElement.style.insetInlineStart = ""; + dropdownElement.classList.remove(styles_css_default13["dropdown-drop-left"]); + dropdownElement.classList.remove(styles_css_default13["dropdown-drop-right"]); + dropdownElement.classList.remove(styles_css_default13["dropdown-drop-up"]); + const overflowParents = getOverflowParentDimensions({ + element: dropdownElement, + excludeClosestParent: interior, + expandToViewport, + canExpandOutsideViewport: stretchHeight + }); + const position = interior ? getInteriorDropdownPosition(triggerElement, dropdownElement, overflowParents, isMobile) : getDropdownPosition({ + triggerElement, + dropdownElement, + overflowParents, + minWidth, + preferCenter, + stretchWidth, + stretchHeight, + isMobile, + stretchBeyondTriggerWidth + }); + const triggerBox = triggerElement.getBoundingClientRect(); + return [position, triggerBox]; +}; + +// node_modules/@cloudscape-design/components/internal/components/transition/index.js +var import_react25 = __toESM(require_react()); +var import_react26 = __toESM(require_react()); + +// node_modules/@babel/runtime/helpers/esm/extends.js +function _extends() { + _extends = Object.assign ? Object.assign.bind() : function(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + return target; + }; + return _extends.apply(this, arguments); +} + +// node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +function _objectWithoutPropertiesLoose(source, excluded) { + if (source == null) return {}; + var target = {}; + var sourceKeys = Object.keys(source); + var key, i; + for (i = 0; i < sourceKeys.length; i++) { + key = sourceKeys[i]; + if (excluded.indexOf(key) >= 0) continue; + target[key] = source[key]; + } + return target; +} + +// node_modules/@babel/runtime/helpers/esm/inheritsLoose.js +function _inheritsLoose(subClass, superClass) { + subClass.prototype = Object.create(superClass.prototype); + subClass.prototype.constructor = subClass; + _setPrototypeOf(subClass, superClass); +} + +// node_modules/react-transition-group/esm/CSSTransition.js +var import_prop_types3 = __toESM(require_prop_types()); + +// node_modules/dom-helpers/esm/hasClass.js +function hasClass(element, className) { + if (element.classList) return !!className && element.classList.contains(className); + return (" " + (element.className.baseVal || element.className) + " ").indexOf(" " + className + " ") !== -1; +} + +// node_modules/dom-helpers/esm/addClass.js +function addClass(element, className) { + if (element.classList) element.classList.add(className); + else if (!hasClass(element, className)) if (typeof element.className === "string") element.className = element.className + " " + className; + else element.setAttribute("class", (element.className && element.className.baseVal || "") + " " + className); +} + +// node_modules/dom-helpers/esm/removeClass.js +function replaceClassName(origClass, classToRemove) { + return origClass.replace(new RegExp("(^|\\s)" + classToRemove + "(?:\\s|$)", "g"), "$1").replace(/\s+/g, " ").replace(/^\s*|\s*$/g, ""); +} +function removeClass(element, className) { + if (element.classList) { + element.classList.remove(className); + } else if (typeof element.className === "string") { + element.className = replaceClassName(element.className, className); + } else { + element.setAttribute("class", replaceClassName(element.className && element.className.baseVal || "", className)); + } +} + +// node_modules/react-transition-group/esm/CSSTransition.js +var import_react20 = __toESM(require_react()); + +// node_modules/react-transition-group/esm/Transition.js +var import_prop_types2 = __toESM(require_prop_types()); +var import_react19 = __toESM(require_react()); +var import_react_dom = __toESM(require_react_dom()); + +// node_modules/react-transition-group/esm/config.js +var config_default = { + disabled: false +}; + +// node_modules/react-transition-group/esm/utils/PropTypes.js +var import_prop_types = __toESM(require_prop_types()); +var timeoutsShape = true ? import_prop_types.default.oneOfType([import_prop_types.default.number, import_prop_types.default.shape({ + enter: import_prop_types.default.number, + exit: import_prop_types.default.number, + appear: import_prop_types.default.number +}).isRequired]) : null; +var classNamesShape = true ? import_prop_types.default.oneOfType([import_prop_types.default.string, import_prop_types.default.shape({ + enter: import_prop_types.default.string, + exit: import_prop_types.default.string, + active: import_prop_types.default.string +}), import_prop_types.default.shape({ + enter: import_prop_types.default.string, + enterDone: import_prop_types.default.string, + enterActive: import_prop_types.default.string, + exit: import_prop_types.default.string, + exitDone: import_prop_types.default.string, + exitActive: import_prop_types.default.string +})]) : null; + +// node_modules/react-transition-group/esm/TransitionGroupContext.js +var import_react18 = __toESM(require_react()); +var TransitionGroupContext_default = import_react18.default.createContext(null); + +// node_modules/react-transition-group/esm/utils/reflow.js +var forceReflow = function forceReflow2(node) { + return node.scrollTop; +}; + +// node_modules/react-transition-group/esm/Transition.js +var UNMOUNTED = "unmounted"; +var EXITED = "exited"; +var ENTERING = "entering"; +var ENTERED = "entered"; +var EXITING = "exiting"; +var Transition = function(_React$Component) { + _inheritsLoose(Transition3, _React$Component); + function Transition3(props2, context) { + var _this; + _this = _React$Component.call(this, props2, context) || this; + var parentGroup = context; + var appear = parentGroup && !parentGroup.isMounting ? props2.enter : props2.appear; + var initialStatus; + _this.appearStatus = null; + if (props2.in) { + if (appear) { + initialStatus = EXITED; + _this.appearStatus = ENTERING; + } else { + initialStatus = ENTERED; + } + } else { + if (props2.unmountOnExit || props2.mountOnEnter) { + initialStatus = UNMOUNTED; + } else { + initialStatus = EXITED; + } + } + _this.state = { + status: initialStatus + }; + _this.nextCallback = null; + return _this; + } + Transition3.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) { + var nextIn = _ref.in; + if (nextIn && prevState.status === UNMOUNTED) { + return { + status: EXITED + }; + } + return null; + }; + var _proto = Transition3.prototype; + _proto.componentDidMount = function componentDidMount() { + this.updateStatus(true, this.appearStatus); + }; + _proto.componentDidUpdate = function componentDidUpdate(prevProps) { + var nextStatus = null; + if (prevProps !== this.props) { + var status = this.state.status; + if (this.props.in) { + if (status !== ENTERING && status !== ENTERED) { + nextStatus = ENTERING; + } + } else { + if (status === ENTERING || status === ENTERED) { + nextStatus = EXITING; + } + } + } + this.updateStatus(false, nextStatus); + }; + _proto.componentWillUnmount = function componentWillUnmount() { + this.cancelNextCallback(); + }; + _proto.getTimeouts = function getTimeouts() { + var timeout2 = this.props.timeout; + var exit, enter, appear; + exit = enter = appear = timeout2; + if (timeout2 != null && typeof timeout2 !== "number") { + exit = timeout2.exit; + enter = timeout2.enter; + appear = timeout2.appear !== void 0 ? timeout2.appear : enter; + } + return { + exit, + enter, + appear + }; + }; + _proto.updateStatus = function updateStatus(mounting, nextStatus) { + if (mounting === void 0) { + mounting = false; + } + if (nextStatus !== null) { + this.cancelNextCallback(); + if (nextStatus === ENTERING) { + if (this.props.unmountOnExit || this.props.mountOnEnter) { + var node = this.props.nodeRef ? this.props.nodeRef.current : import_react_dom.default.findDOMNode(this); + if (node) forceReflow(node); + } + this.performEnter(mounting); + } else { + this.performExit(); + } + } else if (this.props.unmountOnExit && this.state.status === EXITED) { + this.setState({ + status: UNMOUNTED + }); + } + }; + _proto.performEnter = function performEnter(mounting) { + var _this2 = this; + var enter = this.props.enter; + var appearing = this.context ? this.context.isMounting : mounting; + var _ref2 = this.props.nodeRef ? [appearing] : [import_react_dom.default.findDOMNode(this), appearing], maybeNode = _ref2[0], maybeAppearing = _ref2[1]; + var timeouts = this.getTimeouts(); + var enterTimeout = appearing ? timeouts.appear : timeouts.enter; + if (!mounting && !enter || config_default.disabled) { + this.safeSetState({ + status: ENTERED + }, function() { + _this2.props.onEntered(maybeNode); + }); + return; + } + this.props.onEnter(maybeNode, maybeAppearing); + this.safeSetState({ + status: ENTERING + }, function() { + _this2.props.onEntering(maybeNode, maybeAppearing); + _this2.onTransitionEnd(enterTimeout, function() { + _this2.safeSetState({ + status: ENTERED + }, function() { + _this2.props.onEntered(maybeNode, maybeAppearing); + }); + }); + }); + }; + _proto.performExit = function performExit() { + var _this3 = this; + var exit = this.props.exit; + var timeouts = this.getTimeouts(); + var maybeNode = this.props.nodeRef ? void 0 : import_react_dom.default.findDOMNode(this); + if (!exit || config_default.disabled) { + this.safeSetState({ + status: EXITED + }, function() { + _this3.props.onExited(maybeNode); + }); + return; + } + this.props.onExit(maybeNode); + this.safeSetState({ + status: EXITING + }, function() { + _this3.props.onExiting(maybeNode); + _this3.onTransitionEnd(timeouts.exit, function() { + _this3.safeSetState({ + status: EXITED + }, function() { + _this3.props.onExited(maybeNode); + }); + }); + }); + }; + _proto.cancelNextCallback = function cancelNextCallback() { + if (this.nextCallback !== null) { + this.nextCallback.cancel(); + this.nextCallback = null; + } + }; + _proto.safeSetState = function safeSetState(nextState, callback) { + callback = this.setNextCallback(callback); + this.setState(nextState, callback); + }; + _proto.setNextCallback = function setNextCallback(callback) { + var _this4 = this; + var active = true; + this.nextCallback = function(event) { + if (active) { + active = false; + _this4.nextCallback = null; + callback(event); + } + }; + this.nextCallback.cancel = function() { + active = false; + }; + return this.nextCallback; + }; + _proto.onTransitionEnd = function onTransitionEnd(timeout2, handler) { + this.setNextCallback(handler); + var node = this.props.nodeRef ? this.props.nodeRef.current : import_react_dom.default.findDOMNode(this); + var doesNotHaveTimeoutOrListener = timeout2 == null && !this.props.addEndListener; + if (!node || doesNotHaveTimeoutOrListener) { + setTimeout(this.nextCallback, 0); + return; + } + if (this.props.addEndListener) { + var _ref3 = this.props.nodeRef ? [this.nextCallback] : [node, this.nextCallback], maybeNode = _ref3[0], maybeNextCallback = _ref3[1]; + this.props.addEndListener(maybeNode, maybeNextCallback); + } + if (timeout2 != null) { + setTimeout(this.nextCallback, timeout2); + } + }; + _proto.render = function render2() { + var status = this.state.status; + if (status === UNMOUNTED) { + return null; + } + var _this$props = this.props, children2 = _this$props.children, _in = _this$props.in, _mountOnEnter = _this$props.mountOnEnter, _unmountOnExit = _this$props.unmountOnExit, _appear = _this$props.appear, _enter = _this$props.enter, _exit = _this$props.exit, _timeout = _this$props.timeout, _addEndListener = _this$props.addEndListener, _onEnter = _this$props.onEnter, _onEntering = _this$props.onEntering, _onEntered = _this$props.onEntered, _onExit = _this$props.onExit, _onExiting = _this$props.onExiting, _onExited = _this$props.onExited, _nodeRef = _this$props.nodeRef, childProps = _objectWithoutPropertiesLoose(_this$props, ["children", "in", "mountOnEnter", "unmountOnExit", "appear", "enter", "exit", "timeout", "addEndListener", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "nodeRef"]); + return ( + // allows for nested Transitions + import_react19.default.createElement(TransitionGroupContext_default.Provider, { + value: null + }, typeof children2 === "function" ? children2(status, childProps) : import_react19.default.cloneElement(import_react19.default.Children.only(children2), childProps)) + ); + }; + return Transition3; +}(import_react19.default.Component); +Transition.contextType = TransitionGroupContext_default; +Transition.propTypes = true ? { + /** + * A React reference to DOM element that need to transition: + * https://stackoverflow.com/a/51127130/4671932 + * + * - When `nodeRef` prop is used, `node` is not passed to callback functions + * (e.g. `onEnter`) because user already has direct access to the node. + * - When changing `key` prop of `Transition` in a `TransitionGroup` a new + * `nodeRef` need to be provided to `Transition` with changed `key` prop + * (see + * [test/CSSTransition-test.js](https://github.com/reactjs/react-transition-group/blob/13435f897b3ab71f6e19d724f145596f5910581c/test/CSSTransition-test.js#L362-L437)). + */ + nodeRef: import_prop_types2.default.shape({ + current: typeof Element === "undefined" ? import_prop_types2.default.any : function(propValue, key, componentName2, location, propFullName, secret) { + var value = propValue[key]; + return import_prop_types2.default.instanceOf(value && "ownerDocument" in value ? value.ownerDocument.defaultView.Element : Element)(propValue, key, componentName2, location, propFullName, secret); + } + }), + /** + * A `function` child can be used instead of a React element. This function is + * called with the current transition status (`'entering'`, `'entered'`, + * `'exiting'`, `'exited'`), which can be used to apply context + * specific props to a component. + * + * ```jsx + * + * {state => ( + * + * )} + * + * ``` + */ + children: import_prop_types2.default.oneOfType([import_prop_types2.default.func.isRequired, import_prop_types2.default.element.isRequired]).isRequired, + /** + * Show the component; triggers the enter or exit states + */ + in: import_prop_types2.default.bool, + /** + * By default the child component is mounted immediately along with + * the parent `Transition` component. If you want to "lazy mount" the component on the + * first `in={true}` you can set `mountOnEnter`. After the first enter transition the component will stay + * mounted, even on "exited", unless you also specify `unmountOnExit`. + */ + mountOnEnter: import_prop_types2.default.bool, + /** + * By default the child component stays mounted after it reaches the `'exited'` state. + * Set `unmountOnExit` if you'd prefer to unmount the component after it finishes exiting. + */ + unmountOnExit: import_prop_types2.default.bool, + /** + * By default the child component does not perform the enter transition when + * it first mounts, regardless of the value of `in`. If you want this + * behavior, set both `appear` and `in` to `true`. + * + * > **Note**: there are no special appear states like `appearing`/`appeared`, this prop + * > only adds an additional enter transition. However, in the + * > `` component that first enter transition does result in + * > additional `.appear-*` classes, that way you can choose to style it + * > differently. + */ + appear: import_prop_types2.default.bool, + /** + * Enable or disable enter transitions. + */ + enter: import_prop_types2.default.bool, + /** + * Enable or disable exit transitions. + */ + exit: import_prop_types2.default.bool, + /** + * The duration of the transition, in milliseconds. + * Required unless `addEndListener` is provided. + * + * You may specify a single timeout for all transitions: + * + * ```jsx + * timeout={500} + * ``` + * + * or individually: + * + * ```jsx + * timeout={{ + * appear: 500, + * enter: 300, + * exit: 500, + * }} + * ``` + * + * - `appear` defaults to the value of `enter` + * - `enter` defaults to `0` + * - `exit` defaults to `0` + * + * @type {number | { enter?: number, exit?: number, appear?: number }} + */ + timeout: function timeout(props2) { + var pt = timeoutsShape; + if (!props2.addEndListener) pt = pt.isRequired; + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + return pt.apply(void 0, [props2].concat(args)); + }, + /** + * Add a custom transition end trigger. Called with the transitioning + * DOM node and a `done` callback. Allows for more fine grained transition end + * logic. Timeouts are still used as a fallback if provided. + * + * **Note**: when `nodeRef` prop is passed, `node` is not passed. + * + * ```jsx + * addEndListener={(node, done) => { + * // use the css transitionend event to mark the finish of a transition + * node.addEventListener('transitionend', done, false); + * }} + * ``` + */ + addEndListener: import_prop_types2.default.func, + /** + * Callback fired before the "entering" status is applied. An extra parameter + * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount + * + * **Note**: when `nodeRef` prop is passed, `node` is not passed. + * + * @type Function(node: HtmlElement, isAppearing: bool) -> void + */ + onEnter: import_prop_types2.default.func, + /** + * Callback fired after the "entering" status is applied. An extra parameter + * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount + * + * **Note**: when `nodeRef` prop is passed, `node` is not passed. + * + * @type Function(node: HtmlElement, isAppearing: bool) + */ + onEntering: import_prop_types2.default.func, + /** + * Callback fired after the "entered" status is applied. An extra parameter + * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount + * + * **Note**: when `nodeRef` prop is passed, `node` is not passed. + * + * @type Function(node: HtmlElement, isAppearing: bool) -> void + */ + onEntered: import_prop_types2.default.func, + /** + * Callback fired before the "exiting" status is applied. + * + * **Note**: when `nodeRef` prop is passed, `node` is not passed. + * + * @type Function(node: HtmlElement) -> void + */ + onExit: import_prop_types2.default.func, + /** + * Callback fired after the "exiting" status is applied. + * + * **Note**: when `nodeRef` prop is passed, `node` is not passed. + * + * @type Function(node: HtmlElement) -> void + */ + onExiting: import_prop_types2.default.func, + /** + * Callback fired after the "exited" status is applied. + * + * **Note**: when `nodeRef` prop is passed, `node` is not passed + * + * @type Function(node: HtmlElement) -> void + */ + onExited: import_prop_types2.default.func +} : {}; +function noop() { +} +Transition.defaultProps = { + in: false, + mountOnEnter: false, + unmountOnExit: false, + appear: false, + enter: true, + exit: true, + onEnter: noop, + onEntering: noop, + onEntered: noop, + onExit: noop, + onExiting: noop, + onExited: noop +}; +Transition.UNMOUNTED = UNMOUNTED; +Transition.EXITED = EXITED; +Transition.ENTERING = ENTERING; +Transition.ENTERED = ENTERED; +Transition.EXITING = EXITING; +var Transition_default = Transition; + +// node_modules/react-transition-group/esm/CSSTransition.js +var _addClass = function addClass2(node, classes) { + return node && classes && classes.split(" ").forEach(function(c) { + return addClass(node, c); + }); +}; +var removeClass2 = function removeClass3(node, classes) { + return node && classes && classes.split(" ").forEach(function(c) { + return removeClass(node, c); + }); +}; +var CSSTransition = function(_React$Component) { + _inheritsLoose(CSSTransition2, _React$Component); + function CSSTransition2() { + var _this; + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this; + _this.appliedClasses = { + appear: {}, + enter: {}, + exit: {} + }; + _this.onEnter = function(maybeNode, maybeAppearing) { + var _this$resolveArgument = _this.resolveArguments(maybeNode, maybeAppearing), node = _this$resolveArgument[0], appearing = _this$resolveArgument[1]; + _this.removeClasses(node, "exit"); + _this.addClass(node, appearing ? "appear" : "enter", "base"); + if (_this.props.onEnter) { + _this.props.onEnter(maybeNode, maybeAppearing); + } + }; + _this.onEntering = function(maybeNode, maybeAppearing) { + var _this$resolveArgument2 = _this.resolveArguments(maybeNode, maybeAppearing), node = _this$resolveArgument2[0], appearing = _this$resolveArgument2[1]; + var type = appearing ? "appear" : "enter"; + _this.addClass(node, type, "active"); + if (_this.props.onEntering) { + _this.props.onEntering(maybeNode, maybeAppearing); + } + }; + _this.onEntered = function(maybeNode, maybeAppearing) { + var _this$resolveArgument3 = _this.resolveArguments(maybeNode, maybeAppearing), node = _this$resolveArgument3[0], appearing = _this$resolveArgument3[1]; + var type = appearing ? "appear" : "enter"; + _this.removeClasses(node, type); + _this.addClass(node, type, "done"); + if (_this.props.onEntered) { + _this.props.onEntered(maybeNode, maybeAppearing); + } + }; + _this.onExit = function(maybeNode) { + var _this$resolveArgument4 = _this.resolveArguments(maybeNode), node = _this$resolveArgument4[0]; + _this.removeClasses(node, "appear"); + _this.removeClasses(node, "enter"); + _this.addClass(node, "exit", "base"); + if (_this.props.onExit) { + _this.props.onExit(maybeNode); + } + }; + _this.onExiting = function(maybeNode) { + var _this$resolveArgument5 = _this.resolveArguments(maybeNode), node = _this$resolveArgument5[0]; + _this.addClass(node, "exit", "active"); + if (_this.props.onExiting) { + _this.props.onExiting(maybeNode); + } + }; + _this.onExited = function(maybeNode) { + var _this$resolveArgument6 = _this.resolveArguments(maybeNode), node = _this$resolveArgument6[0]; + _this.removeClasses(node, "exit"); + _this.addClass(node, "exit", "done"); + if (_this.props.onExited) { + _this.props.onExited(maybeNode); + } + }; + _this.resolveArguments = function(maybeNode, maybeAppearing) { + return _this.props.nodeRef ? [_this.props.nodeRef.current, maybeNode] : [maybeNode, maybeAppearing]; + }; + _this.getClassNames = function(type) { + var classNames = _this.props.classNames; + var isStringClassNames = typeof classNames === "string"; + var prefix = isStringClassNames && classNames ? classNames + "-" : ""; + var baseClassName = isStringClassNames ? "" + prefix + type : classNames[type]; + var activeClassName = isStringClassNames ? baseClassName + "-active" : classNames[type + "Active"]; + var doneClassName = isStringClassNames ? baseClassName + "-done" : classNames[type + "Done"]; + return { + baseClassName, + activeClassName, + doneClassName + }; + }; + return _this; + } + var _proto = CSSTransition2.prototype; + _proto.addClass = function addClass3(node, type, phase) { + var className = this.getClassNames(type)[phase + "ClassName"]; + var _this$getClassNames = this.getClassNames("enter"), doneClassName = _this$getClassNames.doneClassName; + if (type === "appear" && phase === "done" && doneClassName) { + className += " " + doneClassName; + } + if (phase === "active") { + if (node) forceReflow(node); + } + if (className) { + this.appliedClasses[type][phase] = className; + _addClass(node, className); + } + }; + _proto.removeClasses = function removeClasses(node, type) { + var _this$appliedClasses$ = this.appliedClasses[type], baseClassName = _this$appliedClasses$.base, activeClassName = _this$appliedClasses$.active, doneClassName = _this$appliedClasses$.done; + this.appliedClasses[type] = {}; + if (baseClassName) { + removeClass2(node, baseClassName); + } + if (activeClassName) { + removeClass2(node, activeClassName); + } + if (doneClassName) { + removeClass2(node, doneClassName); + } + }; + _proto.render = function render2() { + var _this$props = this.props, _ = _this$props.classNames, props2 = _objectWithoutPropertiesLoose(_this$props, ["classNames"]); + return import_react20.default.createElement(Transition_default, _extends({}, props2, { + onEnter: this.onEnter, + onEntered: this.onEntered, + onEntering: this.onEntering, + onExit: this.onExit, + onExiting: this.onExiting, + onExited: this.onExited + })); + }; + return CSSTransition2; +}(import_react20.default.Component); +CSSTransition.defaultProps = { + classNames: "" +}; +CSSTransition.propTypes = true ? _extends({}, Transition_default.propTypes, { + /** + * The animation classNames applied to the component as it appears, enters, + * exits or has finished the transition. A single name can be provided, which + * will be suffixed for each stage, e.g. `classNames="fade"` applies: + * + * - `fade-appear`, `fade-appear-active`, `fade-appear-done` + * - `fade-enter`, `fade-enter-active`, `fade-enter-done` + * - `fade-exit`, `fade-exit-active`, `fade-exit-done` + * + * A few details to note about how these classes are applied: + * + * 1. They are _joined_ with the ones that are already defined on the child + * component, so if you want to add some base styles, you can use + * `className` without worrying that it will be overridden. + * + * 2. If the transition component mounts with `in={false}`, no classes are + * applied yet. You might be expecting `*-exit-done`, but if you think + * about it, a component cannot finish exiting if it hasn't entered yet. + * + * 2. `fade-appear-done` and `fade-enter-done` will _both_ be applied. This + * allows you to define different behavior for when appearing is done and + * when regular entering is done, using selectors like + * `.fade-enter-done:not(.fade-appear-done)`. For example, you could apply + * an epic entrance animation when element first appears in the DOM using + * [Animate.css](https://daneden.github.io/animate.css/). Otherwise you can + * simply use `fade-enter-done` for defining both cases. + * + * Each individual classNames can also be specified independently like: + * + * ```js + * classNames={{ + * appear: 'my-appear', + * appearActive: 'my-active-appear', + * appearDone: 'my-done-appear', + * enter: 'my-enter', + * enterActive: 'my-active-enter', + * enterDone: 'my-done-enter', + * exit: 'my-exit', + * exitActive: 'my-active-exit', + * exitDone: 'my-done-exit', + * }} + * ``` + * + * If you want to set these classes using CSS Modules: + * + * ```js + * import styles from './styles.css'; + * ``` + * + * you might want to use camelCase in your CSS file, that way could simply + * spread them instead of listing them one by one: + * + * ```js + * classNames={{ ...styles }} + * ``` + * + * @type {string | { + * appear?: string, + * appearActive?: string, + * appearDone?: string, + * enter?: string, + * enterActive?: string, + * enterDone?: string, + * exit?: string, + * exitActive?: string, + * exitDone?: string, + * }} + */ + classNames: classNamesShape, + /** + * A `` callback fired immediately after the 'enter' or 'appear' class is + * applied. + * + * **Note**: when `nodeRef` prop is passed, `node` is not passed. + * + * @type Function(node: HtmlElement, isAppearing: bool) + */ + onEnter: import_prop_types3.default.func, + /** + * A `` callback fired immediately after the 'enter-active' or + * 'appear-active' class is applied. + * + * **Note**: when `nodeRef` prop is passed, `node` is not passed. + * + * @type Function(node: HtmlElement, isAppearing: bool) + */ + onEntering: import_prop_types3.default.func, + /** + * A `` callback fired immediately after the 'enter' or + * 'appear' classes are **removed** and the `done` class is added to the DOM node. + * + * **Note**: when `nodeRef` prop is passed, `node` is not passed. + * + * @type Function(node: HtmlElement, isAppearing: bool) + */ + onEntered: import_prop_types3.default.func, + /** + * A `` callback fired immediately after the 'exit' class is + * applied. + * + * **Note**: when `nodeRef` prop is passed, `node` is not passed + * + * @type Function(node: HtmlElement) + */ + onExit: import_prop_types3.default.func, + /** + * A `` callback fired immediately after the 'exit-active' is applied. + * + * **Note**: when `nodeRef` prop is passed, `node` is not passed + * + * @type Function(node: HtmlElement) + */ + onExiting: import_prop_types3.default.func, + /** + * A `` callback fired immediately after the 'exit' classes + * are **removed** and the `exit-done` class is added to the DOM node. + * + * **Note**: when `nodeRef` prop is passed, `node` is not passed + * + * @type Function(node: HtmlElement) + */ + onExited: import_prop_types3.default.func +}) : {}; +var CSSTransition_default = CSSTransition; + +// node_modules/react-transition-group/esm/ReplaceTransition.js +var import_prop_types5 = __toESM(require_prop_types()); +var import_react23 = __toESM(require_react()); +var import_react_dom2 = __toESM(require_react_dom()); + +// node_modules/react-transition-group/esm/TransitionGroup.js +var import_prop_types4 = __toESM(require_prop_types()); +var import_react22 = __toESM(require_react()); + +// node_modules/react-transition-group/esm/utils/ChildMapping.js +var import_react21 = __toESM(require_react()); +function getChildMapping(children2, mapFn) { + var mapper = function mapper2(child) { + return mapFn && (0, import_react21.isValidElement)(child) ? mapFn(child) : child; + }; + var result = /* @__PURE__ */ Object.create(null); + if (children2) import_react21.Children.map(children2, function(c) { + return c; + }).forEach(function(child) { + result[child.key] = mapper(child); + }); + return result; +} +function mergeChildMappings(prev, next) { + prev = prev || {}; + next = next || {}; + function getValueForKey(key) { + return key in next ? next[key] : prev[key]; + } + var nextKeysPending = /* @__PURE__ */ Object.create(null); + var pendingKeys = []; + for (var prevKey in prev) { + if (prevKey in next) { + if (pendingKeys.length) { + nextKeysPending[prevKey] = pendingKeys; + pendingKeys = []; + } + } else { + pendingKeys.push(prevKey); + } + } + var i; + var childMapping = {}; + for (var nextKey in next) { + if (nextKeysPending[nextKey]) { + for (i = 0; i < nextKeysPending[nextKey].length; i++) { + var pendingNextKey = nextKeysPending[nextKey][i]; + childMapping[nextKeysPending[nextKey][i]] = getValueForKey(pendingNextKey); + } + } + childMapping[nextKey] = getValueForKey(nextKey); + } + for (i = 0; i < pendingKeys.length; i++) { + childMapping[pendingKeys[i]] = getValueForKey(pendingKeys[i]); + } + return childMapping; +} +function getProp(child, prop, props2) { + return props2[prop] != null ? props2[prop] : child.props[prop]; +} +function getInitialChildMapping(props2, onExited) { + return getChildMapping(props2.children, function(child) { + return (0, import_react21.cloneElement)(child, { + onExited: onExited.bind(null, child), + in: true, + appear: getProp(child, "appear", props2), + enter: getProp(child, "enter", props2), + exit: getProp(child, "exit", props2) + }); + }); +} +function getNextChildMapping(nextProps, prevChildMapping, onExited) { + var nextChildMapping = getChildMapping(nextProps.children); + var children2 = mergeChildMappings(prevChildMapping, nextChildMapping); + Object.keys(children2).forEach(function(key) { + var child = children2[key]; + if (!(0, import_react21.isValidElement)(child)) return; + var hasPrev = key in prevChildMapping; + var hasNext = key in nextChildMapping; + var prevChild = prevChildMapping[key]; + var isLeaving = (0, import_react21.isValidElement)(prevChild) && !prevChild.props.in; + if (hasNext && (!hasPrev || isLeaving)) { + children2[key] = (0, import_react21.cloneElement)(child, { + onExited: onExited.bind(null, child), + in: true, + exit: getProp(child, "exit", nextProps), + enter: getProp(child, "enter", nextProps) + }); + } else if (!hasNext && hasPrev && !isLeaving) { + children2[key] = (0, import_react21.cloneElement)(child, { + in: false + }); + } else if (hasNext && hasPrev && (0, import_react21.isValidElement)(prevChild)) { + children2[key] = (0, import_react21.cloneElement)(child, { + onExited: onExited.bind(null, child), + in: prevChild.props.in, + exit: getProp(child, "exit", nextProps), + enter: getProp(child, "enter", nextProps) + }); + } + }); + return children2; +} + +// node_modules/react-transition-group/esm/TransitionGroup.js +var values = Object.values || function(obj) { + return Object.keys(obj).map(function(k2) { + return obj[k2]; + }); +}; +var defaultProps = { + component: "div", + childFactory: function childFactory(child) { + return child; + } +}; +var TransitionGroup = function(_React$Component) { + _inheritsLoose(TransitionGroup2, _React$Component); + function TransitionGroup2(props2, context) { + var _this; + _this = _React$Component.call(this, props2, context) || this; + var handleExited = _this.handleExited.bind(_assertThisInitialized(_this)); + _this.state = { + contextValue: { + isMounting: true + }, + handleExited, + firstRender: true + }; + return _this; + } + var _proto = TransitionGroup2.prototype; + _proto.componentDidMount = function componentDidMount() { + this.mounted = true; + this.setState({ + contextValue: { + isMounting: false + } + }); + }; + _proto.componentWillUnmount = function componentWillUnmount() { + this.mounted = false; + }; + TransitionGroup2.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, _ref) { + var prevChildMapping = _ref.children, handleExited = _ref.handleExited, firstRender = _ref.firstRender; + return { + children: firstRender ? getInitialChildMapping(nextProps, handleExited) : getNextChildMapping(nextProps, prevChildMapping, handleExited), + firstRender: false + }; + }; + _proto.handleExited = function handleExited(child, node) { + var currentChildMapping = getChildMapping(this.props.children); + if (child.key in currentChildMapping) return; + if (child.props.onExited) { + child.props.onExited(node); + } + if (this.mounted) { + this.setState(function(state) { + var children2 = _extends({}, state.children); + delete children2[child.key]; + return { + children: children2 + }; + }); + } + }; + _proto.render = function render2() { + var _this$props = this.props, Component = _this$props.component, childFactory2 = _this$props.childFactory, props2 = _objectWithoutPropertiesLoose(_this$props, ["component", "childFactory"]); + var contextValue = this.state.contextValue; + var children2 = values(this.state.children).map(childFactory2); + delete props2.appear; + delete props2.enter; + delete props2.exit; + if (Component === null) { + return import_react22.default.createElement(TransitionGroupContext_default.Provider, { + value: contextValue + }, children2); + } + return import_react22.default.createElement(TransitionGroupContext_default.Provider, { + value: contextValue + }, import_react22.default.createElement(Component, props2, children2)); + }; + return TransitionGroup2; +}(import_react22.default.Component); +TransitionGroup.propTypes = true ? { + /** + * `` renders a `
` by default. You can change this + * behavior by providing a `component` prop. + * If you use React v16+ and would like to avoid a wrapping `
` element + * you can pass in `component={null}`. This is useful if the wrapping div + * borks your css styles. + */ + component: import_prop_types4.default.any, + /** + * A set of `` components, that are toggled `in` and out as they + * leave. the `` will inject specific transition props, so + * remember to spread them through if you are wrapping the `` as + * with our `` example. + * + * While this component is meant for multiple `Transition` or `CSSTransition` + * children, sometimes you may want to have a single transition child with + * content that you want to be transitioned out and in when you change it + * (e.g. routes, images etc.) In that case you can change the `key` prop of + * the transition child as you change its content, this will cause + * `TransitionGroup` to transition the child out and back in. + */ + children: import_prop_types4.default.node, + /** + * A convenience prop that enables or disables appear animations + * for all children. Note that specifying this will override any defaults set + * on individual children Transitions. + */ + appear: import_prop_types4.default.bool, + /** + * A convenience prop that enables or disables enter animations + * for all children. Note that specifying this will override any defaults set + * on individual children Transitions. + */ + enter: import_prop_types4.default.bool, + /** + * A convenience prop that enables or disables exit animations + * for all children. Note that specifying this will override any defaults set + * on individual children Transitions. + */ + exit: import_prop_types4.default.bool, + /** + * You may need to apply reactive updates to a child as it is exiting. + * This is generally done by using `cloneElement` however in the case of an exiting + * child the element has already been removed and not accessible to the consumer. + * + * If you do need to update a child as it leaves you can provide a `childFactory` + * to wrap every child, even the ones that are leaving. + * + * @type Function(child: ReactElement) -> ReactElement + */ + childFactory: import_prop_types4.default.func +} : {}; +TransitionGroup.defaultProps = defaultProps; +var TransitionGroup_default = TransitionGroup; + +// node_modules/react-transition-group/esm/ReplaceTransition.js +var ReplaceTransition = function(_React$Component) { + _inheritsLoose(ReplaceTransition2, _React$Component); + function ReplaceTransition2() { + var _this; + for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) { + _args[_key] = arguments[_key]; + } + _this = _React$Component.call.apply(_React$Component, [this].concat(_args)) || this; + _this.handleEnter = function() { + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + return _this.handleLifecycle("onEnter", 0, args); + }; + _this.handleEntering = function() { + for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + args[_key3] = arguments[_key3]; + } + return _this.handleLifecycle("onEntering", 0, args); + }; + _this.handleEntered = function() { + for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { + args[_key4] = arguments[_key4]; + } + return _this.handleLifecycle("onEntered", 0, args); + }; + _this.handleExit = function() { + for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) { + args[_key5] = arguments[_key5]; + } + return _this.handleLifecycle("onExit", 1, args); + }; + _this.handleExiting = function() { + for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) { + args[_key6] = arguments[_key6]; + } + return _this.handleLifecycle("onExiting", 1, args); + }; + _this.handleExited = function() { + for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) { + args[_key7] = arguments[_key7]; + } + return _this.handleLifecycle("onExited", 1, args); + }; + return _this; + } + var _proto = ReplaceTransition2.prototype; + _proto.handleLifecycle = function handleLifecycle(handler, idx, originalArgs) { + var _child$props; + var children2 = this.props.children; + var child = import_react23.default.Children.toArray(children2)[idx]; + if (child.props[handler]) (_child$props = child.props)[handler].apply(_child$props, originalArgs); + if (this.props[handler]) { + var maybeNode = child.props.nodeRef ? void 0 : import_react_dom2.default.findDOMNode(this); + this.props[handler](maybeNode); + } + }; + _proto.render = function render2() { + var _this$props = this.props, children2 = _this$props.children, inProp = _this$props.in, props2 = _objectWithoutPropertiesLoose(_this$props, ["children", "in"]); + var _React$Children$toArr = import_react23.default.Children.toArray(children2), first = _React$Children$toArr[0], second2 = _React$Children$toArr[1]; + delete props2.onEnter; + delete props2.onEntering; + delete props2.onEntered; + delete props2.onExit; + delete props2.onExiting; + delete props2.onExited; + return import_react23.default.createElement(TransitionGroup_default, props2, inProp ? import_react23.default.cloneElement(first, { + key: "first", + onEnter: this.handleEnter, + onEntering: this.handleEntering, + onEntered: this.handleEntered + }) : import_react23.default.cloneElement(second2, { + key: "second", + onEnter: this.handleExit, + onEntering: this.handleExiting, + onEntered: this.handleExited + })); + }; + return ReplaceTransition2; +}(import_react23.default.Component); +ReplaceTransition.propTypes = true ? { + in: import_prop_types5.default.bool.isRequired, + children: function children(props2, propName) { + if (import_react23.default.Children.count(props2[propName]) !== 2) return new Error('"' + propName + '" must be exactly two transition components.'); + return null; + } +} : {}; + +// node_modules/react-transition-group/esm/SwitchTransition.js +var import_react24 = __toESM(require_react()); +var import_prop_types6 = __toESM(require_prop_types()); +var _leaveRenders; +var _enterRenders; +function areChildrenDifferent(oldChildren, newChildren) { + if (oldChildren === newChildren) return false; + if (import_react24.default.isValidElement(oldChildren) && import_react24.default.isValidElement(newChildren) && oldChildren.key != null && oldChildren.key === newChildren.key) { + return false; + } + return true; +} +var modes = { + out: "out-in", + in: "in-out" +}; +var callHook = function callHook2(element, name, cb) { + return function() { + var _element$props; + element.props[name] && (_element$props = element.props)[name].apply(_element$props, arguments); + cb(); + }; +}; +var leaveRenders = (_leaveRenders = {}, _leaveRenders[modes.out] = function(_ref) { + var current = _ref.current, changeState = _ref.changeState; + return import_react24.default.cloneElement(current, { + in: false, + onExited: callHook(current, "onExited", function() { + changeState(ENTERING, null); + }) + }); +}, _leaveRenders[modes.in] = function(_ref2) { + var current = _ref2.current, changeState = _ref2.changeState, children2 = _ref2.children; + return [current, import_react24.default.cloneElement(children2, { + in: true, + onEntered: callHook(children2, "onEntered", function() { + changeState(ENTERING); + }) + })]; +}, _leaveRenders); +var enterRenders = (_enterRenders = {}, _enterRenders[modes.out] = function(_ref3) { + var children2 = _ref3.children, changeState = _ref3.changeState; + return import_react24.default.cloneElement(children2, { + in: true, + onEntered: callHook(children2, "onEntered", function() { + changeState(ENTERED, import_react24.default.cloneElement(children2, { + in: true + })); + }) + }); +}, _enterRenders[modes.in] = function(_ref4) { + var current = _ref4.current, children2 = _ref4.children, changeState = _ref4.changeState; + return [import_react24.default.cloneElement(current, { + in: false, + onExited: callHook(current, "onExited", function() { + changeState(ENTERED, import_react24.default.cloneElement(children2, { + in: true + })); + }) + }), import_react24.default.cloneElement(children2, { + in: true + })]; +}, _enterRenders); +var SwitchTransition = function(_React$Component) { + _inheritsLoose(SwitchTransition2, _React$Component); + function SwitchTransition2() { + var _this; + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this; + _this.state = { + status: ENTERED, + current: null + }; + _this.appeared = false; + _this.changeState = function(status, current) { + if (current === void 0) { + current = _this.state.current; + } + _this.setState({ + status, + current + }); + }; + return _this; + } + var _proto = SwitchTransition2.prototype; + _proto.componentDidMount = function componentDidMount() { + this.appeared = true; + }; + SwitchTransition2.getDerivedStateFromProps = function getDerivedStateFromProps(props2, state) { + if (props2.children == null) { + return { + current: null + }; + } + if (state.status === ENTERING && props2.mode === modes.in) { + return { + status: ENTERING + }; + } + if (state.current && areChildrenDifferent(state.current, props2.children)) { + return { + status: EXITING + }; + } + return { + current: import_react24.default.cloneElement(props2.children, { + in: true + }) + }; + }; + _proto.render = function render2() { + var _this$props = this.props, children2 = _this$props.children, mode = _this$props.mode, _this$state = this.state, status = _this$state.status, current = _this$state.current; + var data = { + children: children2, + current, + changeState: this.changeState, + status + }; + var component; + switch (status) { + case ENTERING: + component = enterRenders[mode](data); + break; + case EXITING: + component = leaveRenders[mode](data); + break; + case ENTERED: + component = current; + } + return import_react24.default.createElement(TransitionGroupContext_default.Provider, { + value: { + isMounting: !this.appeared + } + }, component); + }; + return SwitchTransition2; +}(import_react24.default.Component); +SwitchTransition.propTypes = true ? { + /** + * Transition modes. + * `out-in`: Current element transitions out first, then when complete, the new element transitions in. + * `in-out`: New element transitions in first, then when complete, the current element transitions out. + * + * @type {'out-in'|'in-out'} + */ + mode: import_prop_types6.default.oneOf([modes.in, modes.out]), + /** + * Any `Transition` or `CSSTransition` component. + */ + children: import_prop_types6.default.oneOfType([import_prop_types6.default.element.isRequired]) +} : {}; +SwitchTransition.defaultProps = { + mode: modes.out +}; + +// node_modules/@cloudscape-design/components/internal/components/transition/index.js +function Transition2(_a) { + var { in: isIn, children: children2, exit = true, onStatusChange = () => void 0, disabled = false, transitionChangeDelay } = _a, rest = __rest(_a, ["in", "children", "exit", "onStatusChange", "disabled", "transitionChangeDelay"]); + const transitionRootElement = (0, import_react26.useRef)(null); + const [transitionState, setTransitionState] = (0, import_react25.useState)(isIn ? "entered" : "exited"); + const motionDisabled = useReducedMotion(transitionRootElement) || disabled; + const addTransitionEndListener = (0, import_react26.useCallback)((done) => { + const node = transitionRootElement.current; + if (node === null) { + return; + } + const listener = (e) => { + if (e.target === node) { + node.removeEventListener("transitionend", listener); + node.removeEventListener("animationend", listener); + done(); + } + }; + node.addEventListener("transitionend", listener); + node.addEventListener("animationend", listener); + }, []); + return import_react25.default.createElement(Transition_default, Object.assign({ addEndListener: addTransitionEndListener, timeout: motionDisabled ? 0 : void 0, in: isIn, nodeRef: transitionRootElement, exit, onEnter: (isAppearing) => { + if (!isAppearing) { + setTransitionState("enter"); + onStatusChange("enter"); + } + }, onEntering: (isAppearing) => { + var _a2; + if (!isAppearing) { + void ((_a2 = transitionRootElement.current) === null || _a2 === void 0 ? void 0 : _a2.offsetHeight); + if (transitionChangeDelay === null || transitionChangeDelay === void 0 ? void 0 : transitionChangeDelay.entering) { + setTimeout(() => { + setTransitionState("entering"); + onStatusChange("entering"); + }, transitionChangeDelay === null || transitionChangeDelay === void 0 ? void 0 : transitionChangeDelay.entering); + } else { + setTransitionState("entering"); + onStatusChange("entering"); + } + } + }, onEntered: (isAppearing) => { + if (!isAppearing) { + setTransitionState("entered"); + onStatusChange("entered"); + } + }, onExit: () => { + setTransitionState("exit"); + onStatusChange("exit"); + }, onExiting: () => { + setTransitionState("exiting"); + onStatusChange("exiting"); + }, onExited: () => { + setTransitionState("exited"); + onStatusChange("exited"); + } }, rest), () => children2(transitionState, transitionRootElement)); +} + +// node_modules/@cloudscape-design/components/internal/components/dropdown/context.js +var import_react27 = __toESM(require_react()); +var DropdownContext = import_react27.default.createContext({ + position: "bottom-right" +}); +function DropdownContextProvider({ children: children2, position = "bottom-right" }) { + return import_react27.default.createElement(DropdownContext.Provider, { value: { position } }, children2); +} +function useDropdownContext() { + return (0, import_react27.useContext)(DropdownContext); +} + +// node_modules/@cloudscape-design/components/internal/components/dropdown/index.js +var DropdownContainer = ({ children: children2, renderWithPortal = false, id, referrerId, open }) => { + if (renderWithPortal) { + if (open) { + return (0, import_react_dom3.createPortal)(import_react28.default.createElement("div", { id, "data-awsui-referrer-id": referrerId }, children2), document.body); + } else { + return null; + } + } else { + return import_react28.default.createElement(import_react28.default.Fragment, null, children2); + } +}; +var TransitionContent = ({ state, transitionRef, dropdownClasses, stretchWidth, interior, isRefresh, dropdownRef, verticalContainerRef, expandToViewport, stretchBeyondTriggerWidth, header, children: children2, footer, position, open, onMouseDown, id, role, ariaLabelledby, ariaDescribedby }) => { + const contentRef = useMergeRefs(dropdownRef, transitionRef); + return import_react28.default.createElement( + "div", + { className: clsx_m_default(styles_css_default13.dropdown, dropdownClasses, { + [styles_css_default13.open]: open, + [styles_css_default13["with-limited-width"]]: !stretchWidth, + [styles_css_default13["hide-block-border"]]: stretchWidth, + [styles_css_default13.interior]: interior, + [styles_css_default13.refresh]: isRefresh, + [styles_css_default13["use-portal"]]: expandToViewport && !interior, + [styles_css_default13["stretch-beyond-trigger-width"]]: stretchBeyondTriggerWidth + }), ref: contentRef, id, role, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, "data-open": open, "data-animating": state !== "exited", "aria-hidden": !open, style: stretchBeyondTriggerWidth ? { [custom_css_properties_default.dropdownDefaultMaxWidth]: `${defaultMaxDropdownWidth}px` } : {}, onMouseDown }, + import_react28.default.createElement( + "div", + { className: clsx_m_default(styles_css_default13["dropdown-content-wrapper"], !header && !children2 && styles_css_default13["is-empty"], isRefresh && styles_css_default13.refresh) }, + import_react28.default.createElement( + "div", + { ref: verticalContainerRef, className: styles_css_default13["dropdown-content"] }, + import_react28.default.createElement( + DropdownContextProvider, + { position }, + header, + children2, + footer + ) + ) + ) + ); +}; +var Dropdown = ({ children: children2, trigger, open, onDropdownClose, onMouseDown, header, footer, dropdownId, stretchTriggerHeight = false, stretchWidth = true, stretchHeight = false, stretchToTriggerWidth = true, stretchBeyondTriggerWidth = false, expandToViewport = false, preferCenter = false, interior = false, minWidth, scrollable = true, loopFocus = expandToViewport, onFocus, onBlur, contentKey, dropdownContentId, dropdownContentRole, ariaLabelledby, ariaDescribedby }) => { + const wrapperRef = (0, import_react28.useRef)(null); + const triggerRef = (0, import_react28.useRef)(null); + const dropdownRef = (0, import_react28.useRef)(null); + const dropdownContainerRef = (0, import_react28.useRef)(null); + const verticalContainerRef = (0, import_react28.useRef)(null); + const fixedPosition = (0, import_react28.useRef)(null); + const isRefresh = useVisualRefresh(); + const dropdownClasses = usePortalModeClasses(triggerRef); + const [position, setPosition] = (0, import_react28.useState)("bottom-right"); + const isMobile = useMobile(); + const setDropdownPosition = (position2, triggerBox, target, verticalContainer) => { + const entireWidth = !interior && stretchWidth; + if (!stretchWidth) { + verticalContainer.style.maxBlockSize = `${parseInt(position2.blockSize) + 1}px`; + } else { + verticalContainer.style.maxBlockSize = position2.blockSize; + } + if (entireWidth && !expandToViewport) { + if (stretchToTriggerWidth) { + target.classList.add(styles_css_default13["occupy-entire-width"]); + } + } else { + target.style.inlineSize = position2.inlineSize; + } + if (position2.dropBlockStart && !interior) { + target.classList.add(styles_css_default13["dropdown-drop-up"]); + if (!expandToViewport) { + target.style.insetBlockEnd = "100%"; + } + } else { + target.classList.remove(styles_css_default13["dropdown-drop-up"]); + } + target.classList.add(position2.dropInlineStart ? styles_css_default13["dropdown-drop-left"] : styles_css_default13["dropdown-drop-right"]); + if (position2.insetInlineStart && position2.insetInlineStart !== "auto") { + target.style.insetInlineStart = position2.insetInlineStart; + } + if (expandToViewport && !interior) { + target.style.position = "fixed"; + if (position2.dropBlockStart) { + target.style.insetBlockEnd = `calc(100% - ${triggerBox.top}px)`; + } else { + target.style.insetBlockStart = `${triggerBox.bottom}px`; + } + if (position2.dropInlineStart) { + target.style.insetInlineStart = `calc(${triggerBox.right}px - ${position2.inlineSize})`; + } else { + target.style.insetInlineStart = `${triggerBox.left}px`; + } + fixedPosition.current = position2; + return; + } + if (interior && isInteriorPosition(position2)) { + if (position2.dropBlockStart) { + target.style.insetBlockEnd = position2.insetBlockEnd; + } else { + target.style.insetBlockStart = position2.insetBlockStart; + } + target.style.insetInlineStart = position2.insetInlineStart; + } + if (position2.dropBlockStart && position2.dropInlineStart) { + setPosition("top-left"); + } else if (position2.dropBlockStart) { + setPosition("top-right"); + } else if (position2.dropInlineStart) { + setPosition("bottom-left"); + } else { + setPosition("bottom-right"); + } + }; + const isOutsideDropdown = (element) => (!wrapperRef.current || !nodeBelongs(wrapperRef.current, element)) && (!dropdownContainerRef.current || !nodeBelongs(dropdownContainerRef.current, element)); + const focusHandler = (event) => { + if (!event.relatedTarget || isOutsideDropdown(event.relatedTarget)) { + fireNonCancelableEvent(onFocus, event); + } + }; + const blurHandler = (event) => { + if (!event.relatedTarget || isOutsideDropdown(event.relatedTarget)) { + fireNonCancelableEvent(onBlur, event); + } + }; + const fixStretching = () => { + const classNameToRemove = styles_css_default13["stretch-beyond-trigger-width"]; + if (open && stretchBeyondTriggerWidth && dropdownRef.current && triggerRef.current && dropdownRef.current.classList.contains(classNameToRemove) && !hasEnoughSpaceToStretchBeyondTriggerWidth({ + triggerElement: triggerRef.current, + dropdownElement: dropdownRef.current, + desiredMinWidth: minWidth, + expandToViewport, + stretchWidth, + stretchHeight, + isMobile + })) { + dropdownRef.current.classList.remove(classNameToRemove); + } + }; + useResizeObserver(() => dropdownRef.current, fixStretching); + (0, import_react28.useLayoutEffect)(() => { + const onDropdownOpen = () => { + if (open && dropdownRef.current && triggerRef.current && verticalContainerRef.current) { + if (scrollable) { + dropdownRef.current.classList.add(styles_css_default13.nowrap); + } + setDropdownPosition(...calculatePosition(dropdownRef.current, triggerRef.current, verticalContainerRef.current, interior, expandToViewport, preferCenter, stretchWidth, stretchHeight, isMobile, minWidth, stretchBeyondTriggerWidth), dropdownRef.current, verticalContainerRef.current); + if (scrollable) { + dropdownRef.current.classList.remove(styles_css_default13.nowrap); + } + } + }; + onDropdownOpen(); + if (open) { + window.addEventListener("scroll", onDropdownOpen); + const timeoutId = setTimeout(() => { + window.removeEventListener("scroll", onDropdownOpen); + }, 500); + return () => { + clearTimeout(timeoutId); + window.removeEventListener("scroll", onDropdownOpen); + }; + } + }, [open, dropdownRef, triggerRef, verticalContainerRef, interior, stretchWidth, isMobile, contentKey]); + (0, import_react28.useEffect)(() => { + if (!open) { + return; + } + const clickListener = (e) => { + if (!nodeBelongs(dropdownRef.current, e.target) && !nodeBelongs(triggerRef.current, e.target)) { + fireNonCancelableEvent(onDropdownClose); + } + }; + window.addEventListener("click", clickListener, true); + return () => { + window.removeEventListener("click", clickListener, true); + }; + }, [open, onDropdownClose]); + (0, import_react28.useLayoutEffect)(() => { + if (!expandToViewport || !open) { + return; + } + const updateDropdownPosition = () => { + if (triggerRef.current && dropdownRef.current && verticalContainerRef.current) { + const triggerRect = getLogicalBoundingClientRect(triggerRef.current); + const target = dropdownRef.current; + if (fixedPosition.current) { + if (fixedPosition.current.dropBlockStart) { + dropdownRef.current.style.insetBlockEnd = `calc(100% - ${triggerRect.insetBlockStart}px)`; + } else { + target.style.insetBlockStart = `${triggerRect.insetBlockEnd}px`; + } + if (fixedPosition.current.dropInlineStart) { + target.style.insetInlineStart = `calc(${triggerRect.insetInlineEnd}px - ${fixedPosition.current.inlineSize})`; + } else { + target.style.insetInlineStart = `${triggerRect.insetInlineStart}px`; + } + } + } + }; + updateDropdownPosition(); + window.addEventListener("scroll", updateDropdownPosition, true); + window.addEventListener("resize", updateDropdownPosition, true); + return () => { + window.removeEventListener("scroll", updateDropdownPosition, true); + window.removeEventListener("resize", updateDropdownPosition, true); + }; + }, [open, expandToViewport]); + const referrerId = useUniqueId(); + return import_react28.default.createElement( + "div", + { className: clsx_m_default(styles_css_default13.root, interior && styles_css_default13.interior, stretchTriggerHeight && styles_css_default13["stretch-trigger-height"]), ref: wrapperRef, onFocus: focusHandler, onBlur: blurHandler }, + import_react28.default.createElement("div", { id: referrerId, className: clsx_m_default(stretchTriggerHeight && styles_css_default13["stretch-trigger-height"]), ref: triggerRef }, trigger), + import_react28.default.createElement(TabTrap, { focusNextCallback: () => { + var _a; + return dropdownRef.current && ((_a = getFirstFocusable(dropdownRef.current)) === null || _a === void 0 ? void 0 : _a.focus()); + }, disabled: !open || !loopFocus }), + import_react28.default.createElement( + DropdownContainer, + { renderWithPortal: expandToViewport && !interior, id: dropdownId, referrerId, open }, + import_react28.default.createElement(Transition2, { in: open !== null && open !== void 0 ? open : false, exit: false }, (state, ref) => import_react28.default.createElement( + "div", + { ref: dropdownContainerRef }, + import_react28.default.createElement(TabTrap, { focusNextCallback: () => { + var _a; + return triggerRef.current && ((_a = getLastFocusable(triggerRef.current)) === null || _a === void 0 ? void 0 : _a.focus()); + }, disabled: !open || !loopFocus }), + import_react28.default.createElement(TransitionContent, { state, transitionRef: ref, dropdownClasses, open, stretchWidth, interior, header, expandToViewport, stretchBeyondTriggerWidth, footer, onMouseDown, isRefresh, dropdownRef, verticalContainerRef, position, id: dropdownContentId, role: dropdownContentRole, ariaLabelledby, ariaDescribedby }, children2), + import_react28.default.createElement(TabTrap, { focusNextCallback: () => { + var _a; + return triggerRef.current && ((_a = getFirstFocusable(triggerRef.current)) === null || _a === void 0 ? void 0 : _a.focus()); + }, disabled: !open || !loopFocus }) + )) + ) + ); +}; +var isInteriorPosition = (position) => position.insetBlockEnd !== void 0; +var dropdown_default = Dropdown; + +// node_modules/@cloudscape-design/components/button-dropdown/items-list.js +var import_react35 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/button-dropdown/item-element/index.js +var import_react30 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/button-dropdown/utils/utils.js +var isItemGroup = (item) => item && item.items !== void 0; +var isLinkItem = (item) => item && item.href !== void 0; +var getItemTarget = (item) => item.external ? "_blank" : void 0; +function indexIncludes(source, target) { + for (let index = 0; index < source.length; index++) { + if (source[index] !== target[index]) { + return false; + } + } + return true; +} +function indexEquals(left, right) { + if (left.length !== right.length) { + return false; + } + for (let index = 0; index < left.length; index++) { + if (left[index] !== right[index]) { + return false; + } + } + return true; +} + +// node_modules/@cloudscape-design/components/button-dropdown/item-element/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/button-dropdown/item-element/styles.scoped.css"; +var styles_css_default14 = { + "item-element": "awsui_item-element_93a1u_goggu_99", + "disabled": "awsui_disabled_93a1u_goggu_111", + "show-divider": "awsui_show-divider_93a1u_goggu_118", + "highlighted": "awsui_highlighted_93a1u_goggu_121", + "is-focused": "awsui_is-focused_93a1u_goggu_136", + "menu-item": "awsui_menu-item_93a1u_goggu_141", + "has-category-header": "awsui_has-category-header_93a1u_goggu_155", + "icon": "awsui_icon_93a1u_goggu_159", + "external-icon": "awsui_external-icon_93a1u_goggu_164" +}; + +// node_modules/@cloudscape-design/components/button-dropdown/tooltip.js +var import_react29 = __toESM(require_react()); +var DEFAULT_OPEN_TIMEOUT_IN_MS = 120; +function Tooltip({ children: children2, content, position = "right" }) { + const ref = (0, import_react29.useRef)(null); + const isReducedMotion = useReducedMotion(ref); + const { open, triggerProps } = useTooltipOpen(isReducedMotion ? 0 : DEFAULT_OPEN_TIMEOUT_IN_MS); + const portalClasses = usePortalModeClasses(ref); + return import_react29.default.createElement( + "span", + Object.assign({ ref }, triggerProps), + children2, + open && import_react29.default.createElement( + Portal, + null, + import_react29.default.createElement( + "span", + { className: portalClasses }, + import_react29.default.createElement( + PopoverContainer, + { size: "small", fixedWidth: false, position, trackRef: ref, arrow: (position2) => import_react29.default.createElement(arrow_default, { position: position2 }), renderWithPortal: true, zIndex: 7e3 }, + import_react29.default.createElement( + PopoverBody, + { dismissButton: false, dismissAriaLabel: void 0, header: null, onDismiss: () => { + }, overflowVisible: "both" }, + import_react29.default.createElement("span", { "data-testid": "button-dropdown-disabled-reason", role: "tooltip" }, content) + ) + ) + ) + ) + ); +} +function useTooltipOpen(timeout2) { + const handle = (0, import_react29.useRef)(); + const [isOpen, setIsOpen] = (0, import_react29.useState)(false); + const close = () => { + clearTimeout(handle.current); + setIsOpen(false); + }; + const open = () => setIsOpen(true); + const openDelayed = () => { + handle.current = setTimeout(open, timeout2); + }; + const onKeyDown = (e) => { + if (isOpen && isEscape(e.key)) { + e.preventDefault(); + e.stopPropagation(); + close(); + } + }; + const onFocus = openDelayed; + const onBlur = close; + return { + open: isOpen, + triggerProps: { + onBlur, + onFocus, + onKeyDown + } + }; +} +var isEscape = (key) => key === "Escape" || key === "Esc"; + +// node_modules/@cloudscape-design/components/button-dropdown/utils/menu-item.js +var getMenuItemProps = ({ disabled, parent, expanded }) => ({ + role: "menuitem", + "aria-disabled": disabled ? "true" : void 0, + "aria-haspopup": parent ? "true" : void 0, + "aria-expanded": expanded ? "true" : parent ? "false" : void 0 +}); + +// node_modules/@cloudscape-design/components/button-dropdown/item-element/index.js +var ItemElement = ({ item, disabled, onItemActivate, highlighted, highlightItem, showDivider, hasCategoryHeader, isKeyboardHighlighted = false, variant = "normal" }) => { + const isLink = isLinkItem(item); + const onClick = (event) => { + event.stopPropagation(); + if (!isLink) { + event.preventDefault(); + } + if (!disabled) { + onItemActivate(item, event); + } + }; + const onHover = () => { + highlightItem(item); + }; + return import_react30.default.createElement( + "li", + { className: clsx_m_default(styles_css_default14["item-element"], styles_css_default14[`variant-${variant}`], { + [styles_css_default14.highlighted]: highlighted, + [styles_css_default14.disabled]: disabled, + [styles_css_default14["has-category-header"]]: hasCategoryHeader, + [styles_css_default14["show-divider"]]: showDivider, + [styles_css_default14["is-focused"]]: isKeyboardHighlighted + }), role: "presentation", "data-testid": item.id, "data-description": item.description, onClick, onMouseEnter: onHover, onTouchStart: onHover }, + import_react30.default.createElement(MenuItem, { item, disabled, highlighted }) + ); +}; +function MenuItem({ item, disabled, highlighted }) { + const menuItemRef = (0, import_react30.useRef)(null); + (0, import_react30.useEffect)(() => { + if (highlighted && menuItemRef.current) { + menuItemRef.current.focus(); + } + }, [highlighted]); + const isDisabledWithReason = disabled && item.disabledReason; + const { targetProps, descriptionEl } = useHiddenDescription(item.disabledReason); + const menuItemProps = Object.assign(Object.assign({ + className: styles_css_default14["menu-item"], + lang: item.lang, + ref: menuItemRef, + // We are using the roving tabindex technique to manage the focus state of the dropdown. + // The current element will always have tabindex=0 which means that it can be tabbed to, + // while all other items have tabindex=-1 so we can focus them when necessary. + tabIndex: highlighted ? 0 : -1 + }, getMenuItemProps({ disabled })), isDisabledWithReason ? targetProps : {}); + const menuItem = isLinkItem(item) ? import_react30.default.createElement( + "a", + Object.assign({}, menuItemProps, { href: !disabled ? item.href : void 0, target: getItemTarget(item), rel: item.external ? "noopener noreferrer" : void 0 }), + import_react30.default.createElement(MenuItemContent, { item, disabled }) + ) : import_react30.default.createElement( + "span", + Object.assign({}, menuItemProps), + import_react30.default.createElement(MenuItemContent, { item, disabled }) + ); + const { position } = useDropdownContext(); + const tooltipPosition = position === "bottom-left" || position === "top-left" ? "left" : "right"; + return isDisabledWithReason ? import_react30.default.createElement( + Tooltip, + { content: item.disabledReason, position: tooltipPosition }, + menuItem, + descriptionEl + ) : menuItem; +} +var MenuItemContent = ({ item, disabled }) => { + const hasIcon = !!(item.iconName || item.iconUrl || item.iconSvg); + const hasExternal = isLinkItem(item) && item.external; + return import_react30.default.createElement( + import_react30.default.Fragment, + null, + hasIcon && import_react30.default.createElement(MenuItemIcon, { name: item.iconName, url: item.iconUrl, svg: item.iconSvg, alt: item.iconAlt, badge: item.badge }), + " ", + item.text, + " ", + hasExternal && import_react30.default.createElement(ExternalIcon, { disabled, ariaLabel: item.externalIconAriaLabel }) + ); +}; +var MenuItemIcon = (props2) => import_react30.default.createElement( + "span", + { className: styles_css_default14.icon }, + import_react30.default.createElement(internal_default, Object.assign({}, props2)) +); +var ExternalIcon = ({ disabled, ariaLabel }) => { + const icon = import_react30.default.createElement(internal_default, { variant: disabled ? "disabled" : "normal", name: "external" }); + return import_react30.default.createElement("span", { className: styles_css_default14["external-icon"], role: ariaLabel ? "img" : void 0, "aria-label": ariaLabel }, icon); +}; +var item_element_default = ItemElement; + +// node_modules/@cloudscape-design/components/button-dropdown/category-elements/expandable-category-element.js +var import_react31 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/button-dropdown/category-elements/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/button-dropdown/category-elements/styles.scoped.css"; +var styles_css_default15 = { + "header": "awsui_header_16mm3_w5lmn_99", + "disabled": "awsui_disabled_16mm3_w5lmn_116", + "expandable-header": "awsui_expandable-header_16mm3_w5lmn_120", + "rolled-down": "awsui_rolled-down_16mm3_w5lmn_131", + "highlighted": "awsui_highlighted_16mm3_w5lmn_134", + "is-focused": "awsui_is-focused_16mm3_w5lmn_152", + "category": "awsui_category_16mm3_w5lmn_157", + "expandable": "awsui_expandable_16mm3_w5lmn_120", + "variant-navigation": "awsui_variant-navigation_16mm3_w5lmn_172", + "expand-icon": "awsui_expand-icon_16mm3_w5lmn_179", + "expand-icon-up": "awsui_expand-icon-up_16mm3_w5lmn_186", + "expand-icon-right": "awsui_expand-icon-right_16mm3_w5lmn_189", + "items-list-container": "awsui_items-list-container_16mm3_w5lmn_206", + "in-dropdown": "awsui_in-dropdown_16mm3_w5lmn_215" +}; + +// node_modules/@cloudscape-design/components/button-dropdown/category-elements/expandable-category-element.js +var ExpandableCategoryElement = ({ item, onItemActivate, onGroupToggle, targetItem, isHighlighted, isKeyboardHighlight, isExpanded, lastInDropdown, highlightItem, disabled, expandToViewport, variant }) => { + const highlighted = isHighlighted(item); + const expanded = isExpanded(item); + const isKeyboardHighlighted = isKeyboardHighlight(item); + const triggerRef = import_react31.default.useRef(null); + const ref = (0, import_react31.useRef)(null); + (0, import_react31.useEffect)(() => { + if (triggerRef.current && highlighted && !expanded) { + triggerRef.current.focus(); + } + }, [expanded, highlighted]); + const onClick = (event) => { + var _a; + if (!disabled) { + event.preventDefault(); + onGroupToggle(item, event); + (_a = triggerRef.current) === null || _a === void 0 ? void 0 : _a.focus(); + } + }; + const onHover = () => { + highlightItem(item); + }; + const isDisabledWithReason = !!item.disabledReason && item.disabled; + const { targetProps, descriptionEl } = useHiddenDescription(item.disabledReason); + const trigger = item.text && import_react31.default.createElement( + "span", + Object.assign({ + className: clsx_m_default(styles_css_default15.header, styles_css_default15["expandable-header"], styles_css_default15[`variant-${variant}`], { + [styles_css_default15.disabled]: disabled, + [styles_css_default15.highlighted]: highlighted, + [styles_css_default15["is-focused"]]: isKeyboardHighlighted + }), + // We are using the roving tabindex technique to manage the focus state of the dropdown. + // The current element will always have tabindex=0 which means that it can be tabbed to, + // while all other items have tabindex=-1 so we can focus them when necessary. + tabIndex: highlighted ? 0 : -1, + ref: triggerRef + }, getMenuItemProps({ parent: true, expanded, disabled }), isDisabledWithReason ? targetProps : {}), + item.text, + import_react31.default.createElement( + "span", + { className: clsx_m_default(styles_css_default15["expand-icon"], styles_css_default15["expand-icon-right"]) }, + import_react31.default.createElement(internal_default, { name: "caret-down-filled" }) + ) + ); + let content; + if (isDisabledWithReason) { + content = import_react31.default.createElement( + Tooltip, + { content: item.disabledReason }, + trigger, + descriptionEl + ); + } else if (disabled) { + content = trigger; + } else { + content = import_react31.default.createElement(dropdown_default, { open: expanded, stretchWidth: false, interior: true, expandToViewport, trigger }, item.items && expanded && import_react31.default.createElement( + "ul", + { role: "menu", "aria-label": item.text, className: clsx_m_default(styles_css_default15["items-list-container"], styles_css_default15["in-dropdown"]) }, + import_react31.default.createElement(ItemsList, { items: item.items, onItemActivate, onGroupToggle, targetItem, isHighlighted, isKeyboardHighlight, isExpanded, lastInDropdown, highlightItem, variant }) + )); + } + return import_react31.default.createElement("li", { className: clsx_m_default(styles_css_default15.category, styles_css_default15[`variant-${variant}`], styles_css_default15.expandable, { + [styles_css_default15.expanded]: expanded, + [styles_css_default15.disabled]: disabled, + [styles_css_default15.highlighted]: highlighted + }), role: "presentation", "data-testid": item.id, ref, onClick, onMouseEnter: onHover, onTouchStart: onHover }, content); +}; +var expandable_category_element_default = ExpandableCategoryElement; + +// node_modules/@cloudscape-design/components/button-dropdown/category-elements/category-element.js +var import_react32 = __toESM(require_react()); +var CategoryElement = ({ item, onItemActivate, onGroupToggle, targetItem, isHighlighted, isKeyboardHighlight, isExpanded, lastInDropdown, highlightItem, disabled, variant }) => { + return import_react32.default.createElement( + "li", + { className: clsx_m_default(styles_css_default15.category, styles_css_default15[`variant-${variant}`], disabled && styles_css_default15.disabled), role: "presentation", "aria-disabled": disabled ? "true" : void 0 }, + item.text && import_react32.default.createElement("p", { className: clsx_m_default(styles_css_default15.header, { [styles_css_default15.disabled]: disabled }), "aria-hidden": "true" }, item.text), + import_react32.default.createElement("ul", { className: clsx_m_default(styles_css_default15["items-list-container"]), role: "group", "aria-label": item.text }, item.items && import_react32.default.createElement(ItemsList, { items: item.items, onItemActivate, onGroupToggle, targetItem, isHighlighted, isKeyboardHighlight, isExpanded, lastInDropdown, highlightItem, categoryDisabled: disabled, hasCategoryHeader: !!item.text, variant })) + ); +}; +var category_element_default = CategoryElement; + +// node_modules/@cloudscape-design/components/button-dropdown/category-elements/mobile-expandable-category-element.js +var import_react34 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/button-dropdown/mobile-expandable-group/mobile-expandable-group.js +var import_react33 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/button-dropdown/mobile-expandable-group/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/button-dropdown/mobile-expandable-group/styles.scoped.css"; +var styles_css_default16 = { + "root": "awsui_root_14cnr_1ev1z_99", + "trigger": "awsui_trigger_14cnr_1ev1z_136", + "dropdown": "awsui_dropdown_14cnr_1ev1z_139", + "nowrap": "awsui_nowrap_14cnr_1ev1z_150", + "open": "awsui_open_14cnr_1ev1z_153" +}; + +// node_modules/@cloudscape-design/components/button-dropdown/mobile-expandable-group/mobile-expandable-group.js +var MobileExpandableGroup = ({ children: children2, trigger, open }) => { + return import_react33.default.createElement( + "div", + { className: clsx_m_default(styles_css_default16.root) }, + import_react33.default.createElement("div", { className: styles_css_default16.trigger }, trigger), + import_react33.default.createElement("div", { className: clsx_m_default(styles_css_default16.dropdown, { [styles_css_default16.open]: open }), "data-open": open }, children2) + ); +}; +var mobile_expandable_group_default = MobileExpandableGroup; + +// node_modules/@cloudscape-design/components/button-dropdown/category-elements/mobile-expandable-category-element.js +var MobileExpandableCategoryElement = ({ item, onItemActivate, onGroupToggle, targetItem, isHighlighted, isKeyboardHighlight, isExpanded, lastInDropdown, highlightItem, disabled, variant }) => { + const highlighted = isHighlighted(item); + const expanded = isExpanded(item); + const isKeyboardHighlighted = isKeyboardHighlight(item); + const triggerRef = import_react34.default.useRef(null); + (0, import_react34.useEffect)(() => { + if (triggerRef.current && highlighted && !expanded) { + triggerRef.current.focus(); + } + }, [expanded, highlighted]); + const onClick = (e) => { + if (!disabled) { + e.preventDefault(); + onGroupToggle(item, e); + } + }; + const onHover = () => { + highlightItem(item); + }; + const isDisabledWithReason = !!item.disabledReason && item.disabled; + const { targetProps, descriptionEl } = useHiddenDescription(item.disabledReason); + const trigger = item.text && import_react34.default.createElement( + "span", + Object.assign({ + className: clsx_m_default(styles_css_default15.header, styles_css_default15["expandable-header"], styles_css_default15[`variant-${variant}`], { + [styles_css_default15.highlighted]: highlighted, + [styles_css_default15["rolled-down"]]: expanded, + [styles_css_default15.disabled]: disabled, + [styles_css_default15["is-focused"]]: isKeyboardHighlighted + }), + // We are using the roving tabindex technique to manage the focus state of the dropdown. + // The current element will always have tabindex=0 which means that it can be tabbed to, + // while all other items have tabindex=-1 so we can focus them when necessary. + tabIndex: highlighted ? 0 : -1, + ref: triggerRef + }, getMenuItemProps({ parent: true, disabled, expanded }), isDisabledWithReason ? targetProps : {}), + item.text, + import_react34.default.createElement( + "span", + { className: clsx_m_default(styles_css_default15["expand-icon"], { + [styles_css_default15["expand-icon-up"]]: expanded + }) }, + import_react34.default.createElement(internal_default, { name: "caret-down-filled" }) + ) + ); + let content; + if (isDisabledWithReason) { + content = import_react34.default.createElement( + import_react34.default.Fragment, + null, + descriptionEl, + import_react34.default.createElement(Tooltip, { content: item.disabledReason }, trigger) + ); + } else if (disabled) { + content = trigger; + } else { + content = import_react34.default.createElement(mobile_expandable_group_default, { open: expanded, trigger }, item.items && expanded && import_react34.default.createElement( + "ul", + { role: "menu", "aria-label": item.text, className: clsx_m_default(styles_css_default15["items-list-container"]) }, + import_react34.default.createElement(ItemsList, { items: item.items, onItemActivate, onGroupToggle, targetItem, isHighlighted, isKeyboardHighlight, isExpanded, lastInDropdown, highlightItem, hasCategoryHeader: true, variant }) + )); + } + return import_react34.default.createElement("li", { className: clsx_m_default(styles_css_default15.category, styles_css_default15[`variant-${variant}`], styles_css_default15.expandable, { + [styles_css_default15.expanded]: expanded, + [styles_css_default15.disabled]: disabled, + [styles_css_default15.highlighted]: highlighted || expanded, + [styles_css_default15.expandable]: true + }), role: "presentation", onClick, onMouseEnter: onHover, onTouchStart: onHover, "data-testid": item.id }, content); +}; +var mobile_expandable_category_element_default = MobileExpandableCategoryElement; + +// node_modules/@cloudscape-design/components/button-dropdown/items-list.js +function ItemsList({ items, onItemActivate, onGroupToggle, targetItem, isHighlighted, isKeyboardHighlight, isExpanded, lastInDropdown, highlightItem, categoryDisabled = false, hasExpandableGroups = false, hasCategoryHeader = false, expandToViewport = false, variant = "normal" }) { + const isMobile = useMobile(); + const elements = items.map((item, index) => { + var _a, _b, _c, _d; + if (!isItemGroup(item)) { + const showDivider = index === items.length - 1 && !lastInDropdown || isItemGroup(items[index + 1]); + return import_react35.default.createElement(item_element_default, { key: index, item, onItemActivate, disabled: (_a = item.disabled) !== null && _a !== void 0 ? _a : categoryDisabled, highlighted: isHighlighted(item), isKeyboardHighlighted: isKeyboardHighlight(item), highlightItem, showDivider, hasCategoryHeader, variant }); + } + if (hasExpandableGroups) { + return item.text ? isMobile ? import_react35.default.createElement(mobile_expandable_category_element_default, { key: index, item, onItemActivate, onGroupToggle, targetItem, isHighlighted, isKeyboardHighlight, isExpanded, lastInDropdown: lastInDropdown && index === items.length - 1, highlightItem, disabled: (_b = item.disabled) !== null && _b !== void 0 ? _b : false, variant }) : import_react35.default.createElement(expandable_category_element_default, { key: index, item, onItemActivate, onGroupToggle, targetItem, isHighlighted, isKeyboardHighlight, isExpanded, lastInDropdown: true, highlightItem, disabled: (_c = item.disabled) !== null && _c !== void 0 ? _c : false, expandToViewport, variant }) : null; + } + return import_react35.default.createElement(category_element_default, { key: index, item, onItemActivate, onGroupToggle, targetItem, isHighlighted, isKeyboardHighlight, isExpanded, lastInDropdown: lastInDropdown && index === items.length - 1, highlightItem, disabled: (_d = item.disabled) !== null && _d !== void 0 ? _d : false, variant }); + }); + return import_react35.default.createElement(import_react35.default.Fragment, null, elements); +} + +// node_modules/@cloudscape-design/components/internal/components/options-list/utils/use-open-state.js +var import_react36 = __toESM(require_react()); +var useOpenState = ({ onOpen, onClose }) => { + const [isOpen, setIsOpen] = (0, import_react36.useState)(false); + const [openedWithKeyboard, setOpenedWithKeyboard] = (0, import_react36.useState)(false); + const openDropdown = (isKeyboard) => { + if (!isOpen) { + setIsOpen(true); + setOpenedWithKeyboard(!!isKeyboard); + onOpen === null || onOpen === void 0 ? void 0 : onOpen(); + } + }; + const closeDropdown = () => { + if (isOpen) { + setIsOpen(false); + onClose === null || onClose === void 0 ? void 0 : onClose(); + } + }; + const toggleDropdown = () => { + if (isOpen) { + closeDropdown(); + } else { + openDropdown(false); + } + }; + return { isOpen, openDropdown, closeDropdown, toggleDropdown, openedWithKeyboard }; +}; + +// node_modules/@cloudscape-design/components/button-dropdown/utils/use-highlighted-menu.js +var import_react37 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/button-dropdown/utils/create-items-tree.js +function createItemsTree(items) { + const itemToIndex = /* @__PURE__ */ new Map(); + const indexToItem = /* @__PURE__ */ new Map(); + const flatIndices = []; + traverseItems(items, (item, index) => { + const indexKey = stringifyIndex(index); + itemToIndex.set(item, indexKey); + indexToItem.set(indexKey, item); + flatIndices.push(indexKey); + }); + return { + getItem: (index) => { + const indexKey = stringifyIndex(index); + return indexToItem.get(indexKey) || null; + }, + getItemIndex: (item) => { + const indexKey = itemToIndex.get(item); + if (!indexKey) { + throw new Error("Invariant violation: item is not found."); + } + return parseIndex(indexKey); + }, + getSequentialIndex: (index, direction) => { + const indexKey = stringifyIndex(index); + const position = flatIndices.indexOf(indexKey); + const nextIndexKey = flatIndices[position + direction]; + if (!nextIndexKey) { + return null; + } + return parseIndex(nextIndexKey); + }, + getParentIndex: (item) => { + const indexKey = itemToIndex.get(item); + if (!indexKey) { + throw new Error("Invariant violation: item is not found."); + } + const index = parseIndex(indexKey); + if (index.length === 1) { + return null; + } + return index.slice(0, index.length - 1); + } + }; +} +function traverseItems(items, act, parentIndex = []) { + items.forEach((item, index) => { + const itemIndex = [...parentIndex, index]; + act(item, itemIndex); + if (isItemGroup(item)) { + traverseItems(item.items, act, itemIndex); + } + }); +} +function stringifyIndex(index) { + return index.join("-"); +} +function parseIndex(index) { + return index.split("-").map((it) => parseInt(it)); +} + +// node_modules/@cloudscape-design/components/button-dropdown/utils/move-highlight.js +function moveHighlight({ startIndex, expandedIndex, getNext, hasExpandableGroups, isInRestrictedView }) { + const tryMove = (currentIndex) => { + var _a; + const next = getNext(currentIndex); + if (!next) { + return null; + } + if (((_a = next.parent) === null || _a === void 0 ? void 0 : _a.disabled) && hasExpandableGroups) { + return tryMove(next.index); + } + if (isItemGroup(next.item) && !hasExpandableGroups) { + return tryMove(next.index); + } + if (hasExpandableGroups && !isInRestrictedView && !isSameParent(startIndex, next.index)) { + return tryMove(next.index); + } + if (hasExpandableGroups && isInRestrictedView && !isSameLevel(next.index, expandedIndex) && !isIncluded(expandedIndex, next.index)) { + return tryMove(next.index); + } + return next.index; + }; + return tryMove(startIndex); +} +function isSameParent(left, right) { + return indexEquals(left.slice(0, -1), right.slice(0, -1)); +} +function isSameLevel(left, right) { + return left.length === right.length; +} +function isIncluded(parent, child) { + return indexEquals(parent, child.slice(0, -1)); +} + +// node_modules/@cloudscape-design/components/button-dropdown/utils/use-highlighted-menu.js +function useHighlightedMenu({ items, hasExpandableGroups, isInRestrictedView = false }) { + const [targetIndex, setTargetIndex] = (0, import_react37.useState)([]); + const [expandedIndex, setExpandedIndex] = (0, import_react37.useState)([]); + const [isUsingMouse, setIsUsingMouse] = (0, import_react37.useState)(true); + const { getItem, getItemIndex: getItemIndex2, getSequentialIndex, getParentIndex } = (0, import_react37.useMemo)(() => createItemsTree(items), [items]); + const targetItem = (0, import_react37.useMemo)(() => getItem(targetIndex), [targetIndex, getItem]); + const isHighlighted = (0, import_react37.useCallback)((item) => { + const index = getItemIndex2(item); + return indexIncludes(index, targetIndex); + }, [targetIndex, getItemIndex2]); + const isKeyboardHighlight = (0, import_react37.useCallback)((item) => { + const index = getItemIndex2(item); + return !isUsingMouse && indexEquals(index, targetIndex); + }, [targetIndex, getItemIndex2, isUsingMouse]); + const isExpanded = (0, import_react37.useCallback)((group) => { + const index = getItemIndex2(group); + return indexIncludes(index, expandedIndex); + }, [expandedIndex, getItemIndex2]); + const moveHighlight2 = (0, import_react37.useCallback)((direction) => { + const getNext = (index) => { + const nextIndex2 = getSequentialIndex(index, direction); + const item = getItem(nextIndex2 || [-1]); + if (!nextIndex2 || !item) { + return null; + } + const parentIndex = getParentIndex(item); + const parentItem = parentIndex && getItem(parentIndex); + return { index: nextIndex2, item, parent: parentItem || void 0 }; + }; + const nextIndex = moveHighlight({ + startIndex: targetIndex, + expandedIndex, + getNext, + hasExpandableGroups, + isInRestrictedView + }); + if (nextIndex) { + setTargetIndex(nextIndex); + } + }, [targetIndex, expandedIndex, getItem, getSequentialIndex, getParentIndex, hasExpandableGroups, isInRestrictedView]); + const highlightItem = (0, import_react37.useCallback)((item) => { + setTargetIndex(getItemIndex2(item)); + }, [getItemIndex2]); + const expandGroup = (0, import_react37.useCallback)((group) => { + const groupIndex = group ? getItemIndex2(group) : targetIndex; + const firstChildIndex = [...groupIndex, 0]; + setTargetIndex(isInRestrictedView ? groupIndex : firstChildIndex); + setExpandedIndex(groupIndex); + }, [targetIndex, getItemIndex2, isInRestrictedView]); + const collapseGroup = (0, import_react37.useCallback)(() => { + if (expandedIndex.length > 0) { + setTargetIndex(expandedIndex); + setExpandedIndex(expandedIndex.slice(0, -1)); + } + }, [expandedIndex]); + const reset = (0, import_react37.useCallback)(() => { + setTargetIndex([]); + setExpandedIndex([]); + }, []); + return { + targetItem, + isHighlighted, + isKeyboardHighlight, + isExpanded, + moveHighlight: moveHighlight2, + highlightItem, + expandGroup, + collapseGroup, + reset, + setIsUsingMouse + }; +} + +// node_modules/@cloudscape-design/components/button-dropdown/utils/use-button-dropdown.js +function useButtonDropdown({ items, onItemClick, onItemFollow, onReturnFocus, hasExpandableGroups, isInRestrictedView = false, expandToViewport = false }) { + const { targetItem, isHighlighted, isKeyboardHighlight, isExpanded, highlightItem, moveHighlight: moveHighlight2, expandGroup, collapseGroup, reset, setIsUsingMouse } = useHighlightedMenu({ + items, + hasExpandableGroups, + isInRestrictedView + }); + const _a = useOpenState({ onClose: reset }), { isOpen, closeDropdown } = _a, openStateProps = __rest(_a, ["isOpen", "closeDropdown"]); + const toggleDropdown = (options = {}) => { + var _a2; + const moveHighlightOnOpen = (_a2 = options.moveHighlightOnOpen) !== null && _a2 !== void 0 ? _a2 : true; + if (!isOpen && moveHighlightOnOpen) { + moveHighlight2(1); + } + openStateProps.toggleDropdown(); + }; + const onGroupToggle = (item) => !isExpanded(item) ? expandGroup(item) : collapseGroup(); + const onItemActivate = (item, event) => { + const details = { + id: item.id || "undefined", + href: item.href, + external: item.external, + target: getItemTarget(item) + }; + if (onItemFollow && item.href && isPlainLeftClick(event)) { + fireCancelableEvent(onItemFollow, details, event); + } + if (onItemClick) { + fireCancelableEvent(onItemClick, details, event); + } + onReturnFocus(); + closeDropdown(); + }; + const doVerticalNavigation = (direction) => { + if (isOpen) { + moveHighlight2(direction); + } + }; + const openAndSelectFirst = (event) => { + toggleDropdown(); + event.preventDefault(); + }; + const actOnParentDropdown = (event) => { + if (!targetItem) { + if (isOpen && !isInRestrictedView) { + toggleDropdown(); + } else { + openAndSelectFirst(event); + } + } else { + if (isItemGroup(targetItem)) { + onGroupToggle(targetItem, event); + } else { + onItemActivate(targetItem, event); + } + } + }; + const activate = (event, isEnter) => { + setIsUsingMouse(false); + if (targetItem && isLinkItem(targetItem) && isEnter) { + return; + } + event.preventDefault(); + actOnParentDropdown(event); + }; + const onKeyDown = (event) => { + setIsUsingMouse(false); + switch (event.keyCode) { + case KeyCode.down: { + doVerticalNavigation(1); + event.preventDefault(); + break; + } + case KeyCode.up: { + doVerticalNavigation(-1); + event.preventDefault(); + break; + } + case KeyCode.space: { + event.preventDefault(); + break; + } + case KeyCode.enter: { + if (!(targetItem === null || targetItem === void 0 ? void 0 : targetItem.disabled)) { + activate(event, true); + } + break; + } + case KeyCode.left: + case KeyCode.right: { + if (targetItem && !targetItem.disabled && isItemGroup(targetItem) && !isExpanded(targetItem)) { + expandGroup(); + } else if (hasExpandableGroups) { + collapseGroup(); + } + event.preventDefault(); + break; + } + case KeyCode.escape: { + onReturnFocus(); + closeDropdown(); + event.preventDefault(); + if (isOpen) { + event.stopPropagation(); + } + break; + } + case KeyCode.tab: { + if (expandToViewport) { + onReturnFocus(); + } + closeDropdown(); + break; + } + } + }; + const onKeyUp = (event) => { + if (event.keyCode === KeyCode.space && !(targetItem === null || targetItem === void 0 ? void 0 : targetItem.disabled)) { + activate(event); + } + }; + return { + isOpen, + targetItem, + isHighlighted, + isKeyboardHighlight, + isExpanded, + highlightItem, + onKeyDown, + onKeyUp, + onItemActivate, + onGroupToggle, + toggleDropdown, + closeDropdown, + setIsUsingMouse + }; +} + +// node_modules/@cloudscape-design/components/internal/components/options-list/index.js +var import_react38 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/internal/components/options-list/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/internal/components/options-list/styles.scoped.css"; +var styles_css_default17 = { + "options-list": "awsui_options-list_19gcf_halkh_99", + "decrease-block-margin": "awsui_decrease-block-margin_19gcf_halkh_149" +}; + +// node_modules/@cloudscape-design/components/internal/components/options-list/index.js +var BOTTOM_TRIGGER_OFFSET = 80; +var getItemIndex = (containerRef, event) => { + const target = findUpUntil(event.target, (element) => element === containerRef.current || !!element.dataset.mouseTarget); + const mouseTarget = target === null || target === void 0 ? void 0 : target.dataset.mouseTarget; + return mouseTarget ? parseInt(mouseTarget) : -1; +}; +var OptionsList = (_a, ref) => { + var { open, statusType, children: children2, nativeAttributes = {}, onKeyDown, onBlur, onFocus, onLoadMore, onMouseUp, onMouseMove, position = "relative", role = "listbox", decreaseBlockMargin = false, ariaLabel, ariaLabelledby, ariaDescribedby } = _a, restProps = __rest(_a, ["open", "statusType", "children", "nativeAttributes", "onKeyDown", "onBlur", "onFocus", "onLoadMore", "onMouseUp", "onMouseMove", "position", "role", "decreaseBlockMargin", "ariaLabel", "ariaLabelledby", "ariaDescribedby"]); + const baseProps = getBaseProps(restProps); + const menuRef = (0, import_react38.useRef)(null); + const handleScroll = useStableCallback(() => { + const scrollContainer = menuRef === null || menuRef === void 0 ? void 0 : menuRef.current; + if (scrollContainer) { + const bottomEdgePosition = scrollContainer.scrollTop + scrollContainer.clientHeight; + const remainingScrollHeight = scrollContainer.scrollHeight - bottomEdgePosition; + if (remainingScrollHeight < BOTTOM_TRIGGER_OFFSET) { + fireNonCancelableEvent(onLoadMore); + } + } + }); + (0, import_react38.useEffect)(() => { + if (open && statusType === "pending") { + handleScroll(); + } + }, [open, statusType, handleScroll]); + const className = clsx_m_default(styles_css_default17["options-list"], { + [styles_css_default17["decrease-block-margin"]]: decreaseBlockMargin + }); + const mergedRef = useMergeRefs(ref, menuRef); + return import_react38.default.createElement("ul", Object.assign({}, baseProps, nativeAttributes, { className, ref: mergedRef, style: { position }, role, onScroll: handleScroll, onKeyDown: (event) => onKeyDown && fireKeyboardEvent(onKeyDown, event), onMouseMove: (event) => onMouseMove === null || onMouseMove === void 0 ? void 0 : onMouseMove(getItemIndex(menuRef, event)), onMouseUp: (event) => onMouseUp === null || onMouseUp === void 0 ? void 0 : onMouseUp(getItemIndex(menuRef, event)), onBlur: (event) => fireNonCancelableEvent(onBlur, { relatedTarget: event.relatedTarget }), onFocus: () => fireNonCancelableEvent(onFocus), tabIndex: -1, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby }), open && children2); +}; +var options_list_default = import_react38.default.forwardRef(OptionsList); + +// node_modules/@cloudscape-design/components/button-dropdown/internal.js +var InternalButtonDropdown = import_react39.default.forwardRef((_a, ref) => { + var _b; + var { items, variant = "normal", loading = false, loadingText, disabled = false, expandableGroups = false, children: children2, onItemClick, onItemFollow, customTriggerBuilder, expandToViewport, ariaLabel, title, description, preferCenter, mainAction, __internalRootRef } = _a, props2 = __rest(_a, ["items", "variant", "loading", "loadingText", "disabled", "expandableGroups", "children", "onItemClick", "onItemFollow", "customTriggerBuilder", "expandToViewport", "ariaLabel", "title", "description", "preferCenter", "mainAction", "__internalRootRef"]); + const isInRestrictedView = useMobile(); + const dropdownId = useUniqueId("dropdown"); + for (const item of items) { + checkSafeUrl("ButtonDropdown", item.href); + } + if (mainAction) { + checkSafeUrl("ButtonDropdown", mainAction.href); + } + if (isDevelopment) { + if (mainAction && variant !== "primary" && variant !== "normal") { + warnOnce("ButtonDropdown", 'Main action is only supported for "primary" and "normal" component variant.'); + } + } + const isMainAction = mainAction && (variant === "primary" || variant === "normal"); + const isVisualRefresh = useVisualRefresh(); + const { isOpen, targetItem, isHighlighted, isKeyboardHighlight, isExpanded, highlightItem, onKeyDown, onKeyUp, onItemActivate, onGroupToggle, toggleDropdown, closeDropdown, setIsUsingMouse } = useButtonDropdown({ + items, + onItemClick, + onItemFollow, + // Scroll is unnecessary when moving focus back to the dropdown trigger. + onReturnFocus: () => { + var _a2; + return (_a2 = triggerRef.current) === null || _a2 === void 0 ? void 0 : _a2.focus({ preventScroll: true }); + }, + expandToViewport, + hasExpandableGroups: expandableGroups, + isInRestrictedView + }); + const handleMouseEvent = () => { + setIsUsingMouse(true); + }; + const baseProps = getBaseProps(props2); + const mainActionRef = (0, import_react39.useRef)(null); + const triggerRef = (0, import_react39.useRef)(null); + useForwardFocus(ref, isMainAction ? mainActionRef : triggerRef); + const clickHandler = () => { + if (!loading && !disabled) { + toggleDropdown({ moveHighlightOnOpen: !isInRestrictedView }); + } + }; + const canBeOpened = !loading && !disabled; + const triggerVariant = variant === "navigation" ? void 0 : variant === "inline-icon" ? "inline-icon" : variant; + const iconProps = variant === "icon" || variant === "inline-icon" ? { + iconName: "ellipsis" + } : { + iconName: "caret-down-filled", + iconAlign: "right", + __iconClass: canBeOpened && isOpen ? styles_css_default12["rotate-up"] : styles_css_default12["rotate-down"] + }; + const baseTriggerProps = Object.assign(Object.assign({ className: clsx_m_default(styles_css_default12["trigger-button"], styles_css_default12["test-utils-button-trigger"]) }, iconProps), { + variant: triggerVariant, + loading, + loadingText, + disabled, + onClick: (event) => { + event.preventDefault(); + clickHandler(); + }, + ariaLabel, + ariaExpanded: canBeOpened && isOpen, + formAction: "none", + __nativeAttributes: { + "aria-haspopup": true + } + }); + const triggerId = useUniqueId("awsui-button-dropdown__trigger"); + const triggerHasBadge = () => { + const flatItems = items.flatMap((item) => { + if ("items" in item) { + return item.items; + } + return item; + }); + return variant === "icon" && !!(flatItems === null || flatItems === void 0 ? void 0 : flatItems.find((item) => { + if ("badge" in item) { + return item.badge; + } + })); + }; + let trigger = null; + if (customTriggerBuilder) { + trigger = import_react39.default.createElement("div", { className: styles_css_default12["dropdown-trigger"] }, customTriggerBuilder({ + testUtilsClass: styles_css_default12["test-utils-button-trigger"], + ariaExpanded: canBeOpened && isOpen, + onClick: clickHandler, + triggerRef, + ariaLabel, + disabled, + isOpen + })); + } else if (isMainAction) { + const { text, iconName, iconAlt, iconSvg, iconUrl, external, externalIconAriaLabel } = mainAction, mainActionProps = __rest(mainAction, ["text", "iconName", "iconAlt", "iconSvg", "iconUrl", "external", "externalIconAriaLabel"]); + const mainActionIconProps = external ? { iconName: "external", iconAlign: "right" } : { iconName, iconAlt, iconSvg, iconUrl }; + const mainActionAriaLabel = externalIconAriaLabel ? `${(_b = mainAction.ariaLabel) !== null && _b !== void 0 ? _b : mainAction.text} ${mainAction.externalIconAriaLabel}` : void 0; + trigger = import_react39.default.createElement( + "div", + { role: "group", "aria-label": ariaLabel, className: styles_css_default12["split-trigger-wrapper"] }, + import_react39.default.createElement( + "div", + { + className: clsx_m_default(styles_css_default12["trigger-item"], styles_css_default12["split-trigger"]), + // Close dropdown upon main action click unless event is cancelled. + onClick: closeDropdown, + // Prevent keyboard events from propagation to the button dropdown handler. + onKeyDown: (e) => e.stopPropagation(), + onKeyUp: (e) => e.stopPropagation() + }, + import_react39.default.createElement(InternalButton, Object.assign({ ref: mainActionRef }, mainActionProps, mainActionIconProps, { className: styles_css_default12["trigger-button"], variant, ariaLabel: mainActionAriaLabel, formAction: "none" }), text) + ), + import_react39.default.createElement( + "div", + { className: clsx_m_default(styles_css_default12["trigger-item"], styles_css_default12["dropdown-trigger"], isVisualRefresh && styles_css_default12["visual-refresh"]) }, + import_react39.default.createElement(InternalButton, Object.assign({ ref: triggerRef }, baseTriggerProps)) + ) + ); + } else { + trigger = import_react39.default.createElement( + "div", + { className: styles_css_default12["dropdown-trigger"] }, + import_react39.default.createElement(InternalButton, Object.assign({ ref: triggerRef, id: triggerId }, baseTriggerProps, { badge: triggerHasBadge() }), children2) + ); + } + const hasHeader = title || description; + const headerId = useUniqueId("awsui-button-dropdown__header"); + const shouldLabelWithTrigger = !ariaLabel && !mainAction && variant !== "icon" && variant !== "inline-icon"; + const { loadingButtonCount } = useFunnel(); + (0, import_react39.useEffect)(() => { + if (loading) { + loadingButtonCount.current++; + return () => { + loadingButtonCount.current--; + }; + } + }, [loading, loadingButtonCount]); + return import_react39.default.createElement( + "div", + Object.assign({}, baseProps, { onKeyDown, onKeyUp, onMouseDown: handleMouseEvent, onMouseMove: handleMouseEvent, className: clsx_m_default(styles_css_default12["button-dropdown"], styles_css_default12[`variant-${variant}`], baseProps.className), "aria-owns": expandToViewport && isOpen ? dropdownId : void 0, ref: __internalRootRef }), + import_react39.default.createElement( + dropdown_default, + { open: canBeOpened && isOpen, stretchWidth: false, stretchTriggerHeight: variant === "navigation", expandToViewport, preferCenter, onDropdownClose: () => toggleDropdown(), trigger, dropdownId }, + hasHeader && import_react39.default.createElement( + "div", + { className: styles_css_default12.header, id: headerId }, + title && import_react39.default.createElement( + "div", + { className: styles_css_default12.title }, + import_react39.default.createElement(InternalBox, { fontSize: "heading-s", fontWeight: "bold", color: "inherit", tagOverride: "h2", margin: { vertical: "n", horizontal: "n" } }, title) + ), + description && import_react39.default.createElement( + InternalBox, + { fontSize: "body-s" }, + import_react39.default.createElement("span", { className: styles_css_default12.description }, description) + ) + ), + import_react39.default.createElement( + options_list_default, + { open: canBeOpened && isOpen, position: "static", role: "menu", decreaseBlockMargin: true, ariaLabel, ariaLabelledby: hasHeader ? headerId : shouldLabelWithTrigger ? triggerId : void 0, statusType: "finished" }, + import_react39.default.createElement(ItemsList, { items, onItemActivate, onGroupToggle, hasExpandableGroups: expandableGroups, targetItem, isHighlighted, isKeyboardHighlight, isExpanded, lastInDropdown: true, highlightItem, expandToViewport, variant }) + ) + ) + ); +}); +var internal_default11 = InternalButtonDropdown; + +// node_modules/@cloudscape-design/components/app-layout/test-classes/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/app-layout/test-classes/styles.scoped.css"; +var styles_css_default18 = { + "root": "awsui_root_1fj9k_3pu9z_5", + "navigation": "awsui_navigation_1fj9k_3pu9z_9", + "navigation-toggle": "awsui_navigation-toggle_1fj9k_3pu9z_13", + "navigation-close": "awsui_navigation-close_1fj9k_3pu9z_17", + "content": "awsui_content_1fj9k_3pu9z_21", + "notifications": "awsui_notifications_1fj9k_3pu9z_25", + "breadcrumbs": "awsui_breadcrumbs_1fj9k_3pu9z_29", + "tools": "awsui_tools_1fj9k_3pu9z_33", + "tools-close": "awsui_tools-close_1fj9k_3pu9z_37", + "tools-toggle": "awsui_tools-toggle_1fj9k_3pu9z_41", + "drawer-closed": "awsui_drawer-closed_1fj9k_3pu9z_45", + "mobile-bar": "awsui_mobile-bar_1fj9k_3pu9z_49", + "disable-body-scroll-root": "awsui_disable-body-scroll-root_1fj9k_3pu9z_53", + "drawers-trigger": "awsui_drawers-trigger_1fj9k_3pu9z_57", + "active-drawer": "awsui_active-drawer_1fj9k_3pu9z_61", + "active-drawer-close-button": "awsui_active-drawer-close-button_1fj9k_3pu9z_65", + "overflow-menu": "awsui_overflow-menu_1fj9k_3pu9z_69", + "drawers-slider": "awsui_drawers-slider_1fj9k_3pu9z_73" +}; + +// node_modules/@cloudscape-design/components/app-layout/drawer/overflow-menu.js +function OverflowMenu({ items, onItemClick, customTriggerBuilder, ariaLabel }) { + return import_react40.default.createElement(internal_default11, { items: items.map((item) => ({ + id: item.id, + text: item.ariaLabels.drawerName, + iconName: item.trigger.iconName, + iconSvg: item.trigger.iconSvg, + badge: item.badge + })), className: styles_css_default18["overflow-menu"], onItemClick, ariaLabel, variant: "icon", customTriggerBuilder, expandToViewport: true }); +} + +// node_modules/@cloudscape-design/components/app-layout/mobile-toolbar/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/app-layout/mobile-toolbar/styles.scoped.css"; +var styles_css_default19 = { + "block-body-scroll": "awsui_block-body-scroll_19d8l_c90gb_103", + "mobile-bar": "awsui_mobile-bar_19d8l_c90gb_107", + "mobile-bar-breadcrumbs": "awsui_mobile-bar-breadcrumbs_19d8l_c90gb_120", + "mobile-toggle": "awsui_mobile-toggle_19d8l_c90gb_127", + "mobile-toggle-type-navigation": "awsui_mobile-toggle-type-navigation_19d8l_c90gb_136", + "mobile-toggle-type-tools": "awsui_mobile-toggle-type-tools_19d8l_c90gb_139", + "mobile-toggle-type-drawer": "awsui_mobile-toggle-type-drawer_19d8l_c90gb_139", + "drawers-container": "awsui_drawers-container_19d8l_c90gb_146" +}; + +// node_modules/@cloudscape-design/components/app-layout/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/app-layout/styles.scoped.css"; +var styles_css_default20 = { + "resize-active": "awsui_resize-active_lm6vo_1lt83_104", + "resize-side": "awsui_resize-side_lm6vo_1lt83_110", + "resize-bottom": "awsui_resize-bottom_lm6vo_1lt83_113", + "with-motion": "awsui_with-motion_lm6vo_1lt83_118", + "root": "awsui_root_lm6vo_1lt83_133", + "root-no-scroll": "awsui_root-no-scroll_lm6vo_1lt83_140", + "layout": "awsui_layout_lm6vo_1lt83_145", + "layout-no-scroll": "awsui_layout-no-scroll_lm6vo_1lt83_151", + "layout-main": "awsui_layout-main_lm6vo_1lt83_155", + "layout-main-scrollable": "awsui_layout-main-scrollable_lm6vo_1lt83_161", + "unfocusable": "awsui_unfocusable_lm6vo_1lt83_166", + "breadcrumbs-desktop": "awsui_breadcrumbs-desktop_lm6vo_1lt83_170", + "content-header-wrapper": "awsui_content-header-wrapper_lm6vo_1lt83_175", + "content-wrapper": "awsui_content-wrapper_lm6vo_1lt83_179", + "content-overlapped": "awsui_content-overlapped_lm6vo_1lt83_183", + "content-extra-top-padding": "awsui_content-extra-top-padding_lm6vo_1lt83_187" +}; + +// node_modules/@cloudscape-design/components/app-layout/drawer/drawers-helpers.js +function splitItems(maybeItems, splitIndex, activeId) { + const items = maybeItems !== null && maybeItems !== void 0 ? maybeItems : []; + const visibleItems = items.slice(0, splitIndex); + const overflowItems = items.slice(splitIndex); + if (overflowItems.length === 1) { + return { visibleItems: items, overflowItems: [] }; + } + if (activeId && overflowItems.length > 0 && visibleItems.length > 0) { + const activeInOverflow = overflowItems.find((item) => item.id === activeId); + if (activeInOverflow) { + overflowItems.splice(overflowItems.indexOf(activeInOverflow), 1); + overflowItems.unshift(visibleItems.pop()); + visibleItems.push(activeInOverflow); + } + } + return { visibleItems, overflowItems }; +} + +// node_modules/@cloudscape-design/components/app-layout/utils/use-drawers.js +var import_react42 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/app-layout/runtime-api.js +var import_react41 = __toESM(require_react()); +function convertRuntimeDrawers(drawers) { + const converted = drawers.map((_a) => { + var _b; + var { mountContent, unmountContent, trigger } = _a, runtimeDrawer = __rest(_a, ["mountContent", "unmountContent", "trigger"]); + return Object.assign(Object.assign({}, runtimeDrawer), { ariaLabels: Object.assign({ drawerName: (_b = runtimeDrawer.ariaLabels.content) !== null && _b !== void 0 ? _b : "" }, runtimeDrawer.ariaLabels), trigger: { + iconSvg: ( + // eslint-disable-next-line react/no-danger + import_react41.default.createElement("span", { dangerouslySetInnerHTML: { __html: trigger.iconSvg } }) + ) + }, content: import_react41.default.createElement(RuntimeContentWrapper, { key: runtimeDrawer.id, mountContent, unmountContent }), onResize: (event) => { + fireNonCancelableEvent(runtimeDrawer.onResize, { size: event.detail.size, id: runtimeDrawer.id }); + } }); + }); + const sorted = sortByPriority(converted); + return { + before: sorted.filter((item) => { + var _a; + return ((_a = item.orderPriority) !== null && _a !== void 0 ? _a : 0) > 0; + }), + after: sorted.filter((item) => { + var _a; + return ((_a = item.orderPriority) !== null && _a !== void 0 ? _a : 0) <= 0; + }) + }; +} + +// node_modules/@cloudscape-design/components/app-layout/utils/use-drawers.js +var TOOLS_DRAWER_ID = "awsui-internal-tools"; +function getToolsDrawerItem(props2) { + if (props2.toolsHide) { + return null; + } + const { iconName, getLabels } = togglesConfig.tools; + const { mainLabel, closeLabel, openLabel } = getLabels(props2.ariaLabels); + return { + id: TOOLS_DRAWER_ID, + content: props2.tools, + resizable: false, + ariaLabels: { + triggerButton: openLabel, + closeButton: closeLabel, + drawerName: mainLabel !== null && mainLabel !== void 0 ? mainLabel : "" + }, + trigger: { + iconName + } + }; +} +function useRuntimeDrawers(disableRuntimeDrawers, activeDrawerId, onActiveDrawerChange) { + const [runtimeDrawers, setRuntimeDrawers] = (0, import_react42.useState)({ before: [], after: [] }); + const onActiveDrawerChangeStable = useStableCallback(onActiveDrawerChange); + const drawerWasOpenRef = (0, import_react42.useRef)(false); + drawerWasOpenRef.current = drawerWasOpenRef.current || !!activeDrawerId; + (0, import_react42.useEffect)(() => { + if (disableRuntimeDrawers) { + return; + } + const unsubscribe = awsuiPluginsInternal.appLayout.onDrawersRegistered((drawers) => { + setRuntimeDrawers(convertRuntimeDrawers(drawers)); + if (!drawerWasOpenRef.current) { + const defaultActiveDrawer = sortByPriority(drawers).find((drawer) => drawer.defaultActive); + if (defaultActiveDrawer) { + onActiveDrawerChangeStable(defaultActiveDrawer.id); + } + } + }); + return () => { + unsubscribe(); + setRuntimeDrawers({ before: [], after: [] }); + }; + }, [disableRuntimeDrawers, onActiveDrawerChangeStable]); + return runtimeDrawers; +} +function applyToolsDrawer(toolsProps, runtimeDrawers) { + const drawers = [...runtimeDrawers.before, ...runtimeDrawers.after]; + if (drawers.length === 0) { + return null; + } + const toolsItem = getToolsDrawerItem(toolsProps); + if (toolsItem) { + drawers.unshift(toolsItem); + } + return drawers; +} +function useDrawers({ drawers, activeDrawerId: controlledActiveDrawerId, onDrawerChange, __disableRuntimeDrawers: disableRuntimeDrawers }, ariaLabels, toolsProps) { + var _a, _b, _c, _d; + const [activeDrawerId = null, setActiveDrawerId] = useControllable(controlledActiveDrawerId, onDrawerChange, null, { + componentName: "AppLayout", + controlledProp: "activeDrawerId", + changeHandler: "onChange" + }); + const [drawerSizes, setDrawerSizes] = (0, import_react42.useState)({}); + function onActiveDrawerResize({ id, size }) { + setDrawerSizes((oldSizes) => Object.assign(Object.assign({}, oldSizes), { [id]: size })); + fireNonCancelableEvent(activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.onResize, { id, size }); + } + function onActiveDrawerChange(newDrawerId) { + setActiveDrawerId(newDrawerId); + if (hasOwnDrawers) { + fireNonCancelableEvent(onDrawerChange, { activeDrawerId: newDrawerId }); + } else if (!toolsProps.toolsHide) { + toolsProps.onToolsToggle(newDrawerId === TOOLS_DRAWER_ID); + } + } + const hasOwnDrawers = !!drawers; + const runtimeDrawers = useRuntimeDrawers(disableRuntimeDrawers, activeDrawerId, onActiveDrawerChange); + const combinedDrawers = drawers ? [...runtimeDrawers.before, ...drawers, ...runtimeDrawers.after] : applyToolsDrawer(toolsProps, runtimeDrawers); + let activeDrawerIdResolved = (toolsProps === null || toolsProps === void 0 ? void 0 : toolsProps.toolsOpen) && !hasOwnDrawers ? TOOLS_DRAWER_ID : activeDrawerId; + const activeDrawer = combinedDrawers === null || combinedDrawers === void 0 ? void 0 : combinedDrawers.find((drawer) => drawer.id === activeDrawerIdResolved); + activeDrawerIdResolved = (_a = activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.id) !== null && _a !== void 0 ? _a : null; + const activeDrawerSize = activeDrawerIdResolved ? (_c = (_b = drawerSizes[activeDrawerIdResolved]) !== null && _b !== void 0 ? _b : activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.defaultSize) !== null && _c !== void 0 ? _c : toolsProps.toolsWidth : toolsProps.toolsWidth; + const minDrawerSize = Math.min((_d = activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.defaultSize) !== null && _d !== void 0 ? _d : 290, 290); + return { + ariaLabelsWithDrawers: ariaLabels, + drawers: combinedDrawers || void 0, + activeDrawer, + activeDrawerId: activeDrawerIdResolved, + activeDrawerSize, + minDrawerSize, + onActiveDrawerChange, + onActiveDrawerResize + }; +} + +// node_modules/@cloudscape-design/components/app-layout/mobile-toolbar/index.js +var MobileToggle = import_react43.default.forwardRef(({ className, ariaLabels, type, disabled, onClick }, ref) => { + const { TagName, iconName, getLabels } = togglesConfig[type]; + const { mainLabel, openLabel } = getLabels(ariaLabels); + return import_react43.default.createElement( + TagName, + { className: clsx_m_default(styles_css_default19["mobile-toggle"], styles_css_default19[`mobile-toggle-type-${type}`]), "aria-hidden": disabled, "aria-label": mainLabel, onClick: (e) => e.target === e.currentTarget && onClick() }, + import_react43.default.createElement(ToggleButton, { ref, className, iconName, onClick, ariaLabel: openLabel, disabled, ariaExpanded: disabled }) + ); +}); +function MobileToolbar({ ariaLabels, toggleRefs, topOffset, navigationHide, toolsHide, anyPanelOpen, unfocusable, drawers, activeDrawerId, children: children2, onNavigationOpen, onToolsOpen, onDrawerChange, mobileBarRef }) { + (0, import_react43.useEffect)(() => { + if (anyPanelOpen) { + document.body.classList.add(styles_css_default19["block-body-scroll"]); + return () => { + document.body.classList.remove(styles_css_default19["block-body-scroll"]); + }; + } else { + document.body.classList.remove(styles_css_default19["block-body-scroll"]); + } + }, [anyPanelOpen]); + const { overflowItems, visibleItems } = splitItems(drawers, 2, activeDrawerId); + const overflowMenuHasBadge = !!overflowItems.find((item) => item.badge); + return import_react43.default.createElement( + "div", + { ref: mobileBarRef, className: clsx_m_default(styles_css_default19["mobile-bar"], styles_css_default18["mobile-bar"], unfocusable && styles_css_default20.unfocusable), style: { top: topOffset } }, + !navigationHide && import_react43.default.createElement(MobileToggle, { ref: toggleRefs.navigation, type: "navigation", className: styles_css_default18["navigation-toggle"], ariaLabels, disabled: anyPanelOpen, onClick: onNavigationOpen }), + import_react43.default.createElement("div", { className: styles_css_default19["mobile-bar-breadcrumbs"] }, children2 && import_react43.default.createElement("div", { className: styles_css_default18.breadcrumbs }, children2)), + !toolsHide && !drawers && import_react43.default.createElement(MobileToggle, { ref: toggleRefs.tools, type: "tools", className: styles_css_default18["tools-toggle"], ariaLabels, disabled: anyPanelOpen, onClick: onToolsOpen }), + drawers && import_react43.default.createElement( + "aside", + { "aria-label": ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.drawers, role: "region" }, + import_react43.default.createElement( + "div", + { className: clsx_m_default(styles_css_default19["drawers-container"]), role: "toolbar", "aria-orientation": "horizontal" }, + visibleItems.map((item, index) => { + var _a; + return import_react43.default.createElement( + "div", + { className: clsx_m_default(styles_css_default19["mobile-toggle"], styles_css_default19["mobile-toggle-type-drawer"]), key: index, onClick: () => onDrawerChange(item.id) }, + import_react43.default.createElement(ToggleButton, { className: clsx_m_default(styles_css_default18["drawers-trigger"], item.id === TOOLS_DRAWER_ID && styles_css_default18["tools-toggle"]), iconName: item.trigger.iconName, iconSvg: item.trigger.iconSvg, badge: item.badge, ariaLabel: (_a = item.ariaLabels) === null || _a === void 0 ? void 0 : _a.triggerButton, ariaExpanded: activeDrawerId === item.id, testId: `awsui-app-layout-trigger-${item.id}` }) + ); + }), + overflowItems.length > 0 && import_react43.default.createElement( + "div", + { className: clsx_m_default(styles_css_default19["mobile-toggle"], styles_css_default19["mobile-toggle-type-drawer"]) }, + import_react43.default.createElement(OverflowMenu, { ariaLabel: overflowMenuHasBadge ? ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.drawersOverflowWithBadge : ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.drawersOverflow, items: overflowItems, onItemClick: ({ detail }) => onDrawerChange(detail.id) }) + ) + ) + ) + ); +} + +// node_modules/@cloudscape-design/components/app-layout/utils/use-focus-control.js +var import_react44 = __toESM(require_react()); +function useFocusControl(isOpen, restoreFocus = false, activeDrawerId) { + const refs = { + toggle: (0, import_react44.useRef)(null), + close: (0, import_react44.useRef)(null), + slider: (0, import_react44.useRef)(null) + }; + const previousFocusedElement = (0, import_react44.useRef)(); + const shouldFocus = (0, import_react44.useRef)(false); + const doFocus = () => { + var _a, _b, _c; + if (!shouldFocus.current) { + return; + } + if (isOpen) { + previousFocusedElement.current = document.activeElement !== document.body ? document.activeElement : void 0; + if (refs.slider.current) { + (_a = refs.slider.current) === null || _a === void 0 ? void 0 : _a.focus(); + } else { + (_b = refs.close.current) === null || _b === void 0 ? void 0 : _b.focus(); + } + } else { + if (restoreFocus && previousFocusedElement.current && document.contains(previousFocusedElement.current)) { + previousFocusedElement.current.focus(); + previousFocusedElement.current = void 0; + } else { + (_c = refs.toggle.current) === null || _c === void 0 ? void 0 : _c.focus(); + } + } + shouldFocus.current = false; + }; + const setFocus = (force) => { + shouldFocus.current = true; + if (force && isOpen) { + doFocus(); + } + }; + (0, import_react44.useEffect)(doFocus, [isOpen, activeDrawerId]); + const loseFocus = (0, import_react44.useCallback)(() => { + previousFocusedElement.current = void 0; + }, []); + return { + refs, + setFocus, + loseFocus + }; +} + +// node_modules/@cloudscape-design/components/split-panel/utils/size-utils.js +var CONSTRAINED_PAGE_HEIGHT = 400; +var MAIN_PANEL_MIN_HEIGHT = 250; +var CONSTRAINED_MAIN_PANEL_MIN_HEIGHT = 40; +function getSplitPanelDefaultSize(position) { + if (typeof document === "undefined") { + return 0; + } + return position === "side" ? document.documentElement.clientWidth / 3 : document.documentElement.clientHeight / 2; +} +function getLimitedValue(min3, value, max3) { + if (min3 > max3) { + return min3; + } + if (value < min3) { + return min3; + } + if (value > max3) { + return max3; + } + return value; +} + +// node_modules/@cloudscape-design/components/app-layout/content-wrapper/index.js +var import_react45 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/app-layout/content-wrapper/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/app-layout/content-wrapper/styles.scoped.css"; +var styles_css_default21 = { + "content-wrapper": "awsui_content-wrapper_zycdx_1ocfz_103", + "content-wrapper-mobile": "awsui_content-wrapper-mobile_zycdx_1ocfz_107", + "content-type-dashboard": "awsui_content-type-dashboard_zycdx_1ocfz_112" +}; + +// node_modules/@cloudscape-design/components/app-layout/content-wrapper/index.js +var ContentWrapper = import_react45.default.forwardRef(({ className, contentType, children: children2, toolsPadding, disablePaddings, navigationPadding, isMobile, contentWidthStyles }, ref) => { + if (disablePaddings) { + return import_react45.default.createElement("div", { className, ref }, children2); + } + return import_react45.default.createElement( + "div", + { ref, className: clsx_m_default(styles_css_default21["content-wrapper"], !navigationPadding && styles_css_default21["content-wrapper-no-navigation-padding"], !toolsPadding && styles_css_default21["content-wrapper-no-tools-padding"], isMobile && styles_css_default21["content-wrapper-mobile"]) }, + import_react45.default.createElement("div", { style: contentWidthStyles, className: clsx_m_default(className, styles_css_default21[`content-type-${contentType}`]) }, children2) + ); +}); +var content_wrapper_default = ContentWrapper; + +// node_modules/@cloudscape-design/components/app-layout/drawer/index.js +var import_react46 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/app-layout/drawer/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/app-layout/drawer/styles.scoped.css"; +var styles_css_default22 = { + "toggle": "awsui_toggle_1uo6m_1740t_103", + "drawer-triggers": "awsui_drawer-triggers_1uo6m_1740t_109", + "drawer": "awsui_drawer_1uo6m_1740t_109", + "drawer-mobile": "awsui_drawer-mobile_1uo6m_1740t_119", + "drawer-closed": "awsui_drawer-closed_1uo6m_1740t_122", + "drawer-content": "awsui_drawer-content_1uo6m_1740t_129", + "drawer-content-clickable": "awsui_drawer-content-clickable_1uo6m_1740t_141", + "drawer-resize-content": "awsui_drawer-resize-content_1uo6m_1740t_151", + "drawer-triggers-wrapper": "awsui_drawer-triggers-wrapper_1uo6m_1740t_157", + "drawer-trigger": "awsui_drawer-trigger_1uo6m_1740t_109", + "drawer-trigger-active": "awsui_drawer-trigger-active_1uo6m_1740t_176", + "hide": "awsui_hide_1uo6m_1740t_184" +}; + +// node_modules/@cloudscape-design/components/app-layout/drawer/index.js +var Drawer = import_react46.default.forwardRef(({ id, contentClassName, toggleClassName, closeClassName, width, type, toggleRefs, topOffset, bottomOffset, ariaLabels, children: children2, hideOpenButton, isOpen, isHidden, isMobile, onToggle, onClick, onLoseFocus, resizeHandle }, ref) => { + const openButtonWrapperRef = (0, import_react46.useRef)(null); + const { TagName, iconName } = togglesConfig[type]; + const { mainLabel, closeLabel, openLabel } = ariaLabels; + const drawerContentWidthOpen = isMobile ? void 0 : width; + const drawerContentWidth = isOpen ? drawerContentWidthOpen : void 0; + const regularOpenButton = import_react46.default.createElement( + TagName, + { ref: openButtonWrapperRef, "aria-label": mainLabel, className: styles_css_default22.toggle, "aria-hidden": isOpen }, + import_react46.default.createElement(ToggleButton, { ref: toggleRefs.toggle, className: toggleClassName, iconName, ariaLabel: openLabel, onClick: () => onToggle(true), ariaExpanded: isOpen ? void 0 : false }) + ); + return import_react46.default.createElement( + "div", + { ref, className: clsx_m_default(styles_css_default22.drawer, { + [styles_css_default22.hide]: isHidden, + [styles_css_default22["drawer-closed"]]: !isOpen, + [styles_css_default18["drawer-closed"]]: !isOpen, + [styles_css_default22["drawer-mobile"]]: isMobile + }), style: { width: drawerContentWidth }, onBlur: onLoseFocus ? (e) => { + if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) { + onLoseFocus(e); + } + } : void 0, onClick: (event) => { + var _a; + if (onClick) { + onClick(event); + } + if (!isOpen) { + if (openButtonWrapperRef.current === event.target || !((_a = openButtonWrapperRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target))) { + onToggle(true); + } + } + } }, + import_react46.default.createElement( + "div", + { id, style: { width: drawerContentWidth, top: topOffset, bottom: bottomOffset }, className: clsx_m_default(styles_css_default22["drawer-content"], styles_css_default22["drawer-content-clickable"], contentClassName) }, + !isMobile && !hideOpenButton && regularOpenButton, + import_react46.default.createElement( + TagName, + { className: clsx_m_default(resizeHandle && styles_css_default22["drawer-resize-content"]), "aria-label": mainLabel, "aria-hidden": !isOpen }, + !isMobile && isOpen && resizeHandle, + import_react46.default.createElement(CloseButton, { ref: toggleRefs.close, className: closeClassName, ariaLabel: closeLabel, onClick: () => { + onToggle(false); + } }), + children2 + ) + ) + ); +}); +var DrawerTrigger = import_react46.default.forwardRef(({ testUtilsClassName, ariaLabel, ariaExpanded, ariaControls, badge, itemId, isActive, trigger, onClick }, ref) => import_react46.default.createElement( + "div", + { className: clsx_m_default(styles_css_default22["drawer-trigger"], isActive && styles_css_default22["drawer-trigger-active"]), onClick }, + import_react46.default.createElement(ToggleButton, { ref, className: testUtilsClassName, iconName: trigger.iconName, iconSvg: trigger.iconSvg, ariaLabel, ariaExpanded, ariaControls, badge, testId: itemId && `awsui-app-layout-trigger-${itemId}` }) +)); +var DrawerTriggersBar = ({ isMobile, topOffset, bottomOffset, activeDrawerId, ariaLabels, drawers, drawerRefs, onDrawerChange }) => { + const containerRef = import_react46.default.useRef(null); + const previousActiveDrawerId = (0, import_react46.useRef)(activeDrawerId); + const [containerHeight, triggersContainerRef] = useContainerQuery((rect) => rect.contentBoxHeight); + const isCompactMode = useDensityMode(containerRef) === "compact"; + if (activeDrawerId) { + previousActiveDrawerId.current = activeDrawerId; + } + const getIndexOfOverflowItem = () => { + if (containerHeight) { + const ITEM_HEIGHT = isCompactMode ? 34 : 38; + const overflowSpot = containerHeight / 1.5; + const index = Math.floor(overflowSpot / ITEM_HEIGHT); + return index; + } + return 0; + }; + const { visibleItems, overflowItems } = splitItems(drawers, getIndexOfOverflowItem(), activeDrawerId); + const overflowMenuHasBadge = !!overflowItems.find((item) => item.badge); + return import_react46.default.createElement( + "div", + { className: clsx_m_default(styles_css_default22.drawer, styles_css_default22["drawer-closed"], styles_css_default18["drawer-closed"], { + [styles_css_default22["drawer-mobile"]]: isMobile, + [styles_css_default22.hide]: drawers.length === 1 && !!activeDrawerId + }), ref: containerRef }, + import_react46.default.createElement("div", { ref: triggersContainerRef, style: { top: topOffset, bottom: bottomOffset }, className: clsx_m_default(styles_css_default22["drawer-content"], { + [styles_css_default22["drawer-content-clickable"]]: drawers.length === 1 + }), onClick: drawers.length === 1 ? () => onDrawerChange(drawers[0].id !== activeDrawerId ? drawers[0].id : null) : void 0 }, !isMobile && import_react46.default.createElement( + "aside", + { "aria-label": ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.drawers, role: "region" }, + import_react46.default.createElement( + "div", + { className: clsx_m_default(styles_css_default22["drawer-triggers-wrapper"]), role: "toolbar", "aria-orientation": "vertical" }, + visibleItems.map((item, index) => { + var _a; + return import_react46.default.createElement(DrawerTrigger, { key: index, testUtilsClassName: clsx_m_default(styles_css_default18["drawers-trigger"], item.id === TOOLS_DRAWER_ID && styles_css_default18["tools-toggle"]), ariaExpanded: activeDrawerId === item.id, ref: item.id === previousActiveDrawerId.current ? drawerRefs.toggle : void 0, ariaLabel: (_a = item.ariaLabels) === null || _a === void 0 ? void 0 : _a.triggerButton, ariaControls: activeDrawerId === item.id ? item.id : void 0, trigger: item.trigger, badge: item.badge, itemId: item.id, isActive: activeDrawerId === item.id, onClick: drawers.length !== 1 ? () => onDrawerChange(item.id !== activeDrawerId ? item.id : null) : void 0 }); + }), + overflowItems.length > 0 && import_react46.default.createElement( + "div", + { className: clsx_m_default(styles_css_default22["drawer-trigger"]) }, + import_react46.default.createElement(OverflowMenu, { ariaLabel: overflowMenuHasBadge ? ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.drawersOverflowWithBadge : ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.drawersOverflow, items: overflowItems, onItemClick: ({ detail }) => onDrawerChange(detail.id) }) + ) + ) + )) + ); +}; + +// node_modules/@cloudscape-design/components/app-layout/drawer/resizable-drawer.js +var import_react49 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/app-layout/utils/use-pointer-events.js +var import_react47 = __toESM(require_react()); +var usePointerEvents = ({ position, panelRef, handleRef, onResize, hasTransitions = false }) => { + const onDocumentPointerMove = (0, import_react47.useCallback)((event) => { + if (!panelRef || !panelRef.current || !handleRef || !handleRef.current) { + return; + } + panelRef.current.classList.remove(styles_css_default20["with-motion"]); + if (position === "side") { + const mouseClientX = event.clientX || 0; + const handleOffset = handleRef.current.getBoundingClientRect().width / 2; + const width = panelRef.current.getBoundingClientRect().right - mouseClientX + handleOffset; + onResize(width); + } else { + const mouseClientY = event.clientY || 0; + const handleOffset = handleRef.current.getBoundingClientRect().height / 2; + const height = panelRef.current.getBoundingClientRect().bottom - mouseClientY + handleOffset; + onResize(height); + } + }, [position, panelRef, handleRef, onResize]); + const onDocumentPointerUp = (0, import_react47.useCallback)(() => { + if (!panelRef || !panelRef.current) { + return; + } + if (hasTransitions) { + panelRef.current.classList.add(styles_css_default20["with-motion"]); + } + document.body.classList.remove(styles_css_default20["resize-active"]); + document.body.classList.remove(styles_css_default20[`resize-${position}`]); + document.removeEventListener("pointerup", onDocumentPointerUp); + document.removeEventListener("pointermove", onDocumentPointerMove); + }, [panelRef, onDocumentPointerMove, position, hasTransitions]); + const onSliderPointerDown = (0, import_react47.useCallback)(() => { + document.body.classList.add(styles_css_default20["resize-active"]); + document.body.classList.add(styles_css_default20[`resize-${position}`]); + document.addEventListener("pointerup", onDocumentPointerUp); + document.addEventListener("pointermove", onDocumentPointerMove); + }, [onDocumentPointerMove, onDocumentPointerUp, position]); + return onSliderPointerDown; +}; + +// node_modules/@cloudscape-design/components/app-layout/utils/use-keyboard-events.js +var KEYBOARD_SINGLE_STEP_SIZE = 10; +var KEYBOARD_MULTIPLE_STEPS_SIZE = 60; +var getCurrentSize = (panelRef) => { + if (!panelRef || !panelRef.current) { + return { + panelHeight: 0, + panelWidth: 0 + }; + } + return { + panelHeight: panelRef.current.clientHeight, + panelWidth: panelRef.current.clientWidth + }; +}; +var useKeyboardEvents = ({ position, onResize, panelRef }) => { + return (event) => { + let currentSize; + let maxSize; + const { panelHeight, panelWidth } = getCurrentSize(panelRef); + if (position === "side") { + currentSize = panelWidth; + maxSize = window.innerWidth; + } else { + currentSize = panelHeight; + maxSize = window.innerHeight; + } + const primaryGrowKey = position === "bottom" ? KeyCode.up : KeyCode.left; + const primaryShrinkKey = position === "bottom" ? KeyCode.down : KeyCode.right; + const altGrowKey = position === "bottom" ? KeyCode.right : KeyCode.down; + const altShrinkKey = position === "bottom" ? KeyCode.left : KeyCode.up; + let isEventHandled = true; + switch (event.keyCode) { + case primaryGrowKey: + case altGrowKey: + onResize(currentSize + KEYBOARD_SINGLE_STEP_SIZE); + break; + case primaryShrinkKey: + case altShrinkKey: + onResize(currentSize - KEYBOARD_SINGLE_STEP_SIZE); + break; + case KeyCode.pageUp: + onResize(currentSize + KEYBOARD_MULTIPLE_STEPS_SIZE); + break; + case KeyCode.pageDown: + onResize(currentSize - KEYBOARD_MULTIPLE_STEPS_SIZE); + break; + case KeyCode.home: + onResize(maxSize); + break; + case KeyCode.end: + onResize(0); + break; + default: + isEventHandled = false; + } + if (isEventHandled) { + event.preventDefault(); + event.stopPropagation(); + } + }; +}; + +// node_modules/@cloudscape-design/components/split-panel/icons/resize-handler.js +var import_react48 = __toESM(require_react()); +var ResizeHandler = ({ className }) => import_react48.default.createElement( + "svg", + { focusable: false, className, xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16" }, + import_react48.default.createElement("line", { strokeWidth: "2", x1: "2", y1: "5", x2: "14", y2: "5" }), + import_react48.default.createElement("line", { strokeWidth: "2", x1: "14", y1: "10", x2: "2", y2: "10" }) +); +var resize_handler_default = ResizeHandler; + +// node_modules/@cloudscape-design/components/split-panel/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/split-panel/styles.scoped.css"; +var styles_css_default23 = { + "drawer": "awsui_drawer_1r9lg_5jcsd_201", + "refresh": "awsui_refresh_1r9lg_5jcsd_201", + "animating": "awsui_animating_1r9lg_5jcsd_215", + "preference-icon--layout-border": "awsui_preference-icon--layout-border_1r9lg_5jcsd_238", + "preference-icon--layout-background": "awsui_preference-icon--layout-background_1r9lg_5jcsd_242", + "preference-icon--layout-header": "awsui_preference-icon--layout-header_1r9lg_5jcsd_245", + "preference-icon--border": "awsui_preference-icon--border_1r9lg_5jcsd_248", + "preference-icon--primary-button": "awsui_preference-icon--primary-button_1r9lg_5jcsd_252", + "preference-icon--secondary": "awsui_preference-icon--secondary_1r9lg_5jcsd_255", + "preference-icon--disabled-element": "awsui_preference-icon--disabled-element_1r9lg_5jcsd_258", + "preference-icon--separator": "awsui_preference-icon--separator_1r9lg_5jcsd_261", + "preference-icon--focus-text": "awsui_preference-icon--focus-text_1r9lg_5jcsd_264", + "preference-icon-refresh--layout-top": "awsui_preference-icon-refresh--layout-top_1r9lg_5jcsd_268", + "preference-icon-refresh--layout-main": "awsui_preference-icon-refresh--layout-main_1r9lg_5jcsd_271", + "preference-icon-refresh--primary": "awsui_preference-icon-refresh--primary_1r9lg_5jcsd_274", + "preference-icon-refresh--disabled": "awsui_preference-icon-refresh--disabled_1r9lg_5jcsd_277", + "preference-icon-refresh--column-header": "awsui_preference-icon-refresh--column-header_1r9lg_5jcsd_280", + "preference-icon-refresh--window": "awsui_preference-icon-refresh--window_1r9lg_5jcsd_283", + "preference-icon-refresh--secondary": "awsui_preference-icon-refresh--secondary_1r9lg_5jcsd_287", + "preference-icon-refresh--default": "awsui_preference-icon-refresh--default_1r9lg_5jcsd_290", + "preference-icon-refresh--separator": "awsui_preference-icon-refresh--separator_1r9lg_5jcsd_293", + "preference-icon-refresh--input-default": "awsui_preference-icon-refresh--input-default_1r9lg_5jcsd_296", + "preference-icon-refresh--heading": "awsui_preference-icon-refresh--heading_1r9lg_5jcsd_299", + "root": "awsui_root_1r9lg_5jcsd_303", + "preferences-button": "awsui_preferences-button_1r9lg_5jcsd_338", + "close-button": "awsui_close-button_1r9lg_5jcsd_342", + "drawer-closed": "awsui_drawer-closed_1r9lg_5jcsd_354", + "drawer-content-side": "awsui_drawer-content-side_1r9lg_5jcsd_359", + "drawer-content-bottom": "awsui_drawer-content-bottom_1r9lg_5jcsd_375", + "position-bottom": "awsui_position-bottom_1r9lg_5jcsd_381", + "position-side": "awsui_position-side_1r9lg_5jcsd_408", + "slider": "awsui_slider_1r9lg_5jcsd_414", + "slider-side": "awsui_slider-side_1r9lg_5jcsd_449", + "slider-wrapper-bottom": "awsui_slider-wrapper-bottom_1r9lg_5jcsd_456", + "slider-wrapper-side": "awsui_slider-wrapper-side_1r9lg_5jcsd_467", + "open-button": "awsui_open-button_1r9lg_5jcsd_478", + "open-button-side": "awsui_open-button-side_1r9lg_5jcsd_482", + "slider-icon": "awsui_slider-icon_1r9lg_5jcsd_491", + "slider-icon-bottom": "awsui_slider-icon-bottom_1r9lg_5jcsd_497", + "slider-icon-side": "awsui_slider-icon-side_1r9lg_5jcsd_501", + "pane-header-wrapper-bottom": "awsui_pane-header-wrapper-bottom_1r9lg_5jcsd_505", + "drawer-mobile": "awsui_drawer-mobile_1r9lg_5jcsd_516", + "drawer-disable-content-paddings": "awsui_drawer-disable-content-paddings_1r9lg_5jcsd_520", + "content-bottom": "awsui_content-bottom_1r9lg_5jcsd_529", + "pane-bottom-center-align": "awsui_pane-bottom-center-align_1r9lg_5jcsd_545", + "pane-bottom-content-nav-padding": "awsui_pane-bottom-content-nav-padding_1r9lg_5jcsd_550", + "pane-bottom-content-tools-padding": "awsui_pane-bottom-content-tools-padding_1r9lg_5jcsd_554", + "content-bottom-max-width": "awsui_content-bottom-max-width_1r9lg_5jcsd_558", + "content-side": "awsui_content-side_1r9lg_5jcsd_563", + "pane-header-wrapper-side": "awsui_pane-header-wrapper-side_1r9lg_5jcsd_573", + "pane-content-wrapper-side": "awsui_pane-content-wrapper-side_1r9lg_5jcsd_579", + "header": "awsui_header_1r9lg_5jcsd_586", + "header-text": "awsui_header-text_1r9lg_5jcsd_596", + "header-actions": "awsui_header-actions_1r9lg_5jcsd_609", + "divider": "awsui_divider_1r9lg_5jcsd_617" +}; + +// node_modules/@cloudscape-design/components/app-layout/drawer/resizable-drawer.js +var ResizableDrawer = (_a) => { + var _b, _c, _d, _e; + var { onResize, maxWidth, minWidth, refs, activeDrawer, toolsContent } = _a, props2 = __rest(_a, ["onResize", "maxWidth", "minWidth", "refs", "activeDrawer", "toolsContent"]); + const { isOpen, children: children2, width, isMobile } = props2; + const clampedWidth = getLimitedValue(minWidth, width, maxWidth); + const relativeSize = (clampedWidth - minWidth) / (maxWidth - minWidth) * 100; + const setSidePanelWidth = (newWidth) => { + const size = getLimitedValue(minWidth, newWidth, maxWidth); + const id = activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.id; + if (isOpen && id && maxWidth >= minWidth) { + onResize({ size, id }); + } + }; + const drawerRefObject = (0, import_react49.useRef)(null); + const sizeControlProps = { + position: "side", + panelRef: drawerRefObject, + handleRef: refs.slider, + onResize: setSidePanelWidth + }; + const onSliderPointerDown = usePointerEvents(sizeControlProps); + const onKeyDown = useKeyboardEvents(sizeControlProps); + const resizeHandle = import_react49.default.createElement( + "div", + { ref: refs.slider, role: "slider", tabIndex: 0, "aria-label": (_b = activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.ariaLabels) === null || _b === void 0 ? void 0 : _b.resizeHandle, "aria-valuemax": 100, "aria-valuemin": 0, "aria-valuenow": relativeSize, className: clsx_m_default(styles_css_default23.slider, styles_css_default23[`slider-side`], styles_css_default18["drawers-slider"]), onKeyDown, onPointerDown: onSliderPointerDown }, + import_react49.default.createElement(resize_handler_default, { className: clsx_m_default(styles_css_default23["slider-icon"], styles_css_default23[`slider-icon-side`]) }) + ); + return import_react49.default.createElement( + Drawer, + Object.assign({}, props2, { id: activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.id, width: clampedWidth, ref: drawerRefObject, isHidden: !activeDrawer, resizeHandle: !isMobile && (activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.resizable) && import_react49.default.createElement("div", { className: styles_css_default23["slider-wrapper-side"] }, resizeHandle), ariaLabels: { + openLabel: (_c = activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.ariaLabels) === null || _c === void 0 ? void 0 : _c.triggerButton, + mainLabel: (_d = activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.ariaLabels) === null || _d === void 0 ? void 0 : _d.drawerName, + closeLabel: (_e = activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.ariaLabels) === null || _e === void 0 ? void 0 : _e.closeButton + } }), + toolsContent && import_react49.default.createElement("div", { className: clsx_m_default((activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.id) !== TOOLS_DRAWER_ID && styles_css_default22.hide) }, toolsContent), + (activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.id) !== TOOLS_DRAWER_ID ? children2 : null + ); +}; + +// node_modules/@cloudscape-design/components/app-layout/split-panel/constants.js +var SPLIT_PANEL_MIN_HEIGHT = 160; +var SPLIT_PANEL_MIN_WIDTH = 280; + +// node_modules/@cloudscape-design/components/app-layout/split-panel/drawer.js +var import_react51 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/app-layout/split-panel/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/app-layout/split-panel/styles.scoped.css"; +var styles_css_default24 = { + "drawer-displayed": "awsui_drawer-displayed_1lh3u_1yevz_103", + "drawer-content": "awsui_drawer-content_1lh3u_1yevz_107" +}; + +// node_modules/@cloudscape-design/components/internal/context/split-panel-context.js +var import_react50 = __toESM(require_react()); +var SplitPanelContext = (0, import_react50.createContext)(null); +var SplitPanelContextProvider = SplitPanelContext.Provider; +function useSplitPanelContext() { + const ctx = (0, import_react50.useContext)(SplitPanelContext); + if (!ctx) { + throw new Error("Split panel can only be used inside app layout"); + } + return ctx; +} + +// node_modules/@cloudscape-design/components/app-layout/split-panel/drawer.js +function SideSplitPanelDrawer({ displayed, children: children2 }) { + const { isOpen, size, topOffset, bottomOffset } = useSplitPanelContext(); + const width = isOpen && children2 ? size : void 0; + return import_react51.default.createElement( + "div", + { className: clsx_m_default(displayed && styles_css_default24["drawer-displayed"]), style: { width }, "data-testid": "side-split-panel-drawer" }, + import_react51.default.createElement("div", { className: styles_css_default24["drawer-content"], style: { width, top: topOffset, bottom: bottomOffset } }, children2) + ); +} + +// node_modules/@cloudscape-design/components/app-layout/split-panel/provider.js +var import_react52 = __toESM(require_react()); +function SplitPanelProvider(_a) { + var { children: children2, size, getMaxHeight, maxWidth, onResize } = _a, rest = __rest(_a, ["children", "size", "getMaxHeight", "maxWidth", "onResize"]); + const { position, reportSize, isOpen } = rest; + const [maxHeight, setMaxHeight] = (0, import_react52.useState)(size); + const minSize = position === "bottom" ? SPLIT_PANEL_MIN_HEIGHT : SPLIT_PANEL_MIN_WIDTH; + const maxSize = position === "bottom" ? maxHeight : maxWidth; + const cappedSize = getLimitedValue(minSize, size, maxSize); + const relativeSize = (size - minSize) / (maxSize - minSize) * 100; + const onResizeWithValidation = (newSize) => { + const maxSize2 = position === "side" ? maxWidth : getMaxHeight(); + const isResizeValid = position === "side" ? maxSize2 >= SPLIT_PANEL_MIN_WIDTH : maxSize2 >= SPLIT_PANEL_MIN_HEIGHT; + if (isOpen && isResizeValid) { + onResize(getLimitedValue(minSize, newSize, maxSize2)); + } + }; + (0, import_react52.useEffect)(() => { + if (position !== "bottom") { + return; + } + const handle = requestAnimationFrame(() => setMaxHeight(getMaxHeight())); + return () => cancelAnimationFrame(handle); + }, [size, minSize, position, getMaxHeight]); + (0, import_react52.useEffect)(() => { + reportSize(cappedSize); + }, [reportSize, cappedSize]); + (0, import_react52.useEffect)(() => { + if (position !== "bottom") { + return; + } + const handler = () => setMaxHeight(getMaxHeight()); + window.addEventListener("resize", handler); + return () => window.removeEventListener("resize", handler); + }, [position, getMaxHeight]); + return import_react52.default.createElement(SplitPanelContextProvider, { value: Object.assign(Object.assign({}, rest), { size: cappedSize, relativeSize, onResize: onResizeWithValidation }) }, children2); +} + +// node_modules/@cloudscape-design/components/app-layout/utils/use-split-panel-focus-control.js +var import_react53 = __toESM(require_react()); +function useSplitPanelFocusControl(dependencies) { + const refs = { + toggle: (0, import_react53.useRef)(null), + slider: (0, import_react53.useRef)(null), + preferences: (0, import_react53.useRef)(null) + }; + const lastInteraction = (0, import_react53.useRef)(null); + (0, import_react53.useEffect)(() => { + var _a, _b, _c, _d; + switch ((_a = lastInteraction.current) === null || _a === void 0 ? void 0 : _a.type) { + case "open": + (_b = refs.slider.current) === null || _b === void 0 ? void 0 : _b.focus(); + break; + case "close": + (_c = refs.toggle.current) === null || _c === void 0 ? void 0 : _c.focus(); + break; + case "position": + (_d = refs.preferences.current) === null || _d === void 0 ? void 0 : _d.focus(); + break; + } + lastInteraction.current = null; + }, dependencies); + return { + refs, + setLastInteraction: (interaction) => lastInteraction.current = interaction + }; +} + +// node_modules/@cloudscape-design/components/app-layout/classic.js +var ClassicAppLayout = import_react54.default.forwardRef((_a, ref) => { + var _b, _c, _d, _e, _f, _g; + var { navigation, navigationWidth, navigationHide, navigationOpen, tools, toolsWidth, toolsHide, toolsOpen: controlledToolsOpen, breadcrumbs, notifications, stickyNotifications, contentHeader, disableContentHeaderOverlap, content, contentType, disableContentPaddings, disableBodyScroll, maxContentWidth, minContentWidth, placement, ariaLabels, splitPanel, splitPanelSize: controlledSplitPanelSize, splitPanelOpen: controlledSplitPanelOpen, splitPanelPreferences: controlledSplitPanelPreferences, onSplitPanelPreferencesChange, onSplitPanelResize, onSplitPanelToggle, onNavigationChange, onToolsChange, drawers: controlledDrawers, onDrawerChange, activeDrawerId: controlledActiveDrawerId } = _a, rest = __rest(_a, ["navigation", "navigationWidth", "navigationHide", "navigationOpen", "tools", "toolsWidth", "toolsHide", "toolsOpen", "breadcrumbs", "notifications", "stickyNotifications", "contentHeader", "disableContentHeaderOverlap", "content", "contentType", "disableContentPaddings", "disableBodyScroll", "maxContentWidth", "minContentWidth", "placement", "ariaLabels", "splitPanel", "splitPanelSize", "splitPanelOpen", "splitPanelPreferences", "onSplitPanelPreferencesChange", "onSplitPanelResize", "onSplitPanelToggle", "onNavigationChange", "onToolsChange", "drawers", "onDrawerChange", "activeDrawerId"]); + const __embeddedViewMode = Boolean(rest.__embeddedViewMode); + const rootRef = (0, import_react54.useRef)(null); + const isMobile = useMobile(); + const [toolsOpen = false, setToolsOpen] = useControllable(controlledToolsOpen, onToolsChange, false, { + componentName: "AppLayout", + controlledProp: "toolsOpen", + changeHandler: "onToolsChange" + }); + const onToolsToggle = (open) => { + setToolsOpen(open); + focusToolsButtons(); + fireNonCancelableEvent(onToolsChange, { open }); + }; + const { drawers, activeDrawer, minDrawerSize, activeDrawerSize, activeDrawerId, ariaLabelsWithDrawers, onActiveDrawerChange, onActiveDrawerResize } = useDrawers(Object.assign({ drawers: controlledDrawers, onDrawerChange, activeDrawerId: controlledActiveDrawerId }, rest), ariaLabels, { + ariaLabels, + tools, + toolsOpen, + toolsHide, + toolsWidth, + onToolsToggle + }); + ariaLabels = ariaLabelsWithDrawers; + const hasDrawers = !!drawers; + const { refs: navigationRefs, setFocus: focusNavButtons } = useFocusControl(navigationOpen); + const { refs: toolsRefs, setFocus: focusToolsButtons, loseFocus: loseToolsFocus } = useFocusControl(toolsOpen || activeDrawer !== void 0, true); + const { refs: drawerRefs, setFocus: focusDrawersButtons, loseFocus: loseDrawersFocus } = useFocusControl(!!activeDrawerId, true, activeDrawerId); + const onNavigationToggle = useStableCallback((open) => { + focusNavButtons(); + fireNonCancelableEvent(onNavigationChange, { open }); + }); + const onNavigationClick = (event) => { + const hasLink = findUpUntil(event.target, (node) => node.tagName === "A" && !!node.href); + if (hasLink) { + onNavigationToggle(false); + } + }; + (0, import_react54.useEffect)(() => { + if (isMobile) { + onNavigationToggle(false); + } + }, [isMobile, onNavigationToggle]); + const navigationVisible = !navigationHide && navigationOpen; + const toolsVisible = !toolsHide && toolsOpen; + const [headerFooterHeight, setHeaderFooterHeight] = (0, import_react54.useState)(0); + (0, import_react54.useEffect)(() => { + const id = requestAnimationFrame(() => setHeaderFooterHeight(placement.top + placement.bottom)); + return () => cancelAnimationFrame(id); + }, [placement.top, placement.bottom]); + const contentHeightStyle = { + [disableBodyScroll ? "height" : "minHeight"]: `calc(100vh - ${headerFooterHeight}px)` + }; + const [notificationsHeight, notificationsRef] = useContainerQuery((rect) => rect.contentBoxHeight); + const anyPanelOpen = navigationVisible || toolsVisible || !!activeDrawer; + const hasRenderedNotifications = notificationsHeight ? notificationsHeight > 0 : false; + const stickyNotificationsHeight = stickyNotifications ? notificationsHeight : null; + const [splitPanelPreferences, setSplitPanelPreferences] = useControllable(controlledSplitPanelPreferences, onSplitPanelPreferencesChange, void 0, { + componentName: "AppLayout", + controlledProp: "splitPanelPreferences", + changeHandler: "onSplitPanelPreferencesChange" + }); + const [splitPanelOpen = false, setSplitPanelOpen] = useControllable(controlledSplitPanelOpen, onSplitPanelToggle, false, { + componentName: "AppLayout", + controlledProp: "splitPanelOpen", + changeHandler: "onSplitPanelToggle" + }); + const splitPanelPosition = (splitPanelPreferences === null || splitPanelPreferences === void 0 ? void 0 : splitPanelPreferences.position) || "bottom"; + const [splitPanelReportedToggle, setSplitPanelReportedToggle] = (0, import_react54.useState)({ + displayed: false, + ariaLabel: void 0 + }); + const splitPanelDisplayed = !!(splitPanel && (splitPanelReportedToggle.displayed || splitPanelOpen)); + const closedDrawerWidth = 40; + const effectiveNavigationWidth = navigationHide ? 0 : navigationOpen ? navigationWidth : closedDrawerWidth; + const getEffectiveToolsWidth = () => { + if (activeDrawer && activeDrawerSize) { + return activeDrawerSize; + } + if (toolsHide || drawers) { + return 0; + } + if (toolsOpen) { + return toolsWidth; + } + return closedDrawerWidth; + }; + const effectiveToolsWidth = getEffectiveToolsWidth(); + const defaultSplitPanelSize = getSplitPanelDefaultSize(splitPanelPosition); + const [splitPanelSize = defaultSplitPanelSize, setSplitPanelSize] = useControllable(controlledSplitPanelSize, onSplitPanelResize, defaultSplitPanelSize, { + componentName: "AppLayout", + controlledProp: "splitPanelSize", + changeHandler: "onSplitPanelResize" + }); + const mainContentRef = (0, import_react54.useRef)(null); + const legacyScrollRootRef = (0, import_react54.useRef)(null); + const { refs: splitPanelRefs, setLastInteraction: setSplitPanelLastInteraction } = useSplitPanelFocusControl([ + splitPanelPreferences, + splitPanelOpen + ]); + const onSplitPanelPreferencesSet = (0, import_react54.useCallback)((detail) => { + setSplitPanelPreferences(detail); + setSplitPanelLastInteraction({ type: "position" }); + fireNonCancelableEvent(onSplitPanelPreferencesChange, detail); + }, [setSplitPanelPreferences, onSplitPanelPreferencesChange, setSplitPanelLastInteraction]); + const onSplitPanelSizeSet = (0, import_react54.useCallback)((newSize) => { + setSplitPanelSize(newSize); + fireNonCancelableEvent(onSplitPanelResize, { size: newSize }); + }, [setSplitPanelSize, onSplitPanelResize]); + const onSplitPanelToggleHandler = (0, import_react54.useCallback)(() => { + setSplitPanelOpen(!splitPanelOpen); + setSplitPanelLastInteraction({ type: splitPanelOpen ? "close" : "open" }); + fireNonCancelableEvent(onSplitPanelToggle, { open: !splitPanelOpen }); + }, [setSplitPanelOpen, splitPanelOpen, onSplitPanelToggle, setSplitPanelLastInteraction]); + const getSplitPanelMaxHeight = useStableCallback(() => { + if (typeof document === "undefined") { + return 0; + } else if (disableBodyScroll && legacyScrollRootRef.current) { + const availableHeight = legacyScrollRootRef.current.clientHeight; + return availableHeight < CONSTRAINED_PAGE_HEIGHT ? availableHeight : availableHeight - MAIN_PANEL_MIN_HEIGHT; + } else { + const availableHeight = document.documentElement.clientHeight - placement.top - placement.bottom; + return availableHeight < CONSTRAINED_PAGE_HEIGHT ? availableHeight - CONSTRAINED_MAIN_PANEL_MIN_HEIGHT : availableHeight - MAIN_PANEL_MIN_HEIGHT; + } + }); + const rightDrawerBarWidth = drawers ? drawers.length > 1 ? closedDrawerWidth : 0 : 0; + const contentPadding = 80; + const resizableSpaceAvailable = Math.max(0, placement.width - effectiveNavigationWidth - minContentWidth - contentPadding - rightDrawerBarWidth); + const isSplitPanelForcedPosition = isMobile || resizableSpaceAvailable - effectiveToolsWidth < SPLIT_PANEL_MIN_WIDTH; + const finalSplitPanePosition = isSplitPanelForcedPosition ? "bottom" : splitPanelPosition; + const splitPaneAvailableOnTheSide = splitPanelDisplayed && finalSplitPanePosition === "side"; + const sideSplitPanelSize = splitPaneAvailableOnTheSide ? splitPanelOpen ? splitPanelSize : closedDrawerWidth : 0; + const splitPanelMaxWidth = Math.max(0, resizableSpaceAvailable - effectiveToolsWidth); + const drawerMaxSize = Math.max(0, resizableSpaceAvailable - sideSplitPanelSize); + const navigationClosedWidth = navigationHide || isMobile ? 0 : closedDrawerWidth; + const contentMaxWidthStyle = !isMobile ? { maxWidth: maxContentWidth } : void 0; + const [splitPanelReportedSize, setSplitPanelReportedSize] = (0, import_react54.useState)(0); + const [splitPanelReportedHeaderHeight, setSplitPanelReportedHeaderHeight] = (0, import_react54.useState)(0); + const splitPanelContextProps = { + topOffset: placement.top + (finalSplitPanePosition === "bottom" ? stickyNotificationsHeight || 0 : 0), + bottomOffset: placement.bottom, + leftOffset: placement.left + (isMobile ? 0 : !navigationHide && navigationOpen ? navigationWidth : navigationClosedWidth), + rightOffset: isMobile ? 0 : placement.right + effectiveToolsWidth + rightDrawerBarWidth, + position: finalSplitPanePosition, + size: splitPanelSize, + maxWidth: splitPanelMaxWidth, + getMaxHeight: getSplitPanelMaxHeight, + disableContentPaddings, + contentWidthStyles: contentMaxWidthStyle, + isOpen: splitPanelOpen, + isForcedPosition: isSplitPanelForcedPosition, + onResize: onSplitPanelSizeSet, + onToggle: onSplitPanelToggleHandler, + onPreferencesChange: onSplitPanelPreferencesSet, + setSplitPanelToggle: setSplitPanelReportedToggle, + reportSize: setSplitPanelReportedSize, + reportHeaderHeight: setSplitPanelReportedHeaderHeight, + refs: splitPanelRefs + }; + const splitPanelWrapped = splitPanel && import_react54.default.createElement(SplitPanelProvider, Object.assign({}, splitPanelContextProps), finalSplitPanePosition === "side" ? import_react54.default.createElement(SideSplitPanelDrawer, { displayed: splitPanelDisplayed }, splitPanel) : splitPanel); + const contentWrapperProps = { + contentType, + navigationPadding: navigationHide || !!navigationOpen, + contentWidthStyles: !isMobile ? { minWidth: minContentWidth, maxWidth: maxContentWidth } : void 0, + toolsPadding: ( + // tools padding is displayed in one of the three cases + // 1. Nothing on the that screen edge (no tools panel and no split panel) + toolsHide || hasDrawers && !activeDrawer && (!splitPanelDisplayed || finalSplitPanePosition !== "side") || // 2. Tools panel is present and open + toolsVisible || // 3. Split panel is open in side position + splitPaneAvailableOnTheSide && splitPanelOpen + ), + isMobile + }; + (0, import_react54.useImperativeHandle)(ref, () => ({ + openTools: () => onToolsToggle(true), + closeNavigationIfNecessary: () => { + if (isMobile) { + onNavigationToggle(false); + } + }, + focusToolsClose: () => { + if (hasDrawers) { + focusDrawersButtons(true); + } else { + focusToolsButtons(true); + } + }, + focusActiveDrawer: () => focusDrawersButtons(true), + focusSplitPanel: () => { + var _a2; + return (_a2 = splitPanelRefs.slider.current) === null || _a2 === void 0 ? void 0 : _a2.focus(); + } + })); + const splitPanelBottomOffset = (_b = !splitPanelDisplayed || finalSplitPanePosition !== "bottom" ? void 0 : splitPanelOpen ? splitPanelReportedSize : splitPanelReportedHeaderHeight) !== null && _b !== void 0 ? _b : void 0; + const [mobileBarHeight, mobileBarRef] = useContainerQuery((rect) => rect.contentBoxHeight); + return import_react54.default.createElement( + "div", + { className: clsx_m_default(styles_css_default20.root, styles_css_default18.root, disableBodyScroll && styles_css_default20["root-no-scroll"]), ref: rootRef, style: contentHeightStyle }, + isMobile && !__embeddedViewMode && (!toolsHide || !navigationHide || breadcrumbs) && import_react54.default.createElement(MobileToolbar, { anyPanelOpen, toggleRefs: { navigation: navigationRefs.toggle, tools: toolsRefs.toggle }, topOffset: placement.top, ariaLabels, navigationHide, toolsHide, onNavigationOpen: () => onNavigationToggle(true), onToolsOpen: () => onToolsToggle(true), unfocusable: anyPanelOpen, mobileBarRef, drawers, activeDrawerId, onDrawerChange: (newDrawerId) => { + onActiveDrawerChange(newDrawerId); + if (newDrawerId !== activeDrawerId) { + focusToolsButtons(); + focusDrawersButtons(); + } + } }, breadcrumbs), + import_react54.default.createElement( + "div", + { className: clsx_m_default(styles_css_default20.layout, disableBodyScroll && styles_css_default20["layout-no-scroll"]) }, + !navigationHide && import_react54.default.createElement(Drawer, { contentClassName: styles_css_default18.navigation, toggleClassName: styles_css_default18["navigation-toggle"], closeClassName: styles_css_default18["navigation-close"], ariaLabels: togglesConfig.navigation.getLabels(ariaLabels), bottomOffset: placement.bottom, topOffset: placement.top, isMobile, isOpen: navigationOpen, onClick: isMobile ? onNavigationClick : void 0, onToggle: onNavigationToggle, toggleRefs: navigationRefs, type: "navigation", width: navigationWidth }, navigation), + import_react54.default.createElement( + "main", + { ref: legacyScrollRootRef, className: clsx_m_default(styles_css_default20["layout-main"], { + [styles_css_default20["layout-main-scrollable"]]: disableBodyScroll, + [styles_css_default18["disable-body-scroll-root"]]: disableBodyScroll, + [styles_css_default20.unfocusable]: isMobile && anyPanelOpen + }) }, + import_react54.default.createElement( + "div", + { style: { + marginBottom: splitPanelBottomOffset + } }, + notifications && import_react54.default.createElement(Notifications, { disableContentPaddings, testUtilsClassName: styles_css_default18.notifications, labels: ariaLabels, topOffset: disableBodyScroll ? 0 : placement.top, sticky: !isMobile && stickyNotifications, ref: notificationsRef }, notifications), + (!isMobile && breadcrumbs || contentHeader) && import_react54.default.createElement( + content_wrapper_default, + Object.assign({}, contentWrapperProps), + !isMobile && breadcrumbs && import_react54.default.createElement("div", { className: clsx_m_default(styles_css_default18.breadcrumbs, styles_css_default20["breadcrumbs-desktop"]) }, breadcrumbs), + contentHeader && import_react54.default.createElement("div", { className: clsx_m_default(styles_css_default20["content-header-wrapper"], !hasRenderedNotifications && (isMobile || !breadcrumbs) && styles_css_default20["content-extra-top-padding"], !hasRenderedNotifications && !breadcrumbs && styles_css_default20["content-header-wrapper-first-child"], !disableContentHeaderOverlap && styles_css_default20["content-header-wrapper-overlapped"]) }, contentHeader) + ), + import_react54.default.createElement( + content_wrapper_default, + Object.assign({}, contentWrapperProps, { + ref: mainContentRef, + disablePaddings: disableContentPaddings, + // eslint-disable-next-line react/forbid-component-props + className: clsx_m_default(!disableContentPaddings && styles_css_default20["content-wrapper"], !disableContentPaddings && (isMobile || !breadcrumbs) && !contentHeader && styles_css_default20["content-extra-top-padding"], styles_css_default18.content, !disableContentHeaderOverlap && contentHeader && styles_css_default20["content-overlapped"], !hasRenderedNotifications && !breadcrumbs && !isMobile && !contentHeader && styles_css_default20["content-wrapper-first-child"]) + }), + import_react54.default.createElement(AppLayoutContext.Provider, { value: { + stickyOffsetTop: ( + // We don't support the table header being sticky in case the deprecated disableBodyScroll is enabled, + // therefore we ensure the table header scrolls out of view by offseting a large enough value (9999px) + (disableBodyScroll ? isMobile ? -9999 : 0 : placement.top) + (isMobile ? 0 : stickyNotificationsHeight !== null ? stickyNotificationsHeight : 0) + ), + stickyOffsetBottom: placement.bottom + (splitPanelBottomOffset || 0), + mobileBarHeight: mobileBarHeight !== null && mobileBarHeight !== void 0 ? mobileBarHeight : 0 + } }, content) + ) + ), + finalSplitPanePosition === "bottom" && splitPanelWrapped + ), + finalSplitPanePosition === "side" && splitPanelWrapped, + hasDrawers ? import_react54.default.createElement(ResizableDrawer, { contentClassName: clsx_m_default(activeDrawerId && styles_css_default18["active-drawer"], activeDrawerId === TOOLS_DRAWER_ID && styles_css_default18.tools), toggleClassName: styles_css_default18["tools-toggle"], closeClassName: clsx_m_default(styles_css_default18["active-drawer-close-button"], activeDrawerId === TOOLS_DRAWER_ID && styles_css_default18["tools-close"]), ariaLabels: { + openLabel: (_c = activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.ariaLabels) === null || _c === void 0 ? void 0 : _c.triggerButton, + closeLabel: (_d = activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.ariaLabels) === null || _d === void 0 ? void 0 : _d.closeButton, + mainLabel: (_e = activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.ariaLabels) === null || _e === void 0 ? void 0 : _e.drawerName, + resizeHandle: (_f = activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.ariaLabels) === null || _f === void 0 ? void 0 : _f.resizeHandle + }, minWidth: minDrawerSize, maxWidth: drawerMaxSize, width: activeDrawerSize, bottomOffset: placement.bottom, topOffset: placement.top, isMobile, onToggle: (isOpen) => { + if (!isOpen) { + focusToolsButtons(); + focusDrawersButtons(); + onActiveDrawerChange(null); + } + }, isOpen: true, hideOpenButton: true, toggleRefs: drawerRefs, type: "tools", onLoseFocus: loseDrawersFocus, activeDrawer, onResize: (changeDetail) => onActiveDrawerResize(changeDetail), refs: drawerRefs, toolsContent: (_g = drawers === null || drawers === void 0 ? void 0 : drawers.find((drawer) => drawer.id === TOOLS_DRAWER_ID)) === null || _g === void 0 ? void 0 : _g.content }, activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.content) : !toolsHide && import_react54.default.createElement(Drawer, { contentClassName: styles_css_default18.tools, toggleClassName: styles_css_default18["tools-toggle"], closeClassName: styles_css_default18["tools-close"], ariaLabels: togglesConfig.tools.getLabels(ariaLabels), width: toolsWidth, bottomOffset: placement.bottom, topOffset: placement.top, isMobile, onToggle: onToolsToggle, isOpen: toolsOpen, toggleRefs: toolsRefs, type: "tools", onLoseFocus: loseToolsFocus }, tools), + hasDrawers && drawers.length > 0 && import_react54.default.createElement(DrawerTriggersBar, { drawerRefs, bottomOffset: placement.bottom, topOffset: placement.top, isMobile, drawers, activeDrawerId, onDrawerChange: (newDrawerId) => { + if (activeDrawerId !== newDrawerId) { + focusToolsButtons(); + focusDrawersButtons(); + } + onActiveDrawerChange(newDrawerId); + }, ariaLabels }) + ) + ); +}); +var classic_default = ClassicAppLayout; + +// node_modules/@cloudscape-design/components/app-layout/visual-refresh/index.js +var import_react70 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/app-layout/visual-refresh/context.js +var import_react58 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/app-layout/visual-refresh/split-panel.js +var import_react55 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/app-layout/visual-refresh/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/app-layout/visual-refresh/styles.scoped.css"; +var styles_css_default25 = { + "background": "awsui_background_hyvsj_1t7qb_99", + "scrolling-background": "awsui_scrolling-background_hyvsj_1t7qb_102", + "sticky-background": "awsui_sticky-background_hyvsj_1t7qb_108", + "has-sticky-notifications": "awsui_has-sticky-notifications_hyvsj_1t7qb_116", + "breadcrumbs": "awsui_breadcrumbs_hyvsj_1t7qb_129", + "has-sticky-background": "awsui_has-sticky-background_hyvsj_1t7qb_139", + "drawers-container": "awsui_drawers-container_hyvsj_1t7qb_151", + "has-open-drawer": "awsui_has-open-drawer_hyvsj_1t7qb_162", + "disable-body-scroll": "awsui_disable-body-scroll_hyvsj_1t7qb_185", + "drawers-desktop-triggers-container": "awsui_drawers-desktop-triggers-container_hyvsj_1t7qb_190", + "has-multiple-triggers": "awsui_has-multiple-triggers_hyvsj_1t7qb_231", + "drawers-mobile-triggers-container": "awsui_drawers-mobile-triggers-container_hyvsj_1t7qb_241", + "drawers-trigger-content": "awsui_drawers-trigger-content_hyvsj_1t7qb_245", + "drawers-trigger-overflow": "awsui_drawers-trigger-overflow_hyvsj_1t7qb_259", + "drawers-trigger": "awsui_drawers-trigger_hyvsj_1t7qb_245", + "drawer": "awsui_drawer_hyvsj_1t7qb_151", + "drawer-content-container": "awsui_drawer-content-container_hyvsj_1t7qb_290", + "drawer-close-button": "awsui_drawer-close-button_hyvsj_1t7qb_299", + "drawer-content": "awsui_drawer-content_hyvsj_1t7qb_290", + "drawer-content-hidden": "awsui_drawer-content-hidden_hyvsj_1t7qb_307", + "drawer-slider": "awsui_drawer-slider_hyvsj_1t7qb_310", + "is-drawer-open": "awsui_is-drawer-open_hyvsj_1t7qb_317", + "content": "awsui_content_hyvsj_1t7qb_343", + "layout": "awsui_layout_hyvsj_1t7qb_364", + "has-max-content-width": "awsui_has-max-content-width_hyvsj_1t7qb_445", + "content-type-dashboard": "awsui_content-type-dashboard_hyvsj_1t7qb_460", + "content-type-table": "awsui_content-type-table_hyvsj_1t7qb_474", + "content-type-cards": "awsui_content-type-cards_hyvsj_1t7qb_474", + "is-overlap-disabled": "awsui_is-overlap-disabled_hyvsj_1t7qb_480", + "is-hide-mobile-toolbar": "awsui_is-hide-mobile-toolbar_hyvsj_1t7qb_483", + "has-content-gap-left": "awsui_has-content-gap-left_hyvsj_1t7qb_515", + "has-content-gap-right": "awsui_has-content-gap-right_hyvsj_1t7qb_518", + "content-first-child-notifications": "awsui_content-first-child-notifications_hyvsj_1t7qb_528", + "has-breadcrumbs": "awsui_has-breadcrumbs_hyvsj_1t7qb_531", + "content-first-child-header": "awsui_content-first-child-header_hyvsj_1t7qb_534", + "has-header": "awsui_has-header_hyvsj_1t7qb_534", + "content-first-child-main": "awsui_content-first-child-main_hyvsj_1t7qb_552", + "disable-content-paddings": "awsui_disable-content-paddings_hyvsj_1t7qb_552", + "has-split-panel": "awsui_has-split-panel_hyvsj_1t7qb_589", + "split-panel-position-bottom": "awsui_split-panel-position-bottom_hyvsj_1t7qb_589", + "block-body-scroll": "awsui_block-body-scroll_hyvsj_1t7qb_605", + "unfocusable": "awsui_unfocusable_hyvsj_1t7qb_610", + "container": "awsui_container_hyvsj_1t7qb_620", + "is-navigation-open": "awsui_is-navigation-open_hyvsj_1t7qb_646", + "is-tools-open": "awsui_is-tools-open_hyvsj_1t7qb_649", + "is-split-panel-open": "awsui_is-split-panel-open_hyvsj_1t7qb_649", + "split-panel-position-side": "awsui_split-panel-position-side_hyvsj_1t7qb_649", + "has-active-drawer": "awsui_has-active-drawer_hyvsj_1t7qb_649", + "mobile-toolbar": "awsui_mobile-toolbar_hyvsj_1t7qb_658", + "remove-high-contrast-header": "awsui_remove-high-contrast-header_hyvsj_1t7qb_675", + "mobile-toolbar-nav": "awsui_mobile-toolbar-nav_hyvsj_1t7qb_679", + "mobile-toolbar-breadcrumbs": "awsui_mobile-toolbar-breadcrumbs_hyvsj_1t7qb_683", + "mobile-toolbar-tools": "awsui_mobile-toolbar-tools_hyvsj_1t7qb_687", + "navigation-container": "awsui_navigation-container_hyvsj_1t7qb_696", + "show-navigation": "awsui_show-navigation_hyvsj_1t7qb_734", + "animating": "awsui_animating_hyvsj_1t7qb_757", + "showButtons": "awsui_showButtons_hyvsj_1t7qb_1", + "navigation": "awsui_navigation_hyvsj_1t7qb_696", + "openNavigation": "awsui_openNavigation_hyvsj_1t7qb_1", + "animated-content": "awsui_animated-content_hyvsj_1t7qb_819", + "hide-navigation": "awsui_hide-navigation_hyvsj_1t7qb_828", + "notifications": "awsui_notifications_hyvsj_1t7qb_838", + "sticky-notifications": "awsui_sticky-notifications_hyvsj_1t7qb_844", + "split-panel-bottom": "awsui_split-panel-bottom_hyvsj_1t7qb_861", + "position-bottom": "awsui_position-bottom_hyvsj_1t7qb_908", + "openSplitPanelBottom": "awsui_openSplitPanelBottom_hyvsj_1t7qb_1", + "split-panel-side": "awsui_split-panel-side_hyvsj_1t7qb_937", + "position-side": "awsui_position-side_hyvsj_1t7qb_950", + "tools-container": "awsui_tools-container_hyvsj_1t7qb_972", + "tools": "awsui_tools_hyvsj_1t7qb_972", + "openTools": "awsui_openTools_hyvsj_1t7qb_1", + "has-tools-form-persistence": "awsui_has-tools-form-persistence_hyvsj_1t7qb_1063", + "hide-tools": "awsui_hide-tools_hyvsj_1t7qb_1073", + "show-tools": "awsui_show-tools_hyvsj_1t7qb_1085", + "has-tools-form": "awsui_has-tools-form_hyvsj_1t7qb_1063", + "trigger-badge-wrapper": "awsui_trigger-badge-wrapper_hyvsj_1t7qb_1168", + "trigger": "awsui_trigger_hyvsj_1t7qb_1168", + "selected": "awsui_selected_hyvsj_1t7qb_1242", + "badge": "awsui_badge_hyvsj_1t7qb_1262", + "trigger-wrapper": "awsui_trigger-wrapper_hyvsj_1t7qb_1266", + "dot": "awsui_dot_hyvsj_1t7qb_1277" +}; + +// node_modules/@cloudscape-design/components/app-layout/visual-refresh/split-panel.js +function SplitPanel({ children: children2 }) { + const { footerHeight, handleSplitPanelClick, handleSplitPanelPreferencesChange, handleSplitPanelResize, headerHeight, isSplitPanelForcedPosition, isSplitPanelOpen, setSplitPanelReportedSize, setSplitPanelReportedHeaderHeight, setSplitPanelToggle, splitPanelPosition, splitPanelRefs, splitPanelSize } = useAppLayoutInternals(); + const props2 = { + bottomOffset: 0, + getMaxHeight: () => { + const availableHeight = document.documentElement.clientHeight - headerHeight - footerHeight; + return availableHeight < 400 ? availableHeight - 40 : availableHeight - 250; + }, + maxWidth: typeof document !== "undefined" ? document.documentElement.clientWidth : Number.POSITIVE_INFINITY, + isForcedPosition: isSplitPanelForcedPosition, + isOpen: isSplitPanelOpen, + leftOffset: 0, + onPreferencesChange: handleSplitPanelPreferencesChange, + onResize: handleSplitPanelResize, + onToggle: handleSplitPanelClick, + position: splitPanelPosition, + reportSize: setSplitPanelReportedSize, + reportHeaderHeight: setSplitPanelReportedHeaderHeight, + rightOffset: 0, + size: splitPanelSize || 0, + topOffset: 0, + setSplitPanelToggle, + refs: splitPanelRefs + }; + return import_react55.default.createElement(SplitPanelProvider, Object.assign({}, props2), children2); +} +function SplitPanelBottom() { + const { disableBodyScroll, hasOpenDrawer, navigationOpen, isSplitPanelOpen, splitPanel, splitPanelPosition, splitPanelReportedSize, splitPanelReportedHeaderHeight } = useAppLayoutInternals(); + if (!splitPanel) { + return null; + } + return import_react55.default.createElement(Transition2, { in: isSplitPanelOpen !== null && isSplitPanelOpen !== void 0 ? isSplitPanelOpen : false, exit: false }, (state, transitionEventsRef) => import_react55.default.createElement( + "section", + { className: clsx_m_default(styles_css_default25["split-panel-bottom"], styles_css_default25[`position-${splitPanelPosition}`], { + [styles_css_default25.animating]: state === "entering", + [styles_css_default25["disable-body-scroll"]]: disableBodyScroll, + [styles_css_default25["has-open-drawer"]]: hasOpenDrawer, + [styles_css_default25["is-navigation-open"]]: navigationOpen, + [styles_css_default25["is-split-panel-open"]]: isSplitPanelOpen + }), ref: transitionEventsRef, style: { + [custom_css_properties_default.splitPanelReportedSize]: `${splitPanelReportedSize}px`, + [custom_css_properties_default.splitPanelReportedHeaderSize]: `${splitPanelReportedHeaderHeight}px` + } }, + import_react55.default.createElement(SplitPanel, null), + splitPanelPosition === "bottom" && splitPanel + )); +} +function SplitPanelSide() { + const { isSplitPanelOpen, splitPanel, splitPanelPosition, splitPanelMaxWidth, splitPanelControlId, isToolsOpen, activeDrawerId } = useAppLayoutInternals(); + if (!splitPanel) { + return null; + } + return import_react55.default.createElement("section", { id: splitPanelControlId, "aria-hidden": !isSplitPanelOpen || splitPanelPosition === "bottom" ? true : false, className: clsx_m_default(styles_css_default25["split-panel-side"], styles_css_default25[`position-${splitPanelPosition}`], { + [styles_css_default25["is-split-panel-open"]]: isSplitPanelOpen, + [styles_css_default25["has-open-drawer"]]: !!activeDrawerId || isToolsOpen + }), style: { + [custom_css_properties_default.splitPanelMaxWidth]: `${splitPanelMaxWidth}px`, + [custom_css_properties_default.splitPanelMinWidth]: `${SPLIT_PANEL_MIN_WIDTH}px` + } }, splitPanelPosition === "side" && splitPanel); +} +function getSplitPanelPosition(isSplitPanelForcedPosition, splitPanelPreferences) { + let splitPanelPosition = "bottom"; + if (!isSplitPanelForcedPosition && (splitPanelPreferences === null || splitPanelPreferences === void 0 ? void 0 : splitPanelPreferences.position) === "side") { + splitPanelPosition = "side"; + } + return splitPanelPosition; +} +SplitPanel.Bottom = SplitPanelBottom; +SplitPanel.Side = SplitPanelSide; +var split_panel_default = SplitPanel; + +// node_modules/@cloudscape-design/components/app-layout/utils/use-resize.js +var import_react56 = __toESM(require_react()); +function useResize(drawerRefObject, { activeDrawer, activeDrawerSize, onActiveDrawerResize, drawersRefs, isToolsOpen, drawersMinWidth, drawersMaxWidth }) { + var _a; + const [relativeSize, setRelativeSize] = (0, import_react56.useState)(0); + const drawerSize = !activeDrawer && !isToolsOpen ? 0 : activeDrawerSize; + (0, import_react56.useEffect)(() => { + const handle = requestAnimationFrame(() => { + const maxSize = drawersMaxWidth; + setRelativeSize((drawerSize - drawersMinWidth) / (maxSize - drawersMinWidth) * 100); + }); + return () => cancelAnimationFrame(handle); + }, [drawerSize, drawersMaxWidth, drawersMinWidth]); + const setSidePanelWidth = (width) => { + const maxWidth = drawersMaxWidth; + const size = getLimitedValue(drawersMinWidth, width, maxWidth); + const id = activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.id; + if (id && maxWidth >= drawersMinWidth) { + onActiveDrawerResize({ size, id }); + } + }; + const sizeControlProps = { + position: "side", + panelRef: drawerRefObject, + handleRef: drawersRefs.slider, + onResize: setSidePanelWidth, + hasTransitions: true + }; + const onSliderPointerDown = usePointerEvents(sizeControlProps); + const onKeyDown = useKeyboardEvents(sizeControlProps); + const resizeHandle = import_react56.default.createElement( + "div", + { ref: drawersRefs.slider, role: "slider", tabIndex: 0, "aria-label": (_a = activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.ariaLabels) === null || _a === void 0 ? void 0 : _a.resizeHandle, "aria-valuemax": 100, "aria-valuemin": 0, "aria-valuenow": relativeSize, className: clsx_m_default(styles_css_default23.slider, styles_css_default23[`slider-side`], styles_css_default18["drawers-slider"]), onKeyDown, onPointerDown: onSliderPointerDown }, + import_react56.default.createElement(resize_handler_default, { className: clsx_m_default(styles_css_default23["slider-icon"], styles_css_default23[`slider-icon-side`]) }) + ); + return { resizeHandle: import_react56.default.createElement("div", { className: styles_css_default25["drawer-slider"] }, resizeHandle), drawerSize }; +} +var use_resize_default = useResize; + +// node_modules/@cloudscape-design/components/app-layout/visual-refresh/use-background-overlap.js +var import_react57 = __toESM(require_react()); +function useBackgroundOverlap({ contentHeader, disableContentHeaderOverlap, layoutElement }) { + const hasContentHeader = !!contentHeader; + const [hasBackgroundOverlap, setHasBackgroundOverlap] = (0, import_react57.useState)(hasContentHeader); + const updateBackgroundOverlapHeight = (0, import_react57.useCallback)((height) => { + const hasOverlap = hasContentHeader || height > 0; + setHasBackgroundOverlap(hasOverlap); + const element = typeof layoutElement !== "function" && (layoutElement === null || layoutElement === void 0 ? void 0 : layoutElement.current); + if (!element) { + return; + } + if (disableContentHeaderOverlap || !hasOverlap || height <= 0) { + element.style.removeProperty(custom_css_properties_default.overlapHeight); + } else { + element.style.setProperty(custom_css_properties_default.overlapHeight, `${height}px`); + } + }, [hasContentHeader, layoutElement, disableContentHeaderOverlap]); + return { + hasBackgroundOverlap, + updateBackgroundOverlapHeight + }; +} + +// node_modules/@cloudscape-design/components/app-layout/visual-refresh/context.js +var AppLayoutInternalsContext = (0, import_react58.createContext)(null); +function useAppLayoutInternals() { + const ctx = (0, import_react58.useContext)(AppLayoutInternalsContext); + if (!ctx) { + throw new Error("Invariant violation: this context is only available inside app layout"); + } + return ctx; +} +var AppLayoutInternalsProvider = import_react58.default.forwardRef((props2, forwardRef13) => { + var _a, _b, _c, _d, _e; + const { toolsHide, toolsOpen: controlledToolsOpen, navigationHide, navigationOpen, contentType, placement, children: children2, splitPanel } = props2; + const isMobile = useMobile(); + const __embeddedViewMode = Boolean(props2.__embeddedViewMode); + const [hasStickyBackground, setHasStickyBackground] = (0, import_react58.useState)(false); + const geckoMaxCssLength = ((1 << 30) - 1) / 60; + const halfGeckoMaxCssLength = geckoMaxCssLength / 2; + const maxContentWidth = props2.maxContentWidth && props2.maxContentWidth > halfGeckoMaxCssLength ? halfGeckoMaxCssLength : (_a = props2.maxContentWidth) !== null && _a !== void 0 ? _a : 0; + const minContentWidth = (_b = props2.minContentWidth) !== null && _b !== void 0 ? _b : 280; + const { refs: navigationRefs, setFocus: focusNavButtons } = useFocusControl(navigationOpen); + const handleNavigationClick = useStableCallback(function handleNavigationChange(isOpen) { + focusNavButtons(); + fireNonCancelableEvent(props2.onNavigationChange, { open: isOpen }); + }); + (0, import_react58.useEffect)(() => { + if (isMobile) { + handleNavigationClick(false); + } + }, [isMobile, handleNavigationClick]); + const toolsWidth = props2.toolsWidth; + const [isToolsOpen = false, setIsToolsOpen] = useControllable(controlledToolsOpen, props2.onToolsChange, false, { + componentName: "AppLayout", + controlledProp: "toolsOpen", + changeHandler: "onToolsChange" + }); + const { refs: toolsRefs, setFocus: focusToolsButtons, loseFocus: loseToolsFocus } = useFocusControl(isToolsOpen, true); + const handleToolsClick = (0, import_react58.useCallback)(function handleToolsChange(isOpen, skipFocusControl) { + setIsToolsOpen(isOpen); + !skipFocusControl && focusToolsButtons(); + fireNonCancelableEvent(props2.onToolsChange, { open: isOpen }); + }, [props2.onToolsChange, setIsToolsOpen, focusToolsButtons]); + const [splitPanelMaxWidth, setSplitPanelMaxWidth] = (0, import_react58.useState)(SPLIT_PANEL_MIN_WIDTH); + const [isSplitPanelOpen, setIsSplitPanelOpen] = useControllable(props2.splitPanelOpen, props2.onSplitPanelToggle, false, { componentName: "AppLayout", controlledProp: "splitPanelOpen", changeHandler: "onSplitPanelToggle" }); + const [splitPanelPreferences, setSplitPanelPreferences] = useControllable(props2.splitPanelPreferences, props2.onSplitPanelPreferencesChange, void 0, { + componentName: "AppLayout", + controlledProp: "splitPanelPreferences", + changeHandler: "onSplitPanelPreferencesChange" + }); + const { refs: splitPanelRefs, setLastInteraction: setSplitPanelLastInteraction } = useSplitPanelFocusControl([ + splitPanelPreferences, + isSplitPanelOpen + ]); + const handleSplitPanelClick = (0, import_react58.useCallback)(function handleSplitPanelChange() { + setIsSplitPanelOpen(!isSplitPanelOpen); + setSplitPanelLastInteraction({ type: isSplitPanelOpen ? "close" : "open" }); + fireNonCancelableEvent(props2.onSplitPanelToggle, { open: !isSplitPanelOpen }); + }, [props2.onSplitPanelToggle, isSplitPanelOpen, setIsSplitPanelOpen, setSplitPanelLastInteraction]); + const isSplitPanelForcedPosition = isMobile || SPLIT_PANEL_MIN_WIDTH > splitPanelMaxWidth; + const splitPanelPosition = getSplitPanelPosition(isSplitPanelForcedPosition, splitPanelPreferences); + const [splitPanelReportedSize, setSplitPanelReportedSize] = (0, import_react58.useState)(0); + const [splitPanelReportedHeaderHeight, setSplitPanelReportedHeaderHeight] = (0, import_react58.useState)(0); + const [splitPanelToggle, setSplitPanelToggle] = (0, import_react58.useState)({ + displayed: false, + ariaLabel: void 0 + }); + const splitPanelDisplayed = !!(splitPanelToggle.displayed || isSplitPanelOpen) && !!splitPanel; + const splitPanelControlId = useUniqueId("split-panel-"); + const toolsControlId = useUniqueId("tools-"); + const [splitPanelSize, setSplitPanelSize] = useControllable(props2.splitPanelSize, props2.onSplitPanelResize, getSplitPanelDefaultSize(splitPanelPosition), { componentName: "AppLayout", controlledProp: "splitPanelSize", changeHandler: "onSplitPanelResize" }); + const handleSplitPanelResize = (0, import_react58.useCallback)((size) => { + setSplitPanelSize(size); + fireNonCancelableEvent(props2.onSplitPanelResize, { size }); + }, [props2.onSplitPanelResize, setSplitPanelSize]); + const handleSplitPanelPreferencesChange = (0, import_react58.useCallback)(function handleSplitPanelChange(detail) { + setSplitPanelPreferences(detail); + setSplitPanelLastInteraction({ type: "position" }); + fireNonCancelableEvent(props2.onSplitPanelPreferencesChange, detail); + }, [props2.onSplitPanelPreferencesChange, setSplitPanelPreferences, setSplitPanelLastInteraction]); + const _f = useDrawers(props2, props2.ariaLabels, { + ariaLabels: props2.ariaLabels, + toolsHide, + toolsOpen: isToolsOpen, + tools: props2.tools, + toolsWidth, + onToolsToggle: handleToolsClick + }), { drawers, activeDrawer, activeDrawerId, minDrawerSize: drawersMinWidth, onActiveDrawerChange, onActiveDrawerResize, activeDrawerSize } = _f, drawersProps = __rest(_f, ["drawers", "activeDrawer", "activeDrawerId", "minDrawerSize", "onActiveDrawerChange", "onActiveDrawerResize", "activeDrawerSize"]); + const [drawersMaxWidth, setDrawersMaxWidth] = (0, import_react58.useState)(toolsWidth); + const hasDrawers = !!drawers && drawers.length > 0; + const { refs: drawersRefs, setFocus: focusDrawersButtons, loseFocus: loseDrawersFocus } = useFocusControl(!!activeDrawerId, true, activeDrawerId); + const drawerRef = (0, import_react58.useRef)(null); + const { resizeHandle, drawerSize } = use_resize_default(drawerRef, { + onActiveDrawerResize, + activeDrawerSize, + activeDrawer, + drawersRefs, + isToolsOpen, + drawersMaxWidth, + drawersMinWidth + }); + const handleDrawersClick = (id, skipFocusControl) => { + const newActiveDrawerId = id !== activeDrawerId ? id : null; + onActiveDrawerChange(newActiveDrawerId); + !skipFocusControl && focusDrawersButtons(); + }; + let drawersTriggerCount = drawers ? drawers.length : !toolsHide ? 1 : 0; + if (splitPanelDisplayed && splitPanelPosition === "side") { + drawersTriggerCount++; + } + const hasOpenDrawer = !!activeDrawerId || !toolsHide && isToolsOpen || splitPanelDisplayed && splitPanelPosition === "side" && isSplitPanelOpen; + const hasDrawerViewportOverlay = isMobile && (!!activeDrawerId || !navigationHide && navigationOpen || !toolsHide && isToolsOpen); + const layoutElement = (0, import_react58.useRef)(null); + const mainElement = (0, import_react58.useRef)(null); + const [mainOffsetLeft, setMainOffsetLeft] = (0, import_react58.useState)(0); + const { hasBackgroundOverlap, updateBackgroundOverlapHeight } = useBackgroundOverlap({ + contentHeader: props2.contentHeader, + disableContentHeaderOverlap: props2.disableContentHeaderOverlap, + layoutElement + }); + (0, import_react58.useLayoutEffect)(function handleMainOffsetLeft() { + var _a2, _b2; + setMainOffsetLeft((_b2 = (_a2 = mainElement === null || mainElement === void 0 ? void 0 : mainElement.current) === null || _a2 === void 0 ? void 0 : _a2.offsetLeft) !== null && _b2 !== void 0 ? _b2 : 0); + }, [placement.width, navigationOpen, isToolsOpen, splitPanelReportedSize]); + (0, import_react58.useEffect)(function handleBodyScroll() { + if (isMobile && (navigationOpen || isToolsOpen || !!activeDrawer)) { + document.body.classList.add(styles_css_default25["block-body-scroll"]); + } else { + document.body.classList.remove(styles_css_default25["block-body-scroll"]); + } + return function cleanup() { + document.body.classList.remove(styles_css_default25["block-body-scroll"]); + }; + }, [isMobile, navigationOpen, isToolsOpen, activeDrawer]); + const [notificationsContainerQuery, notificationsElement] = useContainerQuery((rect) => rect.contentBoxHeight); + const notificationsHeight = notificationsContainerQuery !== null && notificationsContainerQuery !== void 0 ? notificationsContainerQuery : 0; + const hasNotificationsContent = notificationsHeight > 0; + let offsetBottom = placement.bottom; + if (splitPanelDisplayed && splitPanelPosition === "bottom") { + if (isSplitPanelOpen) { + offsetBottom += splitPanelReportedSize; + } else { + offsetBottom += splitPanelReportedHeaderHeight; + } + } + (0, import_react58.useLayoutEffect)(function handleSplitPanelMaxWidth() { + const contentGapRight = 50; + const toolsFormOffsetWidth = 120; + const getPanelOffsetWidth = () => { + if (drawers) { + return activeDrawerId ? drawerSize : 0; + } + return isToolsOpen ? toolsWidth : 0; + }; + setSplitPanelMaxWidth(placement.width - mainOffsetLeft - minContentWidth - contentGapRight - toolsFormOffsetWidth - getPanelOffsetWidth()); + setDrawersMaxWidth(placement.width - mainOffsetLeft - minContentWidth - contentGapRight - toolsFormOffsetWidth); + }, [ + activeDrawerId, + drawerSize, + drawers, + navigationOpen, + isToolsOpen, + placement.width, + mainOffsetLeft, + minContentWidth, + toolsWidth + ]); + (0, import_react58.useImperativeHandle)(forwardRef13, function createImperativeHandle() { + return { + closeNavigationIfNecessary: function() { + isMobile && handleNavigationClick(false); + }, + openTools: function() { + handleToolsClick(true); + }, + focusToolsClose: () => { + if (hasDrawers) { + focusDrawersButtons(true); + } else { + focusToolsButtons(true); + } + }, + focusActiveDrawer: () => focusDrawersButtons(true), + focusSplitPanel: () => { + var _a2; + return (_a2 = splitPanelRefs.slider.current) === null || _a2 === void 0 ? void 0 : _a2.focus(); + } + }; + }, [ + isMobile, + handleNavigationClick, + handleToolsClick, + focusToolsButtons, + focusDrawersButtons, + splitPanelRefs.slider, + hasDrawers + ]); + return import_react58.default.createElement( + AppLayoutInternalsContext.Provider, + { value: Object.assign(Object.assign({}, props2), { + activeDrawerId, + contentType, + drawers, + drawersAriaLabel: (_c = drawersProps.ariaLabelsWithDrawers) === null || _c === void 0 ? void 0 : _c.drawers, + drawersOverflowAriaLabel: (_d = drawersProps.ariaLabelsWithDrawers) === null || _d === void 0 ? void 0 : _d.drawersOverflow, + drawersOverflowWithBadgeAriaLabel: (_e = drawersProps.ariaLabelsWithDrawers) === null || _e === void 0 ? void 0 : _e.drawersOverflowWithBadge, + drawersRefs, + drawersMinWidth, + drawersMaxWidth, + drawerSize, + drawerRef, + resizeHandle, + drawersTriggerCount, + headerHeight: placement.top, + footerHeight: placement.bottom, + hasDrawerViewportOverlay, + handleDrawersClick, + handleNavigationClick, + handleSplitPanelClick, + handleSplitPanelPreferencesChange, + handleSplitPanelResize, + handleToolsClick, + hasBackgroundOverlap, + hasNotificationsContent, + hasOpenDrawer, + hasStickyBackground, + isBackgroundOverlapDisabled: props2.disableContentHeaderOverlap || !hasBackgroundOverlap, + isMobile, + isSplitPanelForcedPosition, + isSplitPanelOpen, + isToolsOpen, + layoutElement, + layoutWidth: placement.width, + loseToolsFocus, + loseDrawersFocus, + mainElement, + mainOffsetLeft, + maxContentWidth, + minContentWidth, + navigationHide, + navigationRefs, + notificationsElement, + notificationsHeight, + offsetBottom, + setHasStickyBackground, + setSplitPanelReportedSize, + setSplitPanelReportedHeaderHeight, + splitPanel, + splitPanelControlId, + splitPanelDisplayed, + splitPanelMaxWidth, + splitPanelPosition, + splitPanelPreferences, + splitPanelReportedSize, + splitPanelReportedHeaderHeight, + splitPanelSize, + splitPanelToggle, + setSplitPanelToggle, + splitPanelRefs, + toolsControlId, + toolsHide, + toolsOpen: isToolsOpen, + toolsWidth, + toolsRefs, + __embeddedViewMode + }) }, + import_react58.default.createElement( + AppLayoutContext.Provider, + { value: { + stickyOffsetBottom: offsetBottom, + stickyOffsetTop: 0, + setHasStickyBackground + } }, + import_react58.default.createElement(DynamicOverlapContext.Provider, { value: updateBackgroundOverlapHeight }, children2) + ) + ); +}); + +// node_modules/@cloudscape-design/components/app-layout/visual-refresh/background.js +var import_react59 = __toESM(require_react()); +function Background() { + const { breadcrumbs, hasBackgroundOverlap, hasNotificationsContent, hasStickyBackground, isMobile, stickyNotifications } = useAppLayoutInternals(); + if (!hasNotificationsContent && (!breadcrumbs || isMobile) && !hasBackgroundOverlap) { + return null; + } + return import_react59.default.createElement( + "div", + { className: clsx_m_default(styles_css_default25.background, getContentHeaderClassName()) }, + import_react59.default.createElement("div", { className: styles_css_default25["scrolling-background"] }), + !isMobile && hasStickyBackground && import_react59.default.createElement("div", { className: clsx_m_default(styles_css_default25["sticky-background"], { + [styles_css_default25["has-sticky-notifications"]]: stickyNotifications + }) }) + ); +} + +// node_modules/@cloudscape-design/components/app-layout/visual-refresh/breadcrumbs.js +var import_react60 = __toESM(require_react()); +function Breadcrumbs() { + const { breadcrumbs, hasStickyBackground, isMobile } = useAppLayoutInternals(); + if (isMobile || !breadcrumbs) { + return null; + } + return import_react60.default.createElement("div", { className: clsx_m_default(styles_css_default25.breadcrumbs, styles_css_default18.breadcrumbs, { + [styles_css_default25["has-sticky-background"]]: hasStickyBackground + }, getContentHeaderClassName()) }, breadcrumbs); +} + +// node_modules/@cloudscape-design/components/app-layout/visual-refresh/drawers.js +var import_react62 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/app-layout/visual-refresh/trigger-button.js +var import_react61 = __toESM(require_react()); +function TriggerButton({ ariaLabel, className, iconName, iconSvg, ariaExpanded, ariaControls, onClick, testId, badge, selected = false }, ref) { + return import_react61.default.createElement( + "div", + { className: clsx_m_default(styles_css_default25["trigger-wrapper"], shouldRemoveHighContrastHeader() && styles_css_default25["remove-high-contrast-header"]) }, + import_react61.default.createElement( + "button", + { "aria-expanded": ariaExpanded, "aria-controls": ariaControls, "aria-haspopup": true, "aria-label": ariaLabel, className: clsx_m_default(styles_css_default25.trigger, { + [styles_css_default25.selected]: selected, + [styles_css_default25.badge]: badge + }, className), onClick, ref, type: "button", "data-testid": testId }, + import_react61.default.createElement( + "span", + { className: clsx_m_default(badge && styles_css_default25["trigger-badge-wrapper"]) }, + import_react61.default.createElement(internal_default, { name: iconName, svg: iconSvg }) + ) + ), + badge && import_react61.default.createElement("div", { className: clsx_m_default(styles_css_default25.dot) }) + ); +} +var trigger_button_default = import_react61.default.forwardRef(TriggerButton); + +// node_modules/@cloudscape-design/components/app-layout/visual-refresh/drawers.js +function Drawers() { + const { disableBodyScroll, drawers, drawersTriggerCount, hasDrawerViewportOverlay, hasOpenDrawer, navigationOpen, navigationHide, isMobile } = useAppLayoutInternals(); + const isUnfocusable = hasDrawerViewportOverlay && navigationOpen && !navigationHide; + if (!drawers || drawersTriggerCount === 0) { + return null; + } + return import_react62.default.createElement( + "div", + { className: clsx_m_default(styles_css_default25["drawers-container"], { + [styles_css_default25["disable-body-scroll"]]: disableBodyScroll, + [styles_css_default25["has-open-drawer"]]: hasOpenDrawer, + [styles_css_default25.unfocusable]: isUnfocusable + }) }, + import_react62.default.createElement(split_panel_default.Side, null), + import_react62.default.createElement(ActiveDrawer, null), + !isMobile && import_react62.default.createElement(DesktopTriggers, null) + ); +} +function ActiveDrawer() { + var _a, _b, _c, _d; + const { activeDrawerId, ariaLabels, drawers, drawersRefs, handleDrawersClick, handleToolsClick, hasDrawerViewportOverlay, isMobile, navigationOpen, navigationHide, loseDrawersFocus, resizeHandle, drawerSize, drawersMinWidth, drawersMaxWidth, drawerRef } = useAppLayoutInternals(); + const activeDrawer = (_a = drawers === null || drawers === void 0 ? void 0 : drawers.find((item) => item.id === activeDrawerId)) !== null && _a !== void 0 ? _a : null; + const computedAriaLabels = { + closeButton: activeDrawerId ? (_b = activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.ariaLabels) === null || _b === void 0 ? void 0 : _b.closeButton : ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.toolsClose, + content: activeDrawerId ? (_c = activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.ariaLabels) === null || _c === void 0 ? void 0 : _c.drawerName : ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.tools + }; + const isHidden = !activeDrawerId; + const isUnfocusable = isHidden || hasDrawerViewportOverlay && navigationOpen && !navigationHide; + const isToolsDrawer = activeDrawerId === TOOLS_DRAWER_ID; + const toolsContent = (_d = drawers === null || drawers === void 0 ? void 0 : drawers.find((drawer) => drawer.id === TOOLS_DRAWER_ID)) === null || _d === void 0 ? void 0 : _d.content; + const size = getLimitedValue(drawersMinWidth, drawerSize, drawersMaxWidth); + return import_react62.default.createElement( + "aside", + { id: activeDrawerId !== null && activeDrawerId !== void 0 ? activeDrawerId : void 0, "aria-hidden": isHidden, "aria-label": computedAriaLabels.content, className: clsx_m_default(styles_css_default25.drawer, { + [styles_css_default25["is-drawer-open"]]: activeDrawerId, + [styles_css_default25.unfocusable]: isUnfocusable, + [styles_css_default18["active-drawer"]]: activeDrawerId, + [styles_css_default18.tools]: isToolsDrawer + }), style: Object.assign({}, !isMobile && drawerSize && { [custom_css_properties_default.drawerSize]: `${size}px` }), ref: drawerRef, onBlur: (e) => { + if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) { + loseDrawersFocus(); + } + } }, + !isMobile && (activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.resizable) && resizeHandle, + import_react62.default.createElement( + "div", + { className: styles_css_default25["drawer-content-container"] }, + import_react62.default.createElement( + "div", + { className: clsx_m_default(styles_css_default25["drawer-close-button"]) }, + import_react62.default.createElement(InternalButton, { ariaLabel: computedAriaLabels.closeButton, className: clsx_m_default({ + [styles_css_default18["active-drawer-close-button"]]: activeDrawerId, + [styles_css_default18["tools-close"]]: isToolsDrawer + }), formAction: "none", iconName: isMobile ? "close" : "angle-right", onClick: () => { + handleDrawersClick(activeDrawerId); + handleToolsClick(false); + }, ref: drawersRefs.close, variant: "icon" }) + ), + toolsContent && import_react62.default.createElement("div", { className: clsx_m_default(styles_css_default25["drawer-content"], activeDrawerId !== TOOLS_DRAWER_ID && styles_css_default25["drawer-content-hidden"]) }, toolsContent), + activeDrawerId !== TOOLS_DRAWER_ID && import_react62.default.createElement("div", { className: styles_css_default25["drawer-content"] }, activeDrawerId && (activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.content)) + ) + ); +} +function DesktopTriggers() { + const { activeDrawerId, drawers, drawersAriaLabel, drawersOverflowAriaLabel, drawersOverflowWithBadgeAriaLabel, drawersRefs, drawersTriggerCount, handleDrawersClick, handleSplitPanelClick, hasOpenDrawer, isSplitPanelOpen, splitPanel, splitPanelControlId, splitPanelDisplayed, splitPanelPosition, splitPanelRefs, splitPanelToggle, splitPanelReportedHeaderHeight, splitPanelReportedSize } = useAppLayoutInternals(); + const hasMultipleTriggers = drawersTriggerCount > 1; + const hasSplitPanel = splitPanel && splitPanelDisplayed && splitPanelPosition === "side"; + const previousActiveDrawerId = (0, import_react62.useRef)(activeDrawerId); + const [containerHeight, triggersContainerRef] = useContainerQuery((rect) => rect.contentBoxHeight); + if (activeDrawerId) { + previousActiveDrawerId.current = activeDrawerId; + } + const splitPanelHeight = isSplitPanelOpen && splitPanelPosition === "bottom" ? splitPanelReportedSize : splitPanelReportedHeaderHeight; + const getIndexOfOverflowItem = () => { + if (containerHeight) { + const ITEM_HEIGHT = 48; + const overflowSpot = activeDrawerId && isSplitPanelOpen ? (containerHeight - splitPanelReportedHeaderHeight) / 1.5 : (containerHeight - splitPanelHeight) / 1.5; + const index = Math.floor(overflowSpot / ITEM_HEIGHT); + let splitPanelItem = 0; + if (hasSplitPanel && splitPanelToggle.displayed) { + splitPanelItem = 1; + } + return index - splitPanelItem; + } + return 0; + }; + const { visibleItems, overflowItems } = splitItems(drawers !== null && drawers !== void 0 ? drawers : void 0, getIndexOfOverflowItem(), activeDrawerId); + const overflowMenuHasBadge = !!overflowItems.find((item) => item.badge); + return import_react62.default.createElement( + "aside", + { className: clsx_m_default(styles_css_default25["drawers-desktop-triggers-container"], { + [styles_css_default25["has-multiple-triggers"]]: hasMultipleTriggers, + [styles_css_default25["has-open-drawer"]]: hasOpenDrawer + }), "aria-label": drawersAriaLabel, ref: triggersContainerRef, role: "region" }, + import_react62.default.createElement( + "div", + { className: clsx_m_default(styles_css_default25["drawers-trigger-content"], { + [styles_css_default25["has-multiple-triggers"]]: hasMultipleTriggers, + [styles_css_default25["has-open-drawer"]]: hasOpenDrawer + }), role: "toolbar", "aria-orientation": "vertical" }, + visibleItems.map((item) => { + var _a; + return import_react62.default.createElement(trigger_button_default, { ariaLabel: (_a = item.ariaLabels) === null || _a === void 0 ? void 0 : _a.triggerButton, ariaExpanded: item.id === activeDrawerId, ariaControls: activeDrawerId === item.id ? item.id : void 0, className: clsx_m_default(styles_css_default25["drawers-trigger"], styles_css_default18["drawers-trigger"], item.id === TOOLS_DRAWER_ID && styles_css_default18["tools-toggle"]), iconName: item.trigger.iconName, iconSvg: item.trigger.iconSvg, key: item.id, onClick: () => handleDrawersClick(item.id), ref: item.id === previousActiveDrawerId.current ? drawersRefs.toggle : void 0, selected: item.id === activeDrawerId, badge: item.badge, testId: `awsui-app-layout-trigger-${item.id}` }); + }), + overflowItems.length > 0 && import_react62.default.createElement(OverflowMenu, { items: overflowItems, ariaLabel: overflowMenuHasBadge ? drawersOverflowWithBadgeAriaLabel : drawersOverflowAriaLabel, customTriggerBuilder: ({ onClick, triggerRef, ariaLabel, ariaExpanded, testUtilsClass }) => import_react62.default.createElement(trigger_button_default, { ref: triggerRef, ariaLabel, ariaExpanded, badge: overflowMenuHasBadge, className: clsx_m_default(styles_css_default25["drawers-trigger"], styles_css_default18["drawers-trigger"], testUtilsClass), iconName: "ellipsis", onClick }), onItemClick: ({ detail }) => { + handleDrawersClick(detail.id); + } }), + hasSplitPanel && splitPanelToggle.displayed && import_react62.default.createElement(trigger_button_default, { ariaLabel: splitPanelToggle.ariaLabel, ariaControls: splitPanelControlId, ariaExpanded: !!isSplitPanelOpen, className: clsx_m_default(styles_css_default25["drawers-trigger"], styles_css_default23["open-button"]), iconName: "view-vertical", onClick: () => handleSplitPanelClick(), selected: hasSplitPanel && isSplitPanelOpen, ref: splitPanelRefs.toggle }) + ) + ); +} +function MobileTriggers() { + const { activeDrawerId, drawers, drawersAriaLabel, drawersOverflowAriaLabel, drawersOverflowWithBadgeAriaLabel, drawersRefs, handleDrawersClick, hasDrawerViewportOverlay } = useAppLayoutInternals(); + const previousActiveDrawerId = (0, import_react62.useRef)(activeDrawerId); + if (!drawers) { + return null; + } + if (activeDrawerId) { + previousActiveDrawerId.current = activeDrawerId; + } + const { visibleItems, overflowItems } = splitItems(drawers, 2, activeDrawerId); + const overflowMenuHasBadge = !!overflowItems.find((item) => item.badge); + return import_react62.default.createElement( + "aside", + { "aria-hidden": hasDrawerViewportOverlay, className: clsx_m_default({ + [styles_css_default25.unfocusable]: hasDrawerViewportOverlay + }), "aria-label": drawersAriaLabel, role: "region" }, + import_react62.default.createElement( + "div", + { className: clsx_m_default(styles_css_default25["drawers-mobile-triggers-container"]), role: "toolbar", "aria-orientation": "horizontal" }, + visibleItems.map((item) => { + var _a; + return import_react62.default.createElement(InternalButton, { ariaExpanded: item.id === activeDrawerId, ariaLabel: (_a = item.ariaLabels) === null || _a === void 0 ? void 0 : _a.triggerButton, className: clsx_m_default(styles_css_default25["drawers-trigger"], styles_css_default18["drawers-trigger"], item.id === TOOLS_DRAWER_ID && styles_css_default18["tools-toggle"]), disabled: hasDrawerViewportOverlay, ref: item.id === previousActiveDrawerId.current ? drawersRefs.toggle : void 0, formAction: "none", iconName: item.trigger.iconName, iconSvg: item.trigger.iconSvg, badge: item.badge, key: item.id, onClick: () => handleDrawersClick(item.id), variant: "icon", __nativeAttributes: { "aria-haspopup": true, "data-testid": `awsui-app-layout-trigger-${item.id}` } }); + }), + overflowItems.length > 0 && import_react62.default.createElement(OverflowMenu, { items: overflowItems, ariaLabel: overflowMenuHasBadge ? drawersOverflowWithBadgeAriaLabel : drawersOverflowAriaLabel, onItemClick: ({ detail }) => handleDrawersClick(detail.id) }) + ) + ); +} + +// node_modules/@cloudscape-design/components/app-layout/visual-refresh/header.js +var import_react63 = __toESM(require_react()); +function Header2() { + const { breadcrumbs, contentHeader, hasDrawerViewportOverlay, hasNotificationsContent } = useAppLayoutInternals(); + if (!contentHeader) { + return null; + } + return import_react63.default.createElement("header", { className: clsx_m_default(styles_css_default25.content, { + [styles_css_default25["has-breadcrumbs"]]: breadcrumbs, + [styles_css_default25["has-notifications-content"]]: hasNotificationsContent, + [styles_css_default25.unfocusable]: hasDrawerViewportOverlay + }, getContentHeaderClassName()) }, contentHeader); +} + +// node_modules/@cloudscape-design/components/app-layout/visual-refresh/layout.js +var import_react64 = __toESM(require_react()); +function Layout({ children: children2 }) { + const { breadcrumbs, contentHeader, contentType, disableBodyScroll, disableContentPaddings, drawersTriggerCount, footerHeight, hasNotificationsContent, hasStickyBackground, hasOpenDrawer, headerHeight, isBackgroundOverlapDisabled, isMobile, navigationOpen, layoutElement, layoutWidth, mainOffsetLeft, maxContentWidth, minContentWidth, navigationHide, notificationsHeight, __embeddedViewMode, splitPanelPosition, stickyNotifications, splitPanelDisplayed } = useAppLayoutInternals(); + const contentFirstChild = getContentFirstChild(breadcrumbs, contentHeader, hasNotificationsContent, isMobile); + const hasContentGapLeft = navigationOpen || navigationHide; + const hasContentGapRight = drawersTriggerCount === 0 || hasOpenDrawer; + return import_react64.default.createElement("main", { className: clsx_m_default(styles_css_default25.layout, styles_css_default25[`content-first-child-${contentFirstChild}`], styles_css_default25[`content-type-${contentType}`], styles_css_default25[`split-panel-position-${splitPanelPosition !== null && splitPanelPosition !== void 0 ? splitPanelPosition : "bottom"}`], { + [styles_css_default25["disable-body-scroll"]]: disableBodyScroll, + [styles_css_default18["disable-body-scroll-root"]]: disableBodyScroll, + [styles_css_default25["disable-content-paddings"]]: disableContentPaddings, + [styles_css_default25["has-breadcrumbs"]]: breadcrumbs && !isMobile, + [styles_css_default25["has-content-gap-left"]]: hasContentGapLeft, + [styles_css_default25["has-content-gap-right"]]: hasContentGapRight, + [styles_css_default25["has-header"]]: contentHeader, + [styles_css_default25["has-max-content-width"]]: maxContentWidth && maxContentWidth > 0, + [styles_css_default25["has-split-panel"]]: splitPanelDisplayed, + [styles_css_default25["has-sticky-background"]]: hasStickyBackground, + [styles_css_default25["has-sticky-notifications"]]: stickyNotifications && hasNotificationsContent, + [styles_css_default25["is-overlap-disabled"]]: isBackgroundOverlapDisabled, + [styles_css_default25["is-hide-mobile-toolbar"]]: __embeddedViewMode + }, styles_css_default18.root), ref: layoutElement, style: Object.assign(Object.assign(Object.assign({ [custom_css_properties_default.headerHeight]: `${headerHeight}px`, [custom_css_properties_default.footerHeight]: `${footerHeight}px`, [custom_css_properties_default.layoutWidth]: `${layoutWidth}px`, [custom_css_properties_default.mainOffsetLeft]: `${mainOffsetLeft}px` }, maxContentWidth && { [custom_css_properties_default.maxContentWidth]: `${maxContentWidth}px` }), minContentWidth && { [custom_css_properties_default.minContentWidth]: `${minContentWidth}px` }), { [custom_css_properties_default.notificationsHeight]: `${notificationsHeight}px` }) }, children2); +} +function getContentFirstChild(breadcrumbs, contentHeader, hasNotificationsContent, isMobile) { + let contentFirstChild = "main"; + if (hasNotificationsContent) { + contentFirstChild = "notifications"; + } else if (breadcrumbs && !isMobile) { + contentFirstChild = "breadcrumbs"; + } else if (contentHeader) { + contentFirstChild = "header"; + } + return contentFirstChild; +} + +// node_modules/@cloudscape-design/components/app-layout/visual-refresh/main.js +var import_react65 = __toESM(require_react()); +function Main() { + const { content, disableContentPaddings, footerHeight, hasDrawerViewportOverlay, navigationOpen, isSplitPanelOpen, isToolsOpen, mainElement, offsetBottom, splitPanelDisplayed, splitPanelPosition, activeDrawerId } = useAppLayoutInternals(); + const splitPanelHeight = offsetBottom - footerHeight; + return import_react65.default.createElement("div", { className: clsx_m_default(styles_css_default25.container, styles_css_default25[`split-panel-position-${splitPanelPosition !== null && splitPanelPosition !== void 0 ? splitPanelPosition : "bottom"}`], { + [styles_css_default25["disable-content-paddings"]]: disableContentPaddings, + [styles_css_default25["has-split-panel"]]: splitPanelDisplayed, + [styles_css_default25["is-navigation-open"]]: navigationOpen, + [styles_css_default25["is-tools-open"]]: isToolsOpen, + [styles_css_default25["has-active-drawer"]]: !!activeDrawerId, + [styles_css_default25["is-split-panel-open"]]: isSplitPanelOpen, + [styles_css_default25.unfocusable]: hasDrawerViewportOverlay + }, styles_css_default18.content), ref: mainElement, style: { + [custom_css_properties_default.splitPanelHeight]: `${splitPanelHeight}px` + } }, content); +} + +// node_modules/@cloudscape-design/components/app-layout/visual-refresh/mobile-toolbar.js +var import_react66 = __toESM(require_react()); +function MobileToolbar2() { + var _a, _b, _c; + const { ariaLabels, breadcrumbs, drawers, handleNavigationClick, handleToolsClick, hasDrawerViewportOverlay, isMobile, navigationOpen, __embeddedViewMode, isToolsOpen, navigationHide, navigationRefs, toolsHide, toolsRefs } = useAppLayoutInternals(); + if (!isMobile || __embeddedViewMode || navigationHide && !breadcrumbs && toolsHide && (!drawers || drawers.length === 0)) { + return null; + } + return import_react66.default.createElement( + "section", + { className: clsx_m_default(styles_css_default25["mobile-toolbar"], [styles_css_default18["mobile-bar"]], { + [styles_css_default25["has-breadcrumbs"]]: breadcrumbs, + [styles_css_default25.unfocusable]: hasDrawerViewportOverlay + }, styles_css_default18["mobile-bar"], getContentHeaderClassName(), shouldRemoveHighContrastHeader() && styles_css_default25["remove-high-contrast-header"]) }, + !navigationHide && import_react66.default.createElement( + "nav", + { "aria-hidden": navigationOpen, className: clsx_m_default(styles_css_default25["mobile-toolbar-nav"], { [styles_css_default18["drawer-closed"]]: !navigationOpen }) }, + import_react66.default.createElement(InternalButton, { ariaLabel: (_a = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.navigationToggle) !== null && _a !== void 0 ? _a : void 0, ariaExpanded: navigationOpen ? void 0 : false, iconName: "menu", formAction: "none", onClick: () => handleNavigationClick(true), variant: "icon", className: styles_css_default18["navigation-toggle"], ref: navigationRefs.toggle, disabled: hasDrawerViewportOverlay, __nativeAttributes: { "aria-haspopup": navigationOpen ? void 0 : true } }) + ), + breadcrumbs && import_react66.default.createElement("div", { className: clsx_m_default(styles_css_default25["mobile-toolbar-breadcrumbs"], styles_css_default18.breadcrumbs) }, breadcrumbs), + drawers ? import_react66.default.createElement(MobileTriggers, null) : !toolsHide && import_react66.default.createElement( + "aside", + { "aria-hidden": isToolsOpen, "aria-label": (_b = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.tools) !== null && _b !== void 0 ? _b : void 0, className: clsx_m_default(styles_css_default25["mobile-toolbar-tools"], { [styles_css_default18["drawer-closed"]]: !isToolsOpen }) }, + import_react66.default.createElement(InternalButton, { className: styles_css_default18["tools-toggle"], ariaExpanded: isToolsOpen, disabled: hasDrawerViewportOverlay, ariaLabel: (_c = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.toolsToggle) !== null && _c !== void 0 ? _c : void 0, iconName: "status-info", formAction: "none", onClick: () => handleToolsClick(true), variant: "icon", ref: toolsRefs.toggle, __nativeAttributes: { "aria-haspopup": true } }) + ) + ); +} + +// node_modules/@cloudscape-design/components/app-layout/visual-refresh/navigation.js +var import_react67 = __toESM(require_react()); +function Navigation() { + const { ariaLabels, disableBodyScroll, handleNavigationClick, hasDrawerViewportOverlay, isMobile, navigationOpen, isToolsOpen, navigation, navigationHide, navigationRefs, navigationWidth, toolsHide } = useAppLayoutInternals(); + if (navigationHide) { + return null; + } + const onNavigationClick = (event) => { + const hasLink = findUpUntil(event.target, (node) => node.tagName === "A" && !!node.href); + if (hasLink && isMobile) { + handleNavigationClick(false); + } + }; + const isUnfocusable = hasDrawerViewportOverlay && (!navigationOpen || isToolsOpen && !toolsHide); + return import_react67.default.createElement(Transition2, { in: navigationOpen }, (state, transitionEventsRef) => { + var _a, _b, _c; + return import_react67.default.createElement( + "div", + { className: clsx_m_default(styles_css_default25["navigation-container"], { + [styles_css_default25["disable-body-scroll"]]: disableBodyScroll, + [styles_css_default25.unfocusable]: isUnfocusable, + [styles_css_default18["drawer-closed"]]: !navigationOpen + }), style: { [custom_css_properties_default.navigationWidth]: `${navigationWidth}px` } }, + !isMobile && import_react67.default.createElement( + "nav", + { "aria-hidden": isMobile || navigationOpen, "aria-label": (_a = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.navigation) !== null && _a !== void 0 ? _a : void 0, className: clsx_m_default(styles_css_default25["show-navigation"], { + [styles_css_default25.animating]: state === "exiting", + [styles_css_default25["is-navigation-open"]]: navigationOpen + }), ref: state === "exiting" ? transitionEventsRef : void 0 }, + import_react67.default.createElement(trigger_button_default, { ariaLabel: ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.navigationToggle, ariaExpanded: navigationOpen ? void 0 : false, iconName: "menu", className: styles_css_default18["navigation-toggle"], onClick: () => handleNavigationClick(true), ref: navigationRefs.toggle }) + ), + import_react67.default.createElement( + "nav", + { "aria-label": (_b = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.navigation) !== null && _b !== void 0 ? _b : void 0, className: clsx_m_default(styles_css_default25.navigation, { + [styles_css_default25.animating]: state === "entering", + [styles_css_default25["is-navigation-open"]]: navigationOpen + }, styles_css_default18.navigation), ref: state !== "exiting" ? transitionEventsRef : void 0, "aria-hidden": !navigationOpen, onClick: (event) => { + onNavigationClick && onNavigationClick(event); + } }, + import_react67.default.createElement( + "div", + { className: clsx_m_default(styles_css_default25["animated-content"]) }, + import_react67.default.createElement( + "div", + { className: clsx_m_default(styles_css_default25["hide-navigation"]) }, + import_react67.default.createElement(InternalButton, { ariaLabel: (_c = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.navigationClose) !== null && _c !== void 0 ? _c : void 0, iconName: isMobile ? "close" : "angle-left", onClick: () => handleNavigationClick(false), variant: "icon", formAction: "none", className: styles_css_default18["navigation-close"], ref: navigationRefs.close }) + ), + navigation + ) + ) + ); + }); +} + +// node_modules/@cloudscape-design/components/app-layout/visual-refresh/notifications.js +var import_react68 = __toESM(require_react()); +function Notifications2() { + var _a; + const { ariaLabels, hasDrawerViewportOverlay, notifications, notificationsElement, stickyNotifications } = useAppLayoutInternals(); + if (!notifications) { + return null; + } + return import_react68.default.createElement( + "div", + { role: "region", "aria-label": (_a = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.notifications) !== null && _a !== void 0 ? _a : void 0, className: clsx_m_default(styles_css_default25.notifications, { + [styles_css_default25["sticky-notifications"]]: stickyNotifications, + [styles_css_default25.unfocusable]: hasDrawerViewportOverlay + }, styles_css_default18.notifications, getContentHeaderClassName()) }, + import_react68.default.createElement("div", { ref: notificationsElement }, notifications) + ); +} + +// node_modules/@cloudscape-design/components/app-layout/visual-refresh/tools.js +var import_react69 = __toESM(require_react()); +function Tools({ children: children2 }) { + const { ariaLabels, disableBodyScroll, drawers, handleSplitPanelClick, handleToolsClick, hasDrawerViewportOverlay, isMobile, isSplitPanelOpen, isToolsOpen, loseToolsFocus, splitPanel, splitPanelControlId, splitPanelDisplayed, splitPanelPosition, splitPanelRefs, splitPanelToggle, tools, toolsControlId, toolsHide, toolsRefs, toolsWidth } = useAppLayoutInternals(); + const hasSplitPanel = !!splitPanel && splitPanelPosition === "side"; + const hasToolsForm = getToolsFormStatus(hasSplitPanel && splitPanelDisplayed, isMobile, isSplitPanelOpen, isToolsOpen, toolsHide); + const hasToolsFormPersistence = getToolsFormPersistence(hasSplitPanel, isSplitPanelOpen, isToolsOpen, toolsHide); + const isUnfocusable = hasDrawerViewportOverlay && !isToolsOpen; + if (toolsHide && !hasSplitPanel || drawers) { + return null; + } + return import_react69.default.createElement(Transition2, { in: isToolsOpen !== null && isToolsOpen !== void 0 ? isToolsOpen : false }, (state, transitionEventsRef) => { + var _a, _b, _c; + return import_react69.default.createElement( + "div", + { className: clsx_m_default(styles_css_default25["tools-container"], { + [styles_css_default25["disable-body-scroll"]]: disableBodyScroll, + [styles_css_default25.unfocusable]: isUnfocusable, + [styles_css_default18["drawer-closed"]]: !isToolsOpen + }), style: { + [custom_css_properties_default.toolsAnimationStartingOpacity]: `${hasSplitPanel && isSplitPanelOpen ? 1 : 0}`, + [custom_css_properties_default.toolsWidth]: `${toolsWidth}px` + }, onBlur: (e) => { + if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) { + loseToolsFocus(); + } + } }, + children2, + !toolsHide && import_react69.default.createElement( + "aside", + { id: toolsControlId, "aria-hidden": !isToolsOpen ? true : false, "aria-label": (_a = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.tools) !== null && _a !== void 0 ? _a : void 0, className: clsx_m_default(styles_css_default25.tools, { + [styles_css_default25.animating]: state === "entering", + [styles_css_default25["has-tools-form-persistence"]]: hasToolsFormPersistence, + [styles_css_default25["is-tools-open"]]: isToolsOpen + }, styles_css_default18.tools), ref: state !== "exiting" ? transitionEventsRef : void 0 }, + import_react69.default.createElement( + "div", + { className: clsx_m_default(styles_css_default25["animated-content"]) }, + import_react69.default.createElement( + "div", + { className: clsx_m_default(styles_css_default25["hide-tools"]) }, + import_react69.default.createElement(InternalButton, { ariaLabel: (_b = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.toolsClose) !== null && _b !== void 0 ? _b : void 0, iconName: isMobile ? "close" : "angle-right", onClick: () => handleToolsClick(false), variant: "icon", formAction: "none", className: styles_css_default18["tools-close"], ref: toolsRefs.close }) + ), + tools + ) + ), + !isMobile && import_react69.default.createElement( + "aside", + { "aria-hidden": !hasToolsForm ? true : false, "aria-label": (_c = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.tools) !== null && _c !== void 0 ? _c : void 0, className: clsx_m_default(styles_css_default25["show-tools"], { + [styles_css_default25.animating]: state === "exiting", + [styles_css_default25["has-tools-form"]]: hasToolsForm, + [styles_css_default25["has-tools-form-persistence"]]: hasToolsFormPersistence + }), ref: state === "exiting" ? transitionEventsRef : void 0, "data-testid": "side-split-panel-drawer" }, + !toolsHide && import_react69.default.createElement(trigger_button_default, { ariaLabel: ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.toolsToggle, ariaControls: toolsControlId, ariaExpanded: isToolsOpen, iconName: "status-info", onClick: () => handleToolsClick(!isToolsOpen), selected: hasSplitPanel && isToolsOpen, className: styles_css_default18["tools-toggle"], ref: toolsRefs.toggle }), + hasSplitPanel && splitPanelToggle.displayed && import_react69.default.createElement(trigger_button_default, { ariaLabel: splitPanelToggle.ariaLabel, ariaControls: splitPanelControlId, ariaExpanded: !!isSplitPanelOpen, iconName: "view-vertical", onClick: () => handleSplitPanelClick(), selected: hasSplitPanel && isSplitPanelOpen, className: styles_css_default23["open-button"], ref: splitPanelRefs.toggle }) + ) + ); + }); +} +function getToolsFormStatus(hasSplitPanel, isMobile, isSplitPanelOpen, isToolsOpen, toolsHide) { + let hasToolsForm = false; + if (!isMobile) { + if (hasSplitPanel && !toolsHide) { + hasToolsForm = true; + } + if (hasSplitPanel && !isSplitPanelOpen && toolsHide) { + hasToolsForm = true; + } + if (!hasSplitPanel && !toolsHide && !isToolsOpen) { + hasToolsForm = true; + } + } + return hasToolsForm; +} +function getToolsFormPersistence(hasSplitPanel, isSplitPanelOpen, isToolsOpen, toolsHide) { + let hasToolsFormPersistence = false; + if (hasSplitPanel && !toolsHide && (isSplitPanelOpen || isToolsOpen)) { + hasToolsFormPersistence = true; + } + return hasToolsFormPersistence; +} + +// node_modules/@cloudscape-design/components/app-layout/visual-refresh/index.js +var AppLayoutWithRef = import_react70.default.forwardRef(function AppLayout(props2, ref) { + return import_react70.default.createElement( + AppLayoutInternalsProvider, + Object.assign({}, props2, { ref }), + import_react70.default.createElement( + split_panel_default, + null, + import_react70.default.createElement( + Layout, + null, + import_react70.default.createElement(Background, null), + import_react70.default.createElement(Navigation, null), + import_react70.default.createElement(MobileToolbar2, null), + import_react70.default.createElement(Notifications2, null), + import_react70.default.createElement(Breadcrumbs, null), + import_react70.default.createElement(Header2, null), + import_react70.default.createElement(Main, null), + import_react70.default.createElement(split_panel_default.Bottom, null), + import_react70.default.createElement( + Tools, + null, + import_react70.default.createElement(split_panel_default.Side, null) + ), + import_react70.default.createElement(Drawers, null) + ) + ) + ); +}); +var visual_refresh_default = AppLayoutWithRef; + +// node_modules/@cloudscape-design/components/app-layout/implementation.js +var AppLayoutImplementation = import_react71.default.forwardRef((props2, ref) => { + const isRefresh = useVisualRefresh(); + return isRefresh ? import_react71.default.createElement(visual_refresh_default, Object.assign({ ref }, props2)) : import_react71.default.createElement(classic_default, Object.assign({ ref }, props2)); +}); + +// node_modules/@cloudscape-design/components/app-layout/widget.js +function createWidgetizedAppLayout(AppLayoutLoader) { + return import_react72.default.forwardRef((props2, ref) => { + const isRefresh = useVisualRefresh(); + if (isRefresh && getGlobalFlag("appLayoutWidget") && AppLayoutLoader) { + return import_react72.default.createElement(AppLayoutLoader, Object.assign({ ref }, props2)); + } + return import_react72.default.createElement(AppLayoutImplementation, Object.assign({ ref }, props2)); + }); +} + +// node_modules/@cloudscape-design/components/app-layout/internal.js +var AppLayoutInternal = createWidgetizedAppLayout(); + +// node_modules/@cloudscape-design/components/app-layout/defaults.js +var defaultContentTypeState = { + navigationOpen: true, + minContentWidth: 280, + maxContentWidth: void 0 +}; +var defaults = { + default: Object.assign({}, defaultContentTypeState), + dashboard: Object.assign({}, defaultContentTypeState), + cards: { + navigationOpen: true, + minContentWidth: 280, + maxContentWidth: void 0 + }, + form: { + navigationOpen: false, + minContentWidth: 280, + maxContentWidth: 800 + }, + table: { + navigationOpen: true, + minContentWidth: 280, + maxContentWidth: void 0 + }, + wizard: { + navigationOpen: false, + minContentWidth: 280, + maxContentWidth: 1080 + } +}; +function applyDefaults(contentType, stateFromProps, isRefresh) { + var _a, _b, _c; + const contentTypeDefaults = isRefresh ? Object.assign(Object.assign({}, defaults[contentType]), { maxContentWidth: void 0 }) : defaults[contentType]; + return { + maxContentWidth: (_a = stateFromProps.maxContentWidth) !== null && _a !== void 0 ? _a : contentTypeDefaults.maxContentWidth, + minContentWidth: (_b = stateFromProps.minContentWidth) !== null && _b !== void 0 ? _b : contentTypeDefaults.minContentWidth, + navigationOpen: (_c = stateFromProps.navigationOpen) !== null && _c !== void 0 ? _c : contentTypeDefaults.navigationOpen + }; +} + +// node_modules/@cloudscape-design/components/app-layout/utils/use-app-layout-placement.js +var import_react74 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/app-layout/utils/use-observed-element.js +var import_react73 = __toESM(require_react()); +function useObservedElement(selector) { + const getElement = (0, import_react73.useCallback)(() => { + return document.querySelector(selector); + }, [selector]); + const [height, setHeight] = (0, import_react73.useState)(0); + useResizeObserver(getElement, (entry) => setHeight(entry.borderBoxHeight)); + return height; +} + +// node_modules/@cloudscape-design/components/app-layout/utils/use-app-layout-placement.js +function useAppLayoutPlacement(headerSelector, footerSelector) { + const mainElementRef = (0, import_react74.useRef)(null); + const headerHeight = useObservedElement(headerSelector); + const footerHeight = useObservedElement(footerSelector); + const [offsets, setOffsets] = (0, import_react74.useState)({ left: 0, right: 0, width: Number.POSITIVE_INFINITY }); + const updatePosition = (0, import_react74.useCallback)(() => { + if (!mainElementRef.current) { + return; + } + const { left, right, width } = mainElementRef.current.getBoundingClientRect(); + if (width === 0) { + return; + } + setOffsets({ left, right: width - right, width }); + }, []); + (0, import_react74.useEffect)(() => { + window.addEventListener("resize", updatePosition); + return () => window.removeEventListener("resize", updatePosition); + }, [updatePosition]); + useResizeObserver(mainElementRef, updatePosition); + return [mainElementRef, Object.assign(Object.assign({}, offsets), { top: headerHeight, bottom: footerHeight })]; +} + +// node_modules/@cloudscape-design/components/app-layout/index.js +var AppLayout2 = import_react75.default.forwardRef((_a, ref) => { + var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o; + var { contentType = "default", headerSelector = "#b #h", footerSelector = "#b #f", navigationWidth = 280, toolsWidth = 290, maxContentWidth, minContentWidth, navigationOpen: controlledNavigationOpen, onNavigationChange: controlledOnNavigationChange } = _a, rest = __rest(_a, ["contentType", "headerSelector", "footerSelector", "navigationWidth", "toolsWidth", "maxContentWidth", "minContentWidth", "navigationOpen", "onNavigationChange"]); + if (isDevelopment) { + if (rest.toolsOpen && rest.toolsHide) { + warnOnce("AppLayout", `You have enabled both the \`toolsOpen\` prop and the \`toolsHide\` prop. This is not supported. Set \`toolsOpen\` to \`false\` when you set \`toolsHide\` to \`true\`.`); + } + } + const { __internalRootRef } = useBaseComponent("AppLayout", { + props: { + contentType, + disableContentPaddings: rest.disableContentPaddings, + disableBodyScroll: rest.disableBodyScroll, + navigationWidth, + navigationHide: rest.navigationHide, + toolsHide: rest.toolsHide, + toolsWidth, + maxContentWidth, + minContentWidth, + stickyNotifications: rest.stickyNotifications, + disableContentHeaderOverlap: rest.disableContentHeaderOverlap + }, + metadata: { + drawersCount: (_c = (_b = rest.drawers) === null || _b === void 0 ? void 0 : _b.length) !== null && _c !== void 0 ? _c : null, + hasContentHeader: !!rest.contentHeader + } + }); + const isRefresh = useVisualRefresh(); + const isMobile = useMobile(); + const i18n = useInternalI18n("app-layout"); + const ariaLabels = { + navigation: i18n("ariaLabels.navigation", (_d = rest.ariaLabels) === null || _d === void 0 ? void 0 : _d.navigation), + navigationClose: i18n("ariaLabels.navigationClose", (_e = rest.ariaLabels) === null || _e === void 0 ? void 0 : _e.navigationClose), + navigationToggle: i18n("ariaLabels.navigationToggle", (_f = rest.ariaLabels) === null || _f === void 0 ? void 0 : _f.navigationToggle), + notifications: i18n("ariaLabels.notifications", (_g = rest.ariaLabels) === null || _g === void 0 ? void 0 : _g.notifications), + tools: i18n("ariaLabels.tools", (_h = rest.ariaLabels) === null || _h === void 0 ? void 0 : _h.tools), + toolsClose: i18n("ariaLabels.toolsClose", (_j = rest.ariaLabels) === null || _j === void 0 ? void 0 : _j.toolsClose), + toolsToggle: i18n("ariaLabels.toolsToggle", (_k = rest.ariaLabels) === null || _k === void 0 ? void 0 : _k.toolsToggle), + drawers: i18n("ariaLabels.drawers", (_l = rest.ariaLabels) === null || _l === void 0 ? void 0 : _l.drawers), + drawersOverflow: i18n("ariaLabels.drawersOverflow", (_m = rest.ariaLabels) === null || _m === void 0 ? void 0 : _m.drawersOverflow), + drawersOverflowWithBadge: i18n("ariaLabels.drawersOverflowWithBadge", (_o = rest.ariaLabels) === null || _o === void 0 ? void 0 : _o.drawersOverflowWithBadge) + }; + const _p = applyDefaults(contentType, { maxContentWidth, minContentWidth }, isRefresh), { navigationOpen: defaultNavigationOpen } = _p, restDefaults = __rest(_p, ["navigationOpen"]); + const [navigationOpen = false, setNavigationOpen] = useControllable(controlledNavigationOpen, controlledOnNavigationChange, isMobile ? false : defaultNavigationOpen, { componentName: "AppLayout", controlledProp: "navigationOpen", changeHandler: "onNavigationChange" }); + const onNavigationChange = (event) => { + setNavigationOpen(event.detail.open); + controlledOnNavigationChange === null || controlledOnNavigationChange === void 0 ? void 0 : controlledOnNavigationChange(event); + }; + const [rootRef, placement] = useAppLayoutPlacement(headerSelector, footerSelector); + const props2 = Object.assign(Object.assign(Object.assign({ + contentType, + navigationWidth, + toolsWidth, + navigationOpen, + onNavigationChange + }, restDefaults), rest), { + ariaLabels, + placement + }); + const baseProps = getBaseProps(rest); + return import_react75.default.createElement( + "div", + Object.assign({ ref: useMergeRefs(__internalRootRef, rootRef) }, baseProps), + import_react75.default.createElement(AppLayoutInternal, Object.assign({ ref }, props2)) + ); +}); +applyDisplayName(AppLayout2, "AppLayout"); +var app_layout_default = AppLayout2; + +// node_modules/@cloudscape-design/components/area-chart/index.js +var import_react138 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/area-chart/internal.js +var import_react137 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/internal/components/chart-status-container/index.js +var import_react77 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/link/internal.js +var import_react76 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/link/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/link/styles.scoped.css"; +var styles_css_default26 = { + "link": "awsui_link_4c84z_i6aqa_99", + "variant-secondary": "awsui_variant-secondary_4c84z_i6aqa_168", + "variant-primary": "awsui_variant-primary_4c84z_i6aqa_203", + "variant-info": "awsui_variant-info_4c84z_i6aqa_236", + "variant-value-large": "awsui_variant-value-large_4c84z_i6aqa_271", + "variant-top-navigation": "awsui_variant-top-navigation_4c84z_i6aqa_303", + "variant-recovery": "awsui_variant-recovery_4c84z_i6aqa_336", + "button": "awsui_button_4c84z_i6aqa_369", + "color-inverted": "awsui_color-inverted_4c84z_i6aqa_404", + "font-size-body-s": "awsui_font-size-body-s_4c84z_i6aqa_425", + "font-size-body-m": "awsui_font-size-body-m_4c84z_i6aqa_432", + "font-size-heading-xs": "awsui_font-size-heading-xs_4c84z_i6aqa_438", + "font-size-heading-s": "awsui_font-size-heading-s_4c84z_i6aqa_444", + "font-size-heading-m": "awsui_font-size-heading-m_4c84z_i6aqa_451", + "font-size-heading-l": "awsui_font-size-heading-l_4c84z_i6aqa_458", + "font-size-heading-xl": "awsui_font-size-heading-xl_4c84z_i6aqa_465", + "font-size-display-l": "awsui_font-size-display-l_4c84z_i6aqa_472", + "font-size-inherit": "awsui_font-size-inherit_4c84z_i6aqa_479", + "icon-wrapper": "awsui_icon-wrapper_4c84z_i6aqa_491", + "icon": "awsui_icon_4c84z_i6aqa_491" +}; + +// node_modules/@cloudscape-design/components/link/internal.js +var InternalLink = import_react76.default.forwardRef((_a, ref) => { + var { variant: providedVariant, fontSize = "body-m", color: color2 = "normal", external = false, target, href, rel, ariaLabel, externalIconAriaLabel, onFollow, children: children2, __internalRootRef = null } = _a, props2 = __rest(_a, ["variant", "fontSize", "color", "external", "target", "href", "rel", "ariaLabel", "externalIconAriaLabel", "onFollow", "children", "__internalRootRef"]); + checkSafeUrl("Link", href); + const isButton = !href; + const { defaultVariant } = (0, import_react76.useContext)(LinkDefaultVariantContext); + const variant = providedVariant || defaultVariant; + const specialStyles = ["top-navigation", "link", "recovery"]; + const hasSpecialStyle = specialStyles.indexOf(variant) > -1; + const i18n = useInternalI18n("link"); + const baseProps = getBaseProps(props2); + const anchorTarget = target !== null && target !== void 0 ? target : external ? "_blank" : void 0; + const anchorRel = rel !== null && rel !== void 0 ? rel : anchorTarget === "_blank" ? "noopener noreferrer" : void 0; + const uniqueId = useUniqueId("link"); + const linkId = useUniqueId("link-self"); + const infoId = useUniqueId("link-info"); + const infoLinkLabelFromContext = (0, import_react76.useContext)(InfoLinkLabelContext); + const { funnelInteractionId } = useFunnel(); + const { stepNumber, stepNameSelector } = useFunnelStep(); + const { subStepSelector, subStepNameSelector } = useFunnelSubStep(); + const fireFunnelEvent = (funnelInteractionId2) => { + if (variant === "info") { + const stepName = getNameFromSelector(stepNameSelector); + const subStepName = getNameFromSelector(subStepNameSelector); + FunnelMetrics.helpPanelInteracted({ + funnelInteractionId: funnelInteractionId2, + stepNumber, + stepName, + stepNameSelector, + subStepSelector, + subStepName, + subStepNameSelector, + elementSelector: getFunnelValueSelector(uniqueId), + subStepAllSelector: getSubStepAllSelector() + }); + } else if (external) { + const stepName = getNameFromSelector(stepNameSelector); + const subStepName = getNameFromSelector(subStepNameSelector); + FunnelMetrics.externalLinkInteracted({ + funnelInteractionId: funnelInteractionId2, + stepNumber, + stepName, + stepNameSelector, + subStepSelector, + subStepName, + subStepNameSelector, + elementSelector: getFunnelValueSelector(uniqueId), + subStepAllSelector: getSubStepAllSelector() + }); + } + }; + const fireFollowEvent = (event) => { + if (funnelInteractionId) { + fireFunnelEvent(funnelInteractionId); + } + fireCancelableEvent(onFollow, { href, external, target: anchorTarget }, event); + }; + const handleLinkClick = (event) => { + if (isPlainLeftClick(event)) { + fireFollowEvent(event); + } + }; + const handleButtonClick = (event) => { + fireFollowEvent(event); + }; + const handleButtonKeyDown = (event) => { + if (event.keyCode === KeyCode.space || event.keyCode === KeyCode.enter) { + event.preventDefault(); + fireFollowEvent(event); + } + }; + const linkRef = (0, import_react76.useRef)(null); + const isVisualRefresh = useVisualRefresh(); + useForwardFocus(ref, linkRef); + const applyButtonStyles = isButton && isVisualRefresh && !hasSpecialStyle; + const sharedProps = Object.assign(Object.assign({ id: linkId }, baseProps), { + // https://github.com/microsoft/TypeScript/issues/36659 + ref: useMergeRefs(linkRef, __internalRootRef), + className: clsx_m_default(styles_css_default26.link, baseProps.className, applyButtonStyles ? styles_css_default26.button : null, styles_css_default26[getVariantStyle(variant)], styles_css_default26[getFontSizeStyle(variant, fontSize)], styles_css_default26[getColorStyle(variant, color2)]), + "aria-label": ariaLabel, + "aria-labelledby": "", + [DATA_ATTR_FUNNEL_VALUE]: uniqueId + }); + if (variant === "info" && infoLinkLabelFromContext && !ariaLabel) { + sharedProps["aria-labelledby"] = `${sharedProps.id} ${infoId} ${infoLinkLabelFromContext}`; + } + const renderedExternalIconAriaLabel = i18n("externalIconAriaLabel", externalIconAriaLabel); + const content = import_react76.default.createElement( + import_react76.default.Fragment, + null, + children2, + external && import_react76.default.createElement( + "span", + { className: styles_css_default26["icon-wrapper"] }, + " ", + import_react76.default.createElement( + "span", + { className: styles_css_default26.icon, "aria-label": renderedExternalIconAriaLabel, role: renderedExternalIconAriaLabel ? "img" : void 0 }, + import_react76.default.createElement(internal_default, { name: "external", size: "inherit" }) + ) + ), + variant === "info" && import_react76.default.createElement("span", { hidden: true, id: infoId }, ":") + ); + const { tabIndex } = useSingleTabStopNavigation(linkRef, { tabIndex: isButton ? 0 : void 0 }); + if (isButton) { + return import_react76.default.createElement("a", Object.assign({}, sharedProps, { role: "button", tabIndex, onKeyDown: handleButtonKeyDown, onClick: handleButtonClick }), content); + } + return ( + // we dynamically set proper rel in the code above + // eslint-disable-next-line react/jsx-no-target-blank + import_react76.default.createElement("a", Object.assign({}, sharedProps, { tabIndex, target: anchorTarget, rel: anchorRel, href, onClick: handleLinkClick }), content) + ); +}); +function getVariantStyle(variant) { + return `variant-${variant.replace(/^awsui-/, "")}`; +} +function getFontSizeStyle(variant, fontSize) { + switch (variant) { + case "info": + return "font-size-body-s"; + case "awsui-value-large": + return "font-size-display-l"; + default: + return `font-size-${fontSize}`; + } +} +function getColorStyle(variant, color2) { + return `color-${variant === "info" ? "normal" : color2}`; +} +var internal_default12 = InternalLink; + +// node_modules/@cloudscape-design/components/internal/components/chart-status-container/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/internal/components/chart-status-container/styles.scoped.css"; +var styles_css_default27 = { + "root": "awsui_root_11n0s_6tm6j_9", + "empty": "awsui_empty_11n0s_6tm6j_13" +}; + +// node_modules/@cloudscape-design/components/internal/components/chart-status-container/index.js +function getChartStatus({ externalData, visibleData, statusType }) { + const isEmpty = !visibleData || visibleData.length === 0; + const isNoMatch = isEmpty && visibleData.length !== externalData.length; + const showChart = statusType === "finished" && !isEmpty; + return { isEmpty, isNoMatch, showChart }; +} +function ChartStatusContainer({ statusType, errorText, loadingText, recoveryText, noMatch, empty, onRecoveryClick, isNoMatch, isEmpty, showChart }) { + const i18n = useInternalI18n("[charts]"); + const statusContainer = (0, import_react77.useMemo)(() => { + const handleRecoveryClick = (event) => { + event.preventDefault(); + fireNonCancelableEvent(onRecoveryClick); + }; + if (statusType === "error") { + const renderedRecoveryText = i18n("recoveryText", recoveryText); + return import_react77.default.createElement( + "span", + null, + import_react77.default.createElement(StatusIndicator, { type: "error" }, i18n("errorText", errorText)), + " ", + !!renderedRecoveryText && !!onRecoveryClick && import_react77.default.createElement(internal_default12, { onFollow: handleRecoveryClick, variant: "recovery" }, renderedRecoveryText) + ); + } + if (statusType === "loading") { + return import_react77.default.createElement(StatusIndicator, { type: "loading" }, i18n("loadingText", loadingText)); + } + if (isNoMatch) { + return import_react77.default.createElement("div", { className: styles_css_default27.empty }, noMatch); + } + if (isEmpty) { + return import_react77.default.createElement("div", { className: styles_css_default27.empty }, empty); + } + }, [i18n, statusType, onRecoveryClick, isEmpty, isNoMatch, recoveryText, loadingText, errorText, empty, noMatch]); + return import_react77.default.createElement("div", { className: styles_css_default27.root, "aria-live": "polite", "aria-atomic": "true" }, !showChart && statusContainer); +} + +// node_modules/@cloudscape-design/components/area-chart/elements/area-chart-filter.js +var import_react104 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/internal/components/chart-filter/index.js +var import_react103 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/multiselect/internal.js +var import_react101 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/internal/components/option/utils/filter-options.js +var searchableFields = ["value", "label", "description", "labelTag"]; +var matchesString = (value, searchText, strictMatching) => { + if (!value) { + return false; + } + const index = value.toLowerCase().indexOf(searchText); + return strictMatching ? index === 0 : index > -1; +}; +var matchesSingleOption = (dropdownOption, text, strictMatching) => { + const searchText = text.toLowerCase(); + const option = dropdownOption.option; + const searchStrFields = (attr) => matchesString(option[attr], searchText, strictMatching); + const searchTagsFields = (attr) => { + var _a; + return (_a = option[attr]) === null || _a === void 0 ? void 0 : _a.some((value) => matchesString(value, searchText, strictMatching)); + }; + const searchableTagFields = ["tags"]; + if (!strictMatching) { + searchableTagFields.push("filteringTags"); + } + return searchableFields.some(searchStrFields) || searchableTagFields.some(searchTagsFields); +}; +var filterOptions = (options, searchText, strictMatching = false) => { + if (searchText === "") { + return options; + } + let currentGroup = null; + let parentMatched = false; + return options.reduce((acc, option) => { + if (option.type === "parent") { + parentMatched = false; + currentGroup = option; + if (matchesSingleOption(option, searchText, strictMatching)) { + parentMatched = true; + acc.push(currentGroup); + } + return acc; + } + if (option.type !== "child") { + currentGroup = null; + parentMatched = false; + } + if (parentMatched) { + acc.push(option); + } else if (matchesSingleOption(option, searchText, strictMatching)) { + if (currentGroup) { + acc.push(currentGroup); + currentGroup = null; + } + acc.push(option); + } + return acc; + }, []); +}; +var isInteractive = (option) => !!option && !option.disabled && option.type !== "parent"; +var isGroupInteractive = (option) => !!option && !option.disabled; +var isGroup = (option) => !!option && "options" in option; + +// node_modules/@cloudscape-design/components/internal/components/dropdown-footer/index.js +var import_react79 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/internal/components/dropdown-footer/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/internal/components/dropdown-footer/styles.scoped.css"; +var styles_css_default28 = { + "root": "awsui_root_1afi9_5kqbd_99", + "hidden": "awsui_hidden_1afi9_5kqbd_133", + "no-items": "awsui_no-items_1afi9_5kqbd_136" +}; + +// node_modules/@cloudscape-design/components/internal/components/dropdown-status/index.js +var import_react78 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/internal/components/dropdown-status/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/internal/components/dropdown-status/styles.scoped.css"; +var styles_css_default29 = { + "root": "awsui_root_vrgzu_ljki3_99", + "recovery": "awsui_recovery_vrgzu_ljki3_137" +}; + +// node_modules/@cloudscape-design/components/internal/components/dropdown-status/index.js +function DropdownStatus({ children: children2 }) { + return import_react78.default.createElement("div", { className: styles_css_default29.root }, children2); +} +var useDropdownStatus = ({ statusType, empty, loadingText, finishedText, filteringResultsText, errorText, recoveryText, isEmpty, isNoMatch, isFiltered, noMatch, onRecoveryClick, hasRecoveryCallback = false, errorIconAriaLabel }) => { + const previousStatusType = usePrevious(statusType); + const statusResult = { isSticky: true, content: null }; + if (statusType === "loading") { + statusResult.content = import_react78.default.createElement(StatusIndicator, { type: "loading" }, loadingText); + } else if (statusType === "error") { + statusResult.content = import_react78.default.createElement( + "span", + null, + import_react78.default.createElement(StatusIndicator, { type: "error", __display: "inline", __animate: previousStatusType !== "error", iconAriaLabel: errorIconAriaLabel }, errorText), + " ", + !!recoveryText && hasRecoveryCallback && import_react78.default.createElement(internal_default12, { onFollow: () => fireNonCancelableEvent(onRecoveryClick), variant: "recovery", className: styles_css_default29.recovery }, recoveryText) + ); + } else if (isEmpty && empty) { + statusResult.content = empty; + } else if (isNoMatch && noMatch) { + statusResult.content = noMatch; + } else if (isFiltered && filteringResultsText) { + statusResult.content = filteringResultsText; + } else if (statusType === "finished" && finishedText) { + statusResult.content = finishedText; + statusResult.isSticky = false; + } + return statusResult; +}; +var dropdown_status_default = DropdownStatus; + +// node_modules/@cloudscape-design/components/internal/components/dropdown-footer/index.js +var DropdownFooter = ({ content, id, hasItems = true }) => import_react79.default.createElement( + "div", + { className: clsx_m_default(styles_css_default28.root, { [styles_css_default28.hidden]: content === null, [styles_css_default28["no-items"]]: !hasItems }) }, + import_react79.default.createElement(live_region_default, { visible: true, tagName: "div", id }, content && import_react79.default.createElement(dropdown_status_default, null, content)) +); +var dropdown_footer_default = DropdownFooter; + +// node_modules/@cloudscape-design/components/internal/components/option/utils/flatten-options.js +var flattenOptions = (options) => { + const parentMap = /* @__PURE__ */ new Map(); + const flatOptions = options.reduce((acc, option) => { + if ("options" in option) { + const { options: options2 } = option, rest = __rest(option, ["options"]); + const parentDropdownOption = { type: "parent", option }; + const allOptionsDisabled = options2.every((option2) => option2.disabled); + if (option.disabled || allOptionsDisabled) { + parentDropdownOption.disabled = true; + } + acc.push(parentDropdownOption); + options2.forEach((child) => { + const childDropdownOption = { type: "child", option: child }; + if (rest.disabled || child.disabled) { + childDropdownOption.disabled = true; + } + acc.push(childDropdownOption); + parentMap.set(childDropdownOption, parentDropdownOption); + }); + } else { + const dropdownOption = { option }; + if (option.disabled) { + dropdownOption.disabled = true; + } + acc.push(dropdownOption); + } + return acc; + }, []); + return { + flatOptions, + parentMap + }; +}; + +// node_modules/@cloudscape-design/components/internal/components/options-list/utils/test-indexes.js +var testIndexMap = /* @__PURE__ */ new WeakMap(); +var getTestOptionIndexes = (item) => testIndexMap.get(item); +var generateTestIndexes = (filteredItems, getParentGroup) => { + let throughIndex = 1; + let groupIndex = 0; + let inGroupIndex = 1; + let currentGroup = null; + filteredItems.forEach((item) => { + const isGroup5 = item.type === "parent"; + const group = isGroup5 ? item : getParentGroup(item); + if (group && group !== currentGroup) { + currentGroup = group; + groupIndex += 1; + inGroupIndex = 1; + } + if (isGroup5) { + testIndexMap.set(item, { groupIndex }); + } else if (group && item.type === "child") { + testIndexMap.set(item, { + throughIndex: throughIndex++, + groupIndex, + inGroupIndex: inGroupIndex++ + }); + } else if (item.type === "child" || !item.type) { + testIndexMap.set(item, { throughIndex: throughIndex++ }); + } + }); +}; + +// node_modules/@cloudscape-design/components/internal/components/option/utils/prepare-options.js +function prepareOptions(options, filteringType, filteringText) { + const { flatOptions, parentMap } = flattenOptions(options); + const filteredOptions = filteringType !== "auto" ? flatOptions : filterOptions(flatOptions, filteringText); + generateTestIndexes(filteredOptions, parentMap.get.bind(parentMap)); + return { + filteredOptions, + parentMap, + totalCount: flatOptions.length, + matchesCount: filteredOptions.length + }; +} + +// node_modules/@cloudscape-design/components/select/utils/use-select.js +var import_react82 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/internal/components/options-list/utils/use-highlight-option.js +var import_react80 = __toESM(require_react()); +var HighlightType = class { + constructor(type, moveFocus = type === "keyboard") { + this.type = type; + this.moveFocus = moveFocus; + } +}; +function useHighlightedOption({ options, isHighlightable: isHighlightable2 }) { + const [highlightedIndex, setHighlightedIndexState] = (0, import_react80.useState)(-1); + const [highlightType, setHighlightType] = (0, import_react80.useState)(new HighlightType("keyboard")); + const setHighlightedIndex = (0, import_react80.useCallback)((index, highlightType2) => { + setHighlightedIndexState(index); + setHighlightType(highlightType2); + }, []); + const highlightedOption = options[highlightedIndex] && isHighlightable2(options[highlightedIndex]) ? options[highlightedIndex] : void 0; + const moveHighlightFrom = (direction, startIndex = highlightedIndex, highlightType2) => { + const fromBottomEnd = startIndex === -1 && direction === -1; + let newIndex = fromBottomEnd ? options.length : startIndex; + do { + newIndex += direction; + } while (options[newIndex] && !isHighlightable2(options[newIndex])); + if (options[newIndex]) { + setHighlightedIndex(newIndex, highlightType2); + } + }; + const moveHighlight2 = (direction, highlightType2) => moveHighlightFrom(direction, highlightedIndex, highlightType2); + const highlightOption = (0, import_react80.useCallback)((option, highlightType2) => { + const index = options.indexOf(option); + setHighlightedIndex(index, highlightType2); + }, [options, setHighlightedIndex]); + return [ + { highlightType, highlightedIndex, highlightedOption }, + { + setHighlightedIndexWithMouse: (index, moveFocus = false) => setHighlightedIndex(index, new HighlightType("mouse", moveFocus)), + moveHighlightWithKeyboard: (direction) => moveHighlight2(direction, new HighlightType("keyboard")), + highlightOptionWithKeyboard: (option) => highlightOption(option, new HighlightType("keyboard")), + resetHighlightWithKeyboard: () => setHighlightedIndex(-1, new HighlightType("keyboard")), + goHomeWithKeyboard: () => moveHighlightFrom(1, -1, new HighlightType("keyboard")), + goEndWithKeyboard: () => moveHighlightFrom(-1, options.length, new HighlightType("keyboard")) + } + ]; +} + +// node_modules/@cloudscape-design/components/internal/components/options-list/utils/use-keyboard.js +var import_react81 = __toESM(require_react()); +var HOME = 36; +var END = 35; +var useMenuKeyboard = ({ moveHighlight: moveHighlight2, selectOption, goHome, goEnd, closeDropdown, preventNativeSpace = false }) => { + return (0, import_react81.useCallback)((e) => { + switch (e.detail.keyCode) { + case KeyCode.up: + e.preventDefault(); + moveHighlight2(-1); + break; + case KeyCode.down: + e.preventDefault(); + moveHighlight2(1); + break; + case HOME: + goHome(); + break; + case END: + goEnd(); + break; + case KeyCode.escape: + e.stopPropagation(); + closeDropdown(); + break; + case KeyCode.enter: + e.preventDefault(); + selectOption(); + break; + case KeyCode.space: + if (preventNativeSpace) { + e.preventDefault(); + selectOption(); + } + } + }, [moveHighlight2, selectOption, goHome, goEnd, closeDropdown, preventNativeSpace]); +}; +var useTriggerKeyboard = ({ openDropdown, goHome }) => { + return (0, import_react81.useCallback)((e) => { + switch (e.detail.keyCode) { + case KeyCode.up: + case KeyCode.down: + e.preventDefault(); + goHome(); + openDropdown(); + break; + case KeyCode.space: + case KeyCode.enter: + e.preventDefault(); + openDropdown(); + break; + } + }, [openDropdown, goHome]); +}; + +// node_modules/@cloudscape-design/components/internal/components/options-list/utils/use-ids.js +var getOptionId = (menuId, index) => { + if (index < 0) { + return void 0; + } + return `${menuId}-option-${index}`; +}; + +// node_modules/@cloudscape-design/components/select/utils/connect-options.js +var connectOptionsByValue = (options, selectedOptions) => { + return (selectedOptions || []).map((selectedOption) => { + for (const dropdownOption of options) { + if (dropdownOption.type !== "parent" && dropdownOption.option.value === selectedOption.value) { + return dropdownOption; + } + } + return { option: selectedOption }; + }); +}; +var findOptionIndex = (options, option) => { + for (let index = 0; index < options.length; index++) { + const __option = options[index]; + if (__option === option || __option.value === option.value) { + return index; + } + } + return -1; +}; + +// node_modules/@cloudscape-design/components/select/utils/use-select.js +function useSelect({ selectedOptions, updateSelectedOption, options, filteringType, onBlur, onFocus, externalRef, keepOpen, fireLoadItems, setFilteringValue, useInteractiveGroups = false, statusType }) { + const interactivityCheck = useInteractiveGroups ? isGroupInteractive : isInteractive; + const isHighlightable2 = (option) => !!option && (useInteractiveGroups || option.type !== "parent"); + const filterRef = (0, import_react82.useRef)(null); + const triggerRef = (0, import_react82.useRef)(null); + const menuRef = (0, import_react82.useRef)(null); + const hasFilter = filteringType !== "none"; + const activeRef = hasFilter ? filterRef : menuRef; + const __selectedOptions = connectOptionsByValue(options, selectedOptions); + const __selectedValuesSet = selectedOptions.reduce((selectedValuesSet, item) => { + if (item.value) { + selectedValuesSet.add(item.value); + } + return selectedValuesSet; + }, /* @__PURE__ */ new Set()); + const [{ highlightType, highlightedOption, highlightedIndex }, { moveHighlightWithKeyboard, resetHighlightWithKeyboard, setHighlightedIndexWithMouse, highlightOptionWithKeyboard, goHomeWithKeyboard, goEndWithKeyboard }] = useHighlightedOption({ options, isHighlightable: isHighlightable2 }); + const { isOpen, openDropdown, closeDropdown, toggleDropdown, openedWithKeyboard } = useOpenState({ + onOpen: () => fireLoadItems(""), + onClose: () => { + resetHighlightWithKeyboard(); + setFilteringValue(""); + } + }); + const handleFocus = () => { + fireNonCancelableEvent(onFocus, {}); + }; + const handleBlur = () => { + fireNonCancelableEvent(onBlur, {}); + closeDropdown(); + }; + const hasSelectedOption = __selectedOptions.length > 0; + const menuId = useUniqueId("option-list"); + const dialogId = useUniqueId("dialog"); + const highlightedOptionId = getOptionId(menuId, highlightedIndex); + const selectOption = (option) => { + var _a; + const optionToSelect = option || highlightedOption; + if (!optionToSelect || !interactivityCheck(optionToSelect)) { + return; + } + updateSelectedOption(optionToSelect.option); + if (!keepOpen) { + (_a = triggerRef.current) === null || _a === void 0 ? void 0 : _a.focus(); + closeDropdown(); + } + }; + const activeKeyDownHandler = useMenuKeyboard({ + moveHighlight: moveHighlightWithKeyboard, + selectOption, + goHome: goHomeWithKeyboard, + goEnd: goEndWithKeyboard, + closeDropdown: () => { + var _a; + (_a = triggerRef.current) === null || _a === void 0 ? void 0 : _a.focus(); + closeDropdown(); + }, + preventNativeSpace: !hasFilter + }); + const triggerKeyDownHandler = useTriggerKeyboard({ + openDropdown: () => openDropdown(true), + goHome: goHomeWithKeyboard + }); + const getDropdownProps = () => ({ + onFocus: handleFocus, + onBlur: handleBlur, + dropdownContentId: dialogId, + dropdownContentRole: hasFilter ? "dialog" : void 0 + }); + const getTriggerProps = (disabled = false, autoFocus = false) => { + const triggerProps = { + ref: triggerRef, + onFocus: () => closeDropdown(), + autoFocus, + ariaHasPopup: hasFilter ? "dialog" : "listbox", + ariaControls: isOpen ? hasFilter ? dialogId : menuId : void 0 + }; + if (!disabled) { + triggerProps.onMouseDown = (event) => { + var _a; + event.preventDefault(); + if (isOpen) { + (_a = triggerRef.current) === null || _a === void 0 ? void 0 : _a.focus(); + } + toggleDropdown(); + }; + triggerProps.onKeyDown = triggerKeyDownHandler; + } + return triggerProps; + }; + const getFilterProps = () => { + if (!hasFilter) { + return {}; + } + return { + ref: filterRef, + onKeyDown: activeKeyDownHandler, + onChange: (event) => { + setFilteringValue(event.detail.value); + resetHighlightWithKeyboard(); + }, + __onDelayedInput: (event) => { + fireLoadItems(event.detail.value); + }, + __nativeAttributes: { + "aria-activedescendant": highlightedOptionId, + ["aria-owns"]: menuId, + ["aria-controls"]: menuId + } + }; + }; + const getMenuProps = () => { + const menuProps = { + id: menuId, + ref: menuRef, + open: isOpen, + onMouseUp: (itemIndex) => { + if (itemIndex > -1) { + selectOption(options[itemIndex]); + } + }, + onMouseMove: (itemIndex) => { + if (itemIndex > -1) { + setHighlightedIndexWithMouse(itemIndex); + } + }, + statusType + }; + if (!hasFilter) { + menuProps.onKeyDown = activeKeyDownHandler; + menuProps.nativeAttributes = { + "aria-activedescendant": highlightedOptionId + }; + } + return menuProps; + }; + const getGroupState = (option) => { + const totalSelected = option.options.filter((item) => !!item.value && __selectedValuesSet.has(item.value)).length; + const hasSelected = totalSelected > 0; + const allSelected = totalSelected === option.options.length; + return { + selected: hasSelected && allSelected, + indeterminate: hasSelected && !allSelected + }; + }; + const getOptionProps2 = (option, index) => { + var _a; + const highlighted = option === highlightedOption; + const groupState = isGroup(option.option) ? getGroupState(option.option) : void 0; + const selected = __selectedOptions.indexOf(option) > -1 || !!(groupState === null || groupState === void 0 ? void 0 : groupState.selected); + const nextOption = (_a = options[index + 1]) === null || _a === void 0 ? void 0 : _a.option; + const isNextSelected = !!nextOption && isGroup(nextOption) ? getGroupState(nextOption).selected : __selectedOptions.indexOf(options[index + 1]) > -1; + const optionProps = { + key: index, + option, + highlighted, + selected, + isNextSelected, + indeterminate: !!(groupState === null || groupState === void 0 ? void 0 : groupState.indeterminate), + ["data-mouse-target"]: isHighlightable2(option) ? index : -1, + id: getOptionId(menuId, index) + }; + return optionProps; + }; + const prevOpen = usePrevious(isOpen); + (0, import_react82.useEffect)(() => { + if (isOpen && !prevOpen && hasSelectedOption && !hasFilter) { + if (openedWithKeyboard) { + highlightOptionWithKeyboard(__selectedOptions[0]); + } else { + setHighlightedIndexWithMouse(options.indexOf(__selectedOptions[0]), true); + } + } + }, [ + isOpen, + __selectedOptions, + hasSelectedOption, + setHighlightedIndexWithMouse, + highlightOptionWithKeyboard, + openedWithKeyboard, + options, + prevOpen, + hasFilter + ]); + (0, import_react82.useEffect)(() => { + var _a; + if (isOpen) { + (_a = activeRef.current) === null || _a === void 0 ? void 0 : _a.focus({ preventScroll: true }); + } + }, [isOpen, activeRef]); + useForwardFocus(externalRef, triggerRef); + const highlightedGroupSelected = !!highlightedOption && isGroup(highlightedOption.option) && getGroupState(highlightedOption.option).selected; + const announceSelected = !!highlightedOption && (__selectedOptions.indexOf(highlightedOption) > -1 || highlightedGroupSelected); + return { + isOpen, + highlightedOption, + highlightedIndex, + highlightType, + getTriggerProps, + getDropdownProps, + getMenuProps, + getFilterProps, + getOptionProps: getOptionProps2, + highlightOption: highlightOptionWithKeyboard, + selectOption, + announceSelected, + dialogId + }; +} + +// node_modules/@cloudscape-design/components/select/utils/use-native-search.js +var import_react83 = __toESM(require_react()); +var isRepeatedChar = (str) => str.split("").every((c) => c === str[0]); +function findMatchingOption(options, searchText, currentHighlight, useInteractiveGroups) { + const interactivityCheck = useInteractiveGroups ? isGroupInteractive : isInteractive; + const filter = (searchText2) => filterOptions(options, searchText2, true).filter((option) => interactivityCheck(option)); + const matchingOptions = filter(searchText); + if (matchingOptions.length === 1) { + return matchingOptions[0]; + } + if (currentHighlight && searchText.length > 1 && isRepeatedChar(searchText)) { + const matchingOptions2 = filter(searchText[0]); + if (matchingOptions2.length > 0) { + let active = isGroup(currentHighlight) ? matchingOptions2.map(({ option }) => option).indexOf(currentHighlight) : matchingOptions2.map(({ option }) => option.value).indexOf(currentHighlight.value); + active += 1; + active = active % matchingOptions2.length; + return matchingOptions2[active]; + } + } + if (matchingOptions.length > 0) { + return matchingOptions[0]; + } + return null; +} +function useNativeSearch({ isEnabled, options, highlightOption, highlightedOption, useInteractiveGroups }) { + const value = (0, import_react83.useRef)(""); + const delayedResetValue = useDebounceCallback(() => value.current = "", 500); + return (event) => { + if (!isEnabled) { + return; + } + const { key } = event; + if (!key || key.length !== 1) { + return; + } + delayedResetValue(); + const newValue = value.current + key; + value.current = newValue; + const nextHighlight = findMatchingOption(options, newValue, highlightedOption, useInteractiveGroups); + if (nextHighlight) { + highlightOption(nextHighlight); + } + }; +} + +// node_modules/@cloudscape-design/components/select/utils/use-load-items.js +var import_react84 = __toESM(require_react()); +var useLoadItems = ({ onLoadItems, options, statusType }) => { + const prevFilteringText = (0, import_react84.useRef)(void 0); + const fireLoadItems = (filteringText) => { + if (prevFilteringText.current === filteringText) { + return; + } + prevFilteringText.current = filteringText; + fireNonCancelableEvent(onLoadItems, { filteringText, firstPage: true, samePage: false }); + }; + const handleLoadMore = () => { + const firstPage = options.length === 0; + statusType === "pending" && fireNonCancelableEvent(onLoadItems, { + firstPage, + samePage: false, + filteringText: prevFilteringText.current || "" + }); + }; + const handleRecoveryClick = () => fireNonCancelableEvent(onLoadItems, { + firstPage: false, + samePage: true, + filteringText: prevFilteringText.current || "" + }); + return { + fireLoadItems, + handleLoadMore, + handleRecoveryClick + }; +}; + +// node_modules/@cloudscape-design/components/select/utils/use-announcement.js +var import_react85 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/internal/components/option/option-announcer.js +function defaultOptionDescription(option, parentGroup) { + return [ + parentGroup && parentGroup.label, + option.__labelPrefix, + option.label || option.value, + option.description, + option.labelTag + ].concat(option.tags).filter((el) => !!el).join(" "); +} +var option_announcer_default = defaultOptionDescription; + +// node_modules/@cloudscape-design/components/select/utils/use-announcement.js +function useAnnouncement({ announceSelected, highlightedOption, getParent, selectedAriaLabel, renderHighlightedAriaLive }) { + const prevAnnouncedGroup = (0, import_react85.useRef)(void 0); + (0, import_react85.useEffect)(() => { + if (highlightedOption) { + const frameId = requestAnimationFrame(() => { + prevAnnouncedGroup.current = getParent(highlightedOption); + }); + return () => cancelAnimationFrame(frameId); + } + }); + if (!highlightedOption) { + return ""; + } + const option = highlightedOption.option; + const parent = getParent(highlightedOption); + const group = parent && parent !== prevAnnouncedGroup.current ? parent : void 0; + if (renderHighlightedAriaLive) { + return renderHighlightedAriaLive(option, group); + } + const selectedAnnouncement = announceSelected && selectedAriaLabel ? selectedAriaLabel : ""; + const defaultDescription = option_announcer_default(option, group); + return [selectedAnnouncement, defaultDescription].filter(Boolean).join(" "); +} + +// node_modules/@cloudscape-design/components/select/parts/plain-list.js +var import_react93 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/select/utils/render-options.js +var import_react92 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/select/parts/item.js +var import_react90 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/select/parts/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/select/parts/styles.scoped.css"; +var styles_css_default30 = { + "placeholder": "awsui_placeholder_dwuol_18z0d_99", + "item": "awsui_item_dwuol_18z0d_104", + "checkbox": "awsui_checkbox_dwuol_18z0d_108", + "filter": "awsui_filter_dwuol_18z0d_117", + "trigger": "awsui_trigger_dwuol_18z0d_122", + "layout-strut": "awsui_layout-strut_dwuol_18z0d_128", + "list-bottom": "awsui_list-bottom_dwuol_18z0d_134", + "selected-icon": "awsui_selected-icon_dwuol_18z0d_138", + "show-label-tag": "awsui_show-label-tag_dwuol_18z0d_142", + "inline-token-trigger": "awsui_inline-token-trigger_dwuol_18z0d_146", + "inline-token-list": "awsui_inline-token-list_dwuol_18z0d_153", + "inline-token": "awsui_inline-token_dwuol_18z0d_146", + "visual-refresh": "awsui_visual-refresh_dwuol_18z0d_182", + "inline-token-hidden-placeholder": "awsui_inline-token-hidden-placeholder_dwuol_18z0d_189", + "inline-token-counter": "awsui_inline-token-counter_dwuol_18z0d_195", + "inline-token-trigger--disabled": "awsui_inline-token-trigger--disabled_dwuol_18z0d_199" +}; + +// node_modules/@cloudscape-design/components/internal/components/option/index.js +var import_react88 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/internal/components/option/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/internal/components/option/styles.scoped.css"; +var styles_css_default31 = { + "option": "awsui_option_1p2cx_cx2ic_103", + "disabled": "awsui_disabled_1p2cx_cx2ic_143", + "parent": "awsui_parent_1p2cx_cx2ic_146", + "highlighted": "awsui_highlighted_1p2cx_cx2ic_149", + "content": "awsui_content_1p2cx_cx2ic_153", + "label-content": "awsui_label-content_1p2cx_cx2ic_160", + "label": "awsui_label_1p2cx_cx2ic_160", + "tag": "awsui_tag_1p2cx_cx2ic_167", + "label-tag": "awsui_label-tag_1p2cx_cx2ic_168", + "label-prefix": "awsui_label-prefix_1p2cx_cx2ic_178", + "tags": "awsui_tags_1p2cx_cx2ic_191", + "description": "awsui_description_1p2cx_cx2ic_192", + "selected": "awsui_selected_1p2cx_cx2ic_203", + "icon": "awsui_icon_1p2cx_cx2ic_217", + "icon-size-big": "awsui_icon-size-big_1p2cx_cx2ic_224", + "filtering-match-highlight": "awsui_filtering-match-highlight_1p2cx_cx2ic_228", + "trigger-variant": "awsui_trigger-variant_1p2cx_cx2ic_243" +}; + +// node_modules/@cloudscape-design/components/internal/components/option/option-parts.js +var import_react87 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/internal/components/option/highlight-match.js +var import_react86 = __toESM(require_react()); +var splitOnFiltering = (str, highlightText) => { + if (highlightText.length > 1e5) { + return { noMatches: [str], matches: null }; + } + const filteringPattern = highlightText.replace(/[-[\]/{}()*+?.\\^$|]/g, "\\$&"); + const regexp = new RegExp(filteringPattern, "gi"); + const noMatches = str.split(regexp); + const matches = str.match(regexp); + return { noMatches, matches }; +}; +var Highlight = ({ str }) => str ? import_react86.default.createElement("span", { className: clsx_m_default(styles_css_default31["filtering-match-highlight"]) }, str) : null; +function HighlightMatch({ str, highlightText }) { + if (!str || !highlightText) { + return import_react86.default.createElement("span", null, str); + } + if (str === highlightText) { + return import_react86.default.createElement(Highlight, { str }); + } + const { noMatches, matches } = splitOnFiltering(str, highlightText); + const highlighted = []; + noMatches.forEach((noMatch, idx) => { + highlighted.push(import_react86.default.createElement("span", { key: `noMatch-${idx}` }, noMatch)); + if (matches && idx < matches.length) { + highlighted.push(import_react86.default.createElement(Highlight, { key: `match-${idx}`, str: matches[idx] })); + } + }); + return import_react86.default.createElement("span", null, highlighted); +} + +// node_modules/@cloudscape-design/components/internal/components/option/option-parts.js +var Label = ({ label, prefix, highlightText, triggerVariant }) => import_react87.default.createElement( + "span", + { className: clsx_m_default(styles_css_default31.label, triggerVariant && styles_css_default31["trigger-variant"]) }, + prefix && import_react87.default.createElement( + "span", + { className: clsx_m_default(styles_css_default31["label-prefix"], triggerVariant && styles_css_default31["trigger-variant"]) }, + prefix, + " " + ), + import_react87.default.createElement(HighlightMatch, { str: label, highlightText }) +); +var LabelTag = ({ labelTag, highlightText, triggerVariant }) => labelTag ? import_react87.default.createElement( + "span", + { className: clsx_m_default(styles_css_default31["label-tag"], triggerVariant && styles_css_default31["trigger-variant"]) }, + import_react87.default.createElement(HighlightMatch, { str: labelTag, highlightText }) +) : null; +var Description2 = ({ description, highlightedOption, highlightText, selectedOption, triggerVariant }) => description ? import_react87.default.createElement( + "span", + { className: clsx_m_default(styles_css_default31.description, { + [styles_css_default31["trigger-variant"]]: triggerVariant, + [styles_css_default31.highlighted]: highlightedOption, + [styles_css_default31.selected]: selectedOption + }) }, + import_react87.default.createElement(HighlightMatch, { str: description, highlightText }) +) : null; +var Tags = ({ tags, highlightedOption, highlightText, selectedOption, triggerVariant }) => tags ? import_react87.default.createElement("span", { className: clsx_m_default(styles_css_default31.tags, { + [styles_css_default31.highlighted]: highlightedOption, + [styles_css_default31.selected]: selectedOption +}) }, tags.map((tag, idx) => import_react87.default.createElement( + "span", + { key: idx, className: clsx_m_default(styles_css_default31.tag, triggerVariant && styles_css_default31["trigger-variant"]) }, + import_react87.default.createElement(HighlightMatch, { str: tag, highlightText }) +))) : null; +var FilteringTags = ({ filteringTags, highlightedOption, highlightText, selectedOption, triggerVariant }) => { + if (!highlightText || !filteringTags) { + return null; + } + const searchElement = highlightText.toLowerCase(); + return import_react87.default.createElement("span", { className: clsx_m_default(styles_css_default31.tags, { + [styles_css_default31.highlighted]: highlightedOption, + [styles_css_default31.selected]: selectedOption + }) }, filteringTags.map((filteringTag, key) => { + const match = filteringTag.toLowerCase().indexOf(searchElement) !== -1; + if (match) { + return import_react87.default.createElement( + "span", + { className: clsx_m_default(styles_css_default31.tag, triggerVariant && styles_css_default31["trigger-variant"]), key, "aria-disabled": true }, + import_react87.default.createElement(HighlightMatch, { str: filteringTag, highlightText }) + ); + } + return null; + })); +}; +var OptionIcon = (props2) => { + if (!props2.name && !props2.url && !props2.svg) { + return null; + } + return import_react87.default.createElement( + "span", + { className: clsx_m_default(styles_css_default31.icon, props2.size === "big" && [styles_css_default31[`icon-size-big`]]) }, + import_react87.default.createElement(internal_default, Object.assign({}, props2)) + ); +}; + +// node_modules/@cloudscape-design/components/internal/components/option/index.js +function validateStringValue(value, propertyName) { + if (typeof value !== "undefined" && typeof value !== "string") { + warnOnce("DropdownOption", `This component only supports string values, but "option.${propertyName}" has ${typeof value} type. The component may work incorrectly.`); + } +} +var Option = (_a) => { + var _b, _c, _d, _e; + var { option, highlightText, triggerVariant = false, isGroupOption = false, isGenericGroup = true, highlightedOption = false, selectedOption = false } = _a, restProps = __rest(_a, ["option", "highlightText", "triggerVariant", "isGroupOption", "isGenericGroup", "highlightedOption", "selectedOption"]); + if (!option) { + return null; + } + const { disabled } = option; + const baseProps = getBaseProps(restProps); + if (isDevelopment) { + validateStringValue(option.label, "label"); + validateStringValue(option.description, "description"); + validateStringValue(option.labelTag, "labelTag"); + (_b = option.tags) === null || _b === void 0 ? void 0 : _b.forEach((tag, index) => { + validateStringValue(tag, `tags[${index}]`); + }); + (_c = option.filteringTags) === null || _c === void 0 ? void 0 : _c.forEach((tag, index) => { + validateStringValue(tag, `filteringTags[${index}]`); + }); + } + const className = clsx_m_default(styles_css_default31.option, disabled && styles_css_default31.disabled, isGroupOption && styles_css_default31.parent, highlightedOption && styles_css_default31.highlighted); + const icon = option.__customIcon || import_react88.default.createElement(OptionIcon, { name: option.iconName, url: option.iconUrl, svg: option.iconSvg, alt: option.iconAlt, size: option.description || option.tags ? "big" : "normal" }); + const genericGroupProps = isGenericGroup ? { + title: (_d = option.label) !== null && _d !== void 0 ? _d : option.value, + "aria-disabled": disabled + } : void 0; + return import_react88.default.createElement( + "span", + Object.assign({ "data-value": option.value, className, lang: option.lang }, genericGroupProps, baseProps), + icon, + import_react88.default.createElement( + "span", + { className: clsx_m_default(styles_css_default31.content) }, + import_react88.default.createElement( + "span", + { className: clsx_m_default(styles_css_default31["label-content"]) }, + import_react88.default.createElement(Label, { label: (_e = option.label) !== null && _e !== void 0 ? _e : option.value, prefix: option.__labelPrefix, highlightText, triggerVariant }), + import_react88.default.createElement(LabelTag, { labelTag: option.labelTag, highlightText, triggerVariant }) + ), + import_react88.default.createElement(Description2, { description: option.description, highlightedOption, selectedOption, highlightText, triggerVariant }), + import_react88.default.createElement(Tags, { tags: option.tags, highlightedOption, selectedOption, highlightText, triggerVariant }), + import_react88.default.createElement(FilteringTags, { filteringTags: option.filteringTags, highlightedOption, selectedOption, highlightText, triggerVariant }) + ) + ); +}; +var option_default = Option; + +// node_modules/@cloudscape-design/components/internal/components/selectable-item/index.js +var import_react89 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/internal/components/selectable-item/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/internal/components/selectable-item/styles.scoped.css"; +var styles_css_default32 = { + "selectable-item": "awsui_selectable-item_15o6u_1qv14_99", + "pad-bottom": "awsui_pad-bottom_15o6u_1qv14_123", + "has-background": "awsui_has-background_15o6u_1qv14_132", + "highlighted": "awsui_highlighted_15o6u_1qv14_135", + "selected": "awsui_selected_15o6u_1qv14_135", + "disabled": "awsui_disabled_15o6u_1qv14_153", + "next-item-selected": "awsui_next-item-selected_15o6u_1qv14_163", + "is-keyboard": "awsui_is-keyboard_15o6u_1qv14_175", + "parent": "awsui_parent_15o6u_1qv14_179", + "interactiveGroups": "awsui_interactiveGroups_15o6u_1qv14_183", + "child": "awsui_child_15o6u_1qv14_201", + "virtual": "awsui_virtual_15o6u_1qv14_216", + "measure-strut": "awsui_measure-strut_15o6u_1qv14_227", + "measure-strut-first": "awsui_measure-strut-first_15o6u_1qv14_236", + "screenreader-content": "awsui_screenreader-content_15o6u_1qv14_240", + "option-content": "awsui_option-content_15o6u_1qv14_246" +}; + +// node_modules/@cloudscape-design/components/internal/components/selectable-item/index.js +var SelectableItem = (_a, ref) => { + var { children: content, ariaSelected, ariaChecked, selected, highlighted, disabled, hasBackground, isParent, isChild, virtualPosition, padBottom, isNextSelected, useInteractiveGroups, screenReaderContent, ariaPosinset, ariaSetsize, highlightType } = _a, restProps = __rest(_a, ["children", "ariaSelected", "ariaChecked", "selected", "highlighted", "disabled", "hasBackground", "isParent", "isChild", "virtualPosition", "padBottom", "isNextSelected", "useInteractiveGroups", "screenReaderContent", "ariaPosinset", "ariaSetsize", "highlightType"]); + const _b = getBaseProps(restProps), { className } = _b, rest = __rest(_b, ["className"]); + const classNames = clsx_m_default(className, styles_css_default32["selectable-item"], { + [styles_css_default32.selected]: selected, + [styles_css_default32.highlighted]: highlighted, + [styles_css_default32["has-background"]]: hasBackground, + [styles_css_default32.parent]: isParent, + [styles_css_default32.child]: isChild, + [styles_css_default32["is-keyboard"]]: highlightType === "keyboard", + [styles_css_default32.disabled]: disabled, + [styles_css_default32.virtual]: virtualPosition !== void 0, + [styles_css_default32["pad-bottom"]]: padBottom, + [styles_css_default32["next-item-selected"]]: isNextSelected, + [styles_css_default32.interactiveGroups]: useInteractiveGroups + }); + const contentRef = (0, import_react89.useRef)(null); + const screenReaderContentRef = (0, import_react89.useRef)(null); + (0, import_react89.useLayoutEffect)(() => { + if (highlighted && screenReaderContent) { + if (contentRef.current) { + contentRef.current.setAttribute("aria-hidden", "true"); + } + if (screenReaderContentRef.current) { + screenReaderContentRef.current.textContent = screenReaderContent; + } + } + }, [highlighted, screenReaderContent, contentRef, screenReaderContentRef]); + const style = virtualPosition !== void 0 ? { + transform: `translateY(${virtualPosition}px)` + } : void 0; + const a11yProperties = { + "aria-disabled": disabled + }; + if (isParent && !useInteractiveGroups) { + a11yProperties["aria-hidden"] = true; + } + if (ariaSelected !== void 0) { + a11yProperties["aria-selected"] = ariaSelected; + } + if (ariaChecked !== void 0) { + a11yProperties["aria-checked"] = ariaChecked; + } + if (ariaPosinset && ariaSetsize) { + a11yProperties["aria-posinset"] = ariaPosinset; + a11yProperties["aria-setsize"] = ariaSetsize; + } + return import_react89.default.createElement( + "li", + Object.assign({ role: "option", className: classNames, style }, a11yProperties, rest), + import_react89.default.createElement("div", { className: styles_css_default32["option-content"], ref: contentRef }, content), + import_react89.default.createElement("div", { className: styles_css_default32["measure-strut"], ref }), + import_react89.default.createElement("div", { className: styles_css_default32["screenreader-content"], ref: screenReaderContentRef }) + ); +}; +var selectable_item_default = import_react89.default.forwardRef(SelectableItem); + +// node_modules/@cloudscape-design/components/select/parts/item.js +var Item = (_a, ref) => { + var { option, highlighted, selected, filteringValue, hasCheckbox, virtualPosition, padBottom, isNextSelected, screenReaderContent, ariaPosinset, ariaSetsize, highlightType } = _a, restProps = __rest(_a, ["option", "highlighted", "selected", "filteringValue", "hasCheckbox", "virtualPosition", "padBottom", "isNextSelected", "screenReaderContent", "ariaPosinset", "ariaSetsize", "highlightType"]); + const baseProps = getBaseProps(restProps); + const isParent = option.type === "parent"; + const isChild = option.type === "child"; + const wrappedOption = option.option; + const disabled = option.disabled || wrappedOption.disabled; + return import_react90.default.createElement( + selectable_item_default, + Object.assign({ ariaSelected: Boolean(selected), selected, isNextSelected, highlighted, disabled: option.disabled, isParent, isChild, ref, virtualPosition, padBottom, screenReaderContent, ariaPosinset, ariaSetsize, highlightType }, baseProps), + import_react90.default.createElement( + "div", + { className: clsx_m_default(styles_css_default30.item, !isParent && wrappedOption.labelTag && styles_css_default30["show-label-tag"]) }, + hasCheckbox && !isParent && import_react90.default.createElement( + "div", + { className: styles_css_default30.checkbox }, + import_react90.default.createElement(checkbox_icon_default, { checked: selected || false, disabled: option.disabled }) + ), + isParent ? import_react90.default.createElement("span", null, wrappedOption.label || wrappedOption.value) : import_react90.default.createElement(option_default, { option: Object.assign(Object.assign({}, wrappedOption), { disabled }), highlightedOption: highlighted, selectedOption: selected, highlightText: filteringValue }), + !hasCheckbox && !isParent && selected && import_react90.default.createElement( + "div", + { className: styles_css_default30["selected-icon"] }, + import_react90.default.createElement(internal_default, { name: "check" }) + ) + ) + ); +}; +var item_default = import_react90.default.memo(import_react90.default.forwardRef(Item)); + +// node_modules/@cloudscape-design/components/select/parts/multiselect-item.js +var import_react91 = __toESM(require_react()); +var MultiSelectItem = (_a, ref) => { + var { option, highlighted, selected, filteringValue, hasCheckbox, virtualPosition, padBottom, isNextSelected, indeterminate, screenReaderContent, ariaPosinset, ariaSetsize, highlightType } = _a, restProps = __rest(_a, ["option", "highlighted", "selected", "filteringValue", "hasCheckbox", "virtualPosition", "padBottom", "isNextSelected", "indeterminate", "screenReaderContent", "ariaPosinset", "ariaSetsize", "highlightType"]); + const baseProps = getBaseProps(restProps); + const isParent = option.type === "parent"; + const isChild = option.type === "child"; + const wrappedOption = option.option; + const disabled = option.disabled || wrappedOption.disabled; + const className = clsx_m_default(styles_css_default30.item, { + [styles_css_default30.disabled]: disabled + }); + return import_react91.default.createElement( + selectable_item_default, + Object.assign({ ariaChecked: isParent && indeterminate ? "mixed" : Boolean(selected), selected, isNextSelected, highlighted, disabled, isParent, isChild, highlightType, ref, virtualPosition, padBottom, useInteractiveGroups: true, screenReaderContent, ariaPosinset, ariaSetsize }, baseProps), + import_react91.default.createElement( + "div", + { className }, + hasCheckbox && import_react91.default.createElement( + "div", + { className: styles_css_default30.checkbox }, + import_react91.default.createElement(checkbox_icon_default, { checked: selected, indeterminate: isParent && indeterminate, disabled: option.disabled }) + ), + import_react91.default.createElement(option_default, { option: Object.assign(Object.assign({}, wrappedOption), { disabled }), highlightedOption: highlighted, selectedOption: selected, highlightText: filteringValue, isGroupOption: isParent }) + ) + ); +}; +var multiselect_item_default = import_react91.default.memo(import_react91.default.forwardRef(MultiSelectItem)); + +// node_modules/@cloudscape-design/components/select/utils/get-item-props.js +var getItemProps = ({ option, index, getOptionProps: getOptionProps2, filteringValue, checkboxes = false }) => { + const optionProps = getOptionProps2(option, index); + optionProps.filteringValue = filteringValue; + const { inGroupIndex, groupIndex, throughIndex } = getTestOptionIndexes(option) || {}; + return Object.assign(Object.assign({}, optionProps), { hasCheckbox: checkboxes, ["data-group-index"]: groupIndex, ["data-child-index"]: inGroupIndex, ["data-test-index"]: throughIndex }); +}; + +// node_modules/@cloudscape-design/components/select/utils/render-options.js +var renderOptions = ({ options, getOptionProps: getOptionProps2, filteringValue, highlightType, checkboxes = false, hasDropdownStatus, virtualItems, useInteractiveGroups, screenReaderContent, ariaSetsize }) => { + return options.map((option, index) => { + const virtualItem = virtualItems && virtualItems[index]; + const globalIndex = virtualItem ? virtualItem.index : index; + const props2 = getItemProps({ + option, + index: globalIndex, + getOptionProps: getOptionProps2, + filteringValue, + checkboxes + }); + const isLastItem = index === options.length - 1; + const padBottom = !hasDropdownStatus && isLastItem; + const ListItem2 = useInteractiveGroups ? multiselect_item_default : item_default; + return import_react92.default.createElement(ListItem2, Object.assign({ key: globalIndex }, props2, { virtualPosition: virtualItem && virtualItem.start, ref: virtualItem && virtualItem.measureRef, padBottom, screenReaderContent, ariaPosinset: globalIndex + 1, ariaSetsize, highlightType: highlightType.type })); + }); +}; + +// node_modules/@cloudscape-design/components/select/parts/plain-list.js +var PlainList = ({ menuProps, getOptionProps: getOptionProps2, filteredOptions, filteringValue, highlightType, checkboxes, hasDropdownStatus, listBottom, useInteractiveGroups, screenReaderContent }, ref) => { + const menuRef = menuProps.ref; + (0, import_react93.useImperativeHandle)(ref, () => (index) => { + var _a; + const item = (_a = menuRef.current) === null || _a === void 0 ? void 0 : _a.querySelector(`[data-mouse-target="${index}"]`); + if (highlightType.moveFocus && item) { + scrollElementIntoView(item); + } + }, [highlightType, menuRef]); + return import_react93.default.createElement( + options_list_default, + Object.assign({}, menuProps), + renderOptions({ + options: filteredOptions, + getOptionProps: getOptionProps2, + filteringValue, + highlightType, + checkboxes, + hasDropdownStatus, + useInteractiveGroups, + screenReaderContent + }), + listBottom ? import_react93.default.createElement("li", { role: "option", className: styles_css_default30["list-bottom"] }, listBottom) : null + ); +}; +var plain_list_default = (0, import_react93.forwardRef)(PlainList); + +// node_modules/@cloudscape-design/components/select/parts/virtual-list.js +var import_react96 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/internal/hooks/use-virtual/index.js +var import_react95 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/internal/vendor/react-virtual.js +var import_react94 = __toESM(require_react()); +function _extends2() { + _extends2 = Object.assign || function(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + return target; + }; + return _extends2.apply(this, arguments); +} +function _objectWithoutPropertiesLoose2(source, excluded) { + if (source == null) return {}; + var target = {}; + var sourceKeys = Object.keys(source); + var key, i; + for (i = 0; i < sourceKeys.length; i++) { + key = sourceKeys[i]; + if (excluded.indexOf(key) >= 0) continue; + target[key] = source[key]; + } + return target; +} +var props = ["bottom", "height", "left", "right", "top", "width"]; +var rectChanged = function rectChanged2(a2, b) { + if (a2 === void 0) { + a2 = {}; + } + if (b === void 0) { + b = {}; + } + return props.some(function(prop) { + return a2[prop] !== b[prop]; + }); +}; +var observedNodes = /* @__PURE__ */ new Map(); +var rafId; +var run = function run2() { + var changedStates = []; + observedNodes.forEach(function(state, node) { + var newRect = node.getBoundingClientRect(); + if (rectChanged(newRect, state.rect)) { + state.rect = newRect; + changedStates.push(state); + } + }); + changedStates.forEach(function(state) { + state.callbacks.forEach(function(cb) { + return cb(state.rect); + }); + }); + rafId = window.requestAnimationFrame(run2); +}; +function observeRect(node, cb) { + return { + observe: function observe() { + var wasEmpty = observedNodes.size === 0; + if (observedNodes.has(node)) { + observedNodes.get(node).callbacks.push(cb); + } else { + observedNodes.set(node, { + rect: void 0, + hasRectChanged: false, + callbacks: [cb] + }); + } + if (wasEmpty) run(); + }, + unobserve: function unobserve() { + var state = observedNodes.get(node); + if (state) { + var index = state.callbacks.indexOf(cb); + if (index >= 0) state.callbacks.splice(index, 1); + if (!state.callbacks.length) observedNodes["delete"](node); + if (!observedNodes.size) cancelAnimationFrame(rafId); + } + } + }; +} +var useIsomorphicLayoutEffect = typeof window !== "undefined" ? import_react94.default.useLayoutEffect : import_react94.default.useEffect; +function useRect(nodeRef, initialRect) { + if (initialRect === void 0) { + initialRect = { + width: 0, + height: 0 + }; + } + var _React$useState = import_react94.default.useState(nodeRef.current), element = _React$useState[0], setElement = _React$useState[1]; + var _React$useReducer = import_react94.default.useReducer(rectReducer, initialRect), rect = _React$useReducer[0], dispatch = _React$useReducer[1]; + var initialRectSet = import_react94.default.useRef(false); + useIsomorphicLayoutEffect(function() { + if (nodeRef.current !== element) { + setElement(nodeRef.current); + } + }); + useIsomorphicLayoutEffect(function() { + if (element && !initialRectSet.current) { + initialRectSet.current = true; + var _rect = element.getBoundingClientRect(); + dispatch({ + rect: _rect + }); + } + }, [element]); + import_react94.default.useEffect(function() { + if (!element) { + return; + } + var observer = observeRect(element, function(rect2) { + dispatch({ + rect: rect2 + }); + }); + observer.observe(); + return function() { + observer.unobserve(); + }; + }, [element]); + return rect; +} +function rectReducer(state, action) { + var rect = action.rect; + if (state.height !== rect.height || state.width !== rect.width) { + return rect; + } + return state; +} +var defaultEstimateSize = function defaultEstimateSize2() { + return 50; +}; +var defaultKeyExtractor = function defaultKeyExtractor2(index) { + return index; +}; +var defaultMeasureSize = function defaultMeasureSize2(el, horizontal) { + var key = horizontal ? "offsetWidth" : "offsetHeight"; + return el[key]; +}; +var defaultRangeExtractor = function defaultRangeExtractor2(range2) { + var start = Math.max(range2.start - range2.overscan, 0); + var end = Math.min(range2.end + range2.overscan, range2.size - 1); + var arr = []; + for (var i = start; i <= end; i++) { + arr.push(i); + } + return arr; +}; +function useVirtual(_ref) { + var _measurements; + var _ref$size = _ref.size, size = _ref$size === void 0 ? 0 : _ref$size, _ref$estimateSize = _ref.estimateSize, estimateSize = _ref$estimateSize === void 0 ? defaultEstimateSize : _ref$estimateSize, _ref$overscan = _ref.overscan, overscan = _ref$overscan === void 0 ? 1 : _ref$overscan, _ref$paddingStart = _ref.paddingStart, paddingStart = _ref$paddingStart === void 0 ? 0 : _ref$paddingStart, _ref$paddingEnd = _ref.paddingEnd, paddingEnd = _ref$paddingEnd === void 0 ? 0 : _ref$paddingEnd, parentRef = _ref.parentRef, horizontal = _ref.horizontal, scrollToFn = _ref.scrollToFn, useObserver = _ref.useObserver, initialRect = _ref.initialRect, onScrollElement = _ref.onScrollElement, scrollOffsetFn = _ref.scrollOffsetFn, _ref$keyExtractor = _ref.keyExtractor, keyExtractor = _ref$keyExtractor === void 0 ? defaultKeyExtractor : _ref$keyExtractor, _ref$measureSize = _ref.measureSize, measureSize = _ref$measureSize === void 0 ? defaultMeasureSize : _ref$measureSize, _ref$rangeExtractor = _ref.rangeExtractor, rangeExtractor = _ref$rangeExtractor === void 0 ? defaultRangeExtractor : _ref$rangeExtractor; + var sizeKey = horizontal ? "width" : "height"; + var scrollKey = horizontal ? "scrollLeft" : "scrollTop"; + var latestRef = import_react94.default.useRef({ + scrollOffset: 0, + measurements: [] + }); + var _React$useState = import_react94.default.useState(0), scrollOffset = _React$useState[0], setScrollOffset = _React$useState[1]; + latestRef.current.scrollOffset = scrollOffset; + var useMeasureParent = useObserver || useRect; + var _useMeasureParent = useMeasureParent(parentRef, initialRect), outerSize = _useMeasureParent[sizeKey]; + latestRef.current.outerSize = outerSize; + var defaultScrollToFn = import_react94.default.useCallback(function(offset) { + if (parentRef.current) { + parentRef.current[scrollKey] = offset; + } + }, [parentRef, scrollKey]); + var resolvedScrollToFn = scrollToFn || defaultScrollToFn; + scrollToFn = import_react94.default.useCallback(function(offset) { + resolvedScrollToFn(offset, defaultScrollToFn); + }, [defaultScrollToFn, resolvedScrollToFn]); + var _React$useState2 = import_react94.default.useState({}), measuredCache = _React$useState2[0], setMeasuredCache = _React$useState2[1]; + var measure = import_react94.default.useCallback(function() { + return setMeasuredCache({}); + }, []); + var pendingMeasuredCacheIndexesRef = import_react94.default.useRef([]); + var measurements = import_react94.default.useMemo(function() { + var min3 = pendingMeasuredCacheIndexesRef.current.length > 0 ? Math.min.apply(Math, pendingMeasuredCacheIndexesRef.current) : 0; + pendingMeasuredCacheIndexesRef.current = []; + var measurements2 = latestRef.current.measurements.slice(0, min3); + for (var i = min3; i < size; i++) { + var key = keyExtractor(i); + var measuredSize = measuredCache[key]; + var _start = measurements2[i - 1] ? measurements2[i - 1].end : paddingStart; + var _size = typeof measuredSize === "number" ? measuredSize : estimateSize(i); + var _end = _start + _size; + measurements2[i] = { + index: i, + start: _start, + size: _size, + end: _end, + key + }; + } + return measurements2; + }, [estimateSize, measuredCache, paddingStart, size, keyExtractor]); + var totalSize = (((_measurements = measurements[size - 1]) == null ? void 0 : _measurements.end) || paddingStart) + paddingEnd; + latestRef.current.measurements = measurements; + latestRef.current.totalSize = totalSize; + var element = onScrollElement ? onScrollElement.current : parentRef.current; + var scrollOffsetFnRef = import_react94.default.useRef(scrollOffsetFn); + scrollOffsetFnRef.current = scrollOffsetFn; + useIsomorphicLayoutEffect(function() { + if (!element) { + setScrollOffset(0); + return; + } + var onScroll = function onScroll2(event) { + var offset = scrollOffsetFnRef.current ? scrollOffsetFnRef.current(event) : element[scrollKey]; + setScrollOffset(offset); + }; + onScroll(); + element.addEventListener("scroll", onScroll, { + capture: false, + passive: true + }); + return function() { + element.removeEventListener("scroll", onScroll); + }; + }, [element, scrollKey]); + var _calculateRange = calculateRange(latestRef.current), start = _calculateRange.start, end = _calculateRange.end; + var indexes = import_react94.default.useMemo(function() { + return rangeExtractor({ + start, + end, + overscan, + size: measurements.length + }); + }, [start, end, overscan, measurements.length, rangeExtractor]); + var measureSizeRef = import_react94.default.useRef(measureSize); + measureSizeRef.current = measureSize; + var virtualItems = import_react94.default.useMemo(function() { + var virtualItems2 = []; + var _loop = function _loop2(k3, len2) { + var i = indexes[k3]; + var measurement = measurements[i]; + var item = _extends2(_extends2({}, measurement), {}, { + measureRef: function measureRef(el) { + if (el) { + var measuredSize = measureSizeRef.current(el, horizontal); + if (measuredSize !== item.size) { + var _scrollOffset = latestRef.current.scrollOffset; + if (item.start < _scrollOffset) { + defaultScrollToFn(_scrollOffset + (measuredSize - item.size)); + } + pendingMeasuredCacheIndexesRef.current.push(i); + setMeasuredCache(function(old) { + var _extends22; + return _extends2(_extends2({}, old), {}, (_extends22 = {}, _extends22[item.key] = measuredSize, _extends22)); + }); + } + } + } + }); + virtualItems2.push(item); + }; + for (var k2 = 0, len = indexes.length; k2 < len; k2++) { + _loop(k2); + } + return virtualItems2; + }, [indexes, defaultScrollToFn, horizontal, measurements]); + var mountedRef = import_react94.default.useRef(false); + useIsomorphicLayoutEffect(function() { + if (mountedRef.current) { + setMeasuredCache({}); + } + mountedRef.current = true; + }, [estimateSize]); + var scrollToOffset = import_react94.default.useCallback(function(toOffset, _temp) { + var _ref2 = _temp === void 0 ? {} : _temp, _ref2$align = _ref2.align, align = _ref2$align === void 0 ? "start" : _ref2$align; + var _latestRef$current = latestRef.current, scrollOffset2 = _latestRef$current.scrollOffset, outerSize2 = _latestRef$current.outerSize; + if (align === "auto") { + if (toOffset <= scrollOffset2) { + align = "start"; + } else if (toOffset >= scrollOffset2 + outerSize2) { + align = "end"; + } else { + align = "start"; + } + } + if (align === "start") { + scrollToFn(toOffset); + } else if (align === "end") { + scrollToFn(toOffset - outerSize2); + } else if (align === "center") { + scrollToFn(toOffset - outerSize2 / 2); + } + }, [scrollToFn]); + var tryScrollToIndex = import_react94.default.useCallback(function(index, _temp2) { + var _ref3 = _temp2 === void 0 ? {} : _temp2, _ref3$align = _ref3.align, align = _ref3$align === void 0 ? "auto" : _ref3$align, rest = _objectWithoutPropertiesLoose2(_ref3, ["align"]); + var _latestRef$current2 = latestRef.current, measurements2 = _latestRef$current2.measurements, scrollOffset2 = _latestRef$current2.scrollOffset, outerSize2 = _latestRef$current2.outerSize; + var measurement = measurements2[Math.max(0, Math.min(index, size - 1))]; + if (!measurement) { + return; + } + if (align === "auto") { + if (measurement.end >= scrollOffset2 + outerSize2) { + align = "end"; + } else if (measurement.start <= scrollOffset2) { + align = "start"; + } else { + return; + } + } + var toOffset = align === "center" ? measurement.start + measurement.size / 2 : align === "end" ? measurement.end : measurement.start; + scrollToOffset(toOffset, _extends2({ + align + }, rest)); + }, [scrollToOffset, size]); + var scrollToIndex = import_react94.default.useCallback(function() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + tryScrollToIndex.apply(void 0, args); + requestAnimationFrame(function() { + tryScrollToIndex.apply(void 0, args); + }); + }, [tryScrollToIndex]); + return { + virtualItems, + totalSize, + scrollToOffset, + scrollToIndex, + measure + }; +} +var findNearestBinarySearch = function findNearestBinarySearch2(low, high, getCurrentValue, value) { + while (low <= high) { + var middle = (low + high) / 2 | 0; + var currentValue = getCurrentValue(middle); + if (currentValue < value) { + low = middle + 1; + } else if (currentValue > value) { + high = middle - 1; + } else { + return middle; + } + } + if (low > 0) { + return low - 1; + } else { + return 0; + } +}; +function calculateRange(_ref4) { + var measurements = _ref4.measurements, outerSize = _ref4.outerSize, scrollOffset = _ref4.scrollOffset; + var size = measurements.length - 1; + var getOffset = function getOffset2(index) { + return measurements[index].start; + }; + var start = findNearestBinarySearch(0, size, getOffset, scrollOffset); + var end = start; + while (end < size && measurements[end].end < scrollOffset + outerSize) { + end++; + } + return { + start, + end + }; +} + +// node_modules/@cloudscape-design/components/internal/hooks/use-virtual/index.js +var MAX_ITEM_MOUNTS = 100; +function useVirtual2({ items, parentRef, estimateSize }) { + const rowVirtualizer = useVirtual({ size: items.length, parentRef, estimateSize, overscan: 5 }); + const measuresCache = (0, import_react95.useRef)(/* @__PURE__ */ new WeakMap()); + const indicesKey = rowVirtualizer.virtualItems.map((item) => `${item.index}`).join(":"); + (0, import_react95.useEffect)(() => { + measuresCache.current = /* @__PURE__ */ new WeakMap(); + }, [indicesKey, items, estimateSize]); + const virtualItems = (0, import_react95.useMemo)(() => rowVirtualizer.virtualItems.map((virtualItem) => Object.assign(Object.assign({}, virtualItem), { measureRef: (node) => { + var _a; + const mountedCount = (_a = measuresCache.current.get(items[virtualItem.index])) !== null && _a !== void 0 ? _a : 0; + if (mountedCount < MAX_ITEM_MOUNTS) { + virtualItem.measureRef(node); + measuresCache.current.set(items[virtualItem.index], mountedCount + 1); + } + } })), [items, rowVirtualizer.virtualItems]); + return { + virtualItems, + totalSize: rowVirtualizer.totalSize, + scrollToIndex: rowVirtualizer.scrollToIndex + }; +} + +// node_modules/@cloudscape-design/components/select/parts/virtual-list.js +var VirtualList = (props2, ref) => { + return props2.menuProps.open ? import_react96.default.createElement(VirtualListOpen, Object.assign({}, props2, { ref })) : import_react96.default.createElement(VirtualListClosed, Object.assign({}, props2, { ref })); +}; +var VirtualListOpen = (0, import_react96.forwardRef)(({ menuProps, getOptionProps: getOptionProps2, filteredOptions, filteringValue, highlightType, checkboxes, hasDropdownStatus, listBottom, useInteractiveGroups, screenReaderContent }, ref) => { + const [width, menuMeasureRef] = useContainerQuery((rect) => rect.contentBoxWidth, []); + const menuRefObject = (0, import_react96.useRef)(null); + const menuRef = useMergeRefs(menuMeasureRef, menuRefObject, menuProps.ref); + const { virtualItems, totalSize, scrollToIndex } = useVirtual2({ + items: filteredOptions, + parentRef: menuRefObject, + // estimateSize is a dependency of measurements memo. We update it to force full recalculation + // when the height of any option could have changed: + // 1: because the component got resized (width property got updated) + // 2: because the option changed its content (filteringValue property controls the highlight and the visibility of hidden tags) + // eslint-disable-next-line react-hooks/exhaustive-deps + estimateSize: (0, import_react96.useCallback)(() => 31, [width, filteringValue]) + }); + (0, import_react96.useImperativeHandle)(ref, () => (index) => { + if (highlightType.moveFocus) { + scrollToIndex(index); + } + }, [highlightType, scrollToIndex]); + const finalOptions = renderOptions({ + options: virtualItems.map(({ index }) => filteredOptions[index]), + getOptionProps: getOptionProps2, + filteringValue, + highlightType, + checkboxes, + hasDropdownStatus, + virtualItems, + useInteractiveGroups, + screenReaderContent, + ariaSetsize: filteredOptions.length + }); + return import_react96.default.createElement( + options_list_default, + Object.assign({}, menuProps, { ref: menuRef }), + import_react96.default.createElement("div", { "aria-hidden": "true", key: "total-size", className: styles_css_default30["layout-strut"], style: { height: totalSize } }), + finalOptions, + listBottom ? import_react96.default.createElement("li", { role: "option", className: styles_css_default30["list-bottom"] }, listBottom) : null + ); +}); +var VirtualListClosed = (0, import_react96.forwardRef)(({ menuProps, listBottom }, ref) => { + (0, import_react96.useImperativeHandle)(ref, () => () => { + }, []); + return import_react96.default.createElement(options_list_default, Object.assign({}, menuProps, { ref: menuProps.ref }), listBottom ? import_react96.default.createElement("li", { role: "option", className: styles_css_default30["list-bottom"] }, listBottom) : null); +}); +var virtual_list_default = (0, import_react96.forwardRef)(VirtualList); + +// node_modules/@cloudscape-design/components/select/utils/check-option-value-field.js +function checkOptionValueField(componentName2, propertyName, propertyValue) { + if (isDevelopment) { + if (!propertyValue) { + return; + } + const valuePropertyMissing = !propertyValue.every((element) => { + return "options" in element || "value" in element; + }); + if (valuePropertyMissing) { + warnOnce(componentName2, `You provided an \`${propertyName}\` prop where at least one non-group array element is missing the \`value\` field. This field is required for all options without sub-items.`); + } + } +} + +// node_modules/@cloudscape-design/components/select/parts/filter.js +var import_react97 = __toESM(require_react()); +var Filter = import_react97.default.forwardRef((_a, ref) => { + var { filteringType } = _a, filterProps = __rest(_a, ["filteringType"]); + if (filteringType === "none") { + return null; + } + return import_react97.default.createElement(internal_default4, Object.assign({ ref, type: "visualSearch", className: styles_css_default30.filter, autoComplete: false, disableBrowserAutocorrect: true, invalid: false, __noBorderRadius: true }, filterProps, { __nativeAttributes: Object.assign({ "aria-expanded": true, "aria-haspopup": true, role: "combobox", autoCorrect: "off", autoCapitalize: "off" }, filterProps.__nativeAttributes) })); +}); +var filter_default = Filter; + +// node_modules/@cloudscape-design/components/select/parts/trigger.js +var import_react99 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/internal/components/button-trigger/index.js +var import_react98 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/internal/components/button-trigger/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/internal/components/button-trigger/styles.scoped.css"; +var styles_css_default33 = { + "button-trigger": "awsui_button-trigger_18eso_syr88_103", + "arrow": "awsui_arrow_18eso_syr88_103", + "has-caret": "awsui_has-caret_18eso_syr88_170", + "placeholder": "awsui_placeholder_18eso_syr88_173", + "pressed": "awsui_pressed_18eso_syr88_186", + "disabled": "awsui_disabled_18eso_syr88_189", + "in-filtering-token": "awsui_in-filtering-token_18eso_syr88_199", + "read-only": "awsui_read-only_18eso_syr88_205", + "invalid": "awsui_invalid_18eso_syr88_227", + "inline-tokens": "awsui_inline-tokens_18eso_syr88_265" +}; + +// node_modules/@cloudscape-design/components/internal/components/button-trigger/index.js +var ButtonTrigger = (_a, ref) => { + var { children: children2, pressed = false, hideCaret = false, disabled = false, readOnly = false, invalid = false, inlineTokens, inFilteringToken, ariaHasPopup, ariaLabel, ariaLabelledby, ariaDescribedby, ariaControls, onKeyDown, onKeyUp, onMouseDown, onClick, onFocus, onBlur, autoFocus } = _a, restProps = __rest(_a, ["children", "pressed", "hideCaret", "disabled", "readOnly", "invalid", "inlineTokens", "inFilteringToken", "ariaHasPopup", "ariaLabel", "ariaLabelledby", "ariaDescribedby", "ariaControls", "onKeyDown", "onKeyUp", "onMouseDown", "onClick", "onFocus", "onBlur", "autoFocus"]); + const baseProps = getBaseProps(restProps); + const attributes = Object.assign(Object.assign({}, baseProps), { type: "button", className: clsx_m_default(styles_css_default33["button-trigger"], baseProps.className, pressed && styles_css_default33.pressed, disabled && styles_css_default33.disabled, invalid && styles_css_default33.invalid, !hideCaret && styles_css_default33["has-caret"], readOnly && styles_css_default33["read-only"], inFilteringToken && styles_css_default33["in-filtering-token"], inlineTokens && styles_css_default33["inline-tokens"]), disabled: disabled || readOnly, "aria-expanded": pressed, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, "aria-haspopup": ariaHasPopup !== null && ariaHasPopup !== void 0 ? ariaHasPopup : "listbox", "aria-controls": ariaControls, onKeyDown: onKeyDown && ((event) => fireKeyboardEvent(onKeyDown, event)), onKeyUp: onKeyUp && ((event) => fireKeyboardEvent(onKeyUp, event)), onMouseDown: onMouseDown && ((event) => fireCancelableEvent(onMouseDown, {}, event)), onClick: onClick && ((event) => fireCancelableEvent(onClick, {}, event)), onFocus: onFocus && ((event) => fireCancelableEvent(onFocus, {}, event)), onBlur: onBlur && ((event) => fireCancelableEvent(onBlur, { relatedTarget: event.relatedTarget }, event)), autoFocus }); + if (invalid) { + attributes["aria-invalid"] = invalid; + } + return import_react98.default.createElement( + "button", + Object.assign({ ref }, attributes), + children2, + !hideCaret && import_react98.default.createElement( + "span", + { className: styles_css_default33.arrow }, + import_react98.default.createElement(internal_default, { name: "caret-down-filled", variant: disabled ? "disabled" : "normal" }) + ) + ); +}; +var button_trigger_default = import_react98.default.forwardRef(ButtonTrigger); + +// node_modules/@cloudscape-design/components/select/parts/trigger.js +var Trigger = import_react99.default.forwardRef(({ ariaLabelledby, ariaDescribedby, controlId, invalid, triggerProps, selectedOption, selectedOptions, triggerVariant, inFilteringToken, isOpen, placeholder, disabled }, ref) => { + const isVisualRefresh = useVisualRefresh(); + const generatedId = useUniqueId(); + const id = controlId !== null && controlId !== void 0 ? controlId : generatedId; + const triggerContentId = useUniqueId("trigger-content-"); + let ariaLabelledbyIds = joinStrings(ariaLabelledby, triggerContentId); + let triggerContent = null; + if (triggerVariant === "tokens") { + if (selectedOptions === null || selectedOptions === void 0 ? void 0 : selectedOptions.length) { + triggerContent = import_react99.default.createElement( + "span", + { className: clsx_m_default(styles_css_default30["inline-token-trigger"], disabled && styles_css_default30["inline-token-trigger--disabled"], isVisualRefresh && styles_css_default30["visual-refresh"]) }, + import_react99.default.createElement("span", { className: styles_css_default30["inline-token-list"] }, selectedOptions.map(({ label }, i) => import_react99.default.createElement("span", { key: i, className: styles_css_default30["inline-token"] }, label))), + import_react99.default.createElement( + "span", + { className: styles_css_default30["inline-token-counter"], id: triggerContentId }, + import_react99.default.createElement("span", { className: styles_css_default30["inline-token-hidden-placeholder"] }, placeholder), + import_react99.default.createElement( + "span", + null, + "(", + selectedOptions.length, + ")" + ) + ) + ); + ariaLabelledbyIds = ariaLabelledby; + } else { + triggerContent = import_react99.default.createElement("span", { "aria-disabled": "true", className: clsx_m_default(styles_css_default30.placeholder, styles_css_default30.trigger), id: triggerContentId }, placeholder); + } + } else if (!selectedOption) { + triggerContent = import_react99.default.createElement("span", { "aria-disabled": "true", className: clsx_m_default(styles_css_default30.placeholder, styles_css_default30.trigger), id: triggerContentId }, placeholder); + } else if (triggerVariant === "option") { + triggerContent = import_react99.default.createElement(option_default, { id: triggerContentId, option: Object.assign(Object.assign({}, selectedOption), { disabled }), triggerVariant: true }); + } else { + triggerContent = import_react99.default.createElement("span", { id: triggerContentId, className: styles_css_default30.trigger }, selectedOption.label || selectedOption.value); + } + const mergedRef = useMergeRefs(triggerProps.ref, ref); + return import_react99.default.createElement(button_trigger_default, Object.assign({}, triggerProps, { id, ref: mergedRef, pressed: isOpen, disabled, invalid, inFilteringToken, inlineTokens: triggerVariant === "tokens", ariaDescribedby, ariaLabelledby: ariaLabelledbyIds }), triggerContent); +}); +var trigger_default = Trigger; + +// node_modules/@cloudscape-design/components/token-group/internal.js +var import_react100 = __toESM(require_react()); +function InternalTokenGroup(_a) { + var { alignment, items, onDismiss, limit, i18nStrings, disableOuterPadding, limitShowFewerAriaLabel, limitShowMoreAriaLabel, __internalRootRef } = _a, props2 = __rest(_a, ["alignment", "items", "onDismiss", "limit", "i18nStrings", "disableOuterPadding", "limitShowFewerAriaLabel", "limitShowMoreAriaLabel", "__internalRootRef"]); + checkControlled("TokenGroup", "items", items, "onDismiss", onDismiss); + const [removedItemIndex, setRemovedItemIndex] = (0, import_react100.useState)(null); + const baseProps = getBaseProps(props2); + const hasItems = items.length > 0; + return import_react100.default.createElement( + "div", + Object.assign({}, baseProps, { className: clsx_m_default(baseProps.className, styles_css_default.root, hasItems && styles_css_default["has-items"], disableOuterPadding && styles_css_default["no-padding"]), ref: __internalRootRef }), + import_react100.default.createElement(TokenList, { alignment, items, limit, renderItem: (item, itemIndex) => import_react100.default.createElement( + Token, + { ariaLabel: item.label, dismissLabel: item.dismissLabel, onDismiss: () => { + fireNonCancelableEvent(onDismiss, { itemIndex }); + setRemovedItemIndex(itemIndex); + }, disabled: item.disabled }, + import_react100.default.createElement(option_default, { option: item, isGenericGroup: false }) + ), i18nStrings, limitShowFewerAriaLabel, limitShowMoreAriaLabel, moveFocusNextToIndex: removedItemIndex, onExpandedClick: (isExpanded) => { + if (isExpanded && limit) { + setRemovedItemIndex(limit); + } else { + setRemovedItemIndex(null); + } + } }) + ); +} + +// node_modules/@cloudscape-design/components/multiselect/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/multiselect/styles.scoped.css"; +var styles_css_default34 = { + "root": "awsui_root_f8g6q_17z04_99", + "tokens": "awsui_tokens_f8g6q_17z04_134" +}; + +// node_modules/@cloudscape-design/components/multiselect/internal.js +var InternalMultiselect = import_react101.default.forwardRef((_a, externalRef) => { + var _b; + var { options = [], filteringType = "none", filteringPlaceholder, filteringAriaLabel, filteringClearAriaLabel, filteringResultsText, ariaRequired, placeholder, disabled, ariaLabel, statusType = "finished", empty, loadingText, finishedText, errorText, noMatch, renderHighlightedAriaLive, selectedOptions = [], deselectAriaLabel, keepOpen = true, tokenLimit, i18nStrings, onBlur, onFocus, onLoadItems, onChange, virtualScroll, inlineTokens = false, hideTokens = false, expandToViewport, tokenLimitShowFewerAriaLabel, tokenLimitShowMoreAriaLabel, __internalRootRef = null, autoFocus } = _a, restProps = __rest(_a, ["options", "filteringType", "filteringPlaceholder", "filteringAriaLabel", "filteringClearAriaLabel", "filteringResultsText", "ariaRequired", "placeholder", "disabled", "ariaLabel", "statusType", "empty", "loadingText", "finishedText", "errorText", "noMatch", "renderHighlightedAriaLive", "selectedOptions", "deselectAriaLabel", "keepOpen", "tokenLimit", "i18nStrings", "onBlur", "onFocus", "onLoadItems", "onChange", "virtualScroll", "inlineTokens", "hideTokens", "expandToViewport", "tokenLimitShowFewerAriaLabel", "tokenLimitShowMoreAriaLabel", "__internalRootRef", "autoFocus"]); + checkOptionValueField("Multiselect", "options", options); + const baseProps = getBaseProps(restProps); + const formFieldContext = useFormFieldContext(restProps); + const i18n = useInternalI18n("multiselect"); + const i18nCommon = useInternalI18n("select"); + const recoveryText = i18nCommon("recoveryText", restProps.recoveryText); + const errorIconAriaLabel = i18nCommon("errorIconAriaLabel", restProps.errorIconAriaLabel); + const selectedAriaLabel = i18nCommon("selectedAriaLabel", restProps.selectedAriaLabel); + if (restProps.recoveryText && !onLoadItems) { + warnOnce("Multiselect", "`onLoadItems` must be provided for `recoveryText` to be displayed."); + } + const { handleLoadMore, handleRecoveryClick, fireLoadItems } = useLoadItems({ + onLoadItems, + options, + statusType + }); + const useInteractiveGroups = true; + const [filteringValue, setFilteringValue] = (0, import_react101.useState)(""); + const { filteredOptions, parentMap, totalCount, matchesCount } = prepareOptions(options, filteringType, filteringValue); + const updateSelectedOption = (0, import_react101.useCallback)((option) => { + const filtered = filteredOptions.filter((item) => item.type !== "parent").map((item) => item.option); + const isAllChildrenSelected = (optionsArray) => optionsArray.every((item) => findOptionIndex(selectedOptions, item) > -1 || item.disabled); + const intersection = (visibleOptions, options2) => visibleOptions.filter((item) => findOptionIndex(options2, item) > -1 && !item.disabled); + const union = (visibleOptions, options2) => visibleOptions.filter((item) => findOptionIndex(options2, item) === -1).concat(options2); + const select = (options2, selectedOptions2) => { + return union(selectedOptions2, options2); + }; + const unselect = (options2, selectedOptions2) => { + return selectedOptions2.filter((option2) => findOptionIndex(options2, option2) === -1); + }; + let newSelectedOptions = [...selectedOptions]; + if (isGroup(option)) { + const visibleOptions = intersection([...option.options], filtered); + newSelectedOptions = isAllChildrenSelected(visibleOptions) ? unselect(visibleOptions, newSelectedOptions) : select(visibleOptions, newSelectedOptions); + } else { + newSelectedOptions = isAllChildrenSelected([option]) ? unselect([option], newSelectedOptions) : select([option], newSelectedOptions); + } + fireNonCancelableEvent(onChange, { + selectedOptions: newSelectedOptions + }); + }, [onChange, selectedOptions, filteredOptions]); + const rootRef = (0, import_react101.useRef)(null); + const selfControlId = useUniqueId("trigger"); + const controlId = (_b = formFieldContext.controlId) !== null && _b !== void 0 ? _b : selfControlId; + const multiSelectAriaLabelId = useUniqueId("multiselect-arialabel-"); + const footerId = useUniqueId("footer"); + const scrollToIndex = (0, import_react101.useRef)(null); + const { isOpen, highlightType, highlightedOption, highlightedIndex, getTriggerProps, getDropdownProps, getFilterProps, getMenuProps, getOptionProps: getOptionProps2, highlightOption, announceSelected } = useSelect({ + selectedOptions, + updateSelectedOption, + options: filteredOptions, + filteringType, + onFocus, + onBlur, + externalRef, + keepOpen, + fireLoadItems, + setFilteringValue, + useInteractiveGroups, + statusType + }); + const handleNativeSearch = useNativeSearch({ + isEnabled: filteringType === "none" && isOpen, + options: filteredOptions, + highlightOption, + highlightedOption: highlightedOption === null || highlightedOption === void 0 ? void 0 : highlightedOption.option, + useInteractiveGroups + }); + const isEmpty = !options || options.length === 0; + const isNoMatch = filteredOptions && filteredOptions.length === 0; + const isFiltered = filteringType !== "none" && filteringValue.length > 0 && filteredOptions && filteredOptions.length > 0; + const filteredText = isFiltered ? filteringResultsText === null || filteringResultsText === void 0 ? void 0 : filteringResultsText(matchesCount, totalCount) : void 0; + const dropdownStatus = useDropdownStatus({ + statusType, + empty, + loadingText, + finishedText, + errorText, + recoveryText, + isEmpty, + isNoMatch, + noMatch, + isFiltered, + filteringResultsText: filteredText, + onRecoveryClick: handleRecoveryClick, + errorIconAriaLabel, + hasRecoveryCallback: !!onLoadItems + }); + const filter = import_react101.default.createElement(filter_default, Object.assign({ clearAriaLabel: filteringClearAriaLabel, filteringType, placeholder: filteringPlaceholder, ariaLabel: filteringAriaLabel, ariaRequired, value: filteringValue }, getFilterProps())); + const trigger = import_react101.default.createElement(trigger_default, Object.assign({ placeholder, disabled, triggerProps: getTriggerProps(disabled, autoFocus), selectedOption: null, selectedOptions, triggerVariant: inlineTokens ? "tokens" : "placeholder", isOpen }, formFieldContext, { controlId, ariaLabelledby: joinStrings(formFieldContext.ariaLabelledby, multiSelectAriaLabelId) })); + const menuProps = Object.assign(Object.assign({}, getMenuProps()), { onLoadMore: handleLoadMore, ariaLabelledby: joinStrings(multiSelectAriaLabelId, controlId), ariaDescribedby: dropdownStatus.content ? footerId : void 0 }); + const announcement = useAnnouncement({ + announceSelected, + highlightedOption, + getParent: (option) => { + var _a2; + return (_a2 = parentMap.get(option)) === null || _a2 === void 0 ? void 0 : _a2.option; + }, + selectedAriaLabel, + renderHighlightedAriaLive + }); + const tokens = selectedOptions.map((option) => ({ + label: option.label, + disabled: disabled || option.disabled, + labelTag: option.labelTag, + description: option.description, + iconAlt: option.iconAlt, + iconName: option.iconName, + iconUrl: option.iconUrl, + iconSvg: option.iconSvg, + tags: option.tags, + dismissLabel: i18n("deselectAriaLabel", deselectAriaLabel === null || deselectAriaLabel === void 0 ? void 0 : deselectAriaLabel(option), (format2) => { + var _a2; + return format2({ option__label: (_a2 = option.label) !== null && _a2 !== void 0 ? _a2 : "" }); + }) + })); + (0, import_react101.useEffect)(() => { + var _a2; + (_a2 = scrollToIndex.current) === null || _a2 === void 0 ? void 0 : _a2.call(scrollToIndex, highlightedIndex); + }, [highlightedIndex]); + const ListComponent = virtualScroll ? virtual_list_default : plain_list_default; + const handleMouseDown = (event) => { + const target = event.target; + if (target !== document.activeElement) { + event.preventDefault(); + } + }; + const showTokens = !hideTokens && !inlineTokens && tokens.length > 0; + const handleTokenDismiss = ({ detail }) => { + const optionToDeselect = selectedOptions[detail.itemIndex]; + updateSelectedOption(optionToDeselect); + const targetRef = getTriggerProps().ref; + if (targetRef.current) { + targetRef.current.focus(); + } + }; + const tokenGroupI18nStrings = { + limitShowFewer: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.tokenLimitShowFewer, + limitShowMore: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.tokenLimitShowMore + }; + const mergedRef = useMergeRefs(rootRef, __internalRootRef); + const dropdownProps = getDropdownProps(); + return import_react101.default.createElement( + "div", + Object.assign({}, baseProps, { ref: mergedRef, className: clsx_m_default(styles_css_default34.root, baseProps.className), onKeyPress: handleNativeSearch }), + import_react101.default.createElement( + dropdown_default, + Object.assign({}, dropdownProps, { ariaLabelledby: dropdownProps.dropdownContentRole ? joinStrings(multiSelectAriaLabelId, controlId) : void 0, ariaDescribedby: dropdownProps.dropdownContentRole ? dropdownStatus.content ? footerId : void 0 : void 0, open: isOpen, trigger, header: filter, onMouseDown: handleMouseDown, footer: dropdownStatus.isSticky ? import_react101.default.createElement(dropdown_footer_default, { content: isOpen ? dropdownStatus.content : null, id: footerId }) : null, expandToViewport, stretchBeyondTriggerWidth: true }), + import_react101.default.createElement(ListComponent, { listBottom: !dropdownStatus.isSticky ? import_react101.default.createElement(dropdown_footer_default, { content: isOpen ? dropdownStatus.content : null, id: footerId }) : null, menuProps, getOptionProps: getOptionProps2, filteredOptions, filteringValue, ref: scrollToIndex, hasDropdownStatus: dropdownStatus.content !== null, checkboxes: true, useInteractiveGroups, screenReaderContent: announcement, highlightType }) + ), + showTokens && import_react101.default.createElement(InternalTokenGroup, { className: styles_css_default34.tokens, alignment: "horizontal", limit: tokenLimit, items: tokens, onDismiss: handleTokenDismiss, i18nStrings: tokenGroupI18nStrings, limitShowMoreAriaLabel: tokenLimitShowMoreAriaLabel, limitShowFewerAriaLabel: tokenLimitShowFewerAriaLabel, disableOuterPadding: true }), + import_react101.default.createElement(ScreenreaderOnly, { id: multiSelectAriaLabelId }, ariaLabel) + ); +}); +var internal_default13 = InternalMultiselect; + +// node_modules/@cloudscape-design/components/internal/components/chart-series-marker/index.js +var import_react102 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/internal/components/chart-series-marker/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/internal/components/chart-series-marker/styles.scoped.css"; +var styles_css_default35 = { + "marker": "awsui_marker_1isd1_t85q3_99", + "marker--line": "awsui_marker--line_1isd1_t85q3_142", + "marker--rectangle": "awsui_marker--rectangle_1isd1_t85q3_146", + "marker--hollow-rectangle": "awsui_marker--hollow-rectangle_1isd1_t85q3_153", + "marker--dashed": "awsui_marker--dashed_1isd1_t85q3_169" +}; + +// node_modules/@cloudscape-design/components/internal/components/chart-series-marker/index.js +var chart_series_marker_default = (0, import_react102.memo)(ChartSeriesMarker); +function ChartSeriesMarker({ type = "line", color: color2 }) { + return import_react102.default.createElement("span", { className: clsx_m_default(styles_css_default35.marker, styles_css_default35[`marker--${type}`]), style: { backgroundColor: color2 }, "aria-hidden": "true" }); +} + +// node_modules/@cloudscape-design/components/internal/components/chart-filter/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/internal/components/chart-filter/styles.scoped.css"; +var styles_css_default36 = { + "root": "awsui_root_1px7g_1cmh4_99", + "chart-filter": "awsui_chart-filter_1px7g_1cmh4_134", + "custom-icon-wrapper": "awsui_custom-icon-wrapper_1px7g_1cmh4_138" +}; + +// node_modules/@cloudscape-design/components/internal/components/chart-filter/index.js +var chart_filter_default = (0, import_react103.memo)(ChartFilter); +function ChartFilter(_a) { + var { series, i18nStrings, selectedSeries, onChange } = _a, restProps = __rest(_a, ["series", "i18nStrings", "selectedSeries", "onChange"]); + const baseProps = getBaseProps(restProps); + const className = clsx_m_default(baseProps.className, styles_css_default36.root); + const i18n = useInternalI18n("[charts]"); + const defaultOptions = series.map((d, i) => ({ + label: d.label, + value: "" + i, + datum: d.datum, + __customIcon: import_react103.default.createElement( + "span", + { className: styles_css_default36["custom-icon-wrapper"] }, + import_react103.default.createElement(chart_series_marker_default, { color: d.color, type: d.type }) + ) + })); + const selectedOptions = defaultOptions.filter((option) => (selectedSeries === null || selectedSeries === void 0 ? void 0 : selectedSeries.indexOf(option.datum)) !== -1); + const updateSelection = (0, import_react103.useCallback)(({ detail: { selectedOptions: selectedOptions2 } }) => { + const selectedSeries2 = defaultOptions.filter((option) => selectedOptions2.indexOf(option) !== -1).map((option) => option.datum); + onChange(selectedSeries2); + }, [onChange, defaultOptions]); + return import_react103.default.createElement( + InternalFormField, + Object.assign({}, baseProps, { label: i18n("i18nStrings.filterLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.filterLabel), className }), + import_react103.default.createElement(internal_default13, { placeholder: i18n("i18nStrings.filterPlaceholder", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.filterPlaceholder), options: defaultOptions, selectedOptions, onChange: updateSelection, className: styles_css_default36["chart-filter"], selectedAriaLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.filterSelectedAriaLabel, hideTokens: true }) + ); +} + +// node_modules/@cloudscape-design/components/area-chart/elements/area-chart-filter.js +var area_chart_filter_default = (0, import_react104.memo)(AreaChartFilter); +function AreaChartFilter({ model, filterLabel, filterPlaceholder, filterSelectedAriaLabel }) { + const filterItems = model.allSeries.map((s2) => { + const { title, color: color2, markerType } = model.getInternalSeries(s2); + return { label: title, color: color2, type: markerType, datum: s2 }; + }); + return import_react104.default.createElement(chart_filter_default, { series: filterItems, onChange: model.handlers.onFilterSeries, selectedSeries: model.series, i18nStrings: { + filterLabel, + filterPlaceholder, + filterSelectedAriaLabel + } }); +} + +// node_modules/@cloudscape-design/components/area-chart/elements/area-chart-legend.js +var import_react106 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/internal/components/chart-legend/index.js +var import_react105 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/internal/components/chart-legend/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/internal/components/chart-legend/styles.scoped.css"; +var styles_css_default37 = { + "marker": "awsui_marker_1kjc7_12d3z_99", + "root": "awsui_root_1kjc7_12d3z_117", + "title": "awsui_title_1kjc7_12d3z_155", + "list": "awsui_list_1kjc7_12d3z_159", + "marker--dimmed": "awsui_marker--dimmed_1kjc7_12d3z_208", + "marker--highlighted": "awsui_marker--highlighted_1kjc7_12d3z_211" +}; + +// node_modules/@cloudscape-design/components/internal/components/chart-legend/index.js +var chart_legend_default = (0, import_react105.memo)(ChartLegend); +function ChartLegend({ series, onHighlightChange, highlightedSeries, legendTitle, ariaLabel, plotContainerRef }) { + const i18n = useInternalI18n("[charts]"); + const containerRef = (0, import_react105.useRef)(null); + const segmentsRef = (0, import_react105.useRef)([]); + const highlightedSeriesIndex = findSeriesIndex(series, highlightedSeries); + const highlightLeft = () => { + var _a; + const currentIndex = highlightedSeriesIndex !== null && highlightedSeriesIndex !== void 0 ? highlightedSeriesIndex : 0; + const nextIndex = currentIndex - 1 >= 0 ? currentIndex - 1 : series.length - 1; + (_a = segmentsRef.current[nextIndex]) === null || _a === void 0 ? void 0 : _a.focus(); + }; + const highlightRight = () => { + var _a; + const currentIndex = highlightedSeriesIndex !== null && highlightedSeriesIndex !== void 0 ? highlightedSeriesIndex : 0; + const nextIndex = currentIndex + 1 < series.length ? currentIndex + 1 : 0; + (_a = segmentsRef.current[nextIndex]) === null || _a === void 0 ? void 0 : _a.focus(); + }; + const handleKeyPress = (event) => { + if (event.keyCode === KeyCode.right || event.keyCode === KeyCode.left) { + event.preventDefault(); + switch (event.keyCode) { + case KeyCode.left: + return highlightLeft(); + case KeyCode.right: + return highlightRight(); + default: + return; + } + } + }; + const handleSelection = (index) => { + if (series[index].datum !== highlightedSeries) { + onHighlightChange(series[index].datum); + } + }; + const handleBlur = (event) => { + var _a; + if (event.relatedTarget === null || containerRef.current && !containerRef.current.contains(event.relatedTarget) && !((_a = plotContainerRef === null || plotContainerRef === void 0 ? void 0 : plotContainerRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.relatedTarget))) { + onHighlightChange(null); + } + }; + const handleMouseOver = (s2) => { + if (s2 !== highlightedSeries) { + onHighlightChange(s2); + } + }; + const handleMouseLeave = () => { + onHighlightChange(null); + }; + return import_react105.default.createElement( + import_react105.default.Fragment, + null, + import_react105.default.createElement( + "div", + { ref: containerRef, role: "toolbar", "aria-label": legendTitle || i18n("i18nStrings.legendAriaLabel", ariaLabel), className: styles_css_default37.root, onKeyDown: handleKeyPress, onBlur: handleBlur }, + legendTitle && import_react105.default.createElement(InternalBox, { fontWeight: "bold", className: styles_css_default37.title }, legendTitle), + import_react105.default.createElement("div", { className: styles_css_default37.list }, series.map((s2, index) => { + const someHighlighted = highlightedSeries !== null; + const isHighlighted = highlightedSeries === s2.datum; + const isDimmed = someHighlighted && !isHighlighted; + return import_react105.default.createElement( + "div", + { role: "button", key: index, "aria-pressed": isHighlighted, className: clsx_m_default(styles_css_default37.marker, { + [styles_css_default37["marker--dimmed"]]: isDimmed, + [styles_css_default37["marker--highlighted"]]: isHighlighted + }), ref: (elem) => { + if (elem) { + segmentsRef.current[index] = elem; + } else { + delete segmentsRef.current[index]; + } + }, tabIndex: index === highlightedSeriesIndex || highlightedSeriesIndex === void 0 && index === 0 ? 0 : -1, onFocus: () => handleSelection(index), onClick: () => handleSelection(index), onMouseOver: () => handleMouseOver(s2.datum), onMouseLeave: handleMouseLeave }, + import_react105.default.createElement(chart_series_marker_default, { color: s2.color, type: s2.type }), + " ", + s2.label + ); + })) + ) + ); +} +function findSeriesIndex(series, targetSeries) { + for (let index = 0; index < series.length; index++) { + if (series[index].datum === targetSeries) { + return index; + } + } + return void 0; +} + +// node_modules/@cloudscape-design/components/area-chart/elements/area-chart-legend.js +var area_chart_legend_default = (0, import_react106.memo)(AreaChartLegend); +function AreaChartLegend({ model, legendTitle, ariaLabel, plotContainerRef }) { + const legendItems = (0, import_react106.useMemo)(() => model.series.map((s2) => { + const { title, color: color2, markerType } = model.getInternalSeries(s2); + return { label: title, color: color2, type: markerType, datum: s2 }; + }), [model]); + const legendSeries = useSelector(model.interactions, (state) => state.legendSeries); + return import_react106.default.createElement(chart_legend_default, { series: legendItems, highlightedSeries: legendSeries, onHighlightChange: model.handlers.onLegendHighlight, legendTitle, ariaLabel, plotContainerRef }); +} + +// node_modules/@cloudscape-design/components/area-chart/chart-container.js +var import_react131 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/internal/components/chart-plot/index.js +var import_react109 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/internal/components/chart-plot/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/internal/components/chart-plot/styles.scoped.css"; +var styles_css_default38 = { + "root": "awsui_root_1fcus_y6use_99", + "clickable": "awsui_clickable_1fcus_y6use_108", + "precise": "awsui_precise_1fcus_y6use_112", + "focus-outline": "awsui_focus-outline_1fcus_y6use_116", + "application": "awsui_application_1fcus_y6use_125" +}; + +// node_modules/@cloudscape-design/components/internal/components/chart-plot/application-controller.js +var import_react107 = __toESM(require_react()); +var application_controller_default = (0, import_react107.forwardRef)(ApplicationController); +function ApplicationController({ activeElementKey, activeElementRef, onFocus, onBlur, onKeyDown }, ref) { + const containerRef = (0, import_react107.useRef)(null); + const applicationRef = (0, import_react107.useRef)(null); + const focusTransitionRef = (0, import_react107.useRef)(false); + const [isFocused, setFocused] = (0, import_react107.useState)(false); + const onApplicationFocus = (0, import_react107.useCallback)((event) => { + if (focusTransitionRef.current === false) { + setFocused(true); + onFocus && onFocus(event); + } else { + focusTransitionRef.current = false; + } + }, [onFocus]); + const onApplicationBlur = (0, import_react107.useCallback)((event) => { + if (focusTransitionRef.current === false) { + setFocused(false); + onBlur && onBlur(event); + muteApplication(applicationRef.current); + } + }, [onBlur]); + const onApplicationKeyDown = onKeyDown; + (0, import_react107.useImperativeHandle)(ref, () => ({ + focus: () => focusApplication(applicationRef.current, (activeElementRef === null || activeElementRef === void 0 ? void 0 : activeElementRef.current) || null) + }), [activeElementRef]); + (0, import_react107.useEffect)(() => { + if (!isFocused || focusTransitionRef.current === true) { + return; + } + focusTransitionRef.current = true; + containerRef.current.removeChild(applicationRef.current); + containerRef.current.appendChild(applicationRef.current); + focusApplication(applicationRef.current, (activeElementRef === null || activeElementRef === void 0 ? void 0 : activeElementRef.current) || null); + }, [isFocused, activeElementKey, activeElementRef]); + return import_react107.default.createElement( + "g", + { ref: containerRef }, + import_react107.default.createElement("g", { tabIndex: -1, ref: applicationRef, onFocus: onApplicationFocus, onBlur: onApplicationBlur, onKeyDown: onApplicationKeyDown, className: styles_css_default38.application }) + ); +} +function focusApplication(app, target) { + for (const attributeName of getAttributeNames(app)) { + if (attributeName === "role" || attributeName.slice(0, 4) === "aria") { + app.removeAttribute(attributeName); + } + } + if (target) { + for (const attributeName of getAttributeNames(target)) { + if (attributeName === "role" || attributeName.slice(0, 4) === "aria") { + const attributeValue = target.getAttribute(attributeName); + attributeValue && app.setAttribute(attributeName, attributeValue); + } + } + } + app.tabIndex = 0; + app.setAttribute("focusable", "true"); + app.setAttribute("aria-hidden", "false"); + app.focus({ preventScroll: true }); +} +function muteApplication(app) { + for (const attributeName of getAttributeNames(app)) { + if (attributeName === "role" || attributeName.slice(0, 4) === "aria") { + app.removeAttribute(attributeName); + } + } + app.tabIndex = -1; + app.setAttribute("focusable", "false"); + app.setAttribute("aria-hidden", "true"); +} +function getAttributeNames(element) { + const attributes = element.attributes; + const result = new Array(attributes.length); + for (let i = 0; i < attributes.length; i++) { + result[i] = attributes[i].name; + } + return result; +} + +// node_modules/@cloudscape-design/components/internal/components/chart-plot/focus-outline.js +var import_react108 = __toESM(require_react()); +function useFocusVisibleState() { + const [focusVisible, setFocusVisible] = (0, import_react108.useState)(false); + (0, import_react108.useEffect)(() => { + function handleMousedown() { + return setFocusVisible(false); + } + function handleKeydown(event) { + if (!isModifierKey(event)) { + setFocusVisible(true); + } + } + document.addEventListener("mousedown", handleMousedown); + document.addEventListener("keydown", handleKeydown); + return () => { + document.removeEventListener("mousedown", handleMousedown); + document.removeEventListener("keydown", handleKeydown); + }; + }); + return focusVisible; +} +function FocusOutline({ elementKey, elementRef, offset = 0 }) { + const ref = (0, import_react108.useRef)(null); + const focusVisible = useFocusVisibleState(); + (0, import_react108.useEffect)(() => { + if (!ref.current) { + return; + } + if (focusVisible && elementKey && elementRef && elementRef.current && elementRef.current.getBBox) { + const element = elementRef.current.getBBox(); + showOutline(ref.current, element, offset); + } else { + hideOutline(ref.current); + } + }, [focusVisible, elementKey, elementRef, offset]); + return import_react108.default.createElement("rect", { ref, "aria-hidden": "true", className: styles_css_default38["focus-outline"], rx: "2" }); +} +function showOutline(el, position, offset) { + const offsetX = typeof offset === "number" ? offset : offset.x; + const offsetY = typeof offset === "number" ? offset : offset.y; + el.setAttribute("x", (position.x - offsetX).toString()); + el.setAttribute("y", (position.y - offsetY).toString()); + el.setAttribute("width", (position.width + 2 * offsetX).toString()); + el.setAttribute("height", (position.height + 2 * offsetY).toString()); + el.style.visibility = "visible"; +} +function hideOutline(el) { + el.style.visibility = "hidden"; + el.removeAttribute("x"); + el.removeAttribute("y"); + el.removeAttribute("width"); + el.removeAttribute("height"); +} + +// node_modules/@cloudscape-design/components/internal/components/chart-plot/index.js +var DEFAULT_PLOT_FOCUS_OFFSET = 3; +var DEFAULT_ELEMENT_FOCUS_OFFSET = 3; +var chart_plot_default = (0, import_react109.forwardRef)(ChartPlot); +function ChartPlot({ width, height, transform, offsetTop, offsetBottom, offsetLeft, offsetRight, ariaLabel, ariaLabelledby, ariaRoleDescription, ariaDescription, ariaDescribedby, activeElementKey, activeElementRef, ariaLiveRegion, isClickable, isPrecise, children: children2, onClick, onKeyDown, focusOffset = DEFAULT_PLOT_FOCUS_OFFSET, activeElementFocusOffset = DEFAULT_ELEMENT_FOCUS_OFFSET, onMouseMove, onMouseOut, onApplicationBlur, onApplicationFocus }, ref) { + const i18n = useInternalI18n("[charts]"); + const svgRef = (0, import_react109.useRef)(null); + const applicationRef = (0, import_react109.useRef)(null); + const plotClickedRef = (0, import_react109.useRef)(false); + const [isPlotFocused, setPlotFocused] = (0, import_react109.useState)(false); + const [isApplicationFocused, setApplicationFocused] = (0, import_react109.useState)(false); + const internalDescriptionId = useUniqueId("awsui-chart-plot__description"); + const ariaDescriptionId = [ariaDescription && internalDescriptionId, ariaDescribedby].filter(Boolean).join(" "); + (0, import_react109.useImperativeHandle)(ref, () => ({ + svg: svgRef.current, + focusPlot: () => svgRef.current.focus(), + focusApplication: () => applicationRef.current.focus() + })); + const onPlotMouseDown = () => { + plotClickedRef.current = true; + }; + const onPlotFocus = (event) => { + if (plotClickedRef.current || !!activeElementKey) { + applicationRef.current.focus(); + } else if (event.target === svgRef.current) { + setPlotFocused(true); + } + }; + const onPlotClick = (event) => { + onClick && onClick(event); + }; + const onPlotBlur = (event) => { + if (event.target === svgRef.current) { + setPlotFocused(false); + } + }; + const onPlotKeyDown = (event) => { + if (isPlotFocused) { + const codes = [KeyCode.space, KeyCode.enter, KeyCode.up, KeyCode.left, KeyCode.right, KeyCode.down]; + if (codes.indexOf(event.keyCode) !== -1) { + applicationRef.current.focus(); + } + } + }; + const onPlotApplicationFocus = (event) => { + onApplicationFocus && onApplicationFocus(event, plotClickedRef.current ? "mouse" : "keyboard"); + plotClickedRef.current = false; + setApplicationFocused(true); + }; + const onPlotApplicationBlur = (event) => { + onApplicationBlur && onApplicationBlur(event); + setApplicationFocused(false); + }; + const onApplicationKeyDown = onKeyDown; + const plotFocusable = !isApplicationFocused; + const plotTabIndex = plotFocusable ? 0 : -1; + const plotAria = !isApplicationFocused ? { + "aria-label": ariaLabel, + "aria-labelledby": ariaLabelledby, + "aria-describedby": ariaDescriptionId, + "aria-roledescription": i18n("i18nStrings.chartAriaRoleDescription", ariaRoleDescription) + } : {}; + return import_react109.default.createElement( + import_react109.default.Fragment, + null, + import_react109.default.createElement( + "svg", + Object.assign({ onMouseMove, onMouseOut, focusable: plotFocusable, tabIndex: plotTabIndex, role: "application", "aria-hidden": "false" }, plotAria, { ref: svgRef, style: { + width, + height, + marginTop: offsetTop, + marginBottom: offsetBottom, + marginLeft: offsetLeft, + marginRight: offsetRight + }, className: clsx_m_default(styles_css_default38.root, { + [styles_css_default38.clickable]: isClickable, + [styles_css_default38.precise]: isPrecise + }), onMouseDown: onPlotMouseDown, onClick: onPlotClick, onFocus: onPlotFocus, onBlur: onPlotBlur, onKeyDown: onPlotKeyDown }), + import_react109.default.createElement(FocusOutline, { elementRef: svgRef, elementKey: isPlotFocused, offset: focusOffset }), + import_react109.default.createElement( + "g", + { transform }, + import_react109.default.createElement(application_controller_default, { activeElementKey: isApplicationFocused && activeElementKey || null, activeElementRef, ref: applicationRef, onFocus: onPlotApplicationFocus, onBlur: onPlotApplicationBlur, onKeyDown: onApplicationKeyDown }), + ariaDescription && plotFocusable && import_react109.default.createElement("desc", { "aria-hidden": "true", id: internalDescriptionId }, ariaDescription), + children2, + import_react109.default.createElement(FocusOutline, { elementRef: activeElementRef, elementKey: isApplicationFocused && activeElementKey, offset: activeElementFocusOffset }) + ) + ), + import_react109.default.createElement(live_region_default, null, ariaLiveRegion) + ); +} + +// node_modules/@cloudscape-design/components/internal/components/cartesian-chart/axis-label.js +var import_react110 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/internal/components/cartesian-chart/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/internal/components/cartesian-chart/styles.scoped.css"; +var styles_css_default39 = { + "axis": "awsui_axis_f0fot_f6jsx_9", + "vertical-marker": "awsui_vertical-marker_f0fot_f6jsx_10", + "axis--emphasized": "awsui_axis--emphasized_f0fot_f6jsx_15", + "axis-label": "awsui_axis-label_f0fot_f6jsx_19", + "axis-label--x": "awsui_axis-label--x_f0fot_f6jsx_24", + "axis-label--y": "awsui_axis-label--y_f0fot_f6jsx_25", + "grid": "awsui_grid_f0fot_f6jsx_29", + "ticks__line": "awsui_ticks__line_f0fot_f6jsx_34", + "ticks__text": "awsui_ticks__text_f0fot_f6jsx_39", + "ticks--y": "awsui_ticks--y_f0fot_f6jsx_44", + "ticks--x": "awsui_ticks--x_f0fot_f6jsx_45", + "ticks--bottom": "awsui_ticks--bottom_f0fot_f6jsx_49", + "labels-left": "awsui_labels-left_f0fot_f6jsx_54", + "ticks": "awsui_ticks_f0fot_f6jsx_34", + "labels-left__label": "awsui_labels-left__label_f0fot_f6jsx_69", + "labels-left--hidden": "awsui_labels-left--hidden_f0fot_f6jsx_73", + "labels-bottom": "awsui_labels-bottom_f0fot_f6jsx_81", + "vertical-marker-circle": "awsui_vertical-marker-circle_f0fot_f6jsx_92", + "vertical-marker-circle-active": "awsui_vertical-marker-circle-active_f0fot_f6jsx_98", + "focus-outline": "awsui_focus-outline_f0fot_f6jsx_103", + "chart-container": "awsui_chart-container_f0fot_f6jsx_111", + "fit-height": "awsui_fit-height_f0fot_f6jsx_116", + "chart-container-outer": "awsui_chart-container-outer_f0fot_f6jsx_121", + "chart-container-inner": "awsui_chart-container-inner_f0fot_f6jsx_128", + "chart-container-plot-wrapper": "awsui_chart-container-plot-wrapper_f0fot_f6jsx_135", + "chart-container-plot": "awsui_chart-container-plot_f0fot_f6jsx_135", + "chart-container-bottom-labels": "awsui_chart-container-bottom-labels_f0fot_f6jsx_147" +}; + +// node_modules/@cloudscape-design/components/internal/components/cartesian-chart/axis-label.js +var axis_label_default = (0, import_react110.memo)(AxisLabel); +function AxisLabel({ title, axis, position }) { + if (!title) { + return null; + } + return import_react110.default.createElement( + InternalBox, + { className: clsx_m_default(styles_css_default39["axis-label"], axis === "x" ? styles_css_default39["axis-label--x"] : styles_css_default39["axis-label--y"]), fontWeight: "bold", textAlign: position === "left" ? "left" : "center", margin: { bottom: position === "left" ? "l" : "n" } }, + import_react110.default.createElement("span", { "aria-hidden": "true" }, title) + ); +} + +// node_modules/@cloudscape-design/components/internal/components/cartesian-chart/labels-measure.js +var import_react111 = __toESM(require_react()); +var labels_measure_default = (0, import_react111.memo)(LabelsMeasure); +function LabelsMeasure({ scale, ticks: ticks2, tickFormatter, autoWidth, maxLabelsWidth }) { + const [width, ref] = useContainerQuery((rect) => rect.contentBoxWidth); + (0, import_react111.useEffect)(() => { + autoWidth(width || 0); + }, [autoWidth, width]); + const labelMapper = (value) => { + const scaledValue = scale.d3Scale(value); + if (scaledValue === void 0 || !isFinite(scaledValue)) { + return null; + } + const formattedValue = tickFormatter ? tickFormatter(value) : value.toString(); + const lines = (formattedValue + "").split("\n"); + return import_react111.default.createElement(import_react111.Fragment, { key: `${value}` }, lines.map((line, lineIndex) => import_react111.default.createElement("div", { key: lineIndex, className: styles_css_default39["labels-left__label"], "aria-hidden": "true" }, line))); + }; + return import_react111.default.createElement("div", { ref, className: clsx_m_default(styles_css_default39["labels-left"], styles_css_default39["labels-left--hidden"]), style: { maxWidth: maxLabelsWidth } }, ticks2.map(labelMapper)); +} + +// node_modules/@cloudscape-design/components/internal/components/cartesian-chart/left-labels.js +var import_react113 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/internal/components/cartesian-chart/constants.js +var TICK_LENGTH = 8; +var TICK_MARGIN = 4; +var TICK_LINE_HEIGHT = 16; +var X_TICK_COUNT_RATIO = 100; +var Y_TICK_COUNT_RATIO = 50; + +// node_modules/@cloudscape-design/components/internal/components/cartesian-chart/label-utils.js +var SPACE_BETWEEN = 4; +function formatTicks({ ticks: ticks2, scale, getLabelSpace, tickFormatter }) { + return ticks2.map((tick) => { + var _a; + const position = (_a = scale.d3Scale(tick)) !== null && _a !== void 0 ? _a : NaN; + const label = tickFormatter ? tickFormatter(tick) : tick.toString(); + const lines = (label + "").split("\n"); + return { position, lines, space: Math.max(...lines.map(getLabelSpace)) }; + }); +} +function getVisibleTicks(ticks2, from, until, balanceTicks = false) { + ticks2 = getTicksInRange(ticks2, from, until); + return balanceTicks ? getReducedTicks(ticks2) : removeIntersections(ticks2); +} +function getTicksInRange(ticks2, from, until) { + return ticks2.filter((tick) => from <= tick.position - tick.space / 2 && tick.position + tick.space / 2 <= until); +} +function getReducedTicks(ticks2) { + const reduceLabelRatio = findReduceLabelRatio(ticks2); + const reducedTicks = []; + for (let index = 0; index < ticks2.length; index += reduceLabelRatio) { + reducedTicks.push(ticks2[index]); + } + return reducedTicks; +} +function findReduceLabelRatio(ticks2, ratio = 1) { + if (ratio >= ticks2.length) { + return ratio; + } + for (let i = ratio; i < ticks2.length; i += ratio) { + if (hasIntersection(ticks2[i - ratio], ticks2[i])) { + return findReduceLabelRatio(ticks2, ratio + 1); + } + } + return ratio; +} +function removeIntersections(ticks2) { + const visibleTicks = []; + let prevTick = null; + for (const tick of ticks2) { + if (!prevTick || !hasIntersection(prevTick, tick)) { + visibleTicks.push(tick); + prevTick = tick; + } + } + return visibleTicks; +} +function hasIntersection(a2, b) { + const [left, right] = a2.position < b.position ? [a2, b] : [b, a2]; + const leftEdge = left.position + left.space / 2 + SPACE_BETWEEN; + const rightEdge = right.position - right.space / 2; + return leftEdge > rightEdge; +} +function getSVGTextSize(element) { + if (element && element.getBBox) { + return element.getBBox(); + } + return void 0; +} + +// node_modules/@cloudscape-design/components/internal/components/responsive-text/index.js +var import_react112 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/internal/components/responsive-text/responsive-text-utils.js +function getTextWidth(textNode) { + if (textNode.getComputedTextLength) { + return textNode.getComputedTextLength(); + } + return -1; +} + +// node_modules/@cloudscape-design/components/internal/components/responsive-text/index.js +var responsive_text_default = (0, import_react112.memo)(ResponsiveText); +function ResponsiveText({ x: x2, y: y2, className, children: children2, maxWidth }) { + const textRef = (0, import_react112.useRef)(null); + (0, import_react112.useEffect)(() => { + renderTextContent(textRef.current, children2, maxWidth); + }, [maxWidth, children2]); + return import_react112.default.createElement("text", { ref: textRef, x: x2, y: y2, style: { textAnchor: "end" }, className }, children2); +} +function renderTextContent(textNode, text, maxWidth) { + let visibleLength = text.length; + while (visibleLength >= 0) { + textNode.textContent = truncateText(text, visibleLength); + if (getTextWidth(textNode) <= maxWidth) { + return; + } else { + visibleLength--; + } + } +} +function truncateText(text, maxLength) { + if (text.length === maxLength) { + return text; + } + return text.slice(0, maxLength) + "…"; +} + +// node_modules/@cloudscape-design/components/internal/components/cartesian-chart/left-labels.js +var OFFSET_PX = 12; +var left_labels_default = (0, import_react113.memo)(LeftLabels); +function LeftLabels({ axis = "y", plotWidth, plotHeight, maxLabelsWidth = Number.POSITIVE_INFINITY, scale, ticks: ticks2, tickFormatter, title, ariaRoleDescription }) { + const i18n = useInternalI18n("[charts]"); + const virtualTextRef = (0, import_react113.useRef)(null); + const yOffset = axis === "x" && scale.isCategorical() ? Math.max(0, scale.d3Scale.bandwidth() - 1) / 2 : 0; + const labelToBoxCache = (0, import_react113.useRef)({}); + const getLabelSpace = (label) => { + var _a, _b, _c, _d; + if (labelToBoxCache.current[label] !== void 0) { + return (_b = (_a = labelToBoxCache.current[label]) === null || _a === void 0 ? void 0 : _a.height) !== null && _b !== void 0 ? _b : 0; + } + if (virtualTextRef.current) { + virtualTextRef.current.textContent = label; + } + labelToBoxCache.current[label] = getSVGTextSize(virtualTextRef.current); + return (_d = (_c = labelToBoxCache.current[label]) === null || _c === void 0 ? void 0 : _c.height) !== null && _d !== void 0 ? _d : 0; + }; + const formattedTicks = formatTicks({ ticks: ticks2, scale, getLabelSpace, tickFormatter }); + if (virtualTextRef.current) { + virtualTextRef.current.textContent = ""; + } + const from = 0 - OFFSET_PX - yOffset; + const until = plotHeight + OFFSET_PX - yOffset; + const visibleTicks = getVisibleTicks(formattedTicks, from, until); + return import_react113.default.createElement( + "g", + { className: clsx_m_default(styles_css_default39["labels-left"]), "aria-label": title, role: "list", "aria-roledescription": i18n("i18nStrings.chartAriaRoleDescription", ariaRoleDescription), "aria-hidden": true }, + visibleTicks.map(({ position, lines }, index) => isFinite(position) && import_react113.default.createElement( + "g", + { key: index, role: "listitem", transform: `translate(0,${position + yOffset})`, className: clsx_m_default(styles_css_default39.ticks, axis === "x" ? styles_css_default39["ticks--x"] : styles_css_default39["ticks--y"]) }, + axis === "y" && import_react113.default.createElement("line", { className: clsx_m_default(styles_css_default39.grid, styles_css_default39.ticks_line), x1: -TICK_LENGTH, y1: 0, x2: plotWidth, y2: 0, "aria-hidden": "true" }), + lines.map((line, lineIndex) => { + var _a, _b; + const lineTextProps = { + x: -(TICK_LENGTH + TICK_MARGIN), + y: (lineIndex - (lines.length - 1) * 0.5) * TICK_LINE_HEIGHT, + className: styles_css_default39.ticks__text, + children: line + }; + return ((_b = (_a = labelToBoxCache.current[lines[0]]) === null || _a === void 0 ? void 0 : _a.width) !== null && _b !== void 0 ? _b : 0) > maxLabelsWidth ? import_react113.default.createElement(responsive_text_default, Object.assign({ key: lineIndex }, lineTextProps, { maxWidth: maxLabelsWidth })) : import_react113.default.createElement("text", Object.assign({ key: lineIndex }, lineTextProps)); + }) + )), + import_react113.default.createElement("text", { ref: virtualTextRef, x: 0, y: 0, style: { visibility: "hidden" }, "aria-hidden": "true" }) + ); +} + +// node_modules/@cloudscape-design/components/internal/components/cartesian-chart/bottom-labels.js +var import_react114 = __toESM(require_react()); +function useBottomLabels({ ticks: ticks2, scale, tickFormatter }) { + const virtualTextRef = (0, import_react114.useRef)(null); + const cacheRef = (0, import_react114.useRef)({}); + const getLabelSpace = (label) => { + if (cacheRef.current[label] !== void 0 && cacheRef.current[label] !== 0) { + return cacheRef.current[label]; + } + if (virtualTextRef.current && virtualTextRef.current.getComputedTextLength) { + virtualTextRef.current.textContent = label; + cacheRef.current[label] = virtualTextRef.current.getComputedTextLength(); + return cacheRef.current[label]; + } + return 0; + }; + const formattedTicks = formatTicks({ ticks: ticks2, scale, getLabelSpace, tickFormatter }); + if (virtualTextRef.current) { + virtualTextRef.current.textContent = ""; + } + let height = TICK_LENGTH + TICK_MARGIN; + for (const { lines } of formattedTicks) { + height = Math.max(height, TICK_LENGTH + TICK_MARGIN + lines.length * TICK_LINE_HEIGHT); + } + return { virtualTextRef, formattedTicks, height }; +} +var bottom_labels_default = (0, import_react114.memo)(BottomLabels); +function BottomLabels({ axis = "x", width, height, scale, title, ariaRoleDescription, offsetLeft = 0, offsetRight = 0, virtualTextRef, formattedTicks }) { + const i18n = useInternalI18n("[charts]"); + const xOffset = scale.isCategorical() && axis === "x" ? Math.max(0, scale.d3Scale.bandwidth() - 1) / 2 : 0; + const from = 0 - offsetLeft - xOffset; + const until = width + offsetRight - xOffset; + const balanceLabels = axis === "x" && scale.scaleType !== "log"; + const visibleTicks = getVisibleTicks(formattedTicks, from, until, balanceLabels); + return import_react114.default.createElement( + "g", + { transform: `translate(0,${height})`, className: styles_css_default39["labels-bottom"], "aria-label": title, role: "list", "aria-roledescription": i18n("i18nStrings.chartAriaRoleDescription", ariaRoleDescription), "aria-hidden": true }, + visibleTicks.map(({ position, lines }, index) => isFinite(position) && import_react114.default.createElement( + "g", + { key: index, transform: `translate(${position + xOffset},0)`, className: clsx_m_default(styles_css_default39.ticks, styles_css_default39["ticks--bottom"], { + [styles_css_default39["ticks--x"]]: axis === "x", + [styles_css_default39["ticks--y"]]: axis === "y" + }), role: "listitem", "aria-label": lines.join("\n") }, + import_react114.default.createElement("line", { className: styles_css_default39.ticks__line, x1: 0, x2: 0, y1: 0, y2: TICK_LENGTH, "aria-hidden": "true" }), + lines.map((line, lineIndex) => import_react114.default.createElement("text", { className: styles_css_default39.ticks__text, key: lineIndex, x: 0, y: TICK_LENGTH + TICK_MARGIN + lineIndex * TICK_LINE_HEIGHT }, line)) + )), + import_react114.default.createElement("text", { ref: virtualTextRef, x: 0, y: 0, style: { visibility: "hidden" }, "aria-hidden": "true" }) + ); +} + +// node_modules/@cloudscape-design/components/internal/components/cartesian-chart/emphasized-baseline.js +var import_react115 = __toESM(require_react()); +var emphasized_baseline_default = (0, import_react115.memo)(EmphasizedBaseline); +function EmphasizedBaseline({ axis = "x", width, height, scale }) { + var _a; + const baselineY = (_a = scale.d3Scale(0)) !== null && _a !== void 0 ? _a : NaN; + const showYBaseline = axis === "x" && isFinite(baselineY) && baselineY <= height; + if (showYBaseline) { + return import_react115.default.createElement("line", { className: clsx_m_default(styles_css_default39.axis, styles_css_default39["axis--emphasized"]), x1: -TICK_MARGIN, x2: width, y1: baselineY, y2: baselineY, "aria-hidden": "true" }); + } + if (axis === "y") { + return import_react115.default.createElement("line", { className: clsx_m_default(styles_css_default39.axis, styles_css_default39["axis--emphasized"]), x1: 0, y1: 0, x2: 0, y2: height + TICK_LENGTH, "aria-hidden": "true" }); + } + return null; +} + +// node_modules/@cloudscape-design/components/area-chart/elements/data-series.js +var import_react118 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/area-chart/elements/area-series.js +var import_react116 = __toESM(require_react()); + +// node_modules/d3-path/src/path.js +var pi = Math.PI; +var tau = 2 * pi; +var epsilon = 1e-6; +var tauEpsilon = tau - epsilon; +function Path() { + this._x0 = this._y0 = // start of current subpath + this._x1 = this._y1 = null; + this._ = ""; +} +function path() { + return new Path(); +} +Path.prototype = path.prototype = { + constructor: Path, + moveTo: function(x2, y2) { + this._ += "M" + (this._x0 = this._x1 = +x2) + "," + (this._y0 = this._y1 = +y2); + }, + closePath: function() { + if (this._x1 !== null) { + this._x1 = this._x0, this._y1 = this._y0; + this._ += "Z"; + } + }, + lineTo: function(x2, y2) { + this._ += "L" + (this._x1 = +x2) + "," + (this._y1 = +y2); + }, + quadraticCurveTo: function(x1, y1, x2, y2) { + this._ += "Q" + +x1 + "," + +y1 + "," + (this._x1 = +x2) + "," + (this._y1 = +y2); + }, + bezierCurveTo: function(x1, y1, x2, y2, x3, y3) { + this._ += "C" + +x1 + "," + +y1 + "," + +x2 + "," + +y2 + "," + (this._x1 = +x3) + "," + (this._y1 = +y3); + }, + arcTo: function(x1, y1, x2, y2, r) { + x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r; + var x0 = this._x1, y0 = this._y1, x21 = x2 - x1, y21 = y2 - y1, x01 = x0 - x1, y01 = y0 - y1, l01_2 = x01 * x01 + y01 * y01; + if (r < 0) throw new Error("negative radius: " + r); + if (this._x1 === null) { + this._ += "M" + (this._x1 = x1) + "," + (this._y1 = y1); + } else if (!(l01_2 > epsilon)) ; + else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r) { + this._ += "L" + (this._x1 = x1) + "," + (this._y1 = y1); + } else { + var x20 = x2 - x0, y20 = y2 - y0, l21_2 = x21 * x21 + y21 * y21, l20_2 = x20 * x20 + y20 * y20, l21 = Math.sqrt(l21_2), l01 = Math.sqrt(l01_2), l = r * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2), t01 = l / l01, t21 = l / l21; + if (Math.abs(t01 - 1) > epsilon) { + this._ += "L" + (x1 + t01 * x01) + "," + (y1 + t01 * y01); + } + this._ += "A" + r + "," + r + ",0,0," + +(y01 * x20 > x01 * y20) + "," + (this._x1 = x1 + t21 * x21) + "," + (this._y1 = y1 + t21 * y21); + } + }, + arc: function(x2, y2, r, a0, a1, ccw) { + x2 = +x2, y2 = +y2, r = +r, ccw = !!ccw; + var dx = r * Math.cos(a0), dy = r * Math.sin(a0), x0 = x2 + dx, y0 = y2 + dy, cw = 1 ^ ccw, da = ccw ? a0 - a1 : a1 - a0; + if (r < 0) throw new Error("negative radius: " + r); + if (this._x1 === null) { + this._ += "M" + x0 + "," + y0; + } else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) { + this._ += "L" + x0 + "," + y0; + } + if (!r) return; + if (da < 0) da = da % tau + tau; + if (da > tauEpsilon) { + this._ += "A" + r + "," + r + ",0,1," + cw + "," + (x2 - dx) + "," + (y2 - dy) + "A" + r + "," + r + ",0,1," + cw + "," + (this._x1 = x0) + "," + (this._y1 = y0); + } else if (da > epsilon) { + this._ += "A" + r + "," + r + ",0," + +(da >= pi) + "," + cw + "," + (this._x1 = x2 + r * Math.cos(a1)) + "," + (this._y1 = y2 + r * Math.sin(a1)); + } + }, + rect: function(x2, y2, w, h) { + this._ += "M" + (this._x0 = this._x1 = +x2) + "," + (this._y0 = this._y1 = +y2) + "h" + +w + "v" + +h + "h" + -w + "Z"; + }, + toString: function() { + return this._; + } +}; +var path_default = path; + +// node_modules/d3-shape/src/constant.js +function constant_default(x2) { + return function constant2() { + return x2; + }; +} + +// node_modules/d3-shape/src/math.js +var abs = Math.abs; +var atan2 = Math.atan2; +var cos = Math.cos; +var max2 = Math.max; +var min2 = Math.min; +var sin = Math.sin; +var sqrt = Math.sqrt; +var epsilon2 = 1e-12; +var pi2 = Math.PI; +var halfPi = pi2 / 2; +var tau2 = 2 * pi2; +function acos(x2) { + return x2 > 1 ? 0 : x2 < -1 ? pi2 : Math.acos(x2); +} +function asin(x2) { + return x2 >= 1 ? halfPi : x2 <= -1 ? -halfPi : Math.asin(x2); +} + +// node_modules/d3-shape/src/arc.js +function arcInnerRadius(d) { + return d.innerRadius; +} +function arcOuterRadius(d) { + return d.outerRadius; +} +function arcStartAngle(d) { + return d.startAngle; +} +function arcEndAngle(d) { + return d.endAngle; +} +function arcPadAngle(d) { + return d && d.padAngle; +} +function intersect(x0, y0, x1, y1, x2, y2, x3, y3) { + var x10 = x1 - x0, y10 = y1 - y0, x32 = x3 - x2, y32 = y3 - y2, t = y32 * x10 - x32 * y10; + if (t * t < epsilon2) return; + t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t; + return [x0 + t * x10, y0 + t * y10]; +} +function cornerTangents(x0, y0, x1, y1, r1, rc, cw) { + var x01 = x0 - x1, y01 = y0 - y1, lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01), ox = lo * y01, oy = -lo * x01, x11 = x0 + ox, y11 = y0 + oy, x10 = x1 + ox, y10 = y1 + oy, x00 = (x11 + x10) / 2, y00 = (y11 + y10) / 2, dx = x10 - x11, dy = y10 - y11, d2 = dx * dx + dy * dy, r = r1 - rc, D = x11 * y10 - x10 * y11, d = (dy < 0 ? -1 : 1) * sqrt(max2(0, r * r * d2 - D * D)), cx0 = (D * dy - dx * d) / d2, cy0 = (-D * dx - dy * d) / d2, cx1 = (D * dy + dx * d) / d2, cy1 = (-D * dx + dy * d) / d2, dx0 = cx0 - x00, dy0 = cy0 - y00, dx1 = cx1 - x00, dy1 = cy1 - y00; + if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1; + return { + cx: cx0, + cy: cy0, + x01: -ox, + y01: -oy, + x11: cx0 * (r1 / r - 1), + y11: cy0 * (r1 / r - 1) + }; +} +function arc_default() { + var innerRadius = arcInnerRadius, outerRadius = arcOuterRadius, cornerRadius = constant_default(0), padRadius = null, startAngle = arcStartAngle, endAngle = arcEndAngle, padAngle = arcPadAngle, context = null; + function arc() { + var buffer, r, r0 = +innerRadius.apply(this, arguments), r1 = +outerRadius.apply(this, arguments), a0 = startAngle.apply(this, arguments) - halfPi, a1 = endAngle.apply(this, arguments) - halfPi, da = abs(a1 - a0), cw = a1 > a0; + if (!context) context = buffer = path_default(); + if (r1 < r0) r = r1, r1 = r0, r0 = r; + if (!(r1 > epsilon2)) context.moveTo(0, 0); + else if (da > tau2 - epsilon2) { + context.moveTo(r1 * cos(a0), r1 * sin(a0)); + context.arc(0, 0, r1, a0, a1, !cw); + if (r0 > epsilon2) { + context.moveTo(r0 * cos(a1), r0 * sin(a1)); + context.arc(0, 0, r0, a1, a0, cw); + } + } else { + var a01 = a0, a11 = a1, a00 = a0, a10 = a1, da0 = da, da1 = da, ap = padAngle.apply(this, arguments) / 2, rp = ap > epsilon2 && (padRadius ? +padRadius.apply(this, arguments) : sqrt(r0 * r0 + r1 * r1)), rc = min2(abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments)), rc0 = rc, rc1 = rc, t02, t12; + if (rp > epsilon2) { + var p0 = asin(rp / r0 * sin(ap)), p1 = asin(rp / r1 * sin(ap)); + if ((da0 -= p0 * 2) > epsilon2) p0 *= cw ? 1 : -1, a00 += p0, a10 -= p0; + else da0 = 0, a00 = a10 = (a0 + a1) / 2; + if ((da1 -= p1 * 2) > epsilon2) p1 *= cw ? 1 : -1, a01 += p1, a11 -= p1; + else da1 = 0, a01 = a11 = (a0 + a1) / 2; + } + var x01 = r1 * cos(a01), y01 = r1 * sin(a01), x10 = r0 * cos(a10), y10 = r0 * sin(a10); + if (rc > epsilon2) { + var x11 = r1 * cos(a11), y11 = r1 * sin(a11), x00 = r0 * cos(a00), y00 = r0 * sin(a00), oc; + if (da < pi2 && (oc = intersect(x01, y01, x00, y00, x11, y11, x10, y10))) { + var ax = x01 - oc[0], ay = y01 - oc[1], bx = x11 - oc[0], by = y11 - oc[1], kc = 1 / sin(acos((ax * bx + ay * by) / (sqrt(ax * ax + ay * ay) * sqrt(bx * bx + by * by))) / 2), lc = sqrt(oc[0] * oc[0] + oc[1] * oc[1]); + rc0 = min2(rc, (r0 - lc) / (kc - 1)); + rc1 = min2(rc, (r1 - lc) / (kc + 1)); + } + } + if (!(da1 > epsilon2)) context.moveTo(x01, y01); + else if (rc1 > epsilon2) { + t02 = cornerTangents(x00, y00, x01, y01, r1, rc1, cw); + t12 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw); + context.moveTo(t02.cx + t02.x01, t02.cy + t02.y01); + if (rc1 < rc) context.arc(t02.cx, t02.cy, rc1, atan2(t02.y01, t02.x01), atan2(t12.y01, t12.x01), !cw); + else { + context.arc(t02.cx, t02.cy, rc1, atan2(t02.y01, t02.x01), atan2(t02.y11, t02.x11), !cw); + context.arc(0, 0, r1, atan2(t02.cy + t02.y11, t02.cx + t02.x11), atan2(t12.cy + t12.y11, t12.cx + t12.x11), !cw); + context.arc(t12.cx, t12.cy, rc1, atan2(t12.y11, t12.x11), atan2(t12.y01, t12.x01), !cw); + } + } else context.moveTo(x01, y01), context.arc(0, 0, r1, a01, a11, !cw); + if (!(r0 > epsilon2) || !(da0 > epsilon2)) context.lineTo(x10, y10); + else if (rc0 > epsilon2) { + t02 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw); + t12 = cornerTangents(x01, y01, x00, y00, r0, -rc0, cw); + context.lineTo(t02.cx + t02.x01, t02.cy + t02.y01); + if (rc0 < rc) context.arc(t02.cx, t02.cy, rc0, atan2(t02.y01, t02.x01), atan2(t12.y01, t12.x01), !cw); + else { + context.arc(t02.cx, t02.cy, rc0, atan2(t02.y01, t02.x01), atan2(t02.y11, t02.x11), !cw); + context.arc(0, 0, r0, atan2(t02.cy + t02.y11, t02.cx + t02.x11), atan2(t12.cy + t12.y11, t12.cx + t12.x11), cw); + context.arc(t12.cx, t12.cy, rc0, atan2(t12.y11, t12.x11), atan2(t12.y01, t12.x01), !cw); + } + } else context.arc(0, 0, r0, a10, a00, cw); + } + context.closePath(); + if (buffer) return context = null, buffer + "" || null; + } + arc.centroid = function() { + var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2, a2 = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - pi2 / 2; + return [cos(a2) * r, sin(a2) * r]; + }; + arc.innerRadius = function(_) { + return arguments.length ? (innerRadius = typeof _ === "function" ? _ : constant_default(+_), arc) : innerRadius; + }; + arc.outerRadius = function(_) { + return arguments.length ? (outerRadius = typeof _ === "function" ? _ : constant_default(+_), arc) : outerRadius; + }; + arc.cornerRadius = function(_) { + return arguments.length ? (cornerRadius = typeof _ === "function" ? _ : constant_default(+_), arc) : cornerRadius; + }; + arc.padRadius = function(_) { + return arguments.length ? (padRadius = _ == null ? null : typeof _ === "function" ? _ : constant_default(+_), arc) : padRadius; + }; + arc.startAngle = function(_) { + return arguments.length ? (startAngle = typeof _ === "function" ? _ : constant_default(+_), arc) : startAngle; + }; + arc.endAngle = function(_) { + return arguments.length ? (endAngle = typeof _ === "function" ? _ : constant_default(+_), arc) : endAngle; + }; + arc.padAngle = function(_) { + return arguments.length ? (padAngle = typeof _ === "function" ? _ : constant_default(+_), arc) : padAngle; + }; + arc.context = function(_) { + return arguments.length ? (context = _ == null ? null : _, arc) : context; + }; + return arc; +} + +// node_modules/d3-shape/src/curve/linear.js +function Linear(context) { + this._context = context; +} +Linear.prototype = { + areaStart: function() { + this._line = 0; + }, + areaEnd: function() { + this._line = NaN; + }, + lineStart: function() { + this._point = 0; + }, + lineEnd: function() { + if (this._line || this._line !== 0 && this._point === 1) this._context.closePath(); + this._line = 1 - this._line; + }, + point: function(x2, y2) { + x2 = +x2, y2 = +y2; + switch (this._point) { + case 0: + this._point = 1; + this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2); + break; + case 1: + this._point = 2; + default: + this._context.lineTo(x2, y2); + break; + } + } +}; +function linear_default(context) { + return new Linear(context); +} + +// node_modules/d3-shape/src/point.js +function x(p) { + return p[0]; +} +function y(p) { + return p[1]; +} + +// node_modules/d3-shape/src/line.js +function line_default() { + var x2 = x, y2 = y, defined = constant_default(true), context = null, curve = linear_default, output = null; + function line(data) { + var i, n = data.length, d, defined0 = false, buffer; + if (context == null) output = curve(buffer = path_default()); + for (i = 0; i <= n; ++i) { + if (!(i < n && defined(d = data[i], i, data)) === defined0) { + if (defined0 = !defined0) output.lineStart(); + else output.lineEnd(); + } + if (defined0) output.point(+x2(d, i, data), +y2(d, i, data)); + } + if (buffer) return output = null, buffer + "" || null; + } + line.x = function(_) { + return arguments.length ? (x2 = typeof _ === "function" ? _ : constant_default(+_), line) : x2; + }; + line.y = function(_) { + return arguments.length ? (y2 = typeof _ === "function" ? _ : constant_default(+_), line) : y2; + }; + line.defined = function(_) { + return arguments.length ? (defined = typeof _ === "function" ? _ : constant_default(!!_), line) : defined; + }; + line.curve = function(_) { + return arguments.length ? (curve = _, context != null && (output = curve(context)), line) : curve; + }; + line.context = function(_) { + return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), line) : context; + }; + return line; +} + +// node_modules/d3-shape/src/area.js +function area_default() { + var x0 = x, x1 = null, y0 = constant_default(0), y1 = y, defined = constant_default(true), context = null, curve = linear_default, output = null; + function area(data) { + var i, j, k2, n = data.length, d, defined0 = false, buffer, x0z = new Array(n), y0z = new Array(n); + if (context == null) output = curve(buffer = path_default()); + for (i = 0; i <= n; ++i) { + if (!(i < n && defined(d = data[i], i, data)) === defined0) { + if (defined0 = !defined0) { + j = i; + output.areaStart(); + output.lineStart(); + } else { + output.lineEnd(); + output.lineStart(); + for (k2 = i - 1; k2 >= j; --k2) { + output.point(x0z[k2], y0z[k2]); + } + output.lineEnd(); + output.areaEnd(); + } + } + if (defined0) { + x0z[i] = +x0(d, i, data), y0z[i] = +y0(d, i, data); + output.point(x1 ? +x1(d, i, data) : x0z[i], y1 ? +y1(d, i, data) : y0z[i]); + } + } + if (buffer) return output = null, buffer + "" || null; + } + function arealine() { + return line_default().defined(defined).curve(curve).context(context); + } + area.x = function(_) { + return arguments.length ? (x0 = typeof _ === "function" ? _ : constant_default(+_), x1 = null, area) : x0; + }; + area.x0 = function(_) { + return arguments.length ? (x0 = typeof _ === "function" ? _ : constant_default(+_), area) : x0; + }; + area.x1 = function(_) { + return arguments.length ? (x1 = _ == null ? null : typeof _ === "function" ? _ : constant_default(+_), area) : x1; + }; + area.y = function(_) { + return arguments.length ? (y0 = typeof _ === "function" ? _ : constant_default(+_), y1 = null, area) : y0; + }; + area.y0 = function(_) { + return arguments.length ? (y0 = typeof _ === "function" ? _ : constant_default(+_), area) : y0; + }; + area.y1 = function(_) { + return arguments.length ? (y1 = _ == null ? null : typeof _ === "function" ? _ : constant_default(+_), area) : y1; + }; + area.lineX0 = area.lineY0 = function() { + return arealine().x(x0).y(y0); + }; + area.lineY1 = function() { + return arealine().x(x0).y(y1); + }; + area.lineX1 = function() { + return arealine().x(x1).y(y0); + }; + area.defined = function(_) { + return arguments.length ? (defined = typeof _ === "function" ? _ : constant_default(!!_), area) : defined; + }; + area.curve = function(_) { + return arguments.length ? (curve = _, context != null && (output = curve(context)), area) : curve; + }; + area.context = function(_) { + return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), area) : context; + }; + return area; +} + +// node_modules/d3-shape/src/descending.js +function descending_default(a2, b) { + return b < a2 ? -1 : b > a2 ? 1 : b >= a2 ? 0 : NaN; +} + +// node_modules/d3-shape/src/identity.js +function identity_default(d) { + return d; +} + +// node_modules/d3-shape/src/pie.js +function pie_default() { + var value = identity_default, sortValues = descending_default, sort = null, startAngle = constant_default(0), endAngle = constant_default(tau2), padAngle = constant_default(0); + function pie(data) { + var i, n = data.length, j, k2, sum2 = 0, index = new Array(n), arcs = new Array(n), a0 = +startAngle.apply(this, arguments), da = Math.min(tau2, Math.max(-tau2, endAngle.apply(this, arguments) - a0)), a1, p = Math.min(Math.abs(da) / n, padAngle.apply(this, arguments)), pa = p * (da < 0 ? -1 : 1), v; + for (i = 0; i < n; ++i) { + if ((v = arcs[index[i] = i] = +value(data[i], i, data)) > 0) { + sum2 += v; + } + } + if (sortValues != null) index.sort(function(i2, j2) { + return sortValues(arcs[i2], arcs[j2]); + }); + else if (sort != null) index.sort(function(i2, j2) { + return sort(data[i2], data[j2]); + }); + for (i = 0, k2 = sum2 ? (da - n * pa) / sum2 : 0; i < n; ++i, a0 = a1) { + j = index[i], v = arcs[j], a1 = a0 + (v > 0 ? v * k2 : 0) + pa, arcs[j] = { + data: data[j], + index: i, + value: v, + startAngle: a0, + endAngle: a1, + padAngle: p + }; + } + return arcs; + } + pie.value = function(_) { + return arguments.length ? (value = typeof _ === "function" ? _ : constant_default(+_), pie) : value; + }; + pie.sortValues = function(_) { + return arguments.length ? (sortValues = _, sort = null, pie) : sortValues; + }; + pie.sort = function(_) { + return arguments.length ? (sort = _, sortValues = null, pie) : sort; + }; + pie.startAngle = function(_) { + return arguments.length ? (startAngle = typeof _ === "function" ? _ : constant_default(+_), pie) : startAngle; + }; + pie.endAngle = function(_) { + return arguments.length ? (endAngle = typeof _ === "function" ? _ : constant_default(+_), pie) : endAngle; + }; + pie.padAngle = function(_) { + return arguments.length ? (padAngle = typeof _ === "function" ? _ : constant_default(+_), pie) : padAngle; + }; + return pie; +} + +// node_modules/d3-shape/src/curve/radial.js +var curveRadialLinear = curveRadial(linear_default); +function Radial(curve) { + this._curve = curve; +} +Radial.prototype = { + areaStart: function() { + this._curve.areaStart(); + }, + areaEnd: function() { + this._curve.areaEnd(); + }, + lineStart: function() { + this._curve.lineStart(); + }, + lineEnd: function() { + this._curve.lineEnd(); + }, + point: function(a2, r) { + this._curve.point(r * Math.sin(a2), r * -Math.cos(a2)); + } +}; +function curveRadial(curve) { + function radial(context) { + return new Radial(curve(context)); + } + radial._curve = curve; + return radial; +} + +// node_modules/d3-shape/src/array.js +var slice = Array.prototype.slice; + +// node_modules/d3-shape/src/symbol/diamond.js +var tan30 = Math.sqrt(1 / 3); +var tan30_2 = tan30 * 2; + +// node_modules/d3-shape/src/symbol/star.js +var kr = Math.sin(pi2 / 10) / Math.sin(7 * pi2 / 10); +var kx = Math.sin(tau2 / 10) * kr; +var ky = -Math.cos(tau2 / 10) * kr; + +// node_modules/d3-shape/src/symbol/triangle.js +var sqrt3 = Math.sqrt(3); + +// node_modules/d3-shape/src/symbol/wye.js +var s = Math.sqrt(3) / 2; +var k = 1 / Math.sqrt(12); +var a = (k / 2 + 1) * 3; + +// node_modules/d3-shape/src/noop.js +function noop_default() { +} + +// node_modules/d3-shape/src/curve/basis.js +function point(that, x2, y2) { + that._context.bezierCurveTo( + (2 * that._x0 + that._x1) / 3, + (2 * that._y0 + that._y1) / 3, + (that._x0 + 2 * that._x1) / 3, + (that._y0 + 2 * that._y1) / 3, + (that._x0 + 4 * that._x1 + x2) / 6, + (that._y0 + 4 * that._y1 + y2) / 6 + ); +} +function Basis(context) { + this._context = context; +} +Basis.prototype = { + areaStart: function() { + this._line = 0; + }, + areaEnd: function() { + this._line = NaN; + }, + lineStart: function() { + this._x0 = this._x1 = this._y0 = this._y1 = NaN; + this._point = 0; + }, + lineEnd: function() { + switch (this._point) { + case 3: + point(this, this._x1, this._y1); + case 2: + this._context.lineTo(this._x1, this._y1); + break; + } + if (this._line || this._line !== 0 && this._point === 1) this._context.closePath(); + this._line = 1 - this._line; + }, + point: function(x2, y2) { + x2 = +x2, y2 = +y2; + switch (this._point) { + case 0: + this._point = 1; + this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2); + break; + case 1: + this._point = 2; + break; + case 2: + this._point = 3; + this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6); + default: + point(this, x2, y2); + break; + } + this._x0 = this._x1, this._x1 = x2; + this._y0 = this._y1, this._y1 = y2; + } +}; + +// node_modules/d3-shape/src/curve/basisClosed.js +function BasisClosed(context) { + this._context = context; +} +BasisClosed.prototype = { + areaStart: noop_default, + areaEnd: noop_default, + lineStart: function() { + this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = NaN; + this._point = 0; + }, + lineEnd: function() { + switch (this._point) { + case 1: { + this._context.moveTo(this._x2, this._y2); + this._context.closePath(); + break; + } + case 2: { + this._context.moveTo((this._x2 + 2 * this._x3) / 3, (this._y2 + 2 * this._y3) / 3); + this._context.lineTo((this._x3 + 2 * this._x2) / 3, (this._y3 + 2 * this._y2) / 3); + this._context.closePath(); + break; + } + case 3: { + this.point(this._x2, this._y2); + this.point(this._x3, this._y3); + this.point(this._x4, this._y4); + break; + } + } + }, + point: function(x2, y2) { + x2 = +x2, y2 = +y2; + switch (this._point) { + case 0: + this._point = 1; + this._x2 = x2, this._y2 = y2; + break; + case 1: + this._point = 2; + this._x3 = x2, this._y3 = y2; + break; + case 2: + this._point = 3; + this._x4 = x2, this._y4 = y2; + this._context.moveTo((this._x0 + 4 * this._x1 + x2) / 6, (this._y0 + 4 * this._y1 + y2) / 6); + break; + default: + point(this, x2, y2); + break; + } + this._x0 = this._x1, this._x1 = x2; + this._y0 = this._y1, this._y1 = y2; + } +}; + +// node_modules/d3-shape/src/curve/basisOpen.js +function BasisOpen(context) { + this._context = context; +} +BasisOpen.prototype = { + areaStart: function() { + this._line = 0; + }, + areaEnd: function() { + this._line = NaN; + }, + lineStart: function() { + this._x0 = this._x1 = this._y0 = this._y1 = NaN; + this._point = 0; + }, + lineEnd: function() { + if (this._line || this._line !== 0 && this._point === 3) this._context.closePath(); + this._line = 1 - this._line; + }, + point: function(x2, y2) { + x2 = +x2, y2 = +y2; + switch (this._point) { + case 0: + this._point = 1; + break; + case 1: + this._point = 2; + break; + case 2: + this._point = 3; + var x0 = (this._x0 + 4 * this._x1 + x2) / 6, y0 = (this._y0 + 4 * this._y1 + y2) / 6; + this._line ? this._context.lineTo(x0, y0) : this._context.moveTo(x0, y0); + break; + case 3: + this._point = 4; + default: + point(this, x2, y2); + break; + } + this._x0 = this._x1, this._x1 = x2; + this._y0 = this._y1, this._y1 = y2; + } +}; + +// node_modules/d3-shape/src/curve/bundle.js +function Bundle(context, beta) { + this._basis = new Basis(context); + this._beta = beta; +} +Bundle.prototype = { + lineStart: function() { + this._x = []; + this._y = []; + this._basis.lineStart(); + }, + lineEnd: function() { + var x2 = this._x, y2 = this._y, j = x2.length - 1; + if (j > 0) { + var x0 = x2[0], y0 = y2[0], dx = x2[j] - x0, dy = y2[j] - y0, i = -1, t; + while (++i <= j) { + t = i / j; + this._basis.point( + this._beta * x2[i] + (1 - this._beta) * (x0 + t * dx), + this._beta * y2[i] + (1 - this._beta) * (y0 + t * dy) + ); + } + } + this._x = this._y = null; + this._basis.lineEnd(); + }, + point: function(x2, y2) { + this._x.push(+x2); + this._y.push(+y2); + } +}; +var bundle_default = function custom(beta) { + function bundle(context) { + return beta === 1 ? new Basis(context) : new Bundle(context, beta); + } + bundle.beta = function(beta2) { + return custom(+beta2); + }; + return bundle; +}(0.85); + +// node_modules/d3-shape/src/curve/cardinal.js +function point2(that, x2, y2) { + that._context.bezierCurveTo( + that._x1 + that._k * (that._x2 - that._x0), + that._y1 + that._k * (that._y2 - that._y0), + that._x2 + that._k * (that._x1 - x2), + that._y2 + that._k * (that._y1 - y2), + that._x2, + that._y2 + ); +} +function Cardinal(context, tension) { + this._context = context; + this._k = (1 - tension) / 6; +} +Cardinal.prototype = { + areaStart: function() { + this._line = 0; + }, + areaEnd: function() { + this._line = NaN; + }, + lineStart: function() { + this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN; + this._point = 0; + }, + lineEnd: function() { + switch (this._point) { + case 2: + this._context.lineTo(this._x2, this._y2); + break; + case 3: + point2(this, this._x1, this._y1); + break; + } + if (this._line || this._line !== 0 && this._point === 1) this._context.closePath(); + this._line = 1 - this._line; + }, + point: function(x2, y2) { + x2 = +x2, y2 = +y2; + switch (this._point) { + case 0: + this._point = 1; + this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2); + break; + case 1: + this._point = 2; + this._x1 = x2, this._y1 = y2; + break; + case 2: + this._point = 3; + default: + point2(this, x2, y2); + break; + } + this._x0 = this._x1, this._x1 = this._x2, this._x2 = x2; + this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2; + } +}; +var cardinal_default = function custom2(tension) { + function cardinal(context) { + return new Cardinal(context, tension); + } + cardinal.tension = function(tension2) { + return custom2(+tension2); + }; + return cardinal; +}(0); + +// node_modules/d3-shape/src/curve/cardinalClosed.js +function CardinalClosed(context, tension) { + this._context = context; + this._k = (1 - tension) / 6; +} +CardinalClosed.prototype = { + areaStart: noop_default, + areaEnd: noop_default, + lineStart: function() { + this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN; + this._point = 0; + }, + lineEnd: function() { + switch (this._point) { + case 1: { + this._context.moveTo(this._x3, this._y3); + this._context.closePath(); + break; + } + case 2: { + this._context.lineTo(this._x3, this._y3); + this._context.closePath(); + break; + } + case 3: { + this.point(this._x3, this._y3); + this.point(this._x4, this._y4); + this.point(this._x5, this._y5); + break; + } + } + }, + point: function(x2, y2) { + x2 = +x2, y2 = +y2; + switch (this._point) { + case 0: + this._point = 1; + this._x3 = x2, this._y3 = y2; + break; + case 1: + this._point = 2; + this._context.moveTo(this._x4 = x2, this._y4 = y2); + break; + case 2: + this._point = 3; + this._x5 = x2, this._y5 = y2; + break; + default: + point2(this, x2, y2); + break; + } + this._x0 = this._x1, this._x1 = this._x2, this._x2 = x2; + this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2; + } +}; +var cardinalClosed_default = function custom3(tension) { + function cardinal(context) { + return new CardinalClosed(context, tension); + } + cardinal.tension = function(tension2) { + return custom3(+tension2); + }; + return cardinal; +}(0); + +// node_modules/d3-shape/src/curve/cardinalOpen.js +function CardinalOpen(context, tension) { + this._context = context; + this._k = (1 - tension) / 6; +} +CardinalOpen.prototype = { + areaStart: function() { + this._line = 0; + }, + areaEnd: function() { + this._line = NaN; + }, + lineStart: function() { + this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN; + this._point = 0; + }, + lineEnd: function() { + if (this._line || this._line !== 0 && this._point === 3) this._context.closePath(); + this._line = 1 - this._line; + }, + point: function(x2, y2) { + x2 = +x2, y2 = +y2; + switch (this._point) { + case 0: + this._point = 1; + break; + case 1: + this._point = 2; + break; + case 2: + this._point = 3; + this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); + break; + case 3: + this._point = 4; + default: + point2(this, x2, y2); + break; + } + this._x0 = this._x1, this._x1 = this._x2, this._x2 = x2; + this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2; + } +}; +var cardinalOpen_default = function custom4(tension) { + function cardinal(context) { + return new CardinalOpen(context, tension); + } + cardinal.tension = function(tension2) { + return custom4(+tension2); + }; + return cardinal; +}(0); + +// node_modules/d3-shape/src/curve/catmullRom.js +function point3(that, x2, y2) { + var x1 = that._x1, y1 = that._y1, x22 = that._x2, y22 = that._y2; + if (that._l01_a > epsilon2) { + var a2 = 2 * that._l01_2a + 3 * that._l01_a * that._l12_a + that._l12_2a, n = 3 * that._l01_a * (that._l01_a + that._l12_a); + x1 = (x1 * a2 - that._x0 * that._l12_2a + that._x2 * that._l01_2a) / n; + y1 = (y1 * a2 - that._y0 * that._l12_2a + that._y2 * that._l01_2a) / n; + } + if (that._l23_a > epsilon2) { + var b = 2 * that._l23_2a + 3 * that._l23_a * that._l12_a + that._l12_2a, m = 3 * that._l23_a * (that._l23_a + that._l12_a); + x22 = (x22 * b + that._x1 * that._l23_2a - x2 * that._l12_2a) / m; + y22 = (y22 * b + that._y1 * that._l23_2a - y2 * that._l12_2a) / m; + } + that._context.bezierCurveTo(x1, y1, x22, y22, that._x2, that._y2); +} +function CatmullRom(context, alpha) { + this._context = context; + this._alpha = alpha; +} +CatmullRom.prototype = { + areaStart: function() { + this._line = 0; + }, + areaEnd: function() { + this._line = NaN; + }, + lineStart: function() { + this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN; + this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0; + }, + lineEnd: function() { + switch (this._point) { + case 2: + this._context.lineTo(this._x2, this._y2); + break; + case 3: + this.point(this._x2, this._y2); + break; + } + if (this._line || this._line !== 0 && this._point === 1) this._context.closePath(); + this._line = 1 - this._line; + }, + point: function(x2, y2) { + x2 = +x2, y2 = +y2; + if (this._point) { + var x23 = this._x2 - x2, y23 = this._y2 - y2; + this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha)); + } + switch (this._point) { + case 0: + this._point = 1; + this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2); + break; + case 1: + this._point = 2; + break; + case 2: + this._point = 3; + default: + point3(this, x2, y2); + break; + } + this._l01_a = this._l12_a, this._l12_a = this._l23_a; + this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a; + this._x0 = this._x1, this._x1 = this._x2, this._x2 = x2; + this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2; + } +}; +var catmullRom_default = function custom5(alpha) { + function catmullRom(context) { + return alpha ? new CatmullRom(context, alpha) : new Cardinal(context, 0); + } + catmullRom.alpha = function(alpha2) { + return custom5(+alpha2); + }; + return catmullRom; +}(0.5); + +// node_modules/d3-shape/src/curve/catmullRomClosed.js +function CatmullRomClosed(context, alpha) { + this._context = context; + this._alpha = alpha; +} +CatmullRomClosed.prototype = { + areaStart: noop_default, + areaEnd: noop_default, + lineStart: function() { + this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN; + this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0; + }, + lineEnd: function() { + switch (this._point) { + case 1: { + this._context.moveTo(this._x3, this._y3); + this._context.closePath(); + break; + } + case 2: { + this._context.lineTo(this._x3, this._y3); + this._context.closePath(); + break; + } + case 3: { + this.point(this._x3, this._y3); + this.point(this._x4, this._y4); + this.point(this._x5, this._y5); + break; + } + } + }, + point: function(x2, y2) { + x2 = +x2, y2 = +y2; + if (this._point) { + var x23 = this._x2 - x2, y23 = this._y2 - y2; + this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha)); + } + switch (this._point) { + case 0: + this._point = 1; + this._x3 = x2, this._y3 = y2; + break; + case 1: + this._point = 2; + this._context.moveTo(this._x4 = x2, this._y4 = y2); + break; + case 2: + this._point = 3; + this._x5 = x2, this._y5 = y2; + break; + default: + point3(this, x2, y2); + break; + } + this._l01_a = this._l12_a, this._l12_a = this._l23_a; + this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a; + this._x0 = this._x1, this._x1 = this._x2, this._x2 = x2; + this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2; + } +}; +var catmullRomClosed_default = function custom6(alpha) { + function catmullRom(context) { + return alpha ? new CatmullRomClosed(context, alpha) : new CardinalClosed(context, 0); + } + catmullRom.alpha = function(alpha2) { + return custom6(+alpha2); + }; + return catmullRom; +}(0.5); + +// node_modules/d3-shape/src/curve/catmullRomOpen.js +function CatmullRomOpen(context, alpha) { + this._context = context; + this._alpha = alpha; +} +CatmullRomOpen.prototype = { + areaStart: function() { + this._line = 0; + }, + areaEnd: function() { + this._line = NaN; + }, + lineStart: function() { + this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN; + this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0; + }, + lineEnd: function() { + if (this._line || this._line !== 0 && this._point === 3) this._context.closePath(); + this._line = 1 - this._line; + }, + point: function(x2, y2) { + x2 = +x2, y2 = +y2; + if (this._point) { + var x23 = this._x2 - x2, y23 = this._y2 - y2; + this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha)); + } + switch (this._point) { + case 0: + this._point = 1; + break; + case 1: + this._point = 2; + break; + case 2: + this._point = 3; + this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); + break; + case 3: + this._point = 4; + default: + point3(this, x2, y2); + break; + } + this._l01_a = this._l12_a, this._l12_a = this._l23_a; + this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a; + this._x0 = this._x1, this._x1 = this._x2, this._x2 = x2; + this._y0 = this._y1, this._y1 = this._y2, this._y2 = y2; + } +}; +var catmullRomOpen_default = function custom7(alpha) { + function catmullRom(context) { + return alpha ? new CatmullRomOpen(context, alpha) : new CardinalOpen(context, 0); + } + catmullRom.alpha = function(alpha2) { + return custom7(+alpha2); + }; + return catmullRom; +}(0.5); + +// node_modules/d3-shape/src/curve/linearClosed.js +function LinearClosed(context) { + this._context = context; +} +LinearClosed.prototype = { + areaStart: noop_default, + areaEnd: noop_default, + lineStart: function() { + this._point = 0; + }, + lineEnd: function() { + if (this._point) this._context.closePath(); + }, + point: function(x2, y2) { + x2 = +x2, y2 = +y2; + if (this._point) this._context.lineTo(x2, y2); + else this._point = 1, this._context.moveTo(x2, y2); + } +}; + +// node_modules/d3-shape/src/curve/monotone.js +function sign(x2) { + return x2 < 0 ? -1 : 1; +} +function slope3(that, x2, y2) { + var h0 = that._x1 - that._x0, h1 = x2 - that._x1, s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0), s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0), p = (s0 * h1 + s1 * h0) / (h0 + h1); + return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0; +} +function slope2(that, t) { + var h = that._x1 - that._x0; + return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t; +} +function point4(that, t02, t12) { + var x0 = that._x0, y0 = that._y0, x1 = that._x1, y1 = that._y1, dx = (x1 - x0) / 3; + that._context.bezierCurveTo(x0 + dx, y0 + dx * t02, x1 - dx, y1 - dx * t12, x1, y1); +} +function MonotoneX(context) { + this._context = context; +} +MonotoneX.prototype = { + areaStart: function() { + this._line = 0; + }, + areaEnd: function() { + this._line = NaN; + }, + lineStart: function() { + this._x0 = this._x1 = this._y0 = this._y1 = this._t0 = NaN; + this._point = 0; + }, + lineEnd: function() { + switch (this._point) { + case 2: + this._context.lineTo(this._x1, this._y1); + break; + case 3: + point4(this, this._t0, slope2(this, this._t0)); + break; + } + if (this._line || this._line !== 0 && this._point === 1) this._context.closePath(); + this._line = 1 - this._line; + }, + point: function(x2, y2) { + var t12 = NaN; + x2 = +x2, y2 = +y2; + if (x2 === this._x1 && y2 === this._y1) return; + switch (this._point) { + case 0: + this._point = 1; + this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2); + break; + case 1: + this._point = 2; + break; + case 2: + this._point = 3; + point4(this, slope2(this, t12 = slope3(this, x2, y2)), t12); + break; + default: + point4(this, this._t0, t12 = slope3(this, x2, y2)); + break; + } + this._x0 = this._x1, this._x1 = x2; + this._y0 = this._y1, this._y1 = y2; + this._t0 = t12; + } +}; +function MonotoneY(context) { + this._context = new ReflectContext(context); +} +(MonotoneY.prototype = Object.create(MonotoneX.prototype)).point = function(x2, y2) { + MonotoneX.prototype.point.call(this, y2, x2); +}; +function ReflectContext(context) { + this._context = context; +} +ReflectContext.prototype = { + moveTo: function(x2, y2) { + this._context.moveTo(y2, x2); + }, + closePath: function() { + this._context.closePath(); + }, + lineTo: function(x2, y2) { + this._context.lineTo(y2, x2); + }, + bezierCurveTo: function(x1, y1, x2, y2, x3, y3) { + this._context.bezierCurveTo(y1, x1, y2, x2, y3, x3); + } +}; + +// node_modules/d3-shape/src/curve/natural.js +function Natural(context) { + this._context = context; +} +Natural.prototype = { + areaStart: function() { + this._line = 0; + }, + areaEnd: function() { + this._line = NaN; + }, + lineStart: function() { + this._x = []; + this._y = []; + }, + lineEnd: function() { + var x2 = this._x, y2 = this._y, n = x2.length; + if (n) { + this._line ? this._context.lineTo(x2[0], y2[0]) : this._context.moveTo(x2[0], y2[0]); + if (n === 2) { + this._context.lineTo(x2[1], y2[1]); + } else { + var px = controlPoints(x2), py = controlPoints(y2); + for (var i0 = 0, i1 = 1; i1 < n; ++i0, ++i1) { + this._context.bezierCurveTo(px[0][i0], py[0][i0], px[1][i0], py[1][i0], x2[i1], y2[i1]); + } + } + } + if (this._line || this._line !== 0 && n === 1) this._context.closePath(); + this._line = 1 - this._line; + this._x = this._y = null; + }, + point: function(x2, y2) { + this._x.push(+x2); + this._y.push(+y2); + } +}; +function controlPoints(x2) { + var i, n = x2.length - 1, m, a2 = new Array(n), b = new Array(n), r = new Array(n); + a2[0] = 0, b[0] = 2, r[0] = x2[0] + 2 * x2[1]; + for (i = 1; i < n - 1; ++i) a2[i] = 1, b[i] = 4, r[i] = 4 * x2[i] + 2 * x2[i + 1]; + a2[n - 1] = 2, b[n - 1] = 7, r[n - 1] = 8 * x2[n - 1] + x2[n]; + for (i = 1; i < n; ++i) m = a2[i] / b[i - 1], b[i] -= m, r[i] -= m * r[i - 1]; + a2[n - 1] = r[n - 1] / b[n - 1]; + for (i = n - 2; i >= 0; --i) a2[i] = (r[i] - a2[i + 1]) / b[i]; + b[n - 1] = (x2[n] + a2[n - 1]) / 2; + for (i = 0; i < n - 1; ++i) b[i] = 2 * x2[i + 1] - a2[i + 1]; + return [a2, b]; +} + +// node_modules/d3-shape/src/curve/step.js +function Step(context, t) { + this._context = context; + this._t = t; +} +Step.prototype = { + areaStart: function() { + this._line = 0; + }, + areaEnd: function() { + this._line = NaN; + }, + lineStart: function() { + this._x = this._y = NaN; + this._point = 0; + }, + lineEnd: function() { + if (0 < this._t && this._t < 1 && this._point === 2) this._context.lineTo(this._x, this._y); + if (this._line || this._line !== 0 && this._point === 1) this._context.closePath(); + if (this._line >= 0) this._t = 1 - this._t, this._line = 1 - this._line; + }, + point: function(x2, y2) { + x2 = +x2, y2 = +y2; + switch (this._point) { + case 0: + this._point = 1; + this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2); + break; + case 1: + this._point = 2; + default: { + if (this._t <= 0) { + this._context.lineTo(this._x, y2); + this._context.lineTo(x2, y2); + } else { + var x1 = this._x * (1 - this._t) + x2 * this._t; + this._context.lineTo(x1, this._y); + this._context.lineTo(x1, y2); + } + break; + } + } + this._x = x2, this._y = y2; + } +}; + +// node_modules/@cloudscape-design/components/area-chart/elements/area-series.js +var area_series_default = (0, import_react116.memo)(AreaSeries); +function AreaSeries({ data, color: color2, chartAreaClipPath }) { + const areaGenerator = area_default().x((p) => p.scaled.x).y0((p) => p.scaled.y0).y1((p) => p.scaled.y1); + const areaPath = areaGenerator(data) || ""; + const lineGenerator = line_default().x((p) => p.scaled.x).y((p) => p.scaled.y1); + const linePath = lineGenerator(data) || ""; + return import_react116.default.createElement( + import_react116.default.Fragment, + null, + import_react116.default.createElement("path", { "aria-hidden": true, fill: color2, stroke: color2, style: { opacity: 0.4 }, clipPath: `url(#${chartAreaClipPath})`, d: areaPath }), + import_react116.default.createElement("path", { "aria-hidden": true, stroke: color2, clipPath: `url(#${chartAreaClipPath})`, d: linePath }) + ); +} + +// node_modules/@cloudscape-design/components/area-chart/elements/threshold-series.js +var import_react117 = __toESM(require_react()); +var threshold_series_default = (0, import_react117.memo)(ThresholdSeries); +function ThresholdSeries({ data, xScale, color: color2, chartAreaClipPath }) { + const range2 = xScale.d3Scale.range(); + const y2 = data[0].scaled.y0; + const path2 = { x1: range2[0], x2: range2[1], y1: y2, y2 }; + return import_react117.default.createElement("line", Object.assign({ "aria-hidden": true, stroke: color2, clipPath: `url(#${chartAreaClipPath})` }, path2)); +} + +// node_modules/@cloudscape-design/components/area-chart/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/area-chart/styles.scoped.css"; +var styles_css_default40 = { + "series": "awsui_series_y1yrh_17b8g_99", + "root": "awsui_root_y1yrh_17b8g_117", + "series--highlighted": "awsui_series--highlighted_y1yrh_17b8g_129", + "series--dimmed": "awsui_series--dimmed_y1yrh_17b8g_133", + "series--threshold": "awsui_series--threshold_y1yrh_17b8g_137", + "popover-divider": "awsui_popover-divider_y1yrh_17b8g_142" +}; + +// node_modules/@cloudscape-design/components/area-chart/elements/data-series.js +var data_series_default = (0, import_react118.memo)(DataSeries); +function DataSeries({ model }) { + const chartAreaClipPath = useUniqueId("awsui-area-chart__chart-area-"); + const highlightedX = useSelector(model.interactions, (state) => state.highlightedX); + const highlightedSeries = useSelector(model.interactions, (state) => state.highlightedSeries); + const useHighlightDimmed = !highlightedX; + const seriesData = []; + for (let seriesIndex = model.series.length - 1; seriesIndex >= 0; seriesIndex--) { + if (model.computed.plot.sx[seriesIndex]) { + seriesData.push([model.series[seriesIndex], model.computed.plot.sx[seriesIndex] || []]); + } + } + return import_react118.default.createElement( + import_react118.default.Fragment, + null, + import_react118.default.createElement( + "defs", + { "aria-hidden": "true" }, + import_react118.default.createElement( + "clipPath", + { id: chartAreaClipPath }, + import_react118.default.createElement("rect", { x: 0, y: 0, width: model.width, height: model.height }) + ) + ), + import_react118.default.createElement("g", { role: "group" }, seriesData.map(([series, data]) => { + const isHighlighted = series === highlightedSeries; + const isDimmed = !!highlightedSeries && !isHighlighted; + return import_react118.default.createElement("g", { key: series.title, role: "group", "aria-label": series.title, className: clsx_m_default(styles_css_default40.series, styles_css_default40[`series--${series.type}`], { + [styles_css_default40["series--highlighted"]]: isHighlighted, + [styles_css_default40["series--dimmed"]]: useHighlightDimmed && isDimmed + }) }, series.type === "area" ? import_react118.default.createElement(area_series_default, { data, color: model.getInternalSeries(series).color, chartAreaClipPath }) : import_react118.default.createElement(threshold_series_default, { data, xScale: model.computed.xScale, color: model.getInternalSeries(series).color, chartAreaClipPath })); + })) + ); +} + +// node_modules/@cloudscape-design/components/area-chart/elements/chart-popover.js +var import_react125 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/internal/components/chart-popover/index.js +var import_react119 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/internal/components/chart-popover/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/internal/components/chart-popover/styles.scoped.css"; +var styles_css_default41 = { + "root": "awsui_root_1t44z_16g1a_99", + "hover-area": "awsui_hover-area_1t44z_16g1a_135", + "popover-body": "awsui_popover-body_1t44z_16g1a_143" +}; + +// node_modules/@cloudscape-design/components/internal/components/chart-popover/index.js +var chart_popover_default = import_react119.default.forwardRef(ChartPopover); +function ChartPopover(_a, ref) { + var { position = "right", size = "medium", fixedWidth = false, dismissButton: dismissButton2 = false, dismissAriaLabel, children: children2, title, trackRef, trackKey, onDismiss, container, onMouseEnter, onMouseLeave, onBlur } = _a, restProps = __rest(_a, ["position", "size", "fixedWidth", "dismissButton", "dismissAriaLabel", "children", "title", "trackRef", "trackKey", "onDismiss", "container", "onMouseEnter", "onMouseLeave", "onBlur"]); + const baseProps = getBaseProps(restProps); + const popoverObjectRef = (0, import_react119.useRef)(null); + const popoverRef = useMergeRefs(popoverObjectRef, ref); + (0, import_react119.useEffect)(() => { + const onDocumentClick = (event) => { + if (event.target && !nodeBelongs(popoverObjectRef.current, event.target) && // click not in popover + !nodeContains(container, event.target)) { + onDismiss(true); + } + }; + document.addEventListener("mousedown", onDocumentClick, { capture: true }); + return () => { + document.removeEventListener("mousedown", onDocumentClick, { capture: true }); + }; + }, [container, onDismiss]); + const isPinned = dismissButton2; + return import_react119.default.createElement( + "div", + Object.assign({}, baseProps, { + className: clsx_m_default(styles_css_default2.root, styles_css_default41.root, baseProps.className), + ref: popoverRef, + onMouseEnter, + onMouseLeave, + onBlur, + // The tabIndex makes it so that clicking inside popover assigns this element as blur target. + // That is necessary in charts to ensure the blur target is within the chart and no cleanup is needed. + tabIndex: -1 + }), + import_react119.default.createElement( + PopoverContainer, + { size, fixedWidth, position, trackRef, trackKey, arrow: (position2) => import_react119.default.createElement( + "div", + { className: clsx_m_default(styles_css_default2.arrow, styles_css_default2[`arrow-position-${position2}`]) }, + import_react119.default.createElement("div", { className: styles_css_default2["arrow-outer"] }), + import_react119.default.createElement("div", { className: styles_css_default2["arrow-inner"] }) + ), keepPosition: true, allowVerticalOverflow: true, allowScrollToFit: isPinned }, + import_react119.default.createElement( + "div", + { className: styles_css_default41["hover-area"] }, + import_react119.default.createElement(PopoverBody, { dismissButton: dismissButton2, dismissAriaLabel, header: title, onDismiss, overflowVisible: "content", className: styles_css_default41["popover-body"] }, children2) + ) + ) + ); +} + +// node_modules/@cloudscape-design/components/internal/components/chart-series-details/index.js +var import_react123 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/internal/components/chart-series-details/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/internal/components/chart-series-details/styles.scoped.css"; +var styles_css_default42 = { + "dimmed": "awsui_dimmed_10ipo_1di0o_99", + "marker": "awsui_marker_10ipo_1di0o_150", + "marker--line": "awsui_marker--line_10ipo_1di0o_193", + "marker--rectangle": "awsui_marker--rectangle_10ipo_1di0o_197", + "marker--hollow-rectangle": "awsui_marker--hollow-rectangle_10ipo_1di0o_204", + "marker--dashed": "awsui_marker--dashed_10ipo_1di0o_220", + "root": "awsui_root_10ipo_1di0o_243", + "value": "awsui_value_10ipo_1di0o_278", + "expandable": "awsui_expandable_10ipo_1di0o_282", + "list-item": "awsui_list-item_10ipo_1di0o_286", + "inner-list-item": "awsui_inner-list-item_10ipo_1di0o_287", + "key-value-pair": "awsui_key-value-pair_10ipo_1di0o_292", + "expandable-section": "awsui_expandable-section_10ipo_1di0o_293", + "key": "awsui_key_10ipo_1di0o_292", + "sub-items": "awsui_sub-items_10ipo_1di0o_306", + "list": "awsui_list_10ipo_1di0o_286", + "compact": "awsui_compact_10ipo_1di0o_332", + "with-sub-items": "awsui_with-sub-items_10ipo_1di0o_337", + "full-width": "awsui_full-width_10ipo_1di0o_342", + "announced": "awsui_announced_10ipo_1di0o_346" +}; + +// node_modules/@cloudscape-design/components/expandable-section/internal.js +var import_react122 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/expandable-section/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/expandable-section/styles.scoped.css"; +var styles_css_default43 = { + "content-enter": "awsui_content-enter_gwq0h_xoje_103", + "awsui-motion-fade-in": "awsui_awsui-motion-fade-in_gwq0h_xoje_1", + "trigger-expanded": "awsui_trigger-expanded_gwq0h_xoje_125", + "icon": "awsui_icon_gwq0h_xoje_139", + "root": "awsui_root_gwq0h_xoje_157", + "expand-button": "awsui_expand-button_gwq0h_xoje_195", + "expanded": "awsui_expanded_gwq0h_xoje_202", + "icon-container": "awsui_icon-container_gwq0h_xoje_212", + "icon-container-container": "awsui_icon-container-container_gwq0h_xoje_216", + "wrapper": "awsui_wrapper_gwq0h_xoje_220", + "wrapper-default": "awsui_wrapper-default_gwq0h_xoje_228", + "wrapper-footer": "awsui_wrapper-footer_gwq0h_xoje_228", + "wrapper-navigation": "awsui_wrapper-navigation_gwq0h_xoje_232", + "wrapper-container": "awsui_wrapper-container_gwq0h_xoje_235", + "wrapper-compact": "awsui_wrapper-compact_gwq0h_xoje_239", + "header-deprecated": "awsui_header-deprecated_gwq0h_xoje_252", + "wrapper-expanded": "awsui_wrapper-expanded_gwq0h_xoje_274", + "header": "awsui_header_gwq0h_xoje_252", + "header-wrapper": "awsui_header-wrapper_gwq0h_xoje_294", + "header-actions-wrapper": "awsui_header-actions-wrapper_gwq0h_xoje_306", + "header-button": "awsui_header-button_gwq0h_xoje_311", + "header-container-button": "awsui_header-container-button_gwq0h_xoje_311", + "header-container": "awsui_header-container_gwq0h_xoje_311", + "header-navigation": "awsui_header-navigation_gwq0h_xoje_346", + "header-text": "awsui_header-text_gwq0h_xoje_383", + "content": "awsui_content_gwq0h_xoje_103", + "content-default": "awsui_content-default_gwq0h_xoje_390", + "content-footer": "awsui_content-footer_gwq0h_xoje_394", + "content-expanded": "awsui_content-expanded_gwq0h_xoje_398", + "content-compact": "awsui_content-compact_gwq0h_xoje_401", + "focusable": "awsui_focusable_gwq0h_xoje_405", + "click-target": "awsui_click-target_gwq0h_xoje_420" +}; + +// node_modules/@cloudscape-design/components/expandable-section/expandable-section-container.js +var import_react120 = __toESM(require_react()); +var ExpandableSectionContainer = (_a) => { + var { className, children: children2, header, variant, expanded, disableContentPaddings, __internalRootRef } = _a, rest = __rest(_a, ["className", "children", "header", "variant", "expanded", "disableContentPaddings", "__internalRootRef"]); + if (variant === "container" || variant === "stacked") { + return import_react120.default.createElement( + AnalyticsFunnelSubStep, + null, + import_react120.default.createElement(InternalContainerAsSubstep, Object.assign({}, rest, { className, header, variant: variant === "stacked" ? "stacked" : "default", disableContentPaddings: disableContentPaddings || !expanded, disableHeaderPaddings: true, __hiddenContent: !expanded, __internalRootRef }), children2) + ); + } + return import_react120.default.createElement( + "div", + Object.assign({ className }, rest, { ref: __internalRootRef }), + header, + children2 + ); +}; + +// node_modules/@cloudscape-design/components/expandable-section/expandable-section-header.js +var import_react121 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/expandable-section/utils.js +function variantSupportsDescription(variant) { + return ["container", "default", "footer"].includes(variant); +} +function variantSupportsInteractiveElements(variant) { + return ["container", "compact"].includes(variant); +} + +// node_modules/@cloudscape-design/components/expandable-section/expandable-section-header.js +var componentName = "ExpandableSection"; +var ExpandableDeprecatedHeader = ({ id, className, onClick, ariaLabel, ariaControls, expanded, children: children2, icon, onKeyUp, onKeyDown, variant }) => { + return import_react121.default.createElement( + "div", + { id, role: "button", className: clsx_m_default(className, styles_css_default43["expand-button"], styles_css_default43["click-target"], styles_css_default43["header-deprecated"]), tabIndex: 0, onKeyUp, onKeyDown, onClick, "aria-label": ariaLabel, "aria-controls": ariaControls, "aria-expanded": expanded }, + import_react121.default.createElement("div", { className: clsx_m_default(styles_css_default43["icon-container"], styles_css_default43[`icon-container-${variant}`]) }, icon), + children2 + ); +}; +var ExpandableNavigationHeader = ({ id, className, onClick, ariaLabelledBy, ariaLabel, ariaControls, expanded, children: children2, icon }) => { + return import_react121.default.createElement( + "div", + { id, className: clsx_m_default(className, styles_css_default43["click-target"]) }, + import_react121.default.createElement("button", { className: clsx_m_default(styles_css_default43["icon-container"], styles_css_default43["expand-button"]), "aria-labelledby": ariaLabelledBy, "aria-label": ariaLabel, "aria-controls": ariaControls, "aria-expanded": expanded, type: "button", onClick }, icon), + children2 + ); +}; +var ExpandableHeaderTextWrapper = ({ id, descriptionId, className, onClick, ariaLabel, ariaControls, expanded, children: children2, icon, headerDescription, headerCounter, headerInfo, headerActions, variant, headingTagOverride, onKeyUp, onKeyDown }) => { + const isContainer = variant === "container"; + const HeadingTag = headingTagOverride || "div"; + const supportsInteractiveElements = variantSupportsInteractiveElements(variant); + const restrictClickableArea = supportsInteractiveElements && (headerInfo || headerActions); + const actions = supportsInteractiveElements && headerActions; + const description = variantSupportsDescription(variant) && headerDescription && import_react121.default.createElement("span", { id: descriptionId, className: styles_css_default43[`description-${variant}`] }, headerDescription); + const listeners = { onClick, onKeyDown, onKeyUp }; + const headerButtonListeners = restrictClickableArea ? listeners : void 0; + const headingTagListeners = !headerButtonListeners && !isContainer && description ? listeners : void 0; + const wrapperListeners = !headerButtonListeners && !headingTagListeners ? listeners : void 0; + const headerButton = import_react121.default.createElement( + "span", + Object.assign({ className: clsx_m_default(styles_css_default43["expand-button"], isContainer ? styles_css_default43["header-container-button"] : styles_css_default43["header-button"], headerButtonListeners && styles_css_default43["click-target"]), role: "button", tabIndex: 0, "aria-label": ariaLabel, "aria-labelledby": !ariaLabel && description ? id : void 0, "aria-describedby": description ? descriptionId : void 0, "aria-controls": ariaControls, "aria-expanded": expanded }, headerButtonListeners), + import_react121.default.createElement("span", { className: clsx_m_default(styles_css_default43["icon-container"], styles_css_default43[`icon-container-${variant}`]) }, icon), + import_react121.default.createElement("span", { id, className: styles_css_default43["header-text"] }, children2) + ); + return import_react121.default.createElement("div", Object.assign({ className: clsx_m_default(className, wrapperListeners && styles_css_default43["click-target"]) }, wrapperListeners), isContainer ? import_react121.default.createElement(InternalHeader, { variant: "h2", description, counter: headerCounter, info: headerInfo, actions, headingTagOverride }, headerButton) : import_react121.default.createElement( + import_react121.default.Fragment, + null, + import_react121.default.createElement( + "div", + { className: clsx_m_default(actions && styles_css_default43["header-actions-wrapper"]) }, + import_react121.default.createElement(HeadingTag, Object.assign({ className: clsx_m_default(styles_css_default43["header-wrapper"], headingTagListeners && styles_css_default43["click-target"]) }, headingTagListeners), headerButton), + actions + ), + description && import_react121.default.createElement(Description, { variantOverride: "h3" }, description) + )); +}; +var ExpandableSectionHeader = ({ id, descriptionId, className, variant, header, headerText, headerDescription, headerCounter, headerInfo, headerActions, headingTagOverride, expanded, ariaControls, ariaLabel, ariaLabelledBy, onKeyUp, onKeyDown, onClick }) => { + const icon = import_react121.default.createElement(internal_default, { size: variant === "container" ? "medium" : "normal", className: clsx_m_default(styles_css_default43.icon, expanded && styles_css_default43.expanded), name: "caret-down-filled" }); + const defaultHeaderProps = { + id, + icon, + expanded, + ariaControls, + ariaLabel, + onClick, + variant + }; + if ((headerCounter || headerInfo || headerActions) && !variantSupportsInteractiveElements(variant) && isDevelopment) { + warnOnce(componentName, 'The `headerCounter`, `headerInfo` and `headerActions` props are only supported for the "container" variant.'); + } + if (headerDescription && !variantSupportsDescription(variant) && isDevelopment) { + warnOnce(componentName, `The \`headerDescription\` prop is not supported for the ${variant} variant.`); + } + const wrapperClassName = clsx_m_default(styles_css_default43.wrapper, styles_css_default43[`wrapper-${variant}`], expanded && styles_css_default43["wrapper-expanded"]); + if (variant === "navigation") { + return import_react121.default.createElement(ExpandableNavigationHeader, Object.assign({ className: clsx_m_default(className, wrapperClassName), ariaLabelledBy }, defaultHeaderProps), headerText !== null && headerText !== void 0 ? headerText : header); + } + if (headerText) { + return import_react121.default.createElement(ExpandableHeaderTextWrapper, Object.assign({ className: clsx_m_default(className, wrapperClassName, expanded && styles_css_default43.expanded), descriptionId, headerDescription, headerCounter, headerInfo, headerActions, headingTagOverride, onKeyUp, onKeyDown }, defaultHeaderProps), headerText); + } + if (variant === "container" && header && isDevelopment) { + warnOnce(componentName, "Use `headerText` instead of `header` to provide the button within the heading for a11y."); + } + return import_react121.default.createElement(ExpandableDeprecatedHeader, Object.assign({ className: clsx_m_default(className, wrapperClassName, styles_css_default43.focusable, expanded && styles_css_default43.expanded), onKeyUp, onKeyDown }, defaultHeaderProps), header); +}; + +// node_modules/@cloudscape-design/components/expandable-section/internal.js +function InternalExpandableSection(_a) { + var { expanded: controlledExpanded, defaultExpanded, onChange, variant = "default", children: children2, header, headerText, headerCounter, headerDescription, headerInfo, headerActions, headingTagOverride, disableContentPaddings, headerAriaLabel, __internalRootRef } = _a, props2 = __rest(_a, ["expanded", "defaultExpanded", "onChange", "variant", "children", "header", "headerText", "headerCounter", "headerDescription", "headerInfo", "headerActions", "headingTagOverride", "disableContentPaddings", "headerAriaLabel", "__internalRootRef"]); + const ref = (0, import_react122.useRef)(null); + const controlId = useUniqueId(); + const triggerControlId = `${controlId}-trigger`; + const descriptionId = `${controlId}-description`; + const baseProps = getBaseProps(props2); + const [expanded, setExpanded] = useControllable(controlledExpanded, onChange, defaultExpanded, { + componentName: "ExpandableSection", + controlledProp: "expanded", + changeHandler: "onChange" + }); + const onExpandChange = (0, import_react122.useCallback)((expanded2) => { + setExpanded(expanded2); + fireNonCancelableEvent(onChange, { expanded: expanded2 }); + }, [onChange, setExpanded]); + const onClick = (0, import_react122.useCallback)(() => { + onExpandChange(!expanded); + }, [onExpandChange, expanded]); + const onKeyUp = (0, import_react122.useCallback)((event) => { + const interactionKeys = [KeyCode.enter, KeyCode.space]; + if (interactionKeys.indexOf(event.keyCode) !== -1) { + onExpandChange(!expanded); + } + }, [onExpandChange, expanded]); + const onKeyDown = (0, import_react122.useCallback)((event) => { + if (event.keyCode === KeyCode.space) { + event.preventDefault(); + } + }, []); + const triggerProps = { + ariaControls: controlId, + ariaLabel: headerAriaLabel, + ariaLabelledBy: headerAriaLabel ? void 0 : triggerControlId, + onKeyUp, + onKeyDown, + onClick + }; + const baseVariant = variant === "stacked" ? "container" : variant; + return import_react122.default.createElement( + ExpandableSectionContainer, + Object.assign({}, baseProps, { expanded, className: clsx_m_default(baseProps.className, styles_css_default43.root), variant, disableContentPaddings, header: import_react122.default.createElement(ExpandableSectionHeader, Object.assign({ id: triggerControlId, descriptionId, className: clsx_m_default(styles_css_default43.header, styles_css_default43[`header-${baseVariant}`]), variant: baseVariant, expanded: !!expanded, header, headerText, headerDescription, headerCounter, headerInfo, headerActions, headingTagOverride }, triggerProps)), __internalRootRef }), + import_react122.default.createElement( + CSSTransition_default, + { in: expanded, timeout: 30, classNames: { enter: styles_css_default43["content-enter"] }, nodeRef: ref }, + import_react122.default.createElement("div", { id: controlId, ref, className: clsx_m_default(styles_css_default43.content, styles_css_default43[`content-${baseVariant}`], expanded && styles_css_default43["content-expanded"]), role: "group", "aria-label": triggerProps.ariaLabel, "aria-labelledby": triggerProps.ariaLabelledBy, "aria-describedby": variantSupportsDescription(baseVariant) && headerDescription ? descriptionId : void 0 }, children2) + ) + ); +} + +// node_modules/@cloudscape-design/components/internal/components/chart-series-details/series-details-text.js +function getSeriesDetailsText(element) { + const elementsWithText = Array.from(element.querySelectorAll(`.${styles_css_default42.announced},.${styles_css_default43.header}`)); + return elementsWithText.map((element2) => { + var _a; + if (element2 instanceof HTMLElement) { + return (_a = element2.innerText) === null || _a === void 0 ? void 0 : _a.split("\n").map((s2) => s2.trim()).join(" ").trim(); + } + }).filter(Boolean).join(", "); +} + +// node_modules/@cloudscape-design/components/internal/components/chart-series-details/index.js +var chart_series_details_default = (0, import_react123.memo)((0, import_react123.forwardRef)(ChartSeriesDetails)); +function ChartSeriesDetails(_a, ref) { + var { details, expandedSeries, setPopoverText, setExpandedState, compactList } = _a, restProps = __rest(_a, ["details", "expandedSeries", "setPopoverText", "setExpandedState", "compactList"]); + const baseProps = getBaseProps(restProps); + const className = clsx_m_default(baseProps.className, styles_css_default42.root); + const detailsRef = (0, import_react123.useRef)(null); + const mergedRef = useMergeRefs(ref, detailsRef); + (0, import_react123.useEffect)(() => { + if (setPopoverText) { + if (detailsRef.current) { + setPopoverText(getSeriesDetailsText(detailsRef.current)); + } + return () => { + setPopoverText(""); + }; + } + }, [details, setPopoverText]); + const isExpanded = (seriesTitle) => !!expandedSeries && expandedSeries.has(seriesTitle); + return import_react123.default.createElement( + "div", + Object.assign({}, baseProps, { className, ref: mergedRef }), + import_react123.default.createElement("ul", { className: clsx_m_default(styles_css_default42.list, compactList && styles_css_default42.compact) }, details.map(({ key, value, markerType, color: color2, isDimmed, subItems, expandableId }, index) => import_react123.default.createElement("li", { key: index, className: clsx_m_default({ + [styles_css_default42.dimmed]: isDimmed, + [styles_css_default42["list-item"]]: true, + [styles_css_default42["with-sub-items"]]: subItems === null || subItems === void 0 ? void 0 : subItems.length, + [styles_css_default42.expandable]: !!expandableId + }) }, (subItems === null || subItems === void 0 ? void 0 : subItems.length) && !!expandableId ? import_react123.default.createElement(ExpandableSeries, { itemKey: key, value, markerType, color: color2, subItems, expanded: isExpanded(expandableId), setExpandedState: (state) => setExpandedState && setExpandedState(expandableId, state) }) : import_react123.default.createElement(NonExpandableSeries, { itemKey: key, value, markerType, color: color2, subItems })))) + ); +} +function SubItems({ items, expandable, expanded }) { + return import_react123.default.createElement("ul", { className: clsx_m_default(styles_css_default42["sub-items"], expandable && styles_css_default42.expandable) }, items.map(({ key, value }, index) => import_react123.default.createElement( + "li", + { key: index, className: clsx_m_default(styles_css_default42["inner-list-item"], styles_css_default42["key-value-pair"], (expanded || !expandable) && styles_css_default42.announced) }, + import_react123.default.createElement("span", { className: styles_css_default42.key }, key), + import_react123.default.createElement("span", { className: styles_css_default42.value }, value) + ))); +} +function ExpandableSeries({ itemKey, value, subItems, markerType, color: color2, expanded, setExpandedState }) { + return import_react123.default.createElement( + "div", + { className: styles_css_default42["expandable-section"] }, + markerType && color2 && import_react123.default.createElement(chart_series_marker_default, { type: markerType, color: color2 }), + import_react123.default.createElement( + "div", + { className: styles_css_default42["full-width"] }, + import_react123.default.createElement( + InternalExpandableSection, + { variant: "compact", headerText: itemKey, headerActions: import_react123.default.createElement("span", { className: clsx_m_default(styles_css_default42.value, styles_css_default42.expandable) }, value), expanded, onChange: ({ detail }) => setExpandedState(detail.expanded) }, + import_react123.default.createElement(SubItems, { items: subItems, expandable: true, expanded }) + ) + ) + ); +} +function NonExpandableSeries({ itemKey, value, subItems, markerType, color: color2 }) { + return import_react123.default.createElement( + import_react123.default.Fragment, + null, + import_react123.default.createElement( + "div", + { className: clsx_m_default(styles_css_default42["key-value-pair"], styles_css_default42.announced) }, + import_react123.default.createElement( + "div", + { className: styles_css_default42.key }, + markerType && color2 && import_react123.default.createElement(chart_series_marker_default, { type: markerType, color: color2 }), + import_react123.default.createElement("span", null, itemKey) + ), + import_react123.default.createElement("span", { className: styles_css_default42.value }, value) + ), + subItems && import_react123.default.createElement(SubItems, { items: subItems }) + ); +} + +// node_modules/@cloudscape-design/components/internal/components/chart-popover-footer/index.js +var import_react124 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/internal/components/chart-popover-footer/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/internal/components/chart-popover-footer/styles.scoped.css"; +var styles_css_default44 = { + "root": "awsui_root_1t8ew_td4bm_9" +}; + +// node_modules/@cloudscape-design/components/internal/components/chart-popover-footer/index.js +function ChartPopoverFooter({ children: children2 }) { + return import_react124.default.createElement("div", { className: styles_css_default44.root }, children2); +} + +// node_modules/@cloudscape-design/components/area-chart/elements/chart-popover.js +function AreaChartPopover({ model, highlightDetails, dismissAriaLabel, footer, size, onBlur }) { + if (!highlightDetails) { + return null; + } + const popoverProps = { + title: highlightDetails.formattedX, + trackRef: model.refs.verticalMarker, + trackKey: highlightDetails.highlightIndex, + dismissButton: highlightDetails.isPopoverPinned, + onDismiss: model.handlers.onPopoverDismiss, + onMouseLeave: model.handlers.onPopoverLeave, + ref: model.refs.popoverRef + }; + return import_react125.default.createElement( + chart_popover_default, + Object.assign({}, popoverProps, { container: model.refs.container.current, dismissAriaLabel, size, onBlur }), + import_react125.default.createElement(chart_series_details_default, { details: highlightDetails.seriesDetails }), + import_react125.default.createElement("div", { className: styles_css_default40["popover-divider"] }), + import_react125.default.createElement(chart_series_details_default, { details: highlightDetails.totalDetails }), + footer && import_react125.default.createElement(ChartPopoverFooter, null, footer) + ); +} + +// node_modules/@cloudscape-design/components/area-chart/elements/highlighted-point.js +var import_react127 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/internal/components/cartesian-chart/highlighted-point.js +var import_react126 = __toESM(require_react()); +var highlighted_point_default = (0, import_react126.memo)((0, import_react126.forwardRef)(HighlightedPoint)); +function HighlightedPoint({ point: point5, role = "group", ariaLabel, ariaHasPopup, ariaExpanded }, ref) { + if (!point5) { + return null; + } + return import_react126.default.createElement( + "g", + { ref, role, "aria-label": ariaLabel, "aria-haspopup": ariaHasPopup, "aria-expanded": ariaExpanded }, + import_react126.default.createElement("circle", { key: point5.key, "aria-hidden": "true", className: styles_css_default39["vertical-marker-circle-active"], cx: point5.x, cy: point5.y, r: 4, stroke: point5.color, fill: point5.color }) + ); +} + +// node_modules/@cloudscape-design/components/area-chart/elements/highlighted-point.js +var highlighted_point_default2 = (0, import_react127.memo)((0, import_react127.forwardRef)(AreaHighlightedPoint)); +function AreaHighlightedPoint({ model, ariaLabel }, ref) { + const highlightedPoint = useSelector(model.interactions, (state) => state.highlightedPoint); + const isPopoverPinned = useSelector(model.interactions, (state) => state.isPopoverPinned); + const point5 = highlightedPoint ? { + key: `${highlightedPoint.index.x}:${highlightedPoint.index.s}`, + x: highlightedPoint.scaled.x, + y: highlightedPoint.scaled.y1, + color: model.getInternalSeries(model.series[highlightedPoint.index.s]).color + } : null; + return import_react127.default.createElement(highlighted_point_default, { ref, point: point5, role: "button", ariaLabel, ariaHasPopup: true, ariaExpanded: isPopoverPinned }); +} + +// node_modules/@cloudscape-design/components/area-chart/elements/vertical-marker.js +var import_react129 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/internal/components/cartesian-chart/vertical-marker.js +var import_react128 = __toESM(require_react()); +var vertical_marker_default = (0, import_react128.memo)((0, import_react128.forwardRef)(VerticalMarker)); +function VerticalMarker({ height, showPoints = true, showLine = true, points }, ref) { + const [firstPoint] = points || []; + return import_react128.default.createElement( + "g", + null, + import_react128.default.createElement("line", { ref, "aria-hidden": "true", className: styles_css_default39["vertical-marker"], style: { visibility: showLine && firstPoint ? "visible" : "hidden" }, x1: firstPoint === null || firstPoint === void 0 ? void 0 : firstPoint.x, x2: firstPoint === null || firstPoint === void 0 ? void 0 : firstPoint.x, y1: 0, y2: height }), + showPoints && points && points.map((point5) => import_react128.default.createElement("circle", { key: point5.key, "aria-hidden": "true", className: styles_css_default39["vertical-marker-circle"], cx: point5.x, cy: point5.y, r: 4, stroke: point5.color })) + ); +} + +// node_modules/@cloudscape-design/components/area-chart/elements/vertical-marker.js +var vertical_marker_default2 = (0, import_react129.memo)(AreaVerticalMarker); +function AreaVerticalMarker({ model }) { + const highlightedX = useSelector(model.interactions, (state) => state.highlightedX); + const verticalMarker = (highlightedX || []).map((point5) => ({ + key: `${point5.index.x}:${point5.index.s}`, + x: point5.scaled.x, + y: point5.scaled.y1, + color: model.getInternalSeries(model.series[point5.index.s]).color + })); + return import_react129.default.createElement(vertical_marker_default, { height: model.height, points: verticalMarker, ref: model.refs.verticalMarker }); +} + +// node_modules/@cloudscape-design/components/area-chart/elements/use-highlight-details.js +function useHighlightDetails({ model, xTickFormatter, yTickFormatter, detailTotalFormatter, detailTotalLabel }) { + const i18n = useInternalI18n("area-chart"); + const hX = useSelector(model.interactions, (state) => state.highlightedX); + const hPoint = useSelector(model.interactions, (state) => state.highlightedPoint); + const isPopoverPinned = useSelector(model.interactions, (state) => state.isPopoverPinned); + if (!hX) { + return null; + } + const [firstPoint] = hX; + const highlightIndex = firstPoint.index.x; + const seriesPoints = [...model.computed.plot.xs[highlightIndex]]; + const detailsTotal = seriesPoints.reduce((total, point5) => total + point5.value, 0); + const formattedX = xTickFormatter ? xTickFormatter(firstPoint.x) : firstPoint.x.toString(); + const seriesTitle = hPoint ? getInternalSeries(hPoint).title : ""; + const formattedY = hPoint ? getInternalSeries(hPoint).formatValue(hPoint.value, hPoint.x) : ""; + const seriesDetails = seriesPoints.map((point5) => { + const { title, formatValue: formatValue2, color: color2, markerType } = getInternalSeries(point5); + const isDimmed = Boolean(hPoint) && point5 !== hPoint; + return { key: title, value: formatValue2(point5.value, point5.x), color: color2, markerType, isDimmed }; + }); + const totalDetails = [ + { + key: i18n("i18nStrings.detailTotalLabel", detailTotalLabel) || "", + value: detailTotalFormatter ? detailTotalFormatter(detailsTotal) : yTickFormatter ? yTickFormatter(detailsTotal) : detailsTotal + } + ]; + const pointDetails = hPoint ? seriesDetails[hPoint.index.s] : null; + const activeLabel = `${seriesTitle} ${formattedX} ${formattedY}, ${totalDetails[0].key} ${totalDetails[0].value}`; + return { + isPopoverPinned, + highlightIndex, + formattedX, + seriesTitle, + formattedY, + activeLabel, + seriesDetails, + totalDetails, + pointDetails + }; + function getInternalSeries(point5) { + return model.getInternalSeries(model.series[point5.index.s]); + } +} + +// node_modules/@cloudscape-design/components/internal/utils/use-container-width.js +function useContainerWidth(defaultValue = 0, threshold = 1) { + const [width, ref] = useContainerQuery((rect, prev) => { + if (prev === null) { + return rect.contentBoxWidth; + } + return Math.abs(prev - rect.contentBoxWidth) >= threshold ? rect.contentBoxWidth : prev; + }); + return [width !== null && width !== void 0 ? width : defaultValue, ref]; +} + +// node_modules/@cloudscape-design/components/internal/components/cartesian-chart/chart-container.js +var import_react130 = __toESM(require_react()); +var CONTENT_MIN_HEIGHT_BOUNDARY = 40; +var CartesianChartContainer = (0, import_react130.forwardRef)(({ minHeight, fitHeight, leftAxisLabel, leftAxisLabelMeasure, bottomAxisLabel, chartPlot, popover }, ref) => { + if (fitHeight) { + return import_react130.default.createElement( + "div", + { className: clsx_m_default(styles_css_default39["chart-container"], styles_css_default39["fit-height"]), ref }, + leftAxisLabel, + import_react130.default.createElement( + "div", + { className: clsx_m_default(styles_css_default39["chart-container-outer"], styles_css_default39["fit-height"]) }, + leftAxisLabelMeasure, + import_react130.default.createElement( + "div", + { className: styles_css_default39["chart-container-inner"] }, + import_react130.default.createElement( + "div", + { className: clsx_m_default(styles_css_default39["chart-container-plot-wrapper"], styles_css_default39["fit-height"]), style: { minHeight: Math.max(minHeight, CONTENT_MIN_HEIGHT_BOUNDARY) } }, + import_react130.default.createElement("div", { className: clsx_m_default(styles_css_default39["chart-container-plot"], styles_css_default39["fit-height"]) }, chartPlot) + ), + import_react130.default.createElement("div", { className: clsx_m_default(styles_css_default39["chart-container-bottom-labels"], styles_css_default39["fit-height"]) }, bottomAxisLabel) + ), + popover + ) + ); + } + return import_react130.default.createElement( + "div", + { className: styles_css_default39["chart-container"], ref }, + leftAxisLabel, + import_react130.default.createElement( + "div", + { className: styles_css_default39["chart-container-outer"] }, + leftAxisLabelMeasure, + import_react130.default.createElement( + "div", + { className: styles_css_default39["chart-container-inner"] }, + chartPlot, + bottomAxisLabel + ), + popover + ) + ); +}); + +// node_modules/@cloudscape-design/components/area-chart/chart-container.js +var DEFAULT_CHART_WIDTH = 500; +var LEFT_LABELS_MARGIN = 16; +var BOTTOM_LABELS_OFFSET = 12; +var chart_container_default = (0, import_react131.memo)(ChartContainer); +function ChartContainer({ model, autoWidth, xTitle, yTitle, detailPopoverSize, detailPopoverFooter, ariaLabel, ariaLabelledby, ariaDescription, i18nStrings: { xTickFormatter: deprecatedXTickFormatter, yTickFormatter: deprecatedYTickFormatter, detailTotalFormatter: deprecatedDetailTotalFormatter, detailTotalLabel, chartAriaRoleDescription, xAxisAriaRoleDescription, yAxisAriaRoleDescription, detailPopoverDismissAriaLabel } = {}, fitHeight, minHeight, xTickFormatter = deprecatedXTickFormatter, yTickFormatter = deprecatedYTickFormatter, detailTotalFormatter = deprecatedDetailTotalFormatter }) { + const [leftLabelsWidth, setLeftLabelsWidth] = (0, import_react131.useState)(0); + const [containerWidth, containerWidthRef] = useContainerWidth(DEFAULT_CHART_WIDTH); + const maxLeftLabelsWidth = Math.round(containerWidth / 2); + const bottomLabelsProps = useBottomLabels({ + ticks: model.computed.xTicks, + scale: model.computed.xScale, + tickFormatter: xTickFormatter + }); + const plotWidth = Math.max(0, containerWidth - leftLabelsWidth - LEFT_LABELS_MARGIN); + (0, import_react131.useEffect)(() => { + autoWidth(plotWidth); + }, [autoWidth, plotWidth]); + const highlightDetails = useHighlightDetails({ + model, + xTickFormatter, + yTickFormatter, + detailTotalFormatter, + detailTotalLabel + }); + const highlightedPointRef = (0, import_react131.useRef)(null); + const mergedRef = useMergeRefs(containerWidthRef, model.refs.container); + const isPointHighlighted = model.interactions.get().highlightedPoint !== null; + const highlightedX = useSelector(model.interactions, (state) => state.highlightedX); + const detailPopoverFooterContent = (0, import_react131.useMemo)(() => detailPopoverFooter && highlightedX ? detailPopoverFooter(highlightedX[0].x) : null, [detailPopoverFooter, highlightedX]); + return import_react131.default.createElement(CartesianChartContainer, { ref: mergedRef, minHeight: minHeight + bottomLabelsProps.height, fitHeight: !!fitHeight, leftAxisLabel: import_react131.default.createElement(axis_label_default, { axis: "y", position: "left", title: yTitle }), leftAxisLabelMeasure: import_react131.default.createElement(labels_measure_default, { scale: model.computed.yScale, ticks: model.computed.yTicks, tickFormatter: yTickFormatter, autoWidth: setLeftLabelsWidth, maxLabelsWidth: maxLeftLabelsWidth }), bottomAxisLabel: import_react131.default.createElement(axis_label_default, { axis: "x", position: "bottom", title: xTitle }), chartPlot: import_react131.default.createElement( + chart_plot_default, + { ref: model.refs.plot, width: "100%", height: fitHeight ? `calc(100% - ${bottomLabelsProps.height}px)` : model.height, offsetBottom: bottomLabelsProps.height, ariaLabel, ariaLabelledby, ariaDescription, ariaRoleDescription: chartAriaRoleDescription, activeElementKey: !(highlightDetails === null || highlightDetails === void 0 ? void 0 : highlightDetails.isPopoverPinned) && (highlightDetails === null || highlightDetails === void 0 ? void 0 : highlightDetails.activeLabel), activeElementRef: isPointHighlighted ? highlightedPointRef : model.refs.verticalMarker, activeElementFocusOffset: isPointHighlighted ? 3 : { x: 8, y: 0 }, isClickable: !(highlightDetails === null || highlightDetails === void 0 ? void 0 : highlightDetails.isPopoverPinned), onMouseMove: model.handlers.onSVGMouseMove, onMouseOut: model.handlers.onSVGMouseOut, onClick: model.handlers.onSVGMouseDown, onKeyDown: model.handlers.onSVGKeyDown, onApplicationFocus: model.handlers.onApplicationFocus, onApplicationBlur: model.handlers.onApplicationBlur }, + import_react131.default.createElement("line", { ref: model.refs.plotMeasure, x1: "0", x2: "0", y1: "0", y2: "100%", stroke: "transparent", strokeWidth: 1, style: { pointerEvents: "none" } }), + import_react131.default.createElement(left_labels_default, { plotWidth: model.width, plotHeight: model.height, scale: model.computed.yScale, ticks: model.computed.yTicks, tickFormatter: yTickFormatter, title: yTitle, ariaRoleDescription: yAxisAriaRoleDescription, maxLabelsWidth: maxLeftLabelsWidth }), + import_react131.default.createElement(data_series_default, { model }), + import_react131.default.createElement(bottom_labels_default, Object.assign({}, bottomLabelsProps, { width: model.width, height: model.height, scale: model.computed.xScale, title: xTitle, ariaRoleDescription: xAxisAriaRoleDescription, offsetLeft: leftLabelsWidth + BOTTOM_LABELS_OFFSET, offsetRight: BOTTOM_LABELS_OFFSET })), + import_react131.default.createElement(emphasized_baseline_default, { width: model.width, height: model.height, scale: model.computed.yScale }), + import_react131.default.createElement(vertical_marker_default2, { model }), + import_react131.default.createElement(highlighted_point_default2, { ref: highlightedPointRef, model, ariaLabel: highlightDetails === null || highlightDetails === void 0 ? void 0 : highlightDetails.activeLabel }) + ), popover: import_react131.default.createElement(AreaChartPopover, { model, highlightDetails, dismissAriaLabel: detailPopoverDismissAriaLabel, size: detailPopoverSize, footer: detailPopoverFooterContent, onBlur: model.handlers.onApplicationBlur }) }); +} + +// node_modules/@cloudscape-design/components/area-chart/model/use-chart-model.js +var import_react133 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/area-chart/model/utils.js +var EPSILON = 1e-13; +function computeDomainX(series) { + const xValues = getXValues(series); + if (xValues.length === 0) { + return []; + } + if (typeof xValues[0] === "string") { + return uniq(xValues); + } + return xValues.reduce(([min3, max3], x2) => [x2 < min3 ? x2 : min3, max3 < x2 ? x2 : max3], [xValues[0], xValues[0]]); +} +function computeDomainY(series, scaleType) { + let min3 = Number.POSITIVE_INFINITY; + let max3 = Number.NEGATIVE_INFINITY; + series.forEach((s2) => { + if (s2.type === "threshold") { + min3 = Math.min(min3, s2.y); + max3 = Math.max(max3, s2.y); + } + }); + getXValues(series).forEach((_, xIndex) => { + var _a; + let stackY = scaleType === "linear" ? 0 : EPSILON; + for (const s2 of series) { + if (s2.type === "area") { + stackY = stackY + (((_a = s2.data[xIndex]) === null || _a === void 0 ? void 0 : _a.y) || 0); + min3 = Math.min(min3, stackY); + max3 = Math.max(max3, stackY); + } + } + }); + if (min3 === Number.POSITIVE_INFINITY) { + return []; + } + if (scaleType === "log" && min3 === 0 && max3 > 1) { + return [1, max3]; + } + return [min3, max3]; +} +function computePlotPoints(series, xScale, yScale) { + const xValues = getXValues(series); + const xy = []; + const xs = []; + const sx = []; + getVisibleData(xValues, xScale).forEach(({ x: x2, scaledX }, xIndex) => { + let stackY = yScale.scaleType === "linear" ? 0 : EPSILON; + const points = []; + series.forEach((s2, sIndex) => { + var _a; + if (s2.type === "threshold") { + const scaledY = yScale.d3Scale(s2.y) || 0; + points.push({ + x: x2, + y0: s2.y, + y1: s2.y, + scaled: { x: scaledX, y0: scaledY, y1: scaledY }, + index: { x: xIndex, s: sIndex, y: 0 }, + value: 0 + }); + } else { + const value = ((_a = s2.data[xIndex]) === null || _a === void 0 ? void 0 : _a.y) || 0; + const y0 = stackY; + const y1 = stackY + value; + points.push({ + x: x2, + y0, + y1, + scaled: { x: scaledX, y0: yScale.d3Scale(y0) || 0, y1: yScale.d3Scale(y1) || 0 }, + index: { x: xIndex, s: sIndex, y: 0 }, + value + }); + stackY = y1; + } + }); + points.sort((p1, p2) => p1.y1 - p2.y1).forEach((point5, index) => { + point5.index.y = index; + insertIntoMatrix(xy, point5.index.x, point5.index.y, point5); + insertIntoMatrix(xs, point5.index.x, point5.index.s, point5); + insertIntoMatrix(sx, point5.index.s, point5.index.x, point5); + }); + }); + return { xy, xs, sx }; +} +function findClosest(sortedArray, target, getter) { + if (sortedArray.length === 0) { + throw new Error("Invariant violation: array is empty."); + } + const isAscending = getter(sortedArray[0]) < getter(sortedArray[sortedArray.length - 1]); + const compare = (x2) => isAscending ? getter(x2) < target : getter(x2) > target; + const delta = (x2) => Math.abs(getter(x2) - target); + let lo = 0; + let hi = sortedArray.length - 1; + while (hi - lo > 1) { + const mid = Math.floor((lo + hi) / 2); + if (compare(sortedArray[mid])) { + lo = mid; + } else { + hi = mid; + } + } + return delta(sortedArray[lo]) < delta(sortedArray[hi]) ? sortedArray[lo] : sortedArray[hi]; +} +function circleIndex(index, [from, to]) { + if (index < from) { + return to; + } + if (index > to) { + return from; + } + return index; +} +function isSeriesValid(series) { + var _a; + const sampleXValues = getXValues(series); + for (const s2 of series) { + if (s2.type === "area") { + for (let i = 0; i < Math.max(s2.data.length, sampleXValues.length); i++) { + if (((_a = s2.data[i]) === null || _a === void 0 ? void 0 : _a.x) !== sampleXValues[i]) { + return false; + } + } + } + } + return true; +} +function getXValues(series) { + for (const s2 of series) { + if (s2.type === "area") { + return s2.data.map(({ x: x2 }) => x2); + } + } + return []; +} +function getVisibleData(data, xScale) { + const scaledOffsetX = xScale.isCategorical() ? Math.max(0, xScale.d3Scale.bandwidth() - 1) / 2 : 0; + const visibleData = []; + for (const x2 of data) { + const scaledX = xScale.d3Scale(x2); + if (scaledX !== void 0) { + visibleData.push({ x: x2, scaledX: scaledX + scaledOffsetX }); + } + } + return visibleData; +} +function insertIntoMatrix(matrix, row, col, value) { + if (!matrix[row]) { + matrix[row] = []; + } + matrix[row][col] = value; +} +function uniq(arr) { + const set = /* @__PURE__ */ new Set(); + const uniqArray = []; + for (const value of arr) { + if (!set.has(value)) { + set.add(value); + uniqArray.push(value); + } + } + return uniqArray; +} + +// node_modules/@cloudscape-design/components/internal/components/cartesian-chart/ticks.js +function getXTickCount(width) { + return Math.ceil(width / X_TICK_COUNT_RATIO); +} +function getYTickCount(height) { + return Math.ceil(height / Y_TICK_COUNT_RATIO); +} +function createXTicks(scale, values2) { + if (scale.isNumeric()) { + return scale.d3Scale.ticks(values2); + } else if (scale.isTime()) { + const rawTicks = scale.d3Scale.ticks(values2); + const domain = scale.d3Scale.domain(); + return uniform(rawTicks, domain[domain.length - 1]); + } else { + return scale.d3Scale.domain(); + } +} +function createYTicks(scale, values2) { + const ticks2 = scale.d3Scale.ticks(values2); + if (scale.scaleType === "log" && ticks2.length > 10) { + return scale.d3Scale.ticks(3); + } + return ticks2; +} +function uniform(ticks2, max3) { + if (ticks2.length < 3 || !isMixedDayInterval(ticks2)) { + return ticks2; + } + return createTwoDayInterval(ticks2[0], max3); +} +function isMixedDayInterval(ticks2) { + let oneDayInterval = false; + let twoDayInterval = false; + for (let i = 1; i < ticks2.length; i++) { + oneDayInterval = oneDayInterval || isDayInterval(ticks2[i - 1], ticks2[i], 1); + twoDayInterval = twoDayInterval || isDayInterval(ticks2[i - 1], ticks2[i], 2); + } + return oneDayInterval && twoDayInterval; +} +function isDayInterval(a2, b, difference = 1) { + return Math.abs(differenceInDays(a2, b)) === difference; +} +function createTwoDayInterval(start, max3) { + const result = []; + let curr = start; + while (curr < max3) { + result.push(curr); + curr = add(curr, { days: 2 }); + } + return result; +} + +// node_modules/@cloudscape-design/components/internal/vendor/d3-scale.js +function ascending(a2, b) { + return a2 == null || b == null ? NaN : a2 < b ? -1 : a2 > b ? 1 : a2 >= b ? 0 : NaN; +} +function descending(a2, b) { + return a2 == null || b == null ? NaN : b < a2 ? -1 : b > a2 ? 1 : b >= a2 ? 0 : NaN; +} +function bisector(f) { + let compare1, compare2, delta; + if (f.length !== 2) { + compare1 = ascending; + compare2 = (d, x2) => ascending(f(d), x2); + delta = (d, x2) => f(d) - x2; + } else { + compare1 = f === ascending || f === descending ? f : zero$1; + compare2 = f; + delta = f; + } + function left(a2, x2, lo = 0, hi = a2.length) { + if (lo < hi) { + if (compare1(x2, x2) !== 0) return hi; + do { + const mid = lo + hi >>> 1; + if (compare2(a2[mid], x2) < 0) lo = mid + 1; + else hi = mid; + } while (lo < hi); + } + return lo; + } + function right(a2, x2, lo = 0, hi = a2.length) { + if (lo < hi) { + if (compare1(x2, x2) !== 0) return hi; + do { + const mid = lo + hi >>> 1; + if (compare2(a2[mid], x2) <= 0) lo = mid + 1; + else hi = mid; + } while (lo < hi); + } + return lo; + } + function center(a2, x2, lo = 0, hi = a2.length) { + const i = left(a2, x2, lo, hi - 1); + return i > lo && delta(a2[i - 1], x2) > -delta(a2[i], x2) ? i - 1 : i; + } + return { left, center, right }; +} +function zero$1() { + return 0; +} +function number$2(x2) { + return x2 === null ? NaN : +x2; +} +var ascendingBisect = bisector(ascending); +var bisectRight = ascendingBisect.right; +bisector(number$2).center; +var bisect = bisectRight; +var InternMap = class extends Map { + constructor(entries, key = keyof) { + super(); + Object.defineProperties(this, { _intern: { value: /* @__PURE__ */ new Map() }, _key: { value: key } }); + if (entries != null) for (const [key2, value] of entries) this.set(key2, value); + } + get(key) { + return super.get(intern_get(this, key)); + } + has(key) { + return super.has(intern_get(this, key)); + } + set(key, value) { + return super.set(intern_set(this, key), value); + } + delete(key) { + return super.delete(intern_delete(this, key)); + } +}; +function intern_get({ _intern, _key }, value) { + const key = _key(value); + return _intern.has(key) ? _intern.get(key) : value; +} +function intern_set({ _intern, _key }, value) { + const key = _key(value); + if (_intern.has(key)) return _intern.get(key); + _intern.set(key, value); + return value; +} +function intern_delete({ _intern, _key }, value) { + const key = _key(value); + if (_intern.has(key)) { + value = _intern.get(key); + _intern.delete(key); + } + return value; +} +function keyof(value) { + return value !== null && typeof value === "object" ? value.valueOf() : value; +} +var e10 = Math.sqrt(50); +var e5 = Math.sqrt(10); +var e2 = Math.sqrt(2); +function ticks(start, stop, count) { + var reverse, i = -1, n, ticks2, step2; + stop = +stop, start = +start, count = +count; + if (start === stop && count > 0) return [start]; + if (reverse = stop < start) n = start, start = stop, stop = n; + if ((step2 = tickIncrement(start, stop, count)) === 0 || !isFinite(step2)) return []; + if (step2 > 0) { + let r0 = Math.round(start / step2), r1 = Math.round(stop / step2); + if (r0 * step2 < start) ++r0; + if (r1 * step2 > stop) --r1; + ticks2 = new Array(n = r1 - r0 + 1); + while (++i < n) ticks2[i] = (r0 + i) * step2; + } else { + step2 = -step2; + let r0 = Math.round(start * step2), r1 = Math.round(stop * step2); + if (r0 / step2 < start) ++r0; + if (r1 / step2 > stop) --r1; + ticks2 = new Array(n = r1 - r0 + 1); + while (++i < n) ticks2[i] = (r0 + i) / step2; + } + if (reverse) ticks2.reverse(); + return ticks2; +} +function tickIncrement(start, stop, count) { + var step2 = (stop - start) / Math.max(0, count), power = Math.floor(Math.log(step2) / Math.LN10), error = step2 / Math.pow(10, power); + return power >= 0 ? (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1) * Math.pow(10, power) : -Math.pow(10, -power) / (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1); +} +function tickStep(start, stop, count) { + var step0 = Math.abs(stop - start) / Math.max(0, count), step1 = Math.pow(10, Math.floor(Math.log(step0) / Math.LN10)), error = step0 / step1; + if (error >= e10) step1 *= 10; + else if (error >= e5) step1 *= 5; + else if (error >= e2) step1 *= 2; + return stop < start ? -step1 : step1; +} +function range(start, stop, step2) { + start = +start, stop = +stop, step2 = (n = arguments.length) < 2 ? (stop = start, start = 0, 1) : n < 3 ? 1 : +step2; + var i = -1, n = Math.max(0, Math.ceil((stop - start) / step2)) | 0, range2 = new Array(n); + while (++i < n) { + range2[i] = start + i * step2; + } + return range2; +} +function initRange(domain, range2) { + switch (arguments.length) { + case 0: + break; + case 1: + this.range(domain); + break; + default: + this.range(range2).domain(domain); + break; + } + return this; +} +var implicit = Symbol("implicit"); +function ordinal() { + var index = new InternMap(), domain = [], range2 = [], unknown = implicit; + function scale(d) { + let i = index.get(d); + if (i === void 0) { + if (unknown !== implicit) return unknown; + index.set(d, i = domain.push(d) - 1); + } + return range2[i % range2.length]; + } + scale.domain = function(_) { + if (!arguments.length) return domain.slice(); + domain = [], index = new InternMap(); + for (const value of _) { + if (index.has(value)) continue; + index.set(value, domain.push(value) - 1); + } + return scale; + }; + scale.range = function(_) { + return arguments.length ? (range2 = Array.from(_), scale) : range2.slice(); + }; + scale.unknown = function(_) { + return arguments.length ? (unknown = _, scale) : unknown; + }; + scale.copy = function() { + return ordinal(domain, range2).unknown(unknown); + }; + initRange.apply(scale, arguments); + return scale; +} +function band() { + var scale = ordinal().unknown(void 0), domain = scale.domain, ordinalRange = scale.range, r0 = 0, r1 = 1, step2, bandwidth, round = false, paddingInner = 0, paddingOuter = 0, align = 0.5; + delete scale.unknown; + function rescale() { + var n = domain().length, reverse = r1 < r0, start = reverse ? r1 : r0, stop = reverse ? r0 : r1; + step2 = (stop - start) / Math.max(1, n - paddingInner + paddingOuter * 2); + if (round) step2 = Math.floor(step2); + start += (stop - start - step2 * (n - paddingInner)) * align; + bandwidth = step2 * (1 - paddingInner); + if (round) start = Math.round(start), bandwidth = Math.round(bandwidth); + var values2 = range(n).map(function(i) { + return start + step2 * i; + }); + return ordinalRange(reverse ? values2.reverse() : values2); + } + scale.domain = function(_) { + return arguments.length ? (domain(_), rescale()) : domain(); + }; + scale.range = function(_) { + return arguments.length ? ([r0, r1] = _, r0 = +r0, r1 = +r1, rescale()) : [r0, r1]; + }; + scale.rangeRound = function(_) { + return [r0, r1] = _, r0 = +r0, r1 = +r1, round = true, rescale(); + }; + scale.bandwidth = function() { + return bandwidth; + }; + scale.step = function() { + return step2; + }; + scale.round = function(_) { + return arguments.length ? (round = !!_, rescale()) : round; + }; + scale.padding = function(_) { + return arguments.length ? (paddingInner = Math.min(1, paddingOuter = +_), rescale()) : paddingInner; + }; + scale.paddingInner = function(_) { + return arguments.length ? (paddingInner = Math.min(1, _), rescale()) : paddingInner; + }; + scale.paddingOuter = function(_) { + return arguments.length ? (paddingOuter = +_, rescale()) : paddingOuter; + }; + scale.align = function(_) { + return arguments.length ? (align = Math.max(0, Math.min(1, _)), rescale()) : align; + }; + scale.copy = function() { + return band(domain(), [r0, r1]).round(round).paddingInner(paddingInner).paddingOuter(paddingOuter).align(align); + }; + return initRange.apply(rescale(), arguments); +} +function define(constructor, factory, prototype) { + constructor.prototype = factory.prototype = prototype; + prototype.constructor = constructor; +} +function extend(parent, definition) { + var prototype = Object.create(parent.prototype); + for (var key in definition) prototype[key] = definition[key]; + return prototype; +} +function Color() { +} +var darker = 0.7; +var brighter = 1 / darker; +var reI = "\\s*([+-]?\\d+)\\s*"; +var reN = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*"; +var reP = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*"; +var reHex = /^#([0-9a-f]{3,8})$/; +var reRgbInteger = new RegExp(`^rgb\\(${reI},${reI},${reI}\\)$`); +var reRgbPercent = new RegExp(`^rgb\\(${reP},${reP},${reP}\\)$`); +var reRgbaInteger = new RegExp(`^rgba\\(${reI},${reI},${reI},${reN}\\)$`); +var reRgbaPercent = new RegExp(`^rgba\\(${reP},${reP},${reP},${reN}\\)$`); +var reHslPercent = new RegExp(`^hsl\\(${reN},${reP},${reP}\\)$`); +var reHslaPercent = new RegExp(`^hsla\\(${reN},${reP},${reP},${reN}\\)$`); +var named = { + aliceblue: 15792383, + antiquewhite: 16444375, + aqua: 65535, + aquamarine: 8388564, + azure: 15794175, + beige: 16119260, + bisque: 16770244, + black: 0, + blanchedalmond: 16772045, + blue: 255, + blueviolet: 9055202, + brown: 10824234, + burlywood: 14596231, + cadetblue: 6266528, + chartreuse: 8388352, + chocolate: 13789470, + coral: 16744272, + cornflowerblue: 6591981, + cornsilk: 16775388, + crimson: 14423100, + cyan: 65535, + darkblue: 139, + darkcyan: 35723, + darkgoldenrod: 12092939, + darkgray: 11119017, + darkgreen: 25600, + darkgrey: 11119017, + darkkhaki: 12433259, + darkmagenta: 9109643, + darkolivegreen: 5597999, + darkorange: 16747520, + darkorchid: 10040012, + darkred: 9109504, + darksalmon: 15308410, + darkseagreen: 9419919, + darkslateblue: 4734347, + darkslategray: 3100495, + darkslategrey: 3100495, + darkturquoise: 52945, + darkviolet: 9699539, + deeppink: 16716947, + deepskyblue: 49151, + dimgray: 6908265, + dimgrey: 6908265, + dodgerblue: 2003199, + firebrick: 11674146, + floralwhite: 16775920, + forestgreen: 2263842, + fuchsia: 16711935, + gainsboro: 14474460, + ghostwhite: 16316671, + gold: 16766720, + goldenrod: 14329120, + gray: 8421504, + green: 32768, + greenyellow: 11403055, + grey: 8421504, + honeydew: 15794160, + hotpink: 16738740, + indianred: 13458524, + indigo: 4915330, + ivory: 16777200, + khaki: 15787660, + lavender: 15132410, + lavenderblush: 16773365, + lawngreen: 8190976, + lemonchiffon: 16775885, + lightblue: 11393254, + lightcoral: 15761536, + lightcyan: 14745599, + lightgoldenrodyellow: 16448210, + lightgray: 13882323, + lightgreen: 9498256, + lightgrey: 13882323, + lightpink: 16758465, + lightsalmon: 16752762, + lightseagreen: 2142890, + lightskyblue: 8900346, + lightslategray: 7833753, + lightslategrey: 7833753, + lightsteelblue: 11584734, + lightyellow: 16777184, + lime: 65280, + limegreen: 3329330, + linen: 16445670, + magenta: 16711935, + maroon: 8388608, + mediumaquamarine: 6737322, + mediumblue: 205, + mediumorchid: 12211667, + mediumpurple: 9662683, + mediumseagreen: 3978097, + mediumslateblue: 8087790, + mediumspringgreen: 64154, + mediumturquoise: 4772300, + mediumvioletred: 13047173, + midnightblue: 1644912, + mintcream: 16121850, + mistyrose: 16770273, + moccasin: 16770229, + navajowhite: 16768685, + navy: 128, + oldlace: 16643558, + olive: 8421376, + olivedrab: 7048739, + orange: 16753920, + orangered: 16729344, + orchid: 14315734, + palegoldenrod: 15657130, + palegreen: 10025880, + paleturquoise: 11529966, + palevioletred: 14381203, + papayawhip: 16773077, + peachpuff: 16767673, + peru: 13468991, + pink: 16761035, + plum: 14524637, + powderblue: 11591910, + purple: 8388736, + rebeccapurple: 6697881, + red: 16711680, + rosybrown: 12357519, + royalblue: 4286945, + saddlebrown: 9127187, + salmon: 16416882, + sandybrown: 16032864, + seagreen: 3050327, + seashell: 16774638, + sienna: 10506797, + silver: 12632256, + skyblue: 8900331, + slateblue: 6970061, + slategray: 7372944, + slategrey: 7372944, + snow: 16775930, + springgreen: 65407, + steelblue: 4620980, + tan: 13808780, + teal: 32896, + thistle: 14204888, + tomato: 16737095, + turquoise: 4251856, + violet: 15631086, + wheat: 16113331, + white: 16777215, + whitesmoke: 16119285, + yellow: 16776960, + yellowgreen: 10145074 +}; +define(Color, color, { + copy(channels) { + return Object.assign(new this.constructor(), this, channels); + }, + displayable() { + return this.rgb().displayable(); + }, + hex: color_formatHex, + // Deprecated! Use color.formatHex. + formatHex: color_formatHex, + formatHex8: color_formatHex8, + formatHsl: color_formatHsl, + formatRgb: color_formatRgb, + toString: color_formatRgb +}); +function color_formatHex() { + return this.rgb().formatHex(); +} +function color_formatHex8() { + return this.rgb().formatHex8(); +} +function color_formatHsl() { + return hslConvert(this).formatHsl(); +} +function color_formatRgb() { + return this.rgb().formatRgb(); +} +function color(format2) { + var m, l; + format2 = (format2 + "").trim().toLowerCase(); + return (m = reHex.exec(format2)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) : l === 3 ? new Rgb(m >> 8 & 15 | m >> 4 & 240, m >> 4 & 15 | m & 240, (m & 15) << 4 | m & 15, 1) : l === 8 ? rgba(m >> 24 & 255, m >> 16 & 255, m >> 8 & 255, (m & 255) / 255) : l === 4 ? rgba(m >> 12 & 15 | m >> 8 & 240, m >> 8 & 15 | m >> 4 & 240, m >> 4 & 15 | m & 240, ((m & 15) << 4 | m & 15) / 255) : null) : (m = reRgbInteger.exec(format2)) ? new Rgb(m[1], m[2], m[3], 1) : (m = reRgbPercent.exec(format2)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) : (m = reRgbaInteger.exec(format2)) ? rgba(m[1], m[2], m[3], m[4]) : (m = reRgbaPercent.exec(format2)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) : (m = reHslPercent.exec(format2)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) : (m = reHslaPercent.exec(format2)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) : named.hasOwnProperty(format2) ? rgbn(named[format2]) : format2 === "transparent" ? new Rgb(NaN, NaN, NaN, 0) : null; +} +function rgbn(n) { + return new Rgb(n >> 16 & 255, n >> 8 & 255, n & 255, 1); +} +function rgba(r, g, b, a2) { + if (a2 <= 0) r = g = b = NaN; + return new Rgb(r, g, b, a2); +} +function rgbConvert(o) { + if (!(o instanceof Color)) o = color(o); + if (!o) return new Rgb(); + o = o.rgb(); + return new Rgb(o.r, o.g, o.b, o.opacity); +} +function rgb$1(r, g, b, opacity) { + return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity); +} +function Rgb(r, g, b, opacity) { + this.r = +r; + this.g = +g; + this.b = +b; + this.opacity = +opacity; +} +define(Rgb, rgb$1, extend(Color, { + brighter(k2) { + k2 = k2 == null ? brighter : Math.pow(brighter, k2); + return new Rgb(this.r * k2, this.g * k2, this.b * k2, this.opacity); + }, + darker(k2) { + k2 = k2 == null ? darker : Math.pow(darker, k2); + return new Rgb(this.r * k2, this.g * k2, this.b * k2, this.opacity); + }, + rgb() { + return this; + }, + clamp() { + return new Rgb(clampi(this.r), clampi(this.g), clampi(this.b), clampa(this.opacity)); + }, + displayable() { + return -0.5 <= this.r && this.r < 255.5 && (-0.5 <= this.g && this.g < 255.5) && (-0.5 <= this.b && this.b < 255.5) && (0 <= this.opacity && this.opacity <= 1); + }, + hex: rgb_formatHex, + // Deprecated! Use color.formatHex. + formatHex: rgb_formatHex, + formatHex8: rgb_formatHex8, + formatRgb: rgb_formatRgb, + toString: rgb_formatRgb +})); +function rgb_formatHex() { + return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}`; +} +function rgb_formatHex8() { + return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`; +} +function rgb_formatRgb() { + const a2 = clampa(this.opacity); + return `${a2 === 1 ? "rgb(" : "rgba("}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${a2 === 1 ? ")" : `, ${a2})`}`; +} +function clampa(opacity) { + return isNaN(opacity) ? 1 : Math.max(0, Math.min(1, opacity)); +} +function clampi(value) { + return Math.max(0, Math.min(255, Math.round(value) || 0)); +} +function hex(value) { + value = clampi(value); + return (value < 16 ? "0" : "") + value.toString(16); +} +function hsla(h, s2, l, a2) { + if (a2 <= 0) h = s2 = l = NaN; + else if (l <= 0 || l >= 1) h = s2 = NaN; + else if (s2 <= 0) h = NaN; + return new Hsl(h, s2, l, a2); +} +function hslConvert(o) { + if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity); + if (!(o instanceof Color)) o = color(o); + if (!o) return new Hsl(); + if (o instanceof Hsl) return o; + o = o.rgb(); + var r = o.r / 255, g = o.g / 255, b = o.b / 255, min3 = Math.min(r, g, b), max3 = Math.max(r, g, b), h = NaN, s2 = max3 - min3, l = (max3 + min3) / 2; + if (s2) { + if (r === max3) h = (g - b) / s2 + (g < b) * 6; + else if (g === max3) h = (b - r) / s2 + 2; + else h = (r - g) / s2 + 4; + s2 /= l < 0.5 ? max3 + min3 : 2 - max3 - min3; + h *= 60; + } else { + s2 = l > 0 && l < 1 ? 0 : h; + } + return new Hsl(h, s2, l, o.opacity); +} +function hsl(h, s2, l, opacity) { + return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s2, l, opacity == null ? 1 : opacity); +} +function Hsl(h, s2, l, opacity) { + this.h = +h; + this.s = +s2; + this.l = +l; + this.opacity = +opacity; +} +define(Hsl, hsl, extend(Color, { + brighter(k2) { + k2 = k2 == null ? brighter : Math.pow(brighter, k2); + return new Hsl(this.h, this.s, this.l * k2, this.opacity); + }, + darker(k2) { + k2 = k2 == null ? darker : Math.pow(darker, k2); + return new Hsl(this.h, this.s, this.l * k2, this.opacity); + }, + rgb() { + var h = this.h % 360 + (this.h < 0) * 360, s2 = isNaN(h) || isNaN(this.s) ? 0 : this.s, l = this.l, m2 = l + (l < 0.5 ? l : 1 - l) * s2, m1 = 2 * l - m2; + return new Rgb( + hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2), + hsl2rgb(h, m1, m2), + hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2), + this.opacity + ); + }, + clamp() { + return new Hsl(clamph(this.h), clampt(this.s), clampt(this.l), clampa(this.opacity)); + }, + displayable() { + return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && (0 <= this.l && this.l <= 1) && (0 <= this.opacity && this.opacity <= 1); + }, + formatHsl() { + const a2 = clampa(this.opacity); + return `${a2 === 1 ? "hsl(" : "hsla("}${clamph(this.h)}, ${clampt(this.s) * 100}%, ${clampt(this.l) * 100}%${a2 === 1 ? ")" : `, ${a2})`}`; + } +})); +function clamph(value) { + value = (value || 0) % 360; + return value < 0 ? value + 360 : value; +} +function clampt(value) { + return Math.max(0, Math.min(1, value || 0)); +} +function hsl2rgb(h, m1, m2) { + return (h < 60 ? m1 + (m2 - m1) * h / 60 : h < 180 ? m2 : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60 : m1) * 255; +} +var constant = (x2) => () => x2; +function linear$1(a2, d) { + return function(t) { + return a2 + t * d; + }; +} +function exponential(a2, b, y2) { + return a2 = Math.pow(a2, y2), b = Math.pow(b, y2) - a2, y2 = 1 / y2, function(t) { + return Math.pow(a2 + t * b, y2); + }; +} +function gamma(y2) { + return (y2 = +y2) === 1 ? nogamma : function(a2, b) { + return b - a2 ? exponential(a2, b, y2) : constant(isNaN(a2) ? b : a2); + }; +} +function nogamma(a2, b) { + var d = b - a2; + return d ? linear$1(a2, d) : constant(isNaN(a2) ? b : a2); +} +var rgb = function rgbGamma(y2) { + var color2 = gamma(y2); + function rgb2(start, end) { + var r = color2((start = rgb$1(start)).r, (end = rgb$1(end)).r), g = color2(start.g, end.g), b = color2(start.b, end.b), opacity = nogamma(start.opacity, end.opacity); + return function(t) { + start.r = r(t); + start.g = g(t); + start.b = b(t); + start.opacity = opacity(t); + return start + ""; + }; + } + rgb2.gamma = rgbGamma; + return rgb2; +}(1); +function numberArray(a2, b) { + if (!b) b = []; + var n = a2 ? Math.min(b.length, a2.length) : 0, c = b.slice(), i; + return function(t) { + for (i = 0; i < n; ++i) c[i] = a2[i] * (1 - t) + b[i] * t; + return c; + }; +} +function isNumberArray(x2) { + return ArrayBuffer.isView(x2) && !(x2 instanceof DataView); +} +function genericArray(a2, b) { + var nb = b ? b.length : 0, na = a2 ? Math.min(nb, a2.length) : 0, x2 = new Array(na), c = new Array(nb), i; + for (i = 0; i < na; ++i) x2[i] = interpolate(a2[i], b[i]); + for (; i < nb; ++i) c[i] = b[i]; + return function(t) { + for (i = 0; i < na; ++i) c[i] = x2[i](t); + return c; + }; +} +function date$1(a2, b) { + var d = /* @__PURE__ */ new Date(); + return a2 = +a2, b = +b, function(t) { + return d.setTime(a2 * (1 - t) + b * t), d; + }; +} +function interpolateNumber(a2, b) { + return a2 = +a2, b = +b, function(t) { + return a2 * (1 - t) + b * t; + }; +} +function object(a2, b) { + var i = {}, c = {}, k2; + if (a2 === null || typeof a2 !== "object") a2 = {}; + if (b === null || typeof b !== "object") b = {}; + for (k2 in b) { + if (k2 in a2) { + i[k2] = interpolate(a2[k2], b[k2]); + } else { + c[k2] = b[k2]; + } + } + return function(t) { + for (k2 in i) c[k2] = i[k2](t); + return c; + }; +} +var reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g; +var reB = new RegExp(reA.source, "g"); +function zero(b) { + return function() { + return b; + }; +} +function one(b) { + return function(t) { + return b(t) + ""; + }; +} +function string(a2, b) { + var bi = reA.lastIndex = reB.lastIndex = 0, am, bm, bs, i = -1, s2 = [], q = []; + a2 = a2 + "", b = b + ""; + while ((am = reA.exec(a2)) && (bm = reB.exec(b))) { + if ((bs = bm.index) > bi) { + bs = b.slice(bi, bs); + if (s2[i]) s2[i] += bs; + else s2[++i] = bs; + } + if ((am = am[0]) === (bm = bm[0])) { + if (s2[i]) s2[i] += bm; + else s2[++i] = bm; + } else { + s2[++i] = null; + q.push({ i, x: interpolateNumber(am, bm) }); + } + bi = reB.lastIndex; + } + if (bi < b.length) { + bs = b.slice(bi); + if (s2[i]) s2[i] += bs; + else s2[++i] = bs; + } + return s2.length < 2 ? q[0] ? one(q[0].x) : zero(b) : (b = q.length, function(t) { + for (var i2 = 0, o; i2 < b; ++i2) s2[(o = q[i2]).i] = o.x(t); + return s2.join(""); + }); +} +function interpolate(a2, b) { + var t = typeof b, c; + return b == null || t === "boolean" ? constant(b) : (t === "number" ? interpolateNumber : t === "string" ? (c = color(b)) ? (b = c, rgb) : string : b instanceof color ? rgb : b instanceof Date ? date$1 : isNumberArray(b) ? numberArray : Array.isArray(b) ? genericArray : typeof b.valueOf !== "function" && typeof b.toString !== "function" || isNaN(b) ? object : interpolateNumber)(a2, b); +} +function interpolateRound(a2, b) { + return a2 = +a2, b = +b, function(t) { + return Math.round(a2 * (1 - t) + b * t); + }; +} +function constants(x2) { + return function() { + return x2; + }; +} +function number$1(x2) { + return +x2; +} +var unit = [0, 1]; +function identity$1(x2) { + return x2; +} +function normalize(a2, b) { + return (b -= a2 = +a2) ? function(x2) { + return (x2 - a2) / b; + } : constants(isNaN(b) ? NaN : 0.5); +} +function clamper(a2, b) { + var t; + if (a2 > b) t = a2, a2 = b, b = t; + return function(x2) { + return Math.max(a2, Math.min(b, x2)); + }; +} +function bimap(domain, range2, interpolate2) { + var d0 = domain[0], d1 = domain[1], r0 = range2[0], r1 = range2[1]; + if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate2(r1, r0); + else d0 = normalize(d0, d1), r0 = interpolate2(r0, r1); + return function(x2) { + return r0(d0(x2)); + }; +} +function polymap(domain, range2, interpolate2) { + var j = Math.min(domain.length, range2.length) - 1, d = new Array(j), r = new Array(j), i = -1; + if (domain[j] < domain[0]) { + domain = domain.slice().reverse(); + range2 = range2.slice().reverse(); + } + while (++i < j) { + d[i] = normalize(domain[i], domain[i + 1]); + r[i] = interpolate2(range2[i], range2[i + 1]); + } + return function(x2) { + var i2 = bisect(domain, x2, 1, j) - 1; + return r[i2](d[i2](x2)); + }; +} +function copy(source, target) { + return target.domain(source.domain()).range(source.range()).interpolate(source.interpolate()).clamp(source.clamp()).unknown(source.unknown()); +} +function transformer() { + var domain = unit, range2 = unit, interpolate$1 = interpolate, transform, untransform, unknown, clamp2 = identity$1, piecewise, output, input; + function rescale() { + var n = Math.min(domain.length, range2.length); + if (clamp2 !== identity$1) clamp2 = clamper(domain[0], domain[n - 1]); + piecewise = n > 2 ? polymap : bimap; + output = input = null; + return scale; + } + function scale(x2) { + return x2 == null || isNaN(x2 = +x2) ? unknown : (output || (output = piecewise(domain.map(transform), range2, interpolate$1)))(transform(clamp2(x2))); + } + scale.invert = function(y2) { + return clamp2(untransform((input || (input = piecewise(range2, domain.map(transform), interpolateNumber)))(y2))); + }; + scale.domain = function(_) { + return arguments.length ? (domain = Array.from(_, number$1), rescale()) : domain.slice(); + }; + scale.range = function(_) { + return arguments.length ? (range2 = Array.from(_), rescale()) : range2.slice(); + }; + scale.rangeRound = function(_) { + return range2 = Array.from(_), interpolate$1 = interpolateRound, rescale(); + }; + scale.clamp = function(_) { + return arguments.length ? (clamp2 = _ ? true : identity$1, rescale()) : clamp2 !== identity$1; + }; + scale.interpolate = function(_) { + return arguments.length ? (interpolate$1 = _, rescale()) : interpolate$1; + }; + scale.unknown = function(_) { + return arguments.length ? (unknown = _, scale) : unknown; + }; + return function(t, u) { + transform = t, untransform = u; + return rescale(); + }; +} +function continuous() { + return transformer()(identity$1, identity$1); +} +function formatDecimal(x2) { + return Math.abs(x2 = Math.round(x2)) >= 1e21 ? x2.toLocaleString("en").replace(/,/g, "") : x2.toString(10); +} +function formatDecimalParts(x2, p) { + if ((i = (x2 = p ? x2.toExponential(p - 1) : x2.toExponential()).indexOf("e")) < 0) return null; + var i, coefficient = x2.slice(0, i); + return [ + coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient, + +x2.slice(i + 1) + ]; +} +function exponent(x2) { + return x2 = formatDecimalParts(Math.abs(x2)), x2 ? x2[1] : NaN; +} +function formatGroup(grouping, thousands) { + return function(value, width) { + var i = value.length, t = [], j = 0, g = grouping[0], length = 0; + while (i > 0 && g > 0) { + if (length + g + 1 > width) g = Math.max(1, width - length); + t.push(value.substring(i -= g, i + g)); + if ((length += g + 1) > width) break; + g = grouping[j = (j + 1) % grouping.length]; + } + return t.reverse().join(thousands); + }; +} +function formatNumerals(numerals) { + return function(value) { + return value.replace(/[0-9]/g, function(i) { + return numerals[+i]; + }); + }; +} +var re = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i; +function formatSpecifier(specifier) { + if (!(match = re.exec(specifier))) throw new Error("invalid format: " + specifier); + var match; + return new FormatSpecifier({ + fill: match[1], + align: match[2], + sign: match[3], + symbol: match[4], + zero: match[5], + width: match[6], + comma: match[7], + precision: match[8] && match[8].slice(1), + trim: match[9], + type: match[10] + }); +} +formatSpecifier.prototype = FormatSpecifier.prototype; +function FormatSpecifier(specifier) { + this.fill = specifier.fill === void 0 ? " " : specifier.fill + ""; + this.align = specifier.align === void 0 ? ">" : specifier.align + ""; + this.sign = specifier.sign === void 0 ? "-" : specifier.sign + ""; + this.symbol = specifier.symbol === void 0 ? "" : specifier.symbol + ""; + this.zero = !!specifier.zero; + this.width = specifier.width === void 0 ? void 0 : +specifier.width; + this.comma = !!specifier.comma; + this.precision = specifier.precision === void 0 ? void 0 : +specifier.precision; + this.trim = !!specifier.trim; + this.type = specifier.type === void 0 ? "" : specifier.type + ""; +} +FormatSpecifier.prototype.toString = function() { + return this.fill + this.align + this.sign + this.symbol + (this.zero ? "0" : "") + (this.width === void 0 ? "" : Math.max(1, this.width | 0)) + (this.comma ? "," : "") + (this.precision === void 0 ? "" : "." + Math.max(0, this.precision | 0)) + (this.trim ? "~" : "") + this.type; +}; +function formatTrim(s2) { + out: for (var n = s2.length, i = 1, i0 = -1, i1; i < n; ++i) { + switch (s2[i]) { + case ".": + i0 = i1 = i; + break; + case "0": + if (i0 === 0) i0 = i; + i1 = i; + break; + default: + if (!+s2[i]) break out; + if (i0 > 0) i0 = 0; + break; + } + } + return i0 > 0 ? s2.slice(0, i0) + s2.slice(i1 + 1) : s2; +} +var prefixExponent; +function formatPrefixAuto(x2, p) { + var d = formatDecimalParts(x2, p); + if (!d) return x2 + ""; + var coefficient = d[0], exponent2 = d[1], i = exponent2 - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent2 / 3))) * 3) + 1, n = coefficient.length; + return i === n ? coefficient : i > n ? coefficient + new Array(i - n + 1).join("0") : i > 0 ? coefficient.slice(0, i) + "." + coefficient.slice(i) : "0." + new Array(1 - i).join("0") + formatDecimalParts(x2, Math.max(0, p + i - 1))[0]; +} +function formatRounded(x2, p) { + var d = formatDecimalParts(x2, p); + if (!d) return x2 + ""; + var coefficient = d[0], exponent2 = d[1]; + return exponent2 < 0 ? "0." + new Array(-exponent2).join("0") + coefficient : coefficient.length > exponent2 + 1 ? coefficient.slice(0, exponent2 + 1) + "." + coefficient.slice(exponent2 + 1) : coefficient + new Array(exponent2 - coefficient.length + 2).join("0"); +} +var formatTypes = { + "%": (x2, p) => (x2 * 100).toFixed(p), + "b": (x2) => Math.round(x2).toString(2), + "c": (x2) => x2 + "", + "d": formatDecimal, + "e": (x2, p) => x2.toExponential(p), + "f": (x2, p) => x2.toFixed(p), + "g": (x2, p) => x2.toPrecision(p), + "o": (x2) => Math.round(x2).toString(8), + "p": (x2, p) => formatRounded(x2 * 100, p), + "r": formatRounded, + "s": formatPrefixAuto, + "X": (x2) => Math.round(x2).toString(16).toUpperCase(), + "x": (x2) => Math.round(x2).toString(16) +}; +function identity(x2) { + return x2; +} +var map = Array.prototype.map; +var prefixes = ["y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"]; +function formatLocale$1(locale2) { + var group = locale2.grouping === void 0 || locale2.thousands === void 0 ? identity : formatGroup(map.call(locale2.grouping, Number), locale2.thousands + ""), currencyPrefix = locale2.currency === void 0 ? "" : locale2.currency[0] + "", currencySuffix = locale2.currency === void 0 ? "" : locale2.currency[1] + "", decimal = locale2.decimal === void 0 ? "." : locale2.decimal + "", numerals = locale2.numerals === void 0 ? identity : formatNumerals(map.call(locale2.numerals, String)), percent = locale2.percent === void 0 ? "%" : locale2.percent + "", minus = locale2.minus === void 0 ? "−" : locale2.minus + "", nan = locale2.nan === void 0 ? "NaN" : locale2.nan + ""; + function newFormat(specifier) { + specifier = formatSpecifier(specifier); + var fill = specifier.fill, align = specifier.align, sign2 = specifier.sign, symbol = specifier.symbol, zero2 = specifier.zero, width = specifier.width, comma = specifier.comma, precision = specifier.precision, trim = specifier.trim, type = specifier.type; + if (type === "n") comma = true, type = "g"; + else if (!formatTypes[type]) precision === void 0 && (precision = 12), trim = true, type = "g"; + if (zero2 || fill === "0" && align === "=") zero2 = true, fill = "0", align = "="; + var prefix = symbol === "$" ? currencyPrefix : symbol === "#" && /[boxX]/.test(type) ? "0" + type.toLowerCase() : "", suffix = symbol === "$" ? currencySuffix : /[%p]/.test(type) ? percent : ""; + var formatType = formatTypes[type], maybeSuffix = /[defgprs%]/.test(type); + precision = precision === void 0 ? 6 : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision)) : Math.max(0, Math.min(20, precision)); + function format2(value) { + var valuePrefix = prefix, valueSuffix = suffix, i, n, c; + if (type === "c") { + valueSuffix = formatType(value) + valueSuffix; + value = ""; + } else { + value = +value; + var valueNegative = value < 0 || 1 / value < 0; + value = isNaN(value) ? nan : formatType(Math.abs(value), precision); + if (trim) value = formatTrim(value); + if (valueNegative && +value === 0 && sign2 !== "+") valueNegative = false; + valuePrefix = (valueNegative ? sign2 === "(" ? sign2 : minus : sign2 === "-" || sign2 === "(" ? "" : sign2) + valuePrefix; + valueSuffix = (type === "s" ? prefixes[8 + prefixExponent / 3] : "") + valueSuffix + (valueNegative && sign2 === "(" ? ")" : ""); + if (maybeSuffix) { + i = -1, n = value.length; + while (++i < n) { + if (c = value.charCodeAt(i), 48 > c || c > 57) { + valueSuffix = (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix; + value = value.slice(0, i); + break; + } + } + } + } + if (comma && !zero2) value = group(value, Infinity); + var length = valuePrefix.length + value.length + valueSuffix.length, padding = length < width ? new Array(width - length + 1).join(fill) : ""; + if (comma && zero2) value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = ""; + switch (align) { + case "<": + value = valuePrefix + value + valueSuffix + padding; + break; + case "=": + value = valuePrefix + padding + value + valueSuffix; + break; + case "^": + value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length); + break; + default: + value = padding + valuePrefix + value + valueSuffix; + break; + } + return numerals(value); + } + format2.toString = function() { + return specifier + ""; + }; + return format2; + } + function formatPrefix2(specifier, value) { + var f = newFormat((specifier = formatSpecifier(specifier), specifier.type = "f", specifier)), e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3, k2 = Math.pow(10, -e), prefix = prefixes[8 + e / 3]; + return function(value2) { + return f(k2 * value2) + prefix; + }; + } + return { + format: newFormat, + formatPrefix: formatPrefix2 + }; +} +var locale$1; +var format; +var formatPrefix; +defaultLocale$1({ + thousands: ",", + grouping: [3], + currency: ["$", ""] +}); +function defaultLocale$1(definition) { + locale$1 = formatLocale$1(definition); + format = locale$1.format; + formatPrefix = locale$1.formatPrefix; + return locale$1; +} +function precisionFixed(step2) { + return Math.max(0, -exponent(Math.abs(step2))); +} +function precisionPrefix(step2, value) { + return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3 - exponent(Math.abs(step2))); +} +function precisionRound(step2, max3) { + step2 = Math.abs(step2), max3 = Math.abs(max3) - step2; + return Math.max(0, exponent(max3) - exponent(step2)) + 1; +} +function tickFormat(start, stop, count, specifier) { + var step2 = tickStep(start, stop, count), precision; + specifier = formatSpecifier(specifier == null ? ",f" : specifier); + switch (specifier.type) { + case "s": { + var value = Math.max(Math.abs(start), Math.abs(stop)); + if (specifier.precision == null && !isNaN(precision = precisionPrefix(step2, value))) specifier.precision = precision; + return formatPrefix(specifier, value); + } + case "": + case "e": + case "g": + case "p": + case "r": { + if (specifier.precision == null && !isNaN(precision = precisionRound(step2, Math.max(Math.abs(start), Math.abs(stop))))) specifier.precision = precision - (specifier.type === "e"); + break; + } + case "f": + case "%": { + if (specifier.precision == null && !isNaN(precision = precisionFixed(step2))) specifier.precision = precision - (specifier.type === "%") * 2; + break; + } + } + return format(specifier); +} +function linearish(scale) { + var domain = scale.domain; + scale.ticks = function(count) { + var d = domain(); + return ticks(d[0], d[d.length - 1], count == null ? 10 : count); + }; + scale.tickFormat = function(count, specifier) { + var d = domain(); + return tickFormat(d[0], d[d.length - 1], count == null ? 10 : count, specifier); + }; + scale.nice = function(count) { + if (count == null) count = 10; + var d = domain(); + var i0 = 0; + var i1 = d.length - 1; + var start = d[i0]; + var stop = d[i1]; + var prestep; + var step2; + var maxIter = 10; + if (stop < start) { + step2 = start, start = stop, stop = step2; + step2 = i0, i0 = i1, i1 = step2; + } + while (maxIter-- > 0) { + step2 = tickIncrement(start, stop, count); + if (step2 === prestep) { + d[i0] = start; + d[i1] = stop; + return domain(d); + } else if (step2 > 0) { + start = Math.floor(start / step2) * step2; + stop = Math.ceil(stop / step2) * step2; + } else if (step2 < 0) { + start = Math.ceil(start * step2) / step2; + stop = Math.floor(stop * step2) / step2; + } else { + break; + } + prestep = step2; + } + return scale; + }; + return scale; +} +function linear() { + var scale = continuous(); + scale.copy = function() { + return copy(scale, linear()); + }; + initRange.apply(scale, arguments); + return linearish(scale); +} +function nice(domain, interval) { + domain = domain.slice(); + var i0 = 0, i1 = domain.length - 1, x0 = domain[i0], x1 = domain[i1], t; + if (x1 < x0) { + t = i0, i0 = i1, i1 = t; + t = x0, x0 = x1, x1 = t; + } + domain[i0] = interval.floor(x0); + domain[i1] = interval.ceil(x1); + return domain; +} +function transformLog(x2) { + return Math.log(x2); +} +function transformExp(x2) { + return Math.exp(x2); +} +function transformLogn(x2) { + return -Math.log(-x2); +} +function transformExpn(x2) { + return -Math.exp(-x2); +} +function pow10(x2) { + return isFinite(x2) ? +("1e" + x2) : x2 < 0 ? 0 : x2; +} +function powp(base) { + return base === 10 ? pow10 : base === Math.E ? Math.exp : (x2) => Math.pow(base, x2); +} +function logp(base) { + return base === Math.E ? Math.log : base === 10 && Math.log10 || base === 2 && Math.log2 || (base = Math.log(base), (x2) => Math.log(x2) / base); +} +function reflect(f) { + return (x2, k2) => -f(-x2, k2); +} +function loggish(transform) { + const scale = transform(transformLog, transformExp); + const domain = scale.domain; + let base = 10; + let logs; + let pows; + function rescale() { + logs = logp(base), pows = powp(base); + if (domain()[0] < 0) { + logs = reflect(logs), pows = reflect(pows); + transform(transformLogn, transformExpn); + } else { + transform(transformLog, transformExp); + } + return scale; + } + scale.base = function(_) { + return arguments.length ? (base = +_, rescale()) : base; + }; + scale.domain = function(_) { + return arguments.length ? (domain(_), rescale()) : domain(); + }; + scale.ticks = (count) => { + const d = domain(); + let u = d[0]; + let v = d[d.length - 1]; + const r = v < u; + if (r) [u, v] = [v, u]; + let i = logs(u); + let j = logs(v); + let k2; + let t; + const n = count == null ? 10 : +count; + let z = []; + if (!(base % 1) && j - i < n) { + i = Math.floor(i), j = Math.ceil(j); + if (u > 0) for (; i <= j; ++i) { + for (k2 = 1; k2 < base; ++k2) { + t = i < 0 ? k2 / pows(-i) : k2 * pows(i); + if (t < u) continue; + if (t > v) break; + z.push(t); + } + } + else for (; i <= j; ++i) { + for (k2 = base - 1; k2 >= 1; --k2) { + t = i > 0 ? k2 / pows(-i) : k2 * pows(i); + if (t < u) continue; + if (t > v) break; + z.push(t); + } + } + if (z.length * 2 < n) z = ticks(u, v, n); + } else { + z = ticks(i, j, Math.min(j - i, n)).map(pows); + } + return r ? z.reverse() : z; + }; + scale.tickFormat = (count, specifier) => { + if (count == null) count = 10; + if (specifier == null) specifier = base === 10 ? "s" : ","; + if (typeof specifier !== "function") { + if (!(base % 1) && (specifier = formatSpecifier(specifier)).precision == null) specifier.trim = true; + specifier = format(specifier); + } + if (count === Infinity) return specifier; + const k2 = Math.max(1, base * count / scale.ticks().length); + return (d) => { + let i = d / pows(Math.round(logs(d))); + if (i * base < base - 0.5) i *= base; + return i <= k2 ? specifier(d) : ""; + }; + }; + scale.nice = () => { + return domain(nice(domain(), { + floor: (x2) => pows(Math.floor(logs(x2))), + ceil: (x2) => pows(Math.ceil(logs(x2))) + })); + }; + return scale; +} +function log() { + const scale = loggish(transformer()).domain([1, 10]); + scale.copy = () => copy(scale, log()).base(scale.base()); + initRange.apply(scale, arguments); + return scale; +} +var t0 = /* @__PURE__ */ new Date(); +var t1 = /* @__PURE__ */ new Date(); +function timeInterval(floori, offseti, count, field) { + function interval(date2) { + return floori(date2 = arguments.length === 0 ? /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date(+date2)), date2; + } + interval.floor = (date2) => { + return floori(date2 = /* @__PURE__ */ new Date(+date2)), date2; + }; + interval.ceil = (date2) => { + return floori(date2 = new Date(date2 - 1)), offseti(date2, 1), floori(date2), date2; + }; + interval.round = (date2) => { + const d0 = interval(date2), d1 = interval.ceil(date2); + return date2 - d0 < d1 - date2 ? d0 : d1; + }; + interval.offset = (date2, step2) => { + return offseti(date2 = /* @__PURE__ */ new Date(+date2), step2 == null ? 1 : Math.floor(step2)), date2; + }; + interval.range = (start, stop, step2) => { + const range2 = []; + start = interval.ceil(start); + step2 = step2 == null ? 1 : Math.floor(step2); + if (!(start < stop) || !(step2 > 0)) return range2; + let previous; + do + range2.push(previous = /* @__PURE__ */ new Date(+start)), offseti(start, step2), floori(start); + while (previous < start && start < stop); + return range2; + }; + interval.filter = (test) => { + return timeInterval((date2) => { + if (date2 >= date2) while (floori(date2), !test(date2)) date2.setTime(date2 - 1); + }, (date2, step2) => { + if (date2 >= date2) { + if (step2 < 0) while (++step2 <= 0) { + while (offseti(date2, -1), !test(date2)) { + } + } + else while (--step2 >= 0) { + while (offseti(date2, 1), !test(date2)) { + } + } + } + }); + }; + if (count) { + interval.count = (start, end) => { + t0.setTime(+start), t1.setTime(+end); + floori(t0), floori(t1); + return Math.floor(count(t0, t1)); + }; + interval.every = (step2) => { + step2 = Math.floor(step2); + return !isFinite(step2) || !(step2 > 0) ? null : !(step2 > 1) ? interval : interval.filter(field ? (d) => field(d) % step2 === 0 : (d) => interval.count(0, d) % step2 === 0); + }; + } + return interval; +} +var millisecond = timeInterval(() => { +}, (date2, step2) => { + date2.setTime(+date2 + step2); +}, (start, end) => { + return end - start; +}); +millisecond.every = (k2) => { + k2 = Math.floor(k2); + if (!isFinite(k2) || !(k2 > 0)) return null; + if (!(k2 > 1)) return millisecond; + return timeInterval((date2) => { + date2.setTime(Math.floor(date2 / k2) * k2); + }, (date2, step2) => { + date2.setTime(+date2 + step2 * k2); + }, (start, end) => { + return (end - start) / k2; + }); +}; +millisecond.range; +var durationSecond = 1e3; +var durationMinute = durationSecond * 60; +var durationHour = durationMinute * 60; +var durationDay = durationHour * 24; +var durationWeek = durationDay * 7; +var durationMonth = durationDay * 30; +var durationYear = durationDay * 365; +var second = timeInterval((date2) => { + date2.setTime(date2 - date2.getMilliseconds()); +}, (date2, step2) => { + date2.setTime(+date2 + step2 * durationSecond); +}, (start, end) => { + return (end - start) / durationSecond; +}, (date2) => { + return date2.getUTCSeconds(); +}); +second.range; +var timeMinute = timeInterval((date2) => { + date2.setTime(date2 - date2.getMilliseconds() - date2.getSeconds() * durationSecond); +}, (date2, step2) => { + date2.setTime(+date2 + step2 * durationMinute); +}, (start, end) => { + return (end - start) / durationMinute; +}, (date2) => { + return date2.getMinutes(); +}); +timeMinute.range; +var utcMinute = timeInterval((date2) => { + date2.setUTCSeconds(0, 0); +}, (date2, step2) => { + date2.setTime(+date2 + step2 * durationMinute); +}, (start, end) => { + return (end - start) / durationMinute; +}, (date2) => { + return date2.getUTCMinutes(); +}); +utcMinute.range; +var timeHour = timeInterval((date2) => { + date2.setTime(date2 - date2.getMilliseconds() - date2.getSeconds() * durationSecond - date2.getMinutes() * durationMinute); +}, (date2, step2) => { + date2.setTime(+date2 + step2 * durationHour); +}, (start, end) => { + return (end - start) / durationHour; +}, (date2) => { + return date2.getHours(); +}); +timeHour.range; +var utcHour = timeInterval((date2) => { + date2.setUTCMinutes(0, 0, 0); +}, (date2, step2) => { + date2.setTime(+date2 + step2 * durationHour); +}, (start, end) => { + return (end - start) / durationHour; +}, (date2) => { + return date2.getUTCHours(); +}); +utcHour.range; +var timeDay = timeInterval( + (date2) => date2.setHours(0, 0, 0, 0), + (date2, step2) => date2.setDate(date2.getDate() + step2), + (start, end) => (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationDay, + (date2) => date2.getDate() - 1 +); +timeDay.range; +var utcDay = timeInterval((date2) => { + date2.setUTCHours(0, 0, 0, 0); +}, (date2, step2) => { + date2.setUTCDate(date2.getUTCDate() + step2); +}, (start, end) => { + return (end - start) / durationDay; +}, (date2) => { + return date2.getUTCDate() - 1; +}); +utcDay.range; +var unixDay = timeInterval((date2) => { + date2.setUTCHours(0, 0, 0, 0); +}, (date2, step2) => { + date2.setUTCDate(date2.getUTCDate() + step2); +}, (start, end) => { + return (end - start) / durationDay; +}, (date2) => { + return Math.floor(date2 / durationDay); +}); +unixDay.range; +function timeWeekday(i) { + return timeInterval((date2) => { + date2.setDate(date2.getDate() - (date2.getDay() + 7 - i) % 7); + date2.setHours(0, 0, 0, 0); + }, (date2, step2) => { + date2.setDate(date2.getDate() + step2 * 7); + }, (start, end) => { + return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek; + }); +} +var timeSunday = timeWeekday(0); +var timeMonday = timeWeekday(1); +var timeTuesday = timeWeekday(2); +var timeWednesday = timeWeekday(3); +var timeThursday = timeWeekday(4); +var timeFriday = timeWeekday(5); +var timeSaturday = timeWeekday(6); +timeSunday.range; +timeMonday.range; +timeTuesday.range; +timeWednesday.range; +timeThursday.range; +timeFriday.range; +timeSaturday.range; +function utcWeekday(i) { + return timeInterval((date2) => { + date2.setUTCDate(date2.getUTCDate() - (date2.getUTCDay() + 7 - i) % 7); + date2.setUTCHours(0, 0, 0, 0); + }, (date2, step2) => { + date2.setUTCDate(date2.getUTCDate() + step2 * 7); + }, (start, end) => { + return (end - start) / durationWeek; + }); +} +var utcSunday = utcWeekday(0); +var utcMonday = utcWeekday(1); +var utcTuesday = utcWeekday(2); +var utcWednesday = utcWeekday(3); +var utcThursday = utcWeekday(4); +var utcFriday = utcWeekday(5); +var utcSaturday = utcWeekday(6); +utcSunday.range; +utcMonday.range; +utcTuesday.range; +utcWednesday.range; +utcThursday.range; +utcFriday.range; +utcSaturday.range; +var timeMonth = timeInterval((date2) => { + date2.setDate(1); + date2.setHours(0, 0, 0, 0); +}, (date2, step2) => { + date2.setMonth(date2.getMonth() + step2); +}, (start, end) => { + return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12; +}, (date2) => { + return date2.getMonth(); +}); +timeMonth.range; +var utcMonth = timeInterval((date2) => { + date2.setUTCDate(1); + date2.setUTCHours(0, 0, 0, 0); +}, (date2, step2) => { + date2.setUTCMonth(date2.getUTCMonth() + step2); +}, (start, end) => { + return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12; +}, (date2) => { + return date2.getUTCMonth(); +}); +utcMonth.range; +var timeYear = timeInterval((date2) => { + date2.setMonth(0, 1); + date2.setHours(0, 0, 0, 0); +}, (date2, step2) => { + date2.setFullYear(date2.getFullYear() + step2); +}, (start, end) => { + return end.getFullYear() - start.getFullYear(); +}, (date2) => { + return date2.getFullYear(); +}); +timeYear.every = (k2) => { + return !isFinite(k2 = Math.floor(k2)) || !(k2 > 0) ? null : timeInterval((date2) => { + date2.setFullYear(Math.floor(date2.getFullYear() / k2) * k2); + date2.setMonth(0, 1); + date2.setHours(0, 0, 0, 0); + }, (date2, step2) => { + date2.setFullYear(date2.getFullYear() + step2 * k2); + }); +}; +timeYear.range; +var utcYear = timeInterval((date2) => { + date2.setUTCMonth(0, 1); + date2.setUTCHours(0, 0, 0, 0); +}, (date2, step2) => { + date2.setUTCFullYear(date2.getUTCFullYear() + step2); +}, (start, end) => { + return end.getUTCFullYear() - start.getUTCFullYear(); +}, (date2) => { + return date2.getUTCFullYear(); +}); +utcYear.every = (k2) => { + return !isFinite(k2 = Math.floor(k2)) || !(k2 > 0) ? null : timeInterval((date2) => { + date2.setUTCFullYear(Math.floor(date2.getUTCFullYear() / k2) * k2); + date2.setUTCMonth(0, 1); + date2.setUTCHours(0, 0, 0, 0); + }, (date2, step2) => { + date2.setUTCFullYear(date2.getUTCFullYear() + step2 * k2); + }); +}; +utcYear.range; +function ticker(year, month, week, day, hour, minute) { + const tickIntervals = [ + [second, 1, durationSecond], + [second, 5, 5 * durationSecond], + [second, 15, 15 * durationSecond], + [second, 30, 30 * durationSecond], + [minute, 1, durationMinute], + [minute, 5, 5 * durationMinute], + [minute, 15, 15 * durationMinute], + [minute, 30, 30 * durationMinute], + [hour, 1, durationHour], + [hour, 3, 3 * durationHour], + [hour, 6, 6 * durationHour], + [hour, 12, 12 * durationHour], + [day, 1, durationDay], + [day, 2, 2 * durationDay], + [week, 1, durationWeek], + [month, 1, durationMonth], + [month, 3, 3 * durationMonth], + [year, 1, durationYear] + ]; + function ticks2(start, stop, count) { + const reverse = stop < start; + if (reverse) [start, stop] = [stop, start]; + const interval = count && typeof count.range === "function" ? count : tickInterval(start, stop, count); + const ticks3 = interval ? interval.range(start, +stop + 1) : []; + return reverse ? ticks3.reverse() : ticks3; + } + function tickInterval(start, stop, count) { + const target = Math.abs(stop - start) / count; + const i = bisector(([, , step3]) => step3).right(tickIntervals, target); + if (i === tickIntervals.length) return year.every(tickStep(start / durationYear, stop / durationYear, count)); + if (i === 0) return millisecond.every(Math.max(tickStep(start, stop, count), 1)); + const [t, step2] = tickIntervals[target / tickIntervals[i - 1][2] < tickIntervals[i][2] / target ? i - 1 : i]; + return t.every(step2); + } + return [ticks2, tickInterval]; +} +ticker(utcYear, utcMonth, utcSunday, unixDay, utcHour, utcMinute); +var [timeTicks, timeTickInterval] = ticker(timeYear, timeMonth, timeSunday, timeDay, timeHour, timeMinute); +function localDate(d) { + if (0 <= d.y && d.y < 100) { + var date2 = new Date(-1, d.m, d.d, d.H, d.M, d.S, d.L); + date2.setFullYear(d.y); + return date2; + } + return new Date(d.y, d.m, d.d, d.H, d.M, d.S, d.L); +} +function utcDate(d) { + if (0 <= d.y && d.y < 100) { + var date2 = new Date(Date.UTC(-1, d.m, d.d, d.H, d.M, d.S, d.L)); + date2.setUTCFullYear(d.y); + return date2; + } + return new Date(Date.UTC(d.y, d.m, d.d, d.H, d.M, d.S, d.L)); +} +function newDate(y2, m, d) { + return { y: y2, m, d, H: 0, M: 0, S: 0, L: 0 }; +} +function formatLocale(locale2) { + var locale_dateTime = locale2.dateTime, locale_date = locale2.date, locale_time = locale2.time, locale_periods = locale2.periods, locale_weekdays = locale2.days, locale_shortWeekdays = locale2.shortDays, locale_months = locale2.months, locale_shortMonths = locale2.shortMonths; + var periodRe = formatRe(locale_periods), periodLookup = formatLookup(locale_periods), weekdayRe = formatRe(locale_weekdays), weekdayLookup = formatLookup(locale_weekdays), shortWeekdayRe = formatRe(locale_shortWeekdays), shortWeekdayLookup = formatLookup(locale_shortWeekdays), monthRe = formatRe(locale_months), monthLookup = formatLookup(locale_months), shortMonthRe = formatRe(locale_shortMonths), shortMonthLookup = formatLookup(locale_shortMonths); + var formats = { + "a": formatShortWeekday, + "A": formatWeekday, + "b": formatShortMonth, + "B": formatMonth, + "c": null, + "d": formatDayOfMonth, + "e": formatDayOfMonth, + "f": formatMicroseconds, + "g": formatYearISO, + "G": formatFullYearISO, + "H": formatHour24, + "I": formatHour12, + "j": formatDayOfYear, + "L": formatMilliseconds, + "m": formatMonthNumber, + "M": formatMinutes, + "p": formatPeriod, + "q": formatQuarter, + "Q": formatUnixTimestamp, + "s": formatUnixTimestampSeconds, + "S": formatSeconds, + "u": formatWeekdayNumberMonday, + "U": formatWeekNumberSunday, + "V": formatWeekNumberISO, + "w": formatWeekdayNumberSunday, + "W": formatWeekNumberMonday, + "x": null, + "X": null, + "y": formatYear, + "Y": formatFullYear, + "Z": formatZone, + "%": formatLiteralPercent + }; + var utcFormats = { + "a": formatUTCShortWeekday, + "A": formatUTCWeekday, + "b": formatUTCShortMonth, + "B": formatUTCMonth, + "c": null, + "d": formatUTCDayOfMonth, + "e": formatUTCDayOfMonth, + "f": formatUTCMicroseconds, + "g": formatUTCYearISO, + "G": formatUTCFullYearISO, + "H": formatUTCHour24, + "I": formatUTCHour12, + "j": formatUTCDayOfYear, + "L": formatUTCMilliseconds, + "m": formatUTCMonthNumber, + "M": formatUTCMinutes, + "p": formatUTCPeriod, + "q": formatUTCQuarter, + "Q": formatUnixTimestamp, + "s": formatUnixTimestampSeconds, + "S": formatUTCSeconds, + "u": formatUTCWeekdayNumberMonday, + "U": formatUTCWeekNumberSunday, + "V": formatUTCWeekNumberISO, + "w": formatUTCWeekdayNumberSunday, + "W": formatUTCWeekNumberMonday, + "x": null, + "X": null, + "y": formatUTCYear, + "Y": formatUTCFullYear, + "Z": formatUTCZone, + "%": formatLiteralPercent + }; + var parses = { + "a": parseShortWeekday, + "A": parseWeekday, + "b": parseShortMonth, + "B": parseMonth, + "c": parseLocaleDateTime, + "d": parseDayOfMonth, + "e": parseDayOfMonth, + "f": parseMicroseconds, + "g": parseYear, + "G": parseFullYear, + "H": parseHour24, + "I": parseHour24, + "j": parseDayOfYear, + "L": parseMilliseconds, + "m": parseMonthNumber, + "M": parseMinutes, + "p": parsePeriod, + "q": parseQuarter, + "Q": parseUnixTimestamp, + "s": parseUnixTimestampSeconds, + "S": parseSeconds, + "u": parseWeekdayNumberMonday, + "U": parseWeekNumberSunday, + "V": parseWeekNumberISO, + "w": parseWeekdayNumberSunday, + "W": parseWeekNumberMonday, + "x": parseLocaleDate, + "X": parseLocaleTime, + "y": parseYear, + "Y": parseFullYear, + "Z": parseZone, + "%": parseLiteralPercent + }; + formats.x = newFormat(locale_date, formats); + formats.X = newFormat(locale_time, formats); + formats.c = newFormat(locale_dateTime, formats); + utcFormats.x = newFormat(locale_date, utcFormats); + utcFormats.X = newFormat(locale_time, utcFormats); + utcFormats.c = newFormat(locale_dateTime, utcFormats); + function newFormat(specifier, formats2) { + return function(date2) { + var string2 = [], i = -1, j = 0, n = specifier.length, c, pad2, format2; + if (!(date2 instanceof Date)) date2 = /* @__PURE__ */ new Date(+date2); + while (++i < n) { + if (specifier.charCodeAt(i) === 37) { + string2.push(specifier.slice(j, i)); + if ((pad2 = pads[c = specifier.charAt(++i)]) != null) c = specifier.charAt(++i); + else pad2 = c === "e" ? " " : "0"; + if (format2 = formats2[c]) c = format2(date2, pad2); + string2.push(c); + j = i + 1; + } + } + string2.push(specifier.slice(j, i)); + return string2.join(""); + }; + } + function newParse(specifier, Z) { + return function(string2) { + var d = newDate(1900, void 0, 1), i = parseSpecifier(d, specifier, string2 += "", 0), week, day; + if (i != string2.length) return null; + if ("Q" in d) return new Date(d.Q); + if ("s" in d) return new Date(d.s * 1e3 + ("L" in d ? d.L : 0)); + if (Z && !("Z" in d)) d.Z = 0; + if ("p" in d) d.H = d.H % 12 + d.p * 12; + if (d.m === void 0) d.m = "q" in d ? d.q : 0; + if ("V" in d) { + if (d.V < 1 || d.V > 53) return null; + if (!("w" in d)) d.w = 1; + if ("Z" in d) { + week = utcDate(newDate(d.y, 0, 1)), day = week.getUTCDay(); + week = day > 4 || day === 0 ? utcMonday.ceil(week) : utcMonday(week); + week = utcDay.offset(week, (d.V - 1) * 7); + d.y = week.getUTCFullYear(); + d.m = week.getUTCMonth(); + d.d = week.getUTCDate() + (d.w + 6) % 7; + } else { + week = localDate(newDate(d.y, 0, 1)), day = week.getDay(); + week = day > 4 || day === 0 ? timeMonday.ceil(week) : timeMonday(week); + week = timeDay.offset(week, (d.V - 1) * 7); + d.y = week.getFullYear(); + d.m = week.getMonth(); + d.d = week.getDate() + (d.w + 6) % 7; + } + } else if ("W" in d || "U" in d) { + if (!("w" in d)) d.w = "u" in d ? d.u % 7 : "W" in d ? 1 : 0; + day = "Z" in d ? utcDate(newDate(d.y, 0, 1)).getUTCDay() : localDate(newDate(d.y, 0, 1)).getDay(); + d.m = 0; + d.d = "W" in d ? (d.w + 6) % 7 + d.W * 7 - (day + 5) % 7 : d.w + d.U * 7 - (day + 6) % 7; + } + if ("Z" in d) { + d.H += d.Z / 100 | 0; + d.M += d.Z % 100; + return utcDate(d); + } + return localDate(d); + }; + } + function parseSpecifier(d, specifier, string2, j) { + var i = 0, n = specifier.length, m = string2.length, c, parse; + while (i < n) { + if (j >= m) return -1; + c = specifier.charCodeAt(i++); + if (c === 37) { + c = specifier.charAt(i++); + parse = parses[c in pads ? specifier.charAt(i++) : c]; + if (!parse || (j = parse(d, string2, j)) < 0) return -1; + } else if (c != string2.charCodeAt(j++)) { + return -1; + } + } + return j; + } + function parsePeriod(d, string2, i) { + var n = periodRe.exec(string2.slice(i)); + return n ? (d.p = periodLookup.get(n[0].toLowerCase()), i + n[0].length) : -1; + } + function parseShortWeekday(d, string2, i) { + var n = shortWeekdayRe.exec(string2.slice(i)); + return n ? (d.w = shortWeekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1; + } + function parseWeekday(d, string2, i) { + var n = weekdayRe.exec(string2.slice(i)); + return n ? (d.w = weekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1; + } + function parseShortMonth(d, string2, i) { + var n = shortMonthRe.exec(string2.slice(i)); + return n ? (d.m = shortMonthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1; + } + function parseMonth(d, string2, i) { + var n = monthRe.exec(string2.slice(i)); + return n ? (d.m = monthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1; + } + function parseLocaleDateTime(d, string2, i) { + return parseSpecifier(d, locale_dateTime, string2, i); + } + function parseLocaleDate(d, string2, i) { + return parseSpecifier(d, locale_date, string2, i); + } + function parseLocaleTime(d, string2, i) { + return parseSpecifier(d, locale_time, string2, i); + } + function formatShortWeekday(d) { + return locale_shortWeekdays[d.getDay()]; + } + function formatWeekday(d) { + return locale_weekdays[d.getDay()]; + } + function formatShortMonth(d) { + return locale_shortMonths[d.getMonth()]; + } + function formatMonth(d) { + return locale_months[d.getMonth()]; + } + function formatPeriod(d) { + return locale_periods[+(d.getHours() >= 12)]; + } + function formatQuarter(d) { + return 1 + ~~(d.getMonth() / 3); + } + function formatUTCShortWeekday(d) { + return locale_shortWeekdays[d.getUTCDay()]; + } + function formatUTCWeekday(d) { + return locale_weekdays[d.getUTCDay()]; + } + function formatUTCShortMonth(d) { + return locale_shortMonths[d.getUTCMonth()]; + } + function formatUTCMonth(d) { + return locale_months[d.getUTCMonth()]; + } + function formatUTCPeriod(d) { + return locale_periods[+(d.getUTCHours() >= 12)]; + } + function formatUTCQuarter(d) { + return 1 + ~~(d.getUTCMonth() / 3); + } + return { + format: function(specifier) { + var f = newFormat(specifier += "", formats); + f.toString = function() { + return specifier; + }; + return f; + }, + parse: function(specifier) { + var p = newParse(specifier += "", false); + p.toString = function() { + return specifier; + }; + return p; + }, + utcFormat: function(specifier) { + var f = newFormat(specifier += "", utcFormats); + f.toString = function() { + return specifier; + }; + return f; + }, + utcParse: function(specifier) { + var p = newParse(specifier += "", true); + p.toString = function() { + return specifier; + }; + return p; + } + }; +} +var pads = { "-": "", "_": " ", "0": "0" }; +var numberRe = /^\s*\d+/; +var percentRe = /^%/; +var requoteRe = /[\\^$*+?|[\]().{}]/g; +function pad(value, fill, width) { + var sign2 = value < 0 ? "-" : "", string2 = (sign2 ? -value : value) + "", length = string2.length; + return sign2 + (length < width ? new Array(width - length + 1).join(fill) + string2 : string2); +} +function requote(s2) { + return s2.replace(requoteRe, "\\$&"); +} +function formatRe(names) { + return new RegExp("^(?:" + names.map(requote).join("|") + ")", "i"); +} +function formatLookup(names) { + return new Map(names.map((name, i) => [name.toLowerCase(), i])); +} +function parseWeekdayNumberSunday(d, string2, i) { + var n = numberRe.exec(string2.slice(i, i + 1)); + return n ? (d.w = +n[0], i + n[0].length) : -1; +} +function parseWeekdayNumberMonday(d, string2, i) { + var n = numberRe.exec(string2.slice(i, i + 1)); + return n ? (d.u = +n[0], i + n[0].length) : -1; +} +function parseWeekNumberSunday(d, string2, i) { + var n = numberRe.exec(string2.slice(i, i + 2)); + return n ? (d.U = +n[0], i + n[0].length) : -1; +} +function parseWeekNumberISO(d, string2, i) { + var n = numberRe.exec(string2.slice(i, i + 2)); + return n ? (d.V = +n[0], i + n[0].length) : -1; +} +function parseWeekNumberMonday(d, string2, i) { + var n = numberRe.exec(string2.slice(i, i + 2)); + return n ? (d.W = +n[0], i + n[0].length) : -1; +} +function parseFullYear(d, string2, i) { + var n = numberRe.exec(string2.slice(i, i + 4)); + return n ? (d.y = +n[0], i + n[0].length) : -1; +} +function parseYear(d, string2, i) { + var n = numberRe.exec(string2.slice(i, i + 2)); + return n ? (d.y = +n[0] + (+n[0] > 68 ? 1900 : 2e3), i + n[0].length) : -1; +} +function parseZone(d, string2, i) { + var n = /^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(string2.slice(i, i + 6)); + return n ? (d.Z = n[1] ? 0 : -(n[2] + (n[3] || "00")), i + n[0].length) : -1; +} +function parseQuarter(d, string2, i) { + var n = numberRe.exec(string2.slice(i, i + 1)); + return n ? (d.q = n[0] * 3 - 3, i + n[0].length) : -1; +} +function parseMonthNumber(d, string2, i) { + var n = numberRe.exec(string2.slice(i, i + 2)); + return n ? (d.m = n[0] - 1, i + n[0].length) : -1; +} +function parseDayOfMonth(d, string2, i) { + var n = numberRe.exec(string2.slice(i, i + 2)); + return n ? (d.d = +n[0], i + n[0].length) : -1; +} +function parseDayOfYear(d, string2, i) { + var n = numberRe.exec(string2.slice(i, i + 3)); + return n ? (d.m = 0, d.d = +n[0], i + n[0].length) : -1; +} +function parseHour24(d, string2, i) { + var n = numberRe.exec(string2.slice(i, i + 2)); + return n ? (d.H = +n[0], i + n[0].length) : -1; +} +function parseMinutes(d, string2, i) { + var n = numberRe.exec(string2.slice(i, i + 2)); + return n ? (d.M = +n[0], i + n[0].length) : -1; +} +function parseSeconds(d, string2, i) { + var n = numberRe.exec(string2.slice(i, i + 2)); + return n ? (d.S = +n[0], i + n[0].length) : -1; +} +function parseMilliseconds(d, string2, i) { + var n = numberRe.exec(string2.slice(i, i + 3)); + return n ? (d.L = +n[0], i + n[0].length) : -1; +} +function parseMicroseconds(d, string2, i) { + var n = numberRe.exec(string2.slice(i, i + 6)); + return n ? (d.L = Math.floor(n[0] / 1e3), i + n[0].length) : -1; +} +function parseLiteralPercent(d, string2, i) { + var n = percentRe.exec(string2.slice(i, i + 1)); + return n ? i + n[0].length : -1; +} +function parseUnixTimestamp(d, string2, i) { + var n = numberRe.exec(string2.slice(i)); + return n ? (d.Q = +n[0], i + n[0].length) : -1; +} +function parseUnixTimestampSeconds(d, string2, i) { + var n = numberRe.exec(string2.slice(i)); + return n ? (d.s = +n[0], i + n[0].length) : -1; +} +function formatDayOfMonth(d, p) { + return pad(d.getDate(), p, 2); +} +function formatHour24(d, p) { + return pad(d.getHours(), p, 2); +} +function formatHour12(d, p) { + return pad(d.getHours() % 12 || 12, p, 2); +} +function formatDayOfYear(d, p) { + return pad(1 + timeDay.count(timeYear(d), d), p, 3); +} +function formatMilliseconds(d, p) { + return pad(d.getMilliseconds(), p, 3); +} +function formatMicroseconds(d, p) { + return formatMilliseconds(d, p) + "000"; +} +function formatMonthNumber(d, p) { + return pad(d.getMonth() + 1, p, 2); +} +function formatMinutes(d, p) { + return pad(d.getMinutes(), p, 2); +} +function formatSeconds(d, p) { + return pad(d.getSeconds(), p, 2); +} +function formatWeekdayNumberMonday(d) { + var day = d.getDay(); + return day === 0 ? 7 : day; +} +function formatWeekNumberSunday(d, p) { + return pad(timeSunday.count(timeYear(d) - 1, d), p, 2); +} +function dISO(d) { + var day = d.getDay(); + return day >= 4 || day === 0 ? timeThursday(d) : timeThursday.ceil(d); +} +function formatWeekNumberISO(d, p) { + d = dISO(d); + return pad(timeThursday.count(timeYear(d), d) + (timeYear(d).getDay() === 4), p, 2); +} +function formatWeekdayNumberSunday(d) { + return d.getDay(); +} +function formatWeekNumberMonday(d, p) { + return pad(timeMonday.count(timeYear(d) - 1, d), p, 2); +} +function formatYear(d, p) { + return pad(d.getFullYear() % 100, p, 2); +} +function formatYearISO(d, p) { + d = dISO(d); + return pad(d.getFullYear() % 100, p, 2); +} +function formatFullYear(d, p) { + return pad(d.getFullYear() % 1e4, p, 4); +} +function formatFullYearISO(d, p) { + var day = d.getDay(); + d = day >= 4 || day === 0 ? timeThursday(d) : timeThursday.ceil(d); + return pad(d.getFullYear() % 1e4, p, 4); +} +function formatZone(d) { + var z = d.getTimezoneOffset(); + return (z > 0 ? "-" : (z *= -1, "+")) + pad(z / 60 | 0, "0", 2) + pad(z % 60, "0", 2); +} +function formatUTCDayOfMonth(d, p) { + return pad(d.getUTCDate(), p, 2); +} +function formatUTCHour24(d, p) { + return pad(d.getUTCHours(), p, 2); +} +function formatUTCHour12(d, p) { + return pad(d.getUTCHours() % 12 || 12, p, 2); +} +function formatUTCDayOfYear(d, p) { + return pad(1 + utcDay.count(utcYear(d), d), p, 3); +} +function formatUTCMilliseconds(d, p) { + return pad(d.getUTCMilliseconds(), p, 3); +} +function formatUTCMicroseconds(d, p) { + return formatUTCMilliseconds(d, p) + "000"; +} +function formatUTCMonthNumber(d, p) { + return pad(d.getUTCMonth() + 1, p, 2); +} +function formatUTCMinutes(d, p) { + return pad(d.getUTCMinutes(), p, 2); +} +function formatUTCSeconds(d, p) { + return pad(d.getUTCSeconds(), p, 2); +} +function formatUTCWeekdayNumberMonday(d) { + var dow = d.getUTCDay(); + return dow === 0 ? 7 : dow; +} +function formatUTCWeekNumberSunday(d, p) { + return pad(utcSunday.count(utcYear(d) - 1, d), p, 2); +} +function UTCdISO(d) { + var day = d.getUTCDay(); + return day >= 4 || day === 0 ? utcThursday(d) : utcThursday.ceil(d); +} +function formatUTCWeekNumberISO(d, p) { + d = UTCdISO(d); + return pad(utcThursday.count(utcYear(d), d) + (utcYear(d).getUTCDay() === 4), p, 2); +} +function formatUTCWeekdayNumberSunday(d) { + return d.getUTCDay(); +} +function formatUTCWeekNumberMonday(d, p) { + return pad(utcMonday.count(utcYear(d) - 1, d), p, 2); +} +function formatUTCYear(d, p) { + return pad(d.getUTCFullYear() % 100, p, 2); +} +function formatUTCYearISO(d, p) { + d = UTCdISO(d); + return pad(d.getUTCFullYear() % 100, p, 2); +} +function formatUTCFullYear(d, p) { + return pad(d.getUTCFullYear() % 1e4, p, 4); +} +function formatUTCFullYearISO(d, p) { + var day = d.getUTCDay(); + d = day >= 4 || day === 0 ? utcThursday(d) : utcThursday.ceil(d); + return pad(d.getUTCFullYear() % 1e4, p, 4); +} +function formatUTCZone() { + return "+0000"; +} +function formatLiteralPercent() { + return "%"; +} +function formatUnixTimestamp(d) { + return +d; +} +function formatUnixTimestampSeconds(d) { + return Math.floor(+d / 1e3); +} +var locale; +var timeFormat; +defaultLocale({ + dateTime: "%x, %X", + date: "%-m/%-d/%Y", + time: "%-I:%M:%S %p", + periods: ["AM", "PM"], + days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], + shortDays: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], + months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], + shortMonths: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] +}); +function defaultLocale(definition) { + locale = formatLocale(definition); + timeFormat = locale.format; + locale.parse; + locale.utcFormat; + locale.utcParse; + return locale; +} +function date(t) { + return new Date(t); +} +function number(t) { + return t instanceof Date ? +t : +/* @__PURE__ */ new Date(+t); +} +function calendar(ticks2, tickInterval, year, month, week, day, hour, minute, second2, format2) { + var scale = continuous(), invert = scale.invert, domain = scale.domain; + var formatMillisecond = format2(".%L"), formatSecond = format2(":%S"), formatMinute = format2("%I:%M"), formatHour = format2("%I %p"), formatDay = format2("%a %d"), formatWeek = format2("%b %d"), formatMonth = format2("%B"), formatYear2 = format2("%Y"); + function tickFormat2(date2) { + return (second2(date2) < date2 ? formatMillisecond : minute(date2) < date2 ? formatSecond : hour(date2) < date2 ? formatMinute : day(date2) < date2 ? formatHour : month(date2) < date2 ? week(date2) < date2 ? formatDay : formatWeek : year(date2) < date2 ? formatMonth : formatYear2)(date2); + } + scale.invert = function(y2) { + return new Date(invert(y2)); + }; + scale.domain = function(_) { + return arguments.length ? domain(Array.from(_, number)) : domain().map(date); + }; + scale.ticks = function(interval) { + var d = domain(); + return ticks2(d[0], d[d.length - 1], interval == null ? 10 : interval); + }; + scale.tickFormat = function(count, specifier) { + return specifier == null ? tickFormat2 : format2(specifier); + }; + scale.nice = function(interval) { + var d = domain(); + if (!interval || typeof interval.range !== "function") interval = tickInterval(d[0], d[d.length - 1], interval == null ? 10 : interval); + return interval ? domain(nice(d, interval)) : scale; + }; + scale.copy = function() { + return copy(scale, calendar(ticks2, tickInterval, year, month, week, day, hour, minute, second2, format2)); + }; + return scale; +} +function time() { + return initRange.apply(calendar(timeTicks, timeTickInterval, timeYear, timeMonth, timeSunday, timeDay, timeHour, timeMinute, second, timeFormat).domain([new Date(2e3, 0, 1), new Date(2e3, 0, 2)]), arguments); +} + +// node_modules/@cloudscape-design/components/internal/components/cartesian-chart/scales.js +function isNumericDomain(domain) { + return domain.length > 0 && typeof domain[0] === "number"; +} +function isDateDomain(domain) { + return domain.length > 0 && domain[0] instanceof Date; +} +function createNumericScale(type, domain) { + let scale; + switch (type) { + case "log": + scale = log(); + break; + default: + scale = linear(); + } + if (isNumericDomain(domain)) { + scale.domain(domain); + } + return scale; +} +function createTimeScale(domain) { + const scale = time(); + if (isDateDomain(domain)) { + scale.domain(domain); + } + return scale; +} +function createBandScale(domain) { + const scale = band().padding(0.1); + scale.domain(domain); + return scale; +} +function createScale(type, domain, range2) { + switch (type) { + case "linear": + case "log": + return { type: "numeric", scale: createNumericScale(type, domain).range(range2) }; + case "time": + return { type: "time", scale: createTimeScale(domain).range(range2) }; + case "categorical": + return { type: "categorical", scale: createBandScale(domain).range(range2) }; + } +} +var ChartScale = class _ChartScale { + constructor(scaleType, domain, range2, noCategoricalOuterPadding = false) { + this.scaleType = scaleType; + this.domain = domain; + this.range = range2; + this.scale = createScale(this.scaleType, this.domain, this.range); + this.d3Scale = this.scale.scale; + if (this.isCategorical()) { + if (noCategoricalOuterPadding) { + this.d3Scale.paddingInner(0.7); + this.d3Scale.paddingOuter(0); + } else { + this.d3Scale.paddingInner(0.2); + this.d3Scale.paddingOuter(0.05); + } + } + } + cloneScale(newScaleType, newDomain, newRange) { + return new _ChartScale(newScaleType || this.scaleType, newDomain || this.domain, newRange || this.range); + } + isNumeric() { + return this.scale.type === "numeric"; + } + isTime() { + return this.scale.type === "time"; + } + isCategorical() { + return this.scale.type === "categorical"; + } +}; +var NumericChartScale = class { + constructor(scaleType, domain, range2, adjustDomain) { + this.scaleType = scaleType; + const scale = createNumericScale(scaleType, domain).range(range2); + if (adjustDomain !== null) { + scale.nice(adjustDomain); + } + this.scale = { type: "numeric", scale }; + this.d3Scale = this.scale.scale; + } + isCategorical() { + return false; + } +}; + +// node_modules/@cloudscape-design/components/area-chart/model/compute-chart-props.js +function computeChartProps({ series, xDomain: externalXDomain, yDomain: externalYDomain, xScaleType, yScaleType, height, width }) { + const xDomain = externalXDomain || computeDomainX(series); + const xTickCount = getXTickCount(width); + const xScale = new ChartScale(xScaleType, xDomain, [0, width]); + const xTicks = xScale.domain.length > 0 ? createXTicks(xScale, xTickCount) : []; + const yDomain = externalYDomain || computeDomainY(series, yScaleType); + const yTickCount = getYTickCount(height); + const yScale = new NumericChartScale(yScaleType, yDomain, [height, 0], externalYDomain ? null : yTickCount); + const yTicks = createYTicks(yScale, yTickCount); + const plot = computePlotPoints(series, xScale, yScale); + return { xDomain, yDomain, xScale, yScale, xTicks, yTicks, plot }; +} + +// node_modules/@cloudscape-design/components/internal/generated/styles/tokens.js +var colorChartsThresholdNeutral = "var(--color-charts-threshold-neutral-9351o8, #5f6b7a)"; +var colorChartsPaletteCategorical1 = "var(--color-charts-palette-categorical-1-ld9m1p, #688ae8)"; +var colorChartsPaletteCategorical2 = "var(--color-charts-palette-categorical-2-jwteam, #c33d69)"; +var colorChartsPaletteCategorical3 = "var(--color-charts-palette-categorical-3-tlwr5r, #2ea597)"; +var colorChartsPaletteCategorical4 = "var(--color-charts-palette-categorical-4-prlvih, #8456ce)"; +var colorChartsPaletteCategorical5 = "var(--color-charts-palette-categorical-5-04vsso, #e07941)"; +var colorChartsPaletteCategorical6 = "var(--color-charts-palette-categorical-6-2wgmsi, #3759ce)"; +var colorChartsPaletteCategorical7 = "var(--color-charts-palette-categorical-7-w06irv, #962249)"; +var colorChartsPaletteCategorical8 = "var(--color-charts-palette-categorical-8-1qnvcp, #096f64)"; +var colorChartsPaletteCategorical9 = "var(--color-charts-palette-categorical-9-0342zm, #6237a7)"; +var colorChartsPaletteCategorical10 = "var(--color-charts-palette-categorical-10-u73kns, #a84401)"; +var colorChartsPaletteCategorical11 = "var(--color-charts-palette-categorical-11-tloc2a, #273ea5)"; +var colorChartsPaletteCategorical12 = "var(--color-charts-palette-categorical-12-23xv0d, #780d35)"; +var colorChartsPaletteCategorical13 = "var(--color-charts-palette-categorical-13-tuq7ce, #03524a)"; +var colorChartsPaletteCategorical14 = "var(--color-charts-palette-categorical-14-bom4ss, #4a238b)"; +var colorChartsPaletteCategorical15 = "var(--color-charts-palette-categorical-15-kpqcpe, #7e3103)"; +var colorChartsPaletteCategorical16 = "var(--color-charts-palette-categorical-16-pzlo2l, #1b2b88)"; +var colorChartsPaletteCategorical17 = "var(--color-charts-palette-categorical-17-spn4mx, #ce567c)"; +var colorChartsPaletteCategorical18 = "var(--color-charts-palette-categorical-18-kxbv8i, #003e38)"; +var colorChartsPaletteCategorical19 = "var(--color-charts-palette-categorical-19-cl97gf, #9469d6)"; +var colorChartsPaletteCategorical20 = "var(--color-charts-palette-categorical-20-gzcnb4, #602400)"; +var colorChartsPaletteCategorical21 = "var(--color-charts-palette-categorical-21-vyqcuq, #4066df)"; +var colorChartsPaletteCategorical22 = "var(--color-charts-palette-categorical-22-6r7gq7, #a32952)"; +var colorChartsPaletteCategorical23 = "var(--color-charts-palette-categorical-23-7c98ot, #0d7d70)"; +var colorChartsPaletteCategorical24 = "var(--color-charts-palette-categorical-24-0i0wmq, #6b40b2)"; +var colorChartsPaletteCategorical25 = "var(--color-charts-palette-categorical-25-7j0tso, #bc4d01)"; +var colorChartsPaletteCategorical26 = "var(--color-charts-palette-categorical-26-eql7mt, #2c46b1)"; +var colorChartsPaletteCategorical27 = "var(--color-charts-palette-categorical-27-8doiqc, #81143b)"; +var colorChartsPaletteCategorical28 = "var(--color-charts-palette-categorical-28-tlstes, #045b52)"; +var colorChartsPaletteCategorical29 = "var(--color-charts-palette-categorical-29-noa7ft, #512994)"; +var colorChartsPaletteCategorical30 = "var(--color-charts-palette-categorical-30-ttbs6s, #8a3603)"; +var colorChartsPaletteCategorical31 = "var(--color-charts-palette-categorical-31-lz0ukh, #1f3191)"; +var colorChartsPaletteCategorical32 = "var(--color-charts-palette-categorical-32-ncpn1t, #da7596)"; +var colorChartsPaletteCategorical33 = "var(--color-charts-palette-categorical-33-fpbcye, #01443e)"; +var colorChartsPaletteCategorical34 = "var(--color-charts-palette-categorical-34-sk46nw, #a783e1)"; +var colorChartsPaletteCategorical35 = "var(--color-charts-palette-categorical-35-wwtyjx, #692801)"; +var colorChartsPaletteCategorical36 = "var(--color-charts-palette-categorical-36-7v0fgy, #5978e3)"; +var colorChartsPaletteCategorical37 = "var(--color-charts-palette-categorical-37-b2rc0w, #b1325c)"; +var colorChartsPaletteCategorical38 = "var(--color-charts-palette-categorical-38-nlzlk1, #1c8e81)"; +var colorChartsPaletteCategorical39 = "var(--color-charts-palette-categorical-39-esgczm, #7749bf)"; +var colorChartsPaletteCategorical40 = "var(--color-charts-palette-categorical-40-0hdln6, #cc5f21)"; +var colorChartsPaletteCategorical41 = "var(--color-charts-palette-categorical-41-bsk8cf, #314fbf)"; +var colorChartsPaletteCategorical42 = "var(--color-charts-palette-categorical-42-97om84, #8b1b42)"; +var colorChartsPaletteCategorical43 = "var(--color-charts-palette-categorical-43-euzcqg, #06645a)"; +var colorChartsPaletteCategorical44 = "var(--color-charts-palette-categorical-44-a7wos6, #59309d)"; +var colorChartsPaletteCategorical45 = "var(--color-charts-palette-categorical-45-iz0wz2, #983c02)"; +var colorChartsPaletteCategorical46 = "var(--color-charts-palette-categorical-46-nzigym, #23379b)"; +var colorChartsPaletteCategorical47 = "var(--color-charts-palette-categorical-47-croxgd, #6f062f)"; +var colorChartsPaletteCategorical48 = "var(--color-charts-palette-categorical-48-tptw1p, #014b44)"; +var colorChartsPaletteCategorical49 = "var(--color-charts-palette-categorical-49-6lrkes, #431d84)"; +var colorChartsPaletteCategorical50 = "var(--color-charts-palette-categorical-50-mqbaxr, #732c02)"; + +// node_modules/@cloudscape-design/components/internal/styles/colors.js +var categoryPalette = [ + colorChartsPaletteCategorical1, + colorChartsPaletteCategorical2, + colorChartsPaletteCategorical3, + colorChartsPaletteCategorical4, + colorChartsPaletteCategorical5, + colorChartsPaletteCategorical6, + colorChartsPaletteCategorical7, + colorChartsPaletteCategorical8, + colorChartsPaletteCategorical9, + colorChartsPaletteCategorical10, + colorChartsPaletteCategorical11, + colorChartsPaletteCategorical12, + colorChartsPaletteCategorical13, + colorChartsPaletteCategorical14, + colorChartsPaletteCategorical15, + colorChartsPaletteCategorical16, + colorChartsPaletteCategorical17, + colorChartsPaletteCategorical18, + colorChartsPaletteCategorical19, + colorChartsPaletteCategorical20, + colorChartsPaletteCategorical21, + colorChartsPaletteCategorical22, + colorChartsPaletteCategorical23, + colorChartsPaletteCategorical24, + colorChartsPaletteCategorical25, + colorChartsPaletteCategorical26, + colorChartsPaletteCategorical27, + colorChartsPaletteCategorical28, + colorChartsPaletteCategorical29, + colorChartsPaletteCategorical30, + colorChartsPaletteCategorical31, + colorChartsPaletteCategorical32, + colorChartsPaletteCategorical33, + colorChartsPaletteCategorical34, + colorChartsPaletteCategorical35, + colorChartsPaletteCategorical36, + colorChartsPaletteCategorical37, + colorChartsPaletteCategorical38, + colorChartsPaletteCategorical39, + colorChartsPaletteCategorical40, + colorChartsPaletteCategorical41, + colorChartsPaletteCategorical42, + colorChartsPaletteCategorical43, + colorChartsPaletteCategorical44, + colorChartsPaletteCategorical45, + colorChartsPaletteCategorical46, + colorChartsPaletteCategorical47, + colorChartsPaletteCategorical48, + colorChartsPaletteCategorical49, + colorChartsPaletteCategorical50 +]; + +// node_modules/@cloudscape-design/components/internal/utils/create-category-color-scale.js +function createCategoryColorScale(items, isThreshold = () => false, getOwnColor = () => null) { + const colors = []; + let categoryIndex = 0; + for (const it of items) { + const ownColor = getOwnColor(it); + const defaultColor = isThreshold(it) ? colorChartsThresholdNeutral : categoryPalette[categoryIndex % categoryPalette.length]; + colors.push(parseCssVariable(ownColor || defaultColor)); + if (!isThreshold(it) && !ownColor) { + categoryIndex++; + } + } + return colors; +} + +// node_modules/@cloudscape-design/components/area-chart/model/create-series-decorator.js +function createSeriesDecorator(externalSeries) { + const colorScale = createCategoryColorScale(externalSeries, (s2) => s2.type === "threshold", (s2) => s2.color || null); + const decorateSeries = (s2, index) => { + const title = s2.title; + const color2 = colorScale[index]; + const markerType = s2.type === "area" ? "hollow-rectangle" : "dashed"; + const formatValue2 = s2.type === "threshold" ? () => s2.valueFormatter ? s2.valueFormatter(s2.y) : s2.y : (y2, x2) => s2.valueFormatter ? s2.valueFormatter(y2, x2) : y2; + return { series: s2, title, color: color2, markerType, formatValue: formatValue2 }; + }; + const mapping = externalSeries.reduce((map2, series, index) => { + map2.set(series, decorateSeries(series, index)); + return map2; + }, /* @__PURE__ */ new Map()); + const seriesDecorator = (series) => mapping.get(series) || decorateSeries(series, externalSeries.length); + return seriesDecorator; +} + +// node_modules/@cloudscape-design/components/area-chart/model/interactions-store.js +var initialState = Object.freeze({ + highlightedX: null, + highlightedPoint: null, + highlightedSeries: null, + legendSeries: null, + isPopoverPinned: false +}); +var InteractionsStore = class extends AsyncStore { + constructor(series, plot) { + super(initialState); + this.series = series; + this.plot = plot; + } + highlightPoint(point5) { + this.set((state) => Object.assign(Object.assign({}, state), { highlightedX: this.plot.xy[point5.index.x], highlightedPoint: point5, highlightedSeries: this.series[point5.index.s], legendSeries: this.series[point5.index.s] })); + } + highlightX(points) { + this.set((state) => Object.assign(Object.assign({}, state), { highlightedX: points, highlightedPoint: null, highlightedSeries: null, legendSeries: null })); + } + highlightFirstPoint() { + this.set((state) => { + const series = state.legendSeries || state.highlightedSeries; + const firstSeriesPoint = series && this._getFirstSeriesPoint(series); + const point5 = state.highlightedPoint || firstSeriesPoint || this.plot.sx[0][0]; + return Object.assign(Object.assign({}, state), { highlightedX: this.plot.xy[point5.index.x], highlightedPoint: point5, highlightedSeries: this.series[point5.index.s], legendSeries: this.series[point5.index.s] }); + }); + } + highlightSeries(s2) { + this.set((state) => Object.assign(Object.assign({}, state), { highlightedSeries: s2, legendSeries: s2 })); + } + clearHighlight() { + this.set((state) => Object.assign(Object.assign({}, state), { highlightedX: null, highlightedPoint: null, highlightedSeries: null })); + } + clearHighlightedLegend() { + this.set((state) => Object.assign(Object.assign({}, state), { legendSeries: null })); + } + clearState() { + this.set(() => initialState); + } + pinPopover() { + this.set((state) => Object.assign(Object.assign({}, state), { isPopoverPinned: true })); + } + unpinPopover() { + this.set((state) => Object.assign(Object.assign({}, state), { isPopoverPinned: false })); + } + togglePopoverPin() { + this.set((state) => Object.assign(Object.assign({}, state), { isPopoverPinned: !state.isPopoverPinned })); + } + _getFirstSeriesPoint(s2) { + const seriesIndex = this.series.indexOf(s2); + const [firstSeriesPoint] = this.plot.sx[seriesIndex] || []; + return firstSeriesPoint || null; + } +}; + +// node_modules/@cloudscape-design/components/internal/utils/throttle.js +function throttle(func, delay, { trailing = true } = {}) { + let pending = null; + let lastInvokeTime = null; + let timerId = null; + function pendingFunc() { + if (pending === null || lastInvokeTime === null) { + return; + } + const invokeTime = Date.now(); + const shouldInvoke = invokeTime - lastInvokeTime >= delay; + if (shouldInvoke) { + func.apply(pending.this, pending.args); + lastInvokeTime = invokeTime; + pending = null; + timerId = null; + } else if (trailing) { + startTimer(); + } + } + function startTimer() { + if (timerId) { + cancelAnimationFrame(timerId); + } + timerId = requestAnimationFrame(pendingFunc); + } + function throttled(...args) { + if (lastInvokeTime === null) { + lastInvokeTime = Date.now(); + func.apply(this, args); + } else { + pending = { this: this, args }; + startTimer(); + } + } + throttled.cancel = () => { + if (timerId) { + cancelAnimationFrame(timerId); + } + pending = null; + lastInvokeTime = null; + timerId = null; + }; + return throttled; +} + +// node_modules/@cloudscape-design/components/internal/hooks/container-queries/use-height-measure.js +var import_react132 = __toESM(require_react()); +function useHeightMeasure(getMeasure, skip = false, deps = []) { + const [measuredHeight, setHeight] = (0, import_react132.useState)(0); + const stableGetMeasure = (0, import_react132.useCallback)(getMeasure, [...deps, skip]); + useResizeObserver(stableGetMeasure, (entry) => !skip && setHeight(entry.borderBoxHeight)); + return !skip ? measuredHeight : void 0; +} + +// node_modules/@cloudscape-design/components/area-chart/model/use-chart-model.js +var MAX_HOVER_MARGIN = 6; +var SVG_HOVER_THROTTLE = 25; +var POPOVER_DEADZONE = 12; +function useChartModel({ fitHeight, externalSeries: allSeries, visibleSeries: series, setVisibleSeries, highlightedSeries, setHighlightedSeries, xDomain, yDomain, xScaleType, yScaleType, height: explicitHeight, width, popoverRef }) { + var _a; + const plotRef = (0, import_react133.useRef)(null); + const containerRef = (0, import_react133.useRef)(null); + const verticalMarkerRef = (0, import_react133.useRef)(null); + const plotMeasureRef = (0, import_react133.useRef)(null); + const hasVisibleSeries = series.length > 0; + const height = (_a = useHeightMeasure(() => plotMeasureRef.current, !fitHeight, [hasVisibleSeries])) !== null && _a !== void 0 ? _a : explicitHeight; + const stableSetVisibleSeries = useStableCallback(setVisibleSeries); + const model = (0, import_react133.useMemo)(() => { + const computed = computeChartProps({ + series, + xDomain, + yDomain, + xScaleType, + yScaleType, + height, + width + }); + const interactions = new InteractionsStore(series, computed.plot); + const containsMultipleSeries = interactions.series.length > 1; + const getInternalSeries = createSeriesDecorator(allSeries); + const isMouseOverPopover = (clientX, clientY) => { + var _a2; + if ((_a2 = popoverRef.current) === null || _a2 === void 0 ? void 0 : _a2.firstChild) { + const popoverPosition = popoverRef.current.firstChild.getBoundingClientRect(); + if (clientX > popoverPosition.x - POPOVER_DEADZONE && clientX < popoverPosition.x + popoverPosition.width + POPOVER_DEADZONE && clientY > popoverPosition.y - POPOVER_DEADZONE && clientY < popoverPosition.y + popoverPosition.height + POPOVER_DEADZONE) { + return true; + } + } + return false; + }; + const onSVGMouseMoveThrottled = throttle((clientX, clientY) => { + if (interactions.get().isPopoverPinned || !plotRef.current || interactions.plot.xy.length === 0 || isMouseOverPopover(clientX, clientY)) { + return; + } + const svgRect = plotRef.current.svg.getBoundingClientRect(); + const offsetX = clientX - svgRect.left; + const offsetY = clientY - svgRect.top; + const closestX = findClosest(interactions.plot.xy, offsetX, (xPoints) => xPoints[0].scaled.x); + const closestPoint = findClosest(closestX, offsetY, (point5) => point5.scaled.y1); + if (Math.abs(offsetX - closestPoint.scaled.x) < MAX_HOVER_MARGIN && Math.abs(offsetY - closestPoint.scaled.y1) < MAX_HOVER_MARGIN) { + interactions.highlightPoint(closestPoint); + } else { + interactions.highlightX(closestX); + } + }, SVG_HOVER_THROTTLE); + const onSVGMouseMove = ({ clientX, clientY }) => onSVGMouseMoveThrottled(clientX, clientY); + const onSVGMouseOut = (event) => { + onSVGMouseMoveThrottled.cancel(); + if (interactions.get().isPopoverPinned || isMouseOverPopover(event.clientX, event.clientY)) { + return; + } + if (!nodeContains(plotRef.current.svg, event.relatedTarget)) { + interactions.clearHighlightedLegend(); + interactions.clearHighlight(); + } + }; + const onSVGMouseDown = (event) => { + interactions.togglePopoverPin(); + event.preventDefault(); + }; + const moveWithinXAxis = (direction) => { + if (interactions.get().highlightedPoint) { + return moveWithinSeries(direction); + } else if (containsMultipleSeries) { + const { highlightedX } = interactions.get(); + if (highlightedX) { + const currentXIndex = highlightedX[0].index.x; + const nextXIndex = circleIndex(currentXIndex + direction, [0, interactions.plot.xy.length - 1]); + interactions.highlightX(interactions.plot.xy[nextXIndex]); + } + } + }; + const moveWithinSeries = (direction) => { + const point5 = interactions.get().highlightedPoint; + if (!point5) { + return; + } + const sIndex = point5.index.s; + const xIndex = circleIndex(point5.index.x + direction, [0, interactions.plot.xs.length - 1]); + interactions.highlightPoint(interactions.plot.xs[xIndex][sIndex]); + }; + const moveBetweenSeries = (direction) => { + const point5 = interactions.get().highlightedPoint; + if (!point5) { + const { highlightedX } = interactions.get(); + if (highlightedX) { + const xIndex2 = highlightedX[0].index.x; + const points = interactions.plot.xy[xIndex2]; + const yIndex = direction === 1 ? 0 : points.length - 1; + interactions.highlightPoint(points[yIndex]); + } + return; + } + const xIndex = point5.index.x; + const currentYIndex = point5.index.y; + if (containsMultipleSeries && (currentYIndex === 0 && direction === -1 || currentYIndex === interactions.plot.xy[xIndex].length - 1 && direction === 1)) { + interactions.highlightX(interactions.plot.xy[xIndex]); + } else { + const nextYIndex = circleIndex(currentYIndex + direction, [0, interactions.plot.xy[xIndex].length - 1]); + interactions.highlightPoint(interactions.plot.xy[xIndex][nextYIndex]); + } + }; + const onSVGKeyDown = (event) => { + const keyCode = event.keyCode; + if (keyCode !== KeyCode.up && keyCode !== KeyCode.right && keyCode !== KeyCode.down && keyCode !== KeyCode.left && keyCode !== KeyCode.space && keyCode !== KeyCode.enter) { + return; + } + event.preventDefault(); + if (interactions.get().isPopoverPinned) { + return; + } + if (keyCode === KeyCode.down || keyCode === KeyCode.up) { + moveBetweenSeries(keyCode === KeyCode.down ? -1 : 1); + } else if (keyCode === KeyCode.left || keyCode === KeyCode.right) { + moveWithinXAxis(keyCode === KeyCode.right ? 1 : -1); + } else if (keyCode === KeyCode.enter || keyCode === KeyCode.space) { + interactions.pinPopover(); + } + }; + const highlightFirstX = () => { + interactions.highlightX(interactions.plot.xy[0]); + }; + const onApplicationFocus = (_event, trigger) => { + if (trigger === "keyboard") { + const { highlightedX, highlightedPoint, highlightedSeries: highlightedSeries2, legendSeries } = interactions.get(); + if (containsMultipleSeries && !highlightedX && !highlightedPoint && !highlightedSeries2 && !legendSeries) { + highlightFirstX(); + } else if (!highlightedX) { + interactions.highlightFirstPoint(); + } + } + }; + const onApplicationBlur = (event) => { + if (!nodeBelongs(containerRef.current, event.relatedTarget) && !interactions.get().isPopoverPinned) { + interactions.clearHighlight(); + } + }; + const onFilterSeries = (series2) => { + stableSetVisibleSeries(series2); + }; + const onLegendHighlight = (series2) => { + interactions.highlightSeries(series2); + }; + const onPopoverDismiss = (outsideClick) => { + interactions.unpinPopover(); + if (!outsideClick) { + setTimeout(() => { + if (interactions.get().highlightedPoint || interactions.get().highlightedX) { + plotRef.current.focusApplication(); + } else { + interactions.clearHighlight(); + plotRef.current.focusPlot(); + } + }, 0); + } + }; + const onContainerBlur = () => { + interactions.clearState(); + }; + const onDocumentKeyDown = (event) => { + if (event.key === "Escape") { + interactions.clearHighlight(); + interactions.clearHighlightedLegend(); + } + }; + const onPopoverLeave = (event) => { + if (nodeContains(plotRef.current.svg, event.relatedTarget) || interactions.get().isPopoverPinned) { + return; + } + interactions.clearHighlight(); + interactions.clearHighlightedLegend(); + }; + return { + width, + height, + series, + allSeries, + getInternalSeries, + computed, + interactions, + handlers: { + onSVGMouseMove, + onSVGMouseOut, + onSVGMouseDown, + onSVGKeyDown, + onApplicationFocus, + onApplicationBlur, + onFilterSeries, + onLegendHighlight, + onPopoverDismiss, + onContainerBlur, + onDocumentKeyDown, + onPopoverLeave + }, + refs: { + plot: plotRef, + plotMeasure: plotMeasureRef, + container: containerRef, + verticalMarker: verticalMarkerRef, + popoverRef + } + }; + }, [allSeries, series, xDomain, yDomain, xScaleType, yScaleType, height, width, stableSetVisibleSeries, popoverRef]); + useReaction(model.interactions, (state) => state.highlightedSeries, setHighlightedSeries); + (0, import_react133.useEffect)(() => { + if (highlightedSeries !== model.interactions.get().highlightedSeries) { + model.interactions.highlightSeries(highlightedSeries); + } + }, [model, highlightedSeries]); + return model; +} + +// node_modules/@cloudscape-design/components/area-chart/model/use-filter-props.js +var import_react134 = __toESM(require_react()); +function useFilterProps(series, controlledVisibleSeries, controlledOnVisibleChange) { + const [visibleSeries = [], setVisibleSeriesState] = useControllable(controlledVisibleSeries, controlledOnVisibleChange, series, { + componentName: "AreaChart", + controlledProp: "visibleSeries", + changeHandler: "onFilterChange" + }); + const setVisibleSeries = (0, import_react134.useCallback)((selectedSeries) => { + setVisibleSeriesState(selectedSeries); + fireNonCancelableEvent(controlledOnVisibleChange, { visibleSeries: selectedSeries }); + }, [controlledOnVisibleChange, setVisibleSeriesState]); + (0, import_react134.useEffect)(() => { + const newVisibleSeries = visibleSeries.filter((s2) => series.indexOf(s2) !== -1); + if (newVisibleSeries.length !== visibleSeries.length) { + setVisibleSeries(newVisibleSeries); + } + }, [series, visibleSeries, setVisibleSeries]); + return [visibleSeries, setVisibleSeries]; +} + +// node_modules/@cloudscape-design/components/area-chart/model/use-highlight-props.js +var import_react135 = __toESM(require_react()); +function useHighlightProps(series, controlledHighlightedSeries, controlledOnHighlightChange) { + const [highlightedSeries = null, setHighlightedSeries] = useControllable(controlledHighlightedSeries, controlledOnHighlightChange, null, { + componentName: "AreaChart", + controlledProp: "highlightedSeries", + changeHandler: "onHighlightChange" + }); + const notifyHighlightedSeries = (0, import_react135.useCallback)((s2) => { + fireNonCancelableEvent(controlledOnHighlightChange, { highlightedSeries: s2 }); + }, [controlledOnHighlightChange]); + (0, import_react135.useEffect)(() => { + if (controlledHighlightedSeries) { + const highlightedSeriesIndex = series.indexOf(controlledHighlightedSeries); + if (highlightedSeriesIndex === -1) { + setHighlightedSeries(null); + notifyHighlightedSeries(null); + } + } + }, [series, controlledHighlightedSeries, setHighlightedSeries, notifyHighlightedSeries]); + return [highlightedSeries, notifyHighlightedSeries]; +} + +// node_modules/@cloudscape-design/components/internal/components/chart-wrapper/index.js +var import_react136 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/internal/components/chart-wrapper/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/internal/components/chart-wrapper/styles.scoped.css"; +var styles_css_default45 = { + "wrapper": "awsui_wrapper_z5mul_nyco0_99", + "wrapper--fit-height": "awsui_wrapper--fit-height_z5mul_nyco0_135", + "inner-wrapper--fit-height": "awsui_inner-wrapper--fit-height_z5mul_nyco0_140", + "has-default-filter": "awsui_has-default-filter_z5mul_nyco0_146", + "content": "awsui_content_z5mul_nyco0_150", + "content--reserve-filter": "awsui_content--reserve-filter_z5mul_nyco0_157", + "content--reserve-legend": "awsui_content--reserve-legend_z5mul_nyco0_161", + "content--fit-height": "awsui_content--fit-height_z5mul_nyco0_165", + "filter-container": "awsui_filter-container_z5mul_nyco0_169" +}; + +// node_modules/@cloudscape-design/components/internal/components/chart-wrapper/index.js +var ChartWrapper = (0, import_react136.forwardRef)((_a, ref) => { + var { defaultFilter, additionalFilters, reserveFilterSpace, reserveLegendSpace, chartStatus, chart, legend, onBlur, contentClassName, contentMinHeight, fitHeight } = _a, props2 = __rest(_a, ["defaultFilter", "additionalFilters", "reserveFilterSpace", "reserveLegendSpace", "chartStatus", "chart", "legend", "onBlur", "contentClassName", "contentMinHeight", "fitHeight"]); + const baseProps = getBaseProps(props2); + const filtersNode = (defaultFilter || additionalFilters) && import_react136.default.createElement( + InternalBox, + { className: styles_css_default45["filter-container"], margin: { bottom: "l" } }, + import_react136.default.createElement( + InternalSpaceBetween, + { size: "l", direction: "horizontal", className: clsx_m_default({ [styles_css_default45["has-default-filter"]]: !!defaultFilter }) }, + defaultFilter, + additionalFilters + ) + ); + const legendNode = legend && import_react136.default.createElement(InternalBox, { margin: { top: "m" } }, legend); + if (fitHeight) { + return import_react136.default.createElement( + "div", + Object.assign({ ref }, baseProps, { className: clsx_m_default(baseProps.className, styles_css_default45.wrapper, styles_css_default45["wrapper--fit-height"]), onBlur }), + import_react136.default.createElement( + "div", + { className: clsx_m_default(styles_css_default45["inner-wrapper"], styles_css_default45["inner-wrapper--fit-height"]) }, + filtersNode, + import_react136.default.createElement( + "div", + { className: clsx_m_default(styles_css_default45.content, contentClassName, { + [styles_css_default45["content--reserve-filter"]]: reserveFilterSpace, + [styles_css_default45["content--reserve-legend"]]: reserveLegendSpace, + [styles_css_default45["content--fit-height"]]: true + }) }, + chartStatus, + chart + ), + legendNode + ) + ); + } + return import_react136.default.createElement( + "div", + Object.assign({ ref }, baseProps, { className: clsx_m_default(baseProps.className, styles_css_default45.wrapper), onBlur }), + filtersNode, + import_react136.default.createElement( + "div", + { className: clsx_m_default(styles_css_default45.content, contentClassName, { + [styles_css_default45["content--reserve-filter"]]: reserveFilterSpace, + [styles_css_default45["content--reserve-legend"]]: reserveLegendSpace + }), style: { minHeight: contentMinHeight } }, + chartStatus, + chart + ), + legendNode + ); +}); + +// node_modules/@cloudscape-design/components/area-chart/internal.js +function InternalAreaChart(_a) { + var { fitHeight, height, xScaleType, yScaleType, xDomain, yDomain, xTickFormatter, yTickFormatter, detailTotalFormatter, highlightedSeries: controlledHighlightedSeries, visibleSeries: controlledVisibleSeries, series: externalSeries, onFilterChange: controlledOnVisibleChange, onHighlightChange: controlledOnHighlightChange, i18nStrings, ariaLabel, ariaLabelledby, ariaDescription, xTitle, yTitle, hideFilter, additionalFilters, hideLegend, legendTitle, statusType, detailPopoverSize, detailPopoverFooter, empty, noMatch, errorText, loadingText, recoveryText, onRecoveryClick, __internalRootRef = null } = _a, props2 = __rest(_a, ["fitHeight", "height", "xScaleType", "yScaleType", "xDomain", "yDomain", "xTickFormatter", "yTickFormatter", "detailTotalFormatter", "highlightedSeries", "visibleSeries", "series", "onFilterChange", "onHighlightChange", "i18nStrings", "ariaLabel", "ariaLabelledby", "ariaDescription", "xTitle", "yTitle", "hideFilter", "additionalFilters", "hideLegend", "legendTitle", "statusType", "detailPopoverSize", "detailPopoverFooter", "empty", "noMatch", "errorText", "loadingText", "recoveryText", "onRecoveryClick", "__internalRootRef"]); + const baseProps = getBaseProps(props2); + const containerRef = (0, import_react137.useRef)(null); + const popoverRef = (0, import_react137.useRef)(null); + if (isDevelopment) { + (0, import_react137.useEffect)(() => { + if (!isSeriesValid(externalSeries)) { + warnOnce("AreaChart", "The `series` property violates the component's constraints: all `area` series must have `data` arrays of the same length and with the same x-values."); + } + }, [externalSeries]); + } + const [width, setWidth] = (0, import_react137.useState)(0); + const [visibleSeries, setVisibleSeries] = useFilterProps(externalSeries, controlledVisibleSeries, controlledOnVisibleChange); + const [highlightedSeries, setHighlightedSeries] = useHighlightProps(externalSeries, controlledHighlightedSeries, controlledOnHighlightChange); + const model = useChartModel({ + fitHeight, + externalSeries, + visibleSeries, + setVisibleSeries, + highlightedSeries, + setHighlightedSeries, + xDomain, + yDomain, + xScaleType, + yScaleType, + height, + width, + popoverRef + }); + const { isEmpty, isNoMatch, showChart } = getChartStatus({ + externalData: externalSeries, + visibleData: visibleSeries, + statusType + }); + const showFilters = statusType === "finished" && (!isEmpty || isNoMatch) && (additionalFilters || !hideFilter); + const showLegend = !hideLegend && !isEmpty && statusType === "finished"; + const reserveLegendSpace = !showChart && !hideLegend; + const reserveFilterSpace = !showChart && !isNoMatch && (!hideFilter || additionalFilters); + (0, import_react137.useEffect)(() => { + const onKeyDown = model.handlers.onDocumentKeyDown; + document.addEventListener("keydown", onKeyDown); + return () => document.removeEventListener("keydown", onKeyDown); + }, [model.handlers.onDocumentKeyDown]); + const onBlur = (event) => { + if (event.relatedTarget && !nodeBelongs(containerRef.current, event.relatedTarget)) { + model.handlers.onContainerBlur(); + } + }; + const mergedRef = useMergeRefs(containerRef, __internalRootRef); + return import_react137.default.createElement(ChartWrapper, Object.assign({ ref: mergedRef }, baseProps, { className: clsx_m_default(baseProps.className, styles_css_default40.root), fitHeight: !!fitHeight, contentMinHeight: height, defaultFilter: showFilters && !hideFilter ? import_react137.default.createElement(area_chart_filter_default, { model, filterLabel: i18nStrings.filterLabel, filterPlaceholder: i18nStrings.filterPlaceholder, filterSelectedAriaLabel: i18nStrings.filterSelectedAriaLabel }) : null, additionalFilters: showFilters ? additionalFilters : null, reserveFilterSpace: !!reserveFilterSpace, reserveLegendSpace: !!reserveLegendSpace, chartStatus: import_react137.default.createElement(ChartStatusContainer, { isEmpty, isNoMatch, showChart, statusType, empty, noMatch, loadingText, errorText, recoveryText, onRecoveryClick }), chart: showChart ? import_react137.default.createElement(chart_container_default, { model, autoWidth: setWidth, detailPopoverSize, detailPopoverFooter, xTitle, yTitle, xTickFormatter, yTickFormatter, detailTotalFormatter, ariaLabel, ariaLabelledby, ariaDescription, i18nStrings, fitHeight, minHeight: height }) : null, legend: showLegend ? import_react137.default.createElement(area_chart_legend_default, { plotContainerRef: containerRef, model, legendTitle, ariaLabel: i18nStrings.legendAriaLabel }) : null, onBlur })); +} + +// node_modules/@cloudscape-design/components/area-chart/index.js +function AreaChart(_a) { + var { height = 500, xScaleType = "linear", yScaleType = "linear", statusType = "finished", detailPopoverSize = "medium", i18nStrings = {} } = _a, props2 = __rest(_a, ["height", "xScaleType", "yScaleType", "statusType", "detailPopoverSize", "i18nStrings"]); + const baseComponentProps = useBaseComponent("AreaChart", { + props: { + detailPopoverSize, + hideLegend: props2.hideLegend, + hideFilter: props2.hideFilter, + fitHeight: props2.fitHeight, + xScaleType, + yScaleType + } + }); + return import_react138.default.createElement(InternalAreaChart, Object.assign({ height, xScaleType, yScaleType, statusType, detailPopoverSize, i18nStrings }, props2, baseComponentProps)); +} +applyDisplayName(AreaChart, "AreaChart"); +var area_chart_default = AreaChart; + +// node_modules/@cloudscape-design/components/attribute-editor/index.js +var import_react142 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/attribute-editor/internal.js +var import_react141 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/attribute-editor/additional-info.js +var import_react139 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/attribute-editor/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/attribute-editor/styles.scoped.css"; +var styles_css_default46 = { + "empty-appear": "awsui_empty-appear_n4qlp_1ebkl_99", + "awsui-motion-fade-in": "awsui_awsui-motion-fade-in_n4qlp_1ebkl_1", + "root": "awsui_root_n4qlp_1ebkl_125", + "empty": "awsui_empty_n4qlp_1ebkl_99", + "row": "awsui_row_n4qlp_1ebkl_167", + "row-control": "awsui_row-control_n4qlp_1ebkl_171", + "field": "awsui_field_n4qlp_1ebkl_175", + "add-button": "awsui_add-button_n4qlp_1ebkl_179", + "remove-button": "awsui_remove-button_n4qlp_1ebkl_183", + "button-container-haslabel": "awsui_button-container-haslabel_n4qlp_1ebkl_187", + "button-container-nolabel": "awsui_button-container-nolabel_n4qlp_1ebkl_191", + "divider": "awsui_divider_n4qlp_1ebkl_195", + "additional-info": "awsui_additional-info_n4qlp_1ebkl_199", + "right-align": "awsui_right-align_n4qlp_1ebkl_245" +}; + +// node_modules/@cloudscape-design/components/attribute-editor/additional-info.js +var AdditionalInfo = ({ children: children2, id }) => import_react139.default.createElement( + live_region_default, + { visible: true, tagName: "div", "data-testid": "info-live-region" }, + import_react139.default.createElement("div", { id, className: styles_css_default46["additional-info"] }, children2) +); + +// node_modules/@cloudscape-design/components/attribute-editor/row.js +var import_react140 = __toESM(require_react()); +var Divider = () => import_react140.default.createElement(InternalBox, { className: styles_css_default46.divider, padding: { top: "l" } }); +function render(item, itemIndex, slot) { + if (isSlotFunction(slot)) { + return slot(item, itemIndex); + } + return slot; + function isSlotFunction(slot2) { + return typeof slot2 === "function"; + } +} +var GRID_DEFINITION = [{ colspan: { default: 12, xs: 9 } }]; +var REMOVABLE_GRID_DEFINITION = [{ colspan: { default: 12, xs: 9 } }, { colspan: { default: 12, xs: 3 } }]; +var Row = import_react140.default.memo(({ breakpoint, item, definition, i18nStrings = {}, index, removable, removeButtonText, removeButtonRefs, onRemoveButtonClick, removeButtonAriaLabel }) => { + var _a; + const i18n = useInternalI18n("attribute-editor"); + const isNarrowViewport = breakpoint === "default" || breakpoint === "xxs"; + const isWideViewport = !isNarrowViewport; + const handleRemoveClick = (0, import_react140.useCallback)(() => { + fireNonCancelableEvent(onRemoveButtonClick, { itemIndex: index }); + }, [onRemoveButtonClick, index]); + const firstControlId = useUniqueId("first-control-id-"); + return import_react140.default.createElement( + InternalBox, + { className: styles_css_default46.row, margin: { bottom: "s" } }, + import_react140.default.createElement( + "div", + { role: "group", "aria-labelledby": `${firstControlId}-label ${firstControlId}` }, + import_react140.default.createElement( + internal_default3, + { __breakpoint: breakpoint, gridDefinition: removable ? REMOVABLE_GRID_DEFINITION : GRID_DEFINITION }, + import_react140.default.createElement(ColumnLayout, { className: styles_css_default46["row-control"], columns: definition.length, __breakpoint: breakpoint }, definition.map(({ info, label, constraintText, errorText, control }, defIndex) => import_react140.default.createElement(InternalFormField, { key: defIndex, className: styles_css_default46.field, label, info, constraintText: render(item, index, constraintText), errorText: render(item, index, errorText), stretch: true, i18nStrings: { errorIconAriaLabel: i18nStrings.errorIconAriaLabel }, __hideLabel: isWideViewport && index > 0, controlId: defIndex === 0 ? firstControlId : void 0 }, render(item, index, control)))), + removable && import_react140.default.createElement( + ButtonContainer, + { index, isNarrowViewport, hasLabel: definition.some((row) => row.label) }, + import_react140.default.createElement(InternalButton, { className: styles_css_default46["remove-button"], formAction: "none", ref: (ref) => { + removeButtonRefs[index] = ref !== null && ref !== void 0 ? ref : void 0; + }, ariaLabel: (_a = removeButtonAriaLabel !== null && removeButtonAriaLabel !== void 0 ? removeButtonAriaLabel : i18nStrings.removeButtonAriaLabel) === null || _a === void 0 ? void 0 : _a(item), onClick: handleRemoveClick }, i18n("removeButtonText", removeButtonText)) + ) + ) + ), + isNarrowViewport && import_react140.default.createElement(Divider, null) + ); +}); +var ButtonContainer = ({ index, children: children2, isNarrowViewport, hasLabel }) => import_react140.default.createElement("div", { className: clsx_m_default({ + [styles_css_default46["button-container-haslabel"]]: !isNarrowViewport && index === 0 && hasLabel, + [styles_css_default46["button-container-nolabel"]]: !isNarrowViewport && index === 0 && !hasLabel, + [styles_css_default46["right-align"]]: isNarrowViewport +}) }, children2); + +// node_modules/@cloudscape-design/components/attribute-editor/internal.js +var InternalAttributeEditor = import_react141.default.forwardRef((_a, ref) => { + var { additionalInfo, disableAddButton, definition, items, isItemRemovable: isItemRemovable2 = () => true, empty, addButtonText, removeButtonText, removeButtonAriaLabel, i18nStrings, onAddButtonClick, onRemoveButtonClick, __internalRootRef = null } = _a, props2 = __rest(_a, ["additionalInfo", "disableAddButton", "definition", "items", "isItemRemovable", "empty", "addButtonText", "removeButtonText", "removeButtonAriaLabel", "i18nStrings", "onAddButtonClick", "onRemoveButtonClick", "__internalRootRef"]); + const [breakpoint, breakpointRef] = useContainerBreakpoints(["default", "xxs", "xs"]); + const removeButtonRefs = (0, import_react141.useRef)([]); + const addButtonRef = (0, import_react141.useRef)(null); + const wasNonEmpty = (0, import_react141.useRef)(false); + const [removalAnnouncement, setRemovalAnnouncement] = (0, import_react141.useState)(""); + const baseProps = getBaseProps(props2); + const isEmpty = items && items.length === 0; + wasNonEmpty.current = wasNonEmpty.current || !isEmpty; + (0, import_react141.useImperativeHandle)(ref, () => ({ + focusRemoveButton(rowIndex) { + var _a2; + (_a2 = removeButtonRefs.current[rowIndex]) === null || _a2 === void 0 ? void 0 : _a2.focus(); + }, + focusAddButton() { + var _a2; + (_a2 = addButtonRef.current) === null || _a2 === void 0 ? void 0 : _a2.focus(); + } + })); + const mergedRef = useMergeRefs(breakpointRef, __internalRootRef); + const additionalInfoId = useUniqueId("attribute-editor-info"); + const infoAriaDescribedBy = additionalInfo ? additionalInfoId : void 0; + const prevItemsLength = usePrevious(items.length); + import_react141.default.useEffect(() => { + if (prevItemsLength && prevItemsLength > items.length && (i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.itemRemovedAriaLive)) { + setRemovalAnnouncement(i18nStrings.itemRemovedAriaLive); + } else { + setRemovalAnnouncement(""); + } + }, [items, i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.itemRemovedAriaLive]); + return import_react141.default.createElement( + "div", + Object.assign({}, baseProps, { ref: mergedRef, className: clsx_m_default(baseProps.className, styles_css_default46.root) }), + import_react141.default.createElement( + InternalBox, + { margin: { bottom: "l" } }, + isEmpty && import_react141.default.createElement("div", { className: clsx_m_default(styles_css_default46.empty, wasNonEmpty.current && styles_css_default46["empty-appear"]) }, empty), + items.map((item, index) => import_react141.default.createElement(Row, { key: index, index, breakpoint, item, definition, i18nStrings, removable: isItemRemovable2(item), removeButtonText, removeButtonRefs: removeButtonRefs.current, onRemoveButtonClick, removeButtonAriaLabel })) + ), + import_react141.default.createElement(InternalButton, { className: styles_css_default46["add-button"], disabled: disableAddButton, onClick: onAddButtonClick, formAction: "none", ref: addButtonRef, ariaDescribedby: infoAriaDescribedBy }, addButtonText), + import_react141.default.createElement(live_region_default, { "data-testid": "removal-announcement", delay: 5, key: items.length }, removalAnnouncement), + !!additionalInfo && import_react141.default.createElement(AdditionalInfo, { id: infoAriaDescribedBy }, additionalInfo) + ); +}); +var internal_default14 = InternalAttributeEditor; + +// node_modules/@cloudscape-design/components/attribute-editor/index.js +var AttributeEditor = import_react142.default.forwardRef((_a, ref) => { + var { items = [], isItemRemovable: isItemRemovable2 = () => true } = _a, props2 = __rest(_a, ["items", "isItemRemovable"]); + const baseComponentProps = useBaseComponent("AttributeEditor"); + return import_react142.default.createElement(internal_default14, Object.assign({ items, isItemRemovable: isItemRemovable2 }, props2, baseComponentProps, { ref })); +}); +applyDisplayName(AttributeEditor, "AttributeEditor"); +var attribute_editor_default = AttributeEditor; + +// node_modules/@cloudscape-design/components/autosuggest/index.js +var import_react151 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/autosuggest/internal.js +var import_react150 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/autosuggest/options-controller.js +var import_react143 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/autosuggest/utils/utils.js +var isGroup2 = (option) => "type" in option && option.type === "parent"; +var popLastGroup = (options) => { + if (options.length) { + const lastOption = options[options.length - 1]; + if (isGroup2(lastOption)) { + options.pop(); + } + } +}; +var filterOptions2 = (options, text) => { + const filteredOptions = options.reduce((filteredIn, option) => { + if (isGroup2(option)) { + popLastGroup(filteredIn); + filteredIn.push(option); + } else if (matchSingleOption(option, text)) { + filteredIn.push(option); + } + return filteredIn; + }, []); + popLastGroup(filteredOptions); + return filteredOptions; +}; +var matchSingleOption = (option, text) => { + const searchableFields2 = ["value", "label", "description", "labelTag"]; + const searchableTagFields = ["tags", "filteringTags"]; + const searchText = text.toLowerCase(); + const searchStrFieldsFn = (attr) => matchString(option[attr], searchText); + const searchTagsFieldsFn = (attr) => { + var _a; + return (_a = option[attr]) === null || _a === void 0 ? void 0 : _a.some((value) => matchString(value, searchText)); + }; + return searchableFields2.some(searchStrFieldsFn) || searchableTagFields.some(searchTagsFieldsFn); +}; +var matchString = (value, searchText) => { + return value && value.toLowerCase().indexOf(searchText) !== -1; +}; + +// node_modules/@cloudscape-design/components/autosuggest/options-controller.js +var isHighlightable = (option) => { + return !!option && option.type !== "parent"; +}; +var isInteractive2 = (option) => !!option && !option.disabled && option.type !== "parent"; +var useAutosuggestItems = ({ options, filterValue, filterText, filteringType, enteredTextLabel, hideEnteredTextLabel, onSelectItem }) => { + const i18n = useInternalI18n("autosuggest"); + const [showAll, setShowAll] = (0, import_react143.useState)(false); + const { items, getItemGroup, getItemParent } = (0, import_react143.useMemo)(() => createItems(options), [options]); + const enteredItemLabel = i18n("enteredTextLabel", enteredTextLabel === null || enteredTextLabel === void 0 ? void 0 : enteredTextLabel(filterValue), (format2) => format2({ value: filterValue })); + if (!enteredItemLabel) { + warnOnce("Autosuggest", "A value for enteredTextLabel must be provided."); + } + const filteredItems = (0, import_react143.useMemo)(() => { + const filteredItems2 = filteringType === "auto" && !showAll ? filterOptions2(items, filterText) : [...items]; + if (filterValue && !hideEnteredTextLabel) { + filteredItems2.unshift({ + value: filterValue, + type: "use-entered", + label: enteredItemLabel, + option: { value: filterValue } + }); + } + generateTestIndexes(filteredItems2, getItemParent); + return filteredItems2; + }, [filteringType, showAll, items, filterText, filterValue, hideEnteredTextLabel, getItemParent, enteredItemLabel]); + const [highlightedOptionState, highlightedOptionHandlers] = useHighlightedOption({ + options: filteredItems, + isHighlightable + }); + const selectHighlightedOptionWithKeyboard = () => { + if (highlightedOptionState.highlightedOption && isInteractive2(highlightedOptionState.highlightedOption)) { + onSelectItem(highlightedOptionState.highlightedOption); + return true; + } + return false; + }; + const highlightVisibleOptionWithMouse = (index) => { + if (filteredItems[index] && isHighlightable(filteredItems[index])) { + highlightedOptionHandlers.setHighlightedIndexWithMouse(index); + } + }; + const selectVisibleOptionWithMouse = (index) => { + if (filteredItems[index] && isInteractive2(filteredItems[index])) { + onSelectItem(filteredItems[index]); + } + }; + return [ + Object.assign(Object.assign({}, highlightedOptionState), { items: filteredItems, showAll, getItemGroup }), + Object.assign(Object.assign({}, highlightedOptionHandlers), { + setShowAll, + selectHighlightedOptionWithKeyboard, + highlightVisibleOptionWithMouse, + selectVisibleOptionWithMouse + }) + ]; +}; +function createItems(options) { + const items = []; + const itemToGroup = /* @__PURE__ */ new WeakMap(); + const getItemParent = (item) => itemToGroup.get(item); + const getItemGroup = (item) => { + var _a; + return (_a = getItemParent(item)) === null || _a === void 0 ? void 0 : _a.option; + }; + for (const option of options) { + if (isGroup3(option)) { + for (const item of flattenGroup(option)) { + items.push(item); + } + } else { + items.push(Object.assign(Object.assign({}, option), { option })); + } + } + function flattenGroup(group) { + const { options: options2 } = group, rest = __rest(group, ["options"]); + let hasOnlyDisabledChildren = true; + const groupItem = Object.assign(Object.assign({}, rest), { type: "parent", option: group }); + const items2 = [groupItem]; + for (const option of options2) { + if (!option.disabled) { + hasOnlyDisabledChildren = false; + } + const childOption = Object.assign(Object.assign({}, option), { type: "child", disabled: option.disabled || rest.disabled, option }); + items2.push(childOption); + itemToGroup.set(childOption, groupItem); + } + items2[0].disabled = items2[0].disabled || hasOnlyDisabledChildren; + return items2; + } + return { items, getItemGroup, getItemParent }; +} +function isGroup3(optionOrGroup) { + return "options" in optionOrGroup; +} + +// node_modules/@cloudscape-design/components/autosuggest/options-list.js +var import_react147 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/autosuggest/virtual-list.js +var import_react146 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/autosuggest/autosuggest-option.js +var import_react144 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/autosuggest/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/autosuggest/styles.scoped.css"; +var styles_css_default47 = { + "root": "awsui_root_12hwc_oboi4_5", + "layout-strut": "awsui_layout-strut_12hwc_oboi4_9", + "list-bottom": "awsui_list-bottom_12hwc_oboi4_15" +}; + +// node_modules/@cloudscape-design/components/autosuggest/autosuggest-option.js +var AutosuggestOption = (_a, ref) => { + var { nativeAttributes = {}, highlightText, option, highlighted, highlightType, current, virtualPosition, padBottom, screenReaderContent, ariaSetsize, ariaPosinset } = _a, rest = __rest(_a, ["nativeAttributes", "highlightText", "option", "highlighted", "highlightType", "current", "virtualPosition", "padBottom", "screenReaderContent", "ariaSetsize", "ariaPosinset"]); + const baseProps = getBaseProps(rest); + const useEntered = "type" in option && option.type === "use-entered"; + const isParent = "type" in option && option.type === "parent"; + const isChild = "type" in option && option.type === "child"; + const { throughIndex, inGroupIndex, groupIndex } = getTestOptionIndexes(option) || {}; + let optionContent; + if (useEntered) { + optionContent = option.label; + screenReaderContent = void 0; + } else if (isParent) { + optionContent = option.label; + } else { + const a11yProperties = {}; + if (nativeAttributes["aria-label"]) { + a11yProperties["aria-label"] = nativeAttributes["aria-label"]; + } + optionContent = import_react144.default.createElement( + "div", + Object.assign({}, a11yProperties), + import_react144.default.createElement(option_default, { option, highlightedOption: highlighted, highlightText }) + ); + } + return import_react144.default.createElement(selectable_item_default, Object.assign({}, baseProps, { className: styles_css_default47.option, ariaSelected: current, highlighted, disabled: option.disabled, hasBackground: useEntered, isParent, isChild, virtualPosition, "data-test-index": throughIndex, "data-in-group-index": inGroupIndex, "data-group-index": groupIndex, ref, padBottom, screenReaderContent, ariaSetsize, ariaPosinset, highlightType: highlightType.type }), optionContent); +}; +var autosuggest_option_default = import_react144.default.memo(import_react144.default.forwardRef(AutosuggestOption)); + +// node_modules/@cloudscape-design/components/autosuggest/plain-list.js +var import_react145 = __toESM(require_react()); +var getOptionProps = (index, item, filteredItems, highlightedA11yProps, highlightedOption, hasDropdownStatus) => { + const nativeAttributes = item === highlightedOption ? highlightedA11yProps : {}; + const baseOptionProps = getBaseProps(nativeAttributes); + const isLastItem = index === filteredItems.length - 1; + const isNotEnteredTextItem = filteredItems.length > 1; + const padBottom = !hasDropdownStatus && isNotEnteredTextItem && isLastItem; + return Object.assign({ nativeAttributes, padBottom }, baseOptionProps); +}; +var PlainList2 = ({ autosuggestItemsState, handleLoadMore, menuProps, highlightedA11yProps, hasDropdownStatus, highlightText, listBottom, screenReaderContent }) => { + const listRef = (0, import_react145.useRef)(null); + (0, import_react145.useEffect)(() => { + var _a; + const item = (_a = listRef.current) === null || _a === void 0 ? void 0 : _a.querySelector(`[data-mouse-target="${autosuggestItemsState.highlightedIndex}"]`); + if (autosuggestItemsState.highlightType.moveFocus && item) { + scrollElementIntoView(item); + } + }, [autosuggestItemsState.highlightType, autosuggestItemsState.highlightedIndex]); + return import_react145.default.createElement( + options_list_default, + Object.assign({}, menuProps, { + onLoadMore: handleLoadMore, + open: true, + ref: listRef, + // to prevent closing the list when clicking the scrollbar on IE11 + nativeAttributes: { unselectable: "on" } + }), + autosuggestItemsState.items.map((item, index) => { + const optionProps = getOptionProps(index, item, autosuggestItemsState.items, highlightedA11yProps, autosuggestItemsState.highlightedOption, hasDropdownStatus); + return import_react145.default.createElement(autosuggest_option_default, Object.assign({ highlightText, option: item, highlighted: item === autosuggestItemsState.highlightedOption, current: item.value === highlightText, key: index, "data-mouse-target": index, screenReaderContent, highlightType: autosuggestItemsState.highlightType }, optionProps)); + }), + listBottom ? import_react145.default.createElement("li", { role: "option", className: styles_css_default47["list-bottom"] }, listBottom) : null + ); +}; +var plain_list_default2 = PlainList2; + +// node_modules/@cloudscape-design/components/autosuggest/virtual-list.js +var VirtualList2 = ({ autosuggestItemsState, handleLoadMore, menuProps, highlightedA11yProps, hasDropdownStatus, highlightText, listBottom, screenReaderContent }) => { + const scrollRef = (0, import_react146.useRef)(null); + const [width, strutRef] = useContainerQuery((rect) => rect.contentBoxWidth, []); + (0, import_react146.useImperativeHandle)(strutRef, () => scrollRef.current); + const rowVirtualizer = useVirtual2({ + items: autosuggestItemsState.items, + parentRef: scrollRef, + // estimateSize is a dependency of measurements memo. We update it to force full recalculation + // when the height of any option could have changed: + // 1: because the component got resized (width property got updated) + // 2: because the option changed its content (highlightText property controls the highlight and the visibility of hidden tags) + // eslint-disable-next-line react-hooks/exhaustive-deps + estimateSize: (0, import_react146.useCallback)(() => 31, [width, highlightText]) + }); + (0, import_react146.useEffect)(() => { + if (autosuggestItemsState.highlightType.moveFocus) { + rowVirtualizer.scrollToIndex(autosuggestItemsState.highlightedIndex); + } + }, [autosuggestItemsState.highlightType, autosuggestItemsState.highlightedIndex, rowVirtualizer]); + return import_react146.default.createElement( + options_list_default, + Object.assign({}, menuProps, { + onLoadMore: handleLoadMore, + ref: scrollRef, + open: true, + // to prevent closing the list when clicking the scrollbar on IE11 + nativeAttributes: { unselectable: "on" } + }), + import_react146.default.createElement("div", { "aria-hidden": "true", key: "total-size", className: styles_css_default47["layout-strut"], style: { height: rowVirtualizer.totalSize + (autosuggestItemsState.items.length === 1 ? 1 : 0) } }), + rowVirtualizer.virtualItems.map((virtualRow) => { + const { index, start, measureRef } = virtualRow; + const item = autosuggestItemsState.items[index]; + const optionProps = getOptionProps(index, item, autosuggestItemsState.items, highlightedA11yProps, autosuggestItemsState.highlightedOption, hasDropdownStatus); + return import_react146.default.createElement(autosuggest_option_default, Object.assign({ key: index, ref: measureRef, highlightText, option: item, highlighted: item === autosuggestItemsState.highlightedOption, current: item.value === highlightText, "data-mouse-target": index, virtualPosition: start + (index === 0 ? 1 : 0), screenReaderContent, ariaSetsize: autosuggestItemsState.items.length, ariaPosinset: index + 1, highlightType: autosuggestItemsState.highlightType }, optionProps)); + }), + listBottom ? import_react146.default.createElement("li", { role: "option", className: styles_css_default47["list-bottom"] }, listBottom) : null + ); +}; +var virtual_list_default2 = VirtualList2; + +// node_modules/@cloudscape-design/components/autosuggest/options-list.js +var createMouseEventHandler = (handler) => (itemIndex) => { + if (itemIndex > -1) { + handler(itemIndex); + } +}; +function AutosuggestOptionsList({ statusType, autosuggestItemsState, autosuggestItemsHandlers, highlightedOptionId, highlightText, listId, controlId, handleLoadMore, hasDropdownStatus, virtualScroll, selectedAriaLabel, renderHighlightedAriaLive, listBottom, ariaDescribedby }) { + var _a; + const handleMouseUp = createMouseEventHandler(autosuggestItemsHandlers.selectVisibleOptionWithMouse); + const handleMouseMove = createMouseEventHandler(autosuggestItemsHandlers.highlightVisibleOptionWithMouse); + const ListComponent = virtualScroll ? virtual_list_default2 : plain_list_default2; + const announcement = useAnnouncement({ + announceSelected: ((_a = autosuggestItemsState.highlightedOption) === null || _a === void 0 ? void 0 : _a.value) === highlightText, + highlightedOption: autosuggestItemsState.highlightedOption, + getParent: (option) => autosuggestItemsState.getItemGroup(option), + selectedAriaLabel, + renderHighlightedAriaLive + }); + return import_react147.default.createElement(ListComponent, { listBottom, handleLoadMore, autosuggestItemsState, highlightText, highlightedA11yProps: highlightedOptionId ? { id: highlightedOptionId } : {}, hasDropdownStatus, menuProps: { + id: listId, + ariaLabelledby: controlId, + onMouseUp: handleMouseUp, + onMouseMove: handleMouseMove, + ariaDescribedby, + statusType + }, screenReaderContent: announcement }); +} + +// node_modules/@cloudscape-design/components/autosuggest/load-more-controller.js +var import_react148 = __toESM(require_react()); +var useAutosuggestLoadMore = ({ options = [], statusType, onLoadItems }) => { + const lastFilteringText = (0, import_react148.useRef)(null); + const fireLoadMore = ({ firstPage, samePage, filteringText }) => { + var _a; + if (filteringText === void 0 || lastFilteringText.current !== filteringText) { + if (filteringText !== void 0) { + lastFilteringText.current = filteringText; + } + onLoadItems({ filteringText: (_a = lastFilteringText.current) !== null && _a !== void 0 ? _a : "", firstPage, samePage }); + } + }; + const fireLoadMoreOnScroll = () => { + options.length > 0 && statusType === "pending" && fireLoadMore({ firstPage: false, samePage: false }); + }; + const fireLoadMoreOnRecoveryClick = () => fireLoadMore({ firstPage: false, samePage: true }); + const fireLoadMoreOnInputFocus = () => fireLoadMore({ firstPage: true, samePage: false, filteringText: "" }); + const fireLoadMoreOnInputChange = (filteringText) => fireLoadMore({ firstPage: true, samePage: false, filteringText }); + return { fireLoadMoreOnScroll, fireLoadMoreOnRecoveryClick, fireLoadMoreOnInputFocus, fireLoadMoreOnInputChange }; +}; + +// node_modules/@cloudscape-design/components/internal/components/autosuggest-input/index.js +var import_react149 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/internal/components/autosuggest-input/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/internal/components/autosuggest-input/styles.scoped.css"; +var styles_css_default48 = { + "dropdown-footer": "awsui_dropdown-footer_vm8qf_jxdvh_5", + "dropdown-content": "awsui_dropdown-content_vm8qf_jxdvh_10" +}; + +// node_modules/@cloudscape-design/components/internal/components/autosuggest-input/index.js +var AutosuggestInput = import_react149.default.forwardRef((_a, ref) => { + var { value, onChange, onBlur, onFocus, onKeyUp, onKeyDown, name, placeholder, disabled, readOnly, autoFocus, ariaLabel, ariaRequired, disableBrowserAutocorrect = false, expandToViewport, ariaControls, ariaActivedescendant, clearAriaLabel, dropdownExpanded = true, dropdownContentKey, dropdownContentFocusable = false, dropdownContent = null, dropdownFooter = null, dropdownWidth, loopFocus, onCloseDropdown, onDelayedInput, onPressArrowDown, onPressArrowUp, onPressEnter, __internalRootRef } = _a, restProps = __rest(_a, ["value", "onChange", "onBlur", "onFocus", "onKeyUp", "onKeyDown", "name", "placeholder", "disabled", "readOnly", "autoFocus", "ariaLabel", "ariaRequired", "disableBrowserAutocorrect", "expandToViewport", "ariaControls", "ariaActivedescendant", "clearAriaLabel", "dropdownExpanded", "dropdownContentKey", "dropdownContentFocusable", "dropdownContent", "dropdownFooter", "dropdownWidth", "loopFocus", "onCloseDropdown", "onDelayedInput", "onPressArrowDown", "onPressArrowUp", "onPressEnter", "__internalRootRef"]); + const baseProps = getBaseProps(restProps); + const formFieldContext = useFormFieldContext(restProps); + const inputRef = (0, import_react149.useRef)(null); + const dropdownContentRef = (0, import_react149.useRef)(null); + const dropdownFooterRef = (0, import_react149.useRef)(null); + const preventOpenOnFocusRef = (0, import_react149.useRef)(false); + const preventCloseOnBlurRef = (0, import_react149.useRef)(false); + const [open, setOpen] = (0, import_react149.useState)(false); + const openDropdown = () => !readOnly && setOpen(true); + const closeDropdown = () => { + setOpen(false); + fireNonCancelableEvent(onCloseDropdown, null); + }; + (0, import_react149.useImperativeHandle)(ref, () => ({ + focus(options) { + var _a2; + if (options === null || options === void 0 ? void 0 : options.preventDropdown) { + preventOpenOnFocusRef.current = true; + } + (_a2 = inputRef.current) === null || _a2 === void 0 ? void 0 : _a2.focus(); + }, + select() { + var _a2; + (_a2 = inputRef.current) === null || _a2 === void 0 ? void 0 : _a2.select(); + }, + open: openDropdown, + close: closeDropdown + })); + const handleBlur = () => { + if (!preventCloseOnBlurRef.current) { + closeDropdown(); + fireNonCancelableEvent(onBlur, null); + } + }; + const handleFocus = () => { + if (!preventOpenOnFocusRef.current) { + openDropdown(); + fireNonCancelableEvent(onFocus, null); + } + preventOpenOnFocusRef.current = false; + }; + const fireKeydown = (event) => fireCancelableEvent(onKeyDown, event.detail, event); + const handleKeyDown = (event) => { + switch (event.detail.keyCode) { + case KeyCode.down: { + onPressArrowDown === null || onPressArrowDown === void 0 ? void 0 : onPressArrowDown(); + openDropdown(); + event.preventDefault(); + break; + } + case KeyCode.up: { + onPressArrowUp === null || onPressArrowUp === void 0 ? void 0 : onPressArrowUp(); + openDropdown(); + event.preventDefault(); + break; + } + case KeyCode.enter: { + if (open) { + if (!(onPressEnter === null || onPressEnter === void 0 ? void 0 : onPressEnter())) { + closeDropdown(); + } + event.preventDefault(); + } + fireKeydown(event); + break; + } + case KeyCode.escape: { + if (open) { + event.stopPropagation(); + closeDropdown(); + } else if (value) { + event.stopPropagation(); + fireNonCancelableEvent(onChange, { value: "" }); + } + event.preventDefault(); + fireKeydown(event); + break; + } + default: { + fireKeydown(event); + } + } + }; + const handleChange = (value2) => { + openDropdown(); + fireNonCancelableEvent(onChange, { value: value2 }); + }; + const handleDelayedInput = (value2) => { + fireNonCancelableEvent(onDelayedInput, { value: value2 }); + }; + const handleDropdownMouseDown = (event) => { + if (!dropdownContentFocusable) { + event.preventDefault(); + } else { + preventCloseOnBlurRef.current = true; + requestAnimationFrame(() => { + preventCloseOnBlurRef.current = false; + }); + } + }; + const expanded = open && dropdownExpanded; + const nativeAttributes = { + name, + placeholder, + autoFocus, + onClick: openDropdown, + role: "combobox", + "aria-autocomplete": "list", + "aria-expanded": expanded, + "aria-controls": open ? ariaControls : void 0, + // 'aria-owns' needed for safari+vo to announce activedescendant content + "aria-owns": open ? ariaControls : void 0, + "aria-label": ariaLabel, + "aria-activedescendant": ariaActivedescendant + }; + (0, import_react149.useEffect)(() => { + if (!open) { + return; + } + const clickListener = (event) => { + if (!nodeBelongs(inputRef.current, event.target) && !nodeBelongs(dropdownContentRef.current, event.target) && !nodeBelongs(dropdownFooterRef.current, event.target)) { + closeDropdown(); + } + }; + window.addEventListener("mousedown", clickListener); + return () => { + window.removeEventListener("mousedown", clickListener); + }; + }, [open]); + return import_react149.default.createElement( + "div", + Object.assign({}, baseProps, { className: clsx_m_default(baseProps.className, styles_css_default48.root), ref: __internalRootRef }), + import_react149.default.createElement(dropdown_default, { minWidth: dropdownWidth, stretchWidth: !dropdownWidth, stretchBeyondTriggerWidth: true, contentKey: dropdownContentKey, onFocus: handleFocus, onBlur: handleBlur, trigger: import_react149.default.createElement(internal_default4, Object.assign({ type: "visualSearch", value, onChange: (event) => handleChange(event.detail.value), __onDelayedInput: (event) => handleDelayedInput(event.detail.value), onKeyDown: handleKeyDown, onKeyUp, disabled, disableBrowserAutocorrect, readOnly, ariaRequired, clearAriaLabel, ref: inputRef, autoComplete: false, __nativeAttributes: nativeAttributes }, formFieldContext)), onMouseDown: handleDropdownMouseDown, open: open && (!!dropdownContent || !!dropdownFooter), footer: dropdownFooterRef && import_react149.default.createElement("div", { ref: dropdownFooterRef, className: styles_css_default48["dropdown-footer"] }, dropdownFooter), expandToViewport, loopFocus }, open && dropdownContent ? import_react149.default.createElement("div", { ref: dropdownContentRef, className: styles_css_default48["dropdown-content"] }, dropdownContent) : null) + ); +}); +var autosuggest_input_default = AutosuggestInput; + +// node_modules/@cloudscape-design/components/autosuggest/internal.js +var InternalAutosuggest = import_react150.default.forwardRef((props2, ref) => { + var _a, _b; + const { value, onChange, onBlur, onFocus, onKeyUp, onLoadItems, options, filteringType = "auto", statusType = "finished", placeholder, clearAriaLabel, name, disabled, disableBrowserAutocorrect = false, autoFocus, readOnly, ariaLabel, ariaRequired, enteredTextLabel, filteringResultsText, onKeyDown, virtualScroll, expandToViewport, onSelect, renderHighlightedAriaLive, __internalRootRef } = props2, restProps = __rest(props2, ["value", "onChange", "onBlur", "onFocus", "onKeyUp", "onLoadItems", "options", "filteringType", "statusType", "placeholder", "clearAriaLabel", "name", "disabled", "disableBrowserAutocorrect", "autoFocus", "readOnly", "ariaLabel", "ariaRequired", "enteredTextLabel", "filteringResultsText", "onKeyDown", "virtualScroll", "expandToViewport", "onSelect", "renderHighlightedAriaLive", "__internalRootRef"]); + checkControlled("Autosuggest", "value", value, "onChange", onChange); + checkOptionValueField("Autosuggest", "options", options); + const autosuggestInputRef = (0, import_react150.useRef)(null); + (0, import_react150.useImperativeHandle)(ref, () => ({ + focus: () => { + var _a2; + return (_a2 = autosuggestInputRef.current) === null || _a2 === void 0 ? void 0 : _a2.focus(); + }, + select: () => { + var _a2; + return (_a2 = autosuggestInputRef.current) === null || _a2 === void 0 ? void 0 : _a2.select(); + } + }), []); + const i18n = useInternalI18n("autosuggest"); + const errorIconAriaLabel = i18n("errorIconAriaLabel", restProps.errorIconAriaLabel); + const selectedAriaLabel = i18n("selectedAriaLabel", restProps.selectedAriaLabel); + const recoveryText = i18n("recoveryText", restProps.recoveryText); + if (restProps.recoveryText && !onLoadItems) { + warnOnce("Autosuggest", "`onLoadItems` must be provided for `recoveryText` to be displayed."); + } + const [autosuggestItemsState, autosuggestItemsHandlers] = useAutosuggestItems({ + options: options || [], + filterValue: value, + filterText: value, + filteringType, + enteredTextLabel, + hideEnteredTextLabel: false, + onSelectItem: (option) => { + var _a2; + const value2 = option.value || ""; + fireNonCancelableEvent(onChange, { value: value2 }); + fireNonCancelableEvent(onSelect, { + value: value2, + selectedOption: option.type !== "use-entered" ? option.option : void 0 + }); + (_a2 = autosuggestInputRef.current) === null || _a2 === void 0 ? void 0 : _a2.close(); + } + }); + const autosuggestLoadMoreHandlers = useAutosuggestLoadMore({ + options, + statusType, + onLoadItems: (detail) => fireNonCancelableEvent(onLoadItems, detail) + }); + const handleChange = (event) => { + autosuggestItemsHandlers.setShowAll(false); + autosuggestItemsHandlers.resetHighlightWithKeyboard(); + fireNonCancelableEvent(onChange, event.detail); + }; + const handleDelayedInput = (event) => { + autosuggestLoadMoreHandlers.fireLoadMoreOnInputChange(event.detail.value); + }; + const handleBlur = () => { + fireNonCancelableEvent(onBlur, null); + }; + const handleFocus = () => { + autosuggestItemsHandlers.setShowAll(true); + autosuggestLoadMoreHandlers.fireLoadMoreOnInputFocus(); + fireNonCancelableEvent(onFocus, null); + }; + const handleKeyUp = (event) => { + fireCancelableEvent(onKeyUp, event.detail, event); + }; + const handleKeyDown = (event) => { + fireCancelableEvent(onKeyDown, event.detail, event); + }; + const handlePressArrowDown = () => { + autosuggestItemsHandlers.moveHighlightWithKeyboard(1); + }; + const handlePressArrowUp = () => { + autosuggestItemsHandlers.moveHighlightWithKeyboard(-1); + }; + const handlePressEnter = () => { + return autosuggestItemsHandlers.selectHighlightedOptionWithKeyboard(); + }; + const handleCloseDropdown = () => { + autosuggestItemsHandlers.resetHighlightWithKeyboard(); + }; + const handleRecoveryClick = () => { + var _a2; + autosuggestLoadMoreHandlers.fireLoadMoreOnRecoveryClick(); + (_a2 = autosuggestInputRef.current) === null || _a2 === void 0 ? void 0 : _a2.focus(); + }; + const formFieldContext = useFormFieldContext(restProps); + const selfControlId = useUniqueId("input"); + const footerControlId = useUniqueId("footer"); + const controlId = (_a = formFieldContext.controlId) !== null && _a !== void 0 ? _a : selfControlId; + const listId = useUniqueId("list"); + const highlightedOptionIdSource = useUniqueId(); + const highlightedOptionId = autosuggestItemsState.highlightedOption ? highlightedOptionIdSource : void 0; + const isEmpty = !value && !autosuggestItemsState.items.length; + const isFiltered = !!value && value.length !== 0; + const filteredText = isFiltered ? filteringResultsText === null || filteringResultsText === void 0 ? void 0 : filteringResultsText(autosuggestItemsState.items.length, (_b = options === null || options === void 0 ? void 0 : options.length) !== null && _b !== void 0 ? _b : 0) : void 0; + const dropdownStatus = useDropdownStatus(Object.assign(Object.assign({}, props2), { + isEmpty, + isFiltered, + recoveryText, + errorIconAriaLabel, + onRecoveryClick: handleRecoveryClick, + filteringResultsText: filteredText, + hasRecoveryCallback: !!onLoadItems + })); + const shouldRenderDropdownContent = !isEmpty || dropdownStatus.content; + return import_react150.default.createElement(autosuggest_input_default, Object.assign({}, restProps, { className: clsx_m_default(styles_css_default47.root, restProps.className), ref: autosuggestInputRef, __internalRootRef, value, onChange: handleChange, onBlur: handleBlur, onFocus: handleFocus, onKeyUp: handleKeyUp, onKeyDown: handleKeyDown, name, controlId, placeholder, disabled, readOnly, autoFocus, ariaLabel, ariaRequired, clearAriaLabel, disableBrowserAutocorrect, expandToViewport, ariaControls: listId, ariaActivedescendant: highlightedOptionId, dropdownExpanded: autosuggestItemsState.items.length > 1 || dropdownStatus.content !== null, dropdownContent: shouldRenderDropdownContent && import_react150.default.createElement(AutosuggestOptionsList, { statusType, autosuggestItemsState, autosuggestItemsHandlers, highlightedOptionId, highlightText: value, listId, controlId, handleLoadMore: autosuggestLoadMoreHandlers.fireLoadMoreOnScroll, hasDropdownStatus: dropdownStatus.content !== null, virtualScroll, selectedAriaLabel, renderHighlightedAriaLive, listBottom: !dropdownStatus.isSticky ? import_react150.default.createElement(dropdown_footer_default, { content: dropdownStatus.content, id: footerControlId }) : null, ariaDescribedby: dropdownStatus.content ? footerControlId : void 0 }), dropdownFooter: dropdownStatus.isSticky && dropdownStatus.content ? import_react150.default.createElement(dropdown_footer_default, { id: footerControlId, content: dropdownStatus.content, hasItems: autosuggestItemsState.items.length >= 1 }) : null, loopFocus: statusType === "error" && !!recoveryText && !!onLoadItems, onCloseDropdown: handleCloseDropdown, onDelayedInput: handleDelayedInput, onPressArrowDown: handlePressArrowDown, onPressArrowUp: handlePressArrowUp, onPressEnter: handlePressEnter })); +}); +var internal_default15 = InternalAutosuggest; + +// node_modules/@cloudscape-design/components/autosuggest/index.js +var Autosuggest = import_react151.default.forwardRef((_a, ref) => { + var { filteringType = "auto", statusType = "finished", disableBrowserAutocorrect = false } = _a, props2 = __rest(_a, ["filteringType", "statusType", "disableBrowserAutocorrect"]); + const baseComponentProps = useBaseComponent("Autosuggest", { + props: { + autoFocus: props2.autoFocus, + disableBrowserAutocorrect, + expandToViewport: props2.expandToViewport, + filteringType, + readOnly: props2.readOnly, + virtualScroll: props2.virtualScroll + } + }); + const externalProps = getExternalProps(props2); + return import_react151.default.createElement(internal_default15, Object.assign({ filteringType, statusType, disableBrowserAutocorrect }, externalProps, baseComponentProps, { ref })); +}); +applyDisplayName(Autosuggest, "Autosuggest"); +var autosuggest_default = Autosuggest; + +// node_modules/@cloudscape-design/components/badge/index.js +var import_react152 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/badge/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/badge/styles.scoped.css"; +var styles_css_default49 = { + "badge": "awsui_badge_1yjyg_bjogl_99", + "badge-color-grey": "awsui_badge-color-grey_1yjyg_bjogl_145", + "badge-color-green": "awsui_badge-color-green_1yjyg_bjogl_148", + "badge-color-blue": "awsui_badge-color-blue_1yjyg_bjogl_151", + "badge-color-red": "awsui_badge-color-red_1yjyg_bjogl_154" +}; + +// node_modules/@cloudscape-design/components/badge/index.js +function Badge(_a) { + var { color: color2 = "grey", children: children2 } = _a, rest = __rest(_a, ["color", "children"]); + const { __internalRootRef } = useBaseComponent("Badge", { props: { color: color2 } }); + const baseProps = getBaseProps(rest); + const className = clsx_m_default(baseProps.className, styles_css_default49.badge, styles_css_default49[`badge-color-${color2}`]); + return import_react152.default.createElement("span", Object.assign({}, baseProps, { className }, { ref: __internalRootRef }), children2); +} +applyDisplayName(Badge, "Badge"); + +// node_modules/@cloudscape-design/components/bar-chart/index.js +var import_react164 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/bar-chart/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/bar-chart/styles.scoped.css"; +var styles_css_default50 = { + "root": "awsui_root_1gfe1_7b6p8_9" +}; + +// node_modules/@cloudscape-design/components/mixed-line-bar-chart/internal.js +var import_react163 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/mixed-line-bar-chart/chart-legend.js +var import_react153 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/mixed-line-bar-chart/utils.js +var chartLegendMap = { + line: "line", + bar: "rectangle", + threshold: "dashed" +}; +var nextValidDomainIndex = (nextGroupIndex, barGroups, direction = 1) => { + let index = nextGroupIndex; + if (index < 0 || index >= barGroups.length) { + index = 0; + } + do { + if (barGroups[index].isValid && barGroups[index].hasData) { + return index; + } + index += direction; + if (index >= barGroups.length) { + index = 0; + } else if (index < 0) { + index = barGroups.length - 1; + } + } while (index !== nextGroupIndex); + return 0; +}; +function findNavigableSeries(series) { + const navigableSeries = []; + let navigableBarSeriesIndex = -1; + series.forEach((internalSeries) => { + if (internalSeries.series.type === "bar") { + if (navigableBarSeriesIndex === -1) { + navigableBarSeriesIndex = navigableSeries.length; + navigableSeries.push(internalSeries.series); + } + } else { + navigableSeries.push(internalSeries.series); + } + }); + return { navigableSeries, navigableBarSeriesIndex }; +} +var matchesX = (x1, x2) => { + if (x1 instanceof Date && x2 instanceof Date) { + return x1.getTime() === x2.getTime(); + } + return x1 === x2; +}; +function calculateOffsetMaps(data) { + return data.reduce((acc, curr, idx) => { + if (idx === 0) { + acc.push({ positiveOffsets: /* @__PURE__ */ new Map(), negativeOffsets: /* @__PURE__ */ new Map() }); + } + const lastMap = acc[idx]; + const map2 = lastMap ? { positiveOffsets: new Map(lastMap.positiveOffsets), negativeOffsets: new Map(lastMap.negativeOffsets) } : { positiveOffsets: /* @__PURE__ */ new Map(), negativeOffsets: /* @__PURE__ */ new Map() }; + curr.forEach(({ x: x2, y: y2 }) => { + const key = getKeyValue(x2); + if (y2 < 0) { + const lastValue = (lastMap === null || lastMap === void 0 ? void 0 : lastMap.negativeOffsets.get(key)) || 0; + map2.negativeOffsets.set(key, lastValue + y2); + } else { + const lastValue = (lastMap === null || lastMap === void 0 ? void 0 : lastMap.positiveOffsets.get(key)) || 0; + map2.positiveOffsets.set(key, lastValue + y2); + } + }); + if (idx < data.length - 1) { + acc.push(map2); + } + return acc; + }, []); +} +var getKeyValue = (key) => key instanceof Date ? key.getTime() : key; +function isYThreshold(series) { + return series.type === "threshold" && "y" in series; +} +function isXThreshold(series) { + return series.type === "threshold" && "x" in series; +} +function isDataSeries(series) { + return series.type === "line" || series.type === "bar"; +} + +// node_modules/@cloudscape-design/components/mixed-line-bar-chart/chart-legend.js +function InternalChartLegend({ series, visibleSeries, highlightedSeries, onHighlightChange, legendTitle, ariaLabel, plotContainerRef }) { + const legendItems = (0, import_react153.useMemo)(() => { + return series.filter((s2) => visibleSeries.indexOf(s2.series) !== -1).map(({ series: series2, color: color2 }) => ({ + label: series2.title, + type: chartLegendMap[series2.type], + color: color2, + datum: series2 + })); + }, [series, visibleSeries]); + return import_react153.default.createElement(chart_legend_default, { series: legendItems, highlightedSeries: highlightedSeries || null, onHighlightChange, legendTitle, ariaLabel, plotContainerRef }); +} + +// node_modules/@cloudscape-design/components/mixed-line-bar-chart/chart-container.js +var import_react162 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/internal/components/cartesian-chart/vertical-grid-lines.js +var import_react154 = __toESM(require_react()); +var vertical_grid_lines_default = (0, import_react154.memo)(VerticalGridLines); +function VerticalGridLines({ ticks: ticks2, scale, height }) { + return import_react154.default.createElement("g", { "aria-hidden": "true" }, ticks2.map((tick) => { + var _a; + const x2 = (_a = scale.d3Scale(tick)) !== null && _a !== void 0 ? _a : NaN; + return isFinite(x2) && import_react154.default.createElement("line", { key: tick, className: styles_css_default39.grid, x1: x2, y1: 0, x2, y2: height }); + })); +} + +// node_modules/@cloudscape-design/components/mixed-line-bar-chart/chart-popover.js +var import_react155 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/mixed-line-bar-chart/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/mixed-line-bar-chart/styles.scoped.css"; +var styles_css_default51 = { + "series": "awsui_series_1yz9c_1g0qf_99", + "series--bar": "awsui_series--bar_1yz9c_1g0qf_100", + "series__rect": "awsui_series__rect_1yz9c_1g0qf_100", + "exiting": "awsui_exiting_1yz9c_1g0qf_117", + "awsui-motion-fade-out-0": "awsui_awsui-motion-fade-out-0_1yz9c_1g0qf_1", + "root": "awsui_root_1yz9c_1g0qf_143", + "series--highlighted": "awsui_series--highlighted_1yz9c_1g0qf_156", + "series__bar--highlighted": "awsui_series__bar--highlighted_1yz9c_1g0qf_157", + "series--dimmed": "awsui_series--dimmed_1yz9c_1g0qf_161", + "series--threshold": "awsui_series--threshold_1yz9c_1g0qf_165", + "bar-group": "awsui_bar-group_1yz9c_1g0qf_170" +}; + +// node_modules/@cloudscape-design/components/mixed-line-bar-chart/chart-popover.js +var chart_popover_default2 = import_react155.default.forwardRef(MixedChartPopover); +function MixedChartPopover({ containerRef, trackRef, isOpen, isPinned, highlightDetails, footer, onDismiss, size = "medium", dismissAriaLabel, onMouseEnter, onMouseLeave, onBlur, setPopoverText }, popoverRef) { + const [expandedSeries, setExpandedSeries] = (0, import_react155.useState)({}); + return import_react155.default.createElement(Transition2, { in: isOpen }, (state, ref) => import_react155.default.createElement("div", { ref, className: clsx_m_default(state === "exiting" && styles_css_default51.exiting) }, (isOpen || state !== "exited") && highlightDetails && import_react155.default.createElement( + chart_popover_default, + { ref: popoverRef, title: highlightDetails.position, trackRef, trackKey: highlightDetails.position, dismissButton: isPinned, dismissAriaLabel, onDismiss, container: containerRef.current, size, onMouseEnter, onMouseLeave, onBlur }, + import_react155.default.createElement(chart_series_details_default, { key: highlightDetails.position, details: highlightDetails.details, setPopoverText, expandedSeries: expandedSeries[highlightDetails.position], setExpandedState: (id, isExpanded) => setExpandedSeries((oldState) => { + const expandedSeriesInCurrentCoordinate = new Set(oldState[highlightDetails.position]); + if (isExpanded) { + expandedSeriesInCurrentCoordinate.add(id); + } else { + expandedSeriesInCurrentCoordinate.delete(id); + } + return Object.assign(Object.assign({}, oldState), { [highlightDetails.position]: expandedSeriesInCurrentCoordinate }); + }) }), + footer && import_react155.default.createElement(ChartPopoverFooter, null, footer) + ))); +} + +// node_modules/@cloudscape-design/components/mixed-line-bar-chart/domain.js +function computeDomainX2(series, xScaleType) { + if (xScaleType === "categorical") { + return series.reduce((acc, s2) => { + if (isDataSeries(s2.series)) { + s2.series.data.forEach(({ x: x2 }) => { + if (acc.indexOf(x2) === -1) { + acc.push(x2); + } + }); + } + if (isXThreshold(s2.series)) { + if (acc.indexOf(s2.series.x) === -1) { + acc.push(s2.series.x); + } + } + return acc; + }, []); + } + return series.reduce((acc, curr) => { + if (isYThreshold(curr.series)) { + return acc; + } + if (isXThreshold(curr.series)) { + const [min3, max3] = acc; + const newMin = min3 === void 0 || min3 === null || curr.series.x < min3 ? curr.series.x : min3; + const newMax = max3 === void 0 || max3 === null || max3 < curr.series.x ? curr.series.x : max3; + return [newMin, newMax]; + } + if (isDataSeries(curr.series)) { + return curr.series.data.reduce(([min3, max3], { x: x2 }) => { + const newMin = min3 === void 0 || min3 === null || x2 < min3 ? x2 : min3; + const newMax = max3 === void 0 || max3 === null || max3 < x2 ? x2 : max3; + return [newMin, newMax]; + }, acc); + } + return acc; + }, []); +} +function find(arr, func) { + for (let i = 0; i < arr.length; i++) { + const found = func(arr[i]); + if (found) { + return arr[i]; + } + } + return null; +} +function computeDomainY2(series, scaleType, stackedBars) { + let _series = series; + if (stackedBars) { + const { positiveData, negativeData } = series.reduce((acc, curr) => { + if (curr.series.type === "bar") { + curr.series.data.forEach(({ x: x2, y: y2 }) => { + const data = y2 < 0 ? acc.negativeData : acc.positiveData; + const stackedDatum = find(data, (el) => matchesX(el.x, x2)); + if (stackedDatum) { + stackedDatum.y += y2; + } else { + data.push({ x: x2, y: y2 }); + } + return acc; + }); + } + return acc; + }, { + positiveData: [], + negativeData: [] + }); + const stackedSeries = [ + { + color: "", + index: NaN, + series: { + type: "bar", + title: "positive", + data: positiveData + } + }, + { + color: "", + index: NaN, + series: { + type: "bar", + title: "negative", + data: negativeData + } + } + ]; + _series = [...stackedSeries, ..._series.filter((s2) => s2.series.type !== "bar")]; + } + const domain = _series.reduce((acc, curr) => { + if (isYThreshold(curr.series)) { + const [min3, max3] = acc; + const newMin = min3 === void 0 || curr.series.y < min3 ? curr.series.y : min3; + const newMax = max3 === void 0 || max3 < curr.series.y ? curr.series.y : max3; + return [newMin, newMax]; + } + if (isXThreshold(curr.series)) { + return acc; + } + if (isDataSeries(curr.series)) { + return curr.series.data.reduce(([min3, max3], { y: y2 }) => { + const newMin = min3 === void 0 || y2 < min3 ? y2 : min3; + const newMax = max3 === void 0 || max3 < y2 ? y2 : max3; + return [newMin, newMax]; + }, acc); + } + return acc; + }, [0, 0]); + if (scaleType === "log" && domain[0] === 0 && domain[1] > 1) { + return [1, domain[1]]; + } + return domain; +} + +// node_modules/@cloudscape-design/components/mixed-line-bar-chart/make-scaled-series.js +function makeScaledSeries(allSeries, xScale, yScale) { + const xOffset = xScale.isCategorical() ? Math.max(0, xScale.d3Scale.bandwidth() - 1) / 2 : 0; + const scaleX = (x2) => (xScale.d3Scale(x2) || 0) + xOffset; + const scaleY = (y2) => yScale.d3Scale(y2) || 0; + const allX = getAllX(allSeries); + function mergeLineSeriesPointsWithXThresholds(scaledPoints, xThresholdSeries, xThresholdSeriesColor) { + var _a, _b; + const x2 = scaleX(xThresholdSeries.x); + let bisectIndex = -1; + for (let i = 0; i < scaledPoints.length - 1; i++) { + if (scaledPoints[i].x < x2 && x2 < scaledPoints[i + 1].x) { + bisectIndex = i; + break; + } + } + if (bisectIndex !== -1) { + const prevY = ((_a = scaledPoints[bisectIndex].datum) === null || _a === void 0 ? void 0 : _a.y) || 0; + const nextY = ((_b = scaledPoints[bisectIndex + 1].datum) === null || _b === void 0 ? void 0 : _b.y) || 0; + const averageY = (prevY + nextY) / 2; + scaledPoints.push({ + x: x2, + y: scaleY(averageY), + datum: { x: xThresholdSeries.x, y: NaN }, + series: scaledPoints[bisectIndex].series, + color: xThresholdSeriesColor + }); + } + } + const scaledSeriesX = allSeries.map(({ series, color: color2 }) => { + const scaledPoints = []; + if (series.type === "line") { + for (const datum of series.data) { + scaledPoints.push({ x: scaleX(datum.x), y: scaleY(datum.y), datum, series, color: color2 }); + } + scaledPoints.sort((s1, s2) => s1.x - s2.x); + for (const otherSeries of allSeries) { + if (isXThreshold(otherSeries.series)) { + mergeLineSeriesPointsWithXThresholds(scaledPoints, otherSeries.series, otherSeries.color); + } + } + } else if (isYThreshold(series)) { + for (const x2 of allX) { + scaledPoints.push({ x: scaleX(x2), y: scaleY(series.y), datum: { x: x2, y: series.y }, series, color: color2 }); + } + if (allX.length === 0) { + scaledPoints.push({ x: NaN, y: scaleY(series.y), series, color: color2 }); + } + } else if (isXThreshold(series)) { + scaledPoints.push({ x: scaleX(series.x), y: NaN, datum: { x: series.x, y: NaN }, series, color: color2 }); + } + return scaledPoints; + }); + return flatten(scaledSeriesX).sort((s1, s2) => s1.x - s2.x); +} +function getAllX(series) { + const addDataXSet = /* @__PURE__ */ new Set(); + for (const { series: s2 } of series) { + switch (s2.type) { + case "bar": + case "line": + for (const d of s2.data) { + addDataXSet.add(d.x); + } + break; + case "threshold": + if (isXThreshold(s2)) { + addDataXSet.add(s2.x); + } + break; + } + } + const allDataX = []; + addDataXSet.forEach((x2) => allDataX.push(x2)); + return allDataX; +} +function flatten(arrays) { + const merged = []; + for (const array of arrays) { + for (const item of array) { + merged.push(item); + } + } + return merged; +} + +// node_modules/@cloudscape-design/components/mixed-line-bar-chart/make-scaled-bar-groups.js +function makeScaledBarGroups(series, xScale, plotWidth, plotHeight, axis) { + if (!xScale.isCategorical()) { + return []; + } + return xScale.domain.map((x2) => { + const scaledX = xScale.d3Scale(x2); + const isValid = typeof scaledX !== "undefined" && isFinite(scaledX); + return { + x: x2, + isValid, + hasData: series.some(({ series: series2 }) => { + if (isYThreshold(series2)) { + return true; + } + if (isXThreshold(series2)) { + return false; + } + if (isDataSeries(series2)) { + return series2.data.some((datum) => matchesX(datum.x, x2)); + } + return false; + }), + position: axis === "x" ? { + x: 0, + y: isValid ? scaledX || 0 : 0, + width: plotWidth, + height: xScale.d3Scale.bandwidth() + } : { + x: isValid ? scaledX || 0 : 0, + y: 0, + width: xScale.d3Scale.bandwidth(), + height: plotHeight + } + }; + }); +} + +// node_modules/@cloudscape-design/components/mixed-line-bar-chart/format-highlighted.js +function formatHighlighted({ position, series, xTickFormatter, detailPopoverSeriesContent }) { + const formattedPosition = xTickFormatter ? xTickFormatter(position) : position.toString(); + const details = []; + series.forEach((s2) => { + const detail = getSeriesDetail({ internalSeries: s2, targetX: position, detailPopoverSeriesContent }); + if (detail) { + details.push(detail); + } + }); + return { position: formattedPosition, details }; +} +function getSeriesDetail({ internalSeries, targetX, detailPopoverSeriesContent }) { + var _a; + const { series, color: color2 } = internalSeries; + if (isXThreshold(series)) { + return series.x === targetX ? { + key: series.title, + value: "", + color: color2, + markerType: "dashed" + } : null; + } + if (isYThreshold(series)) { + return { + key: series.title, + value: series.valueFormatter ? series.valueFormatter(series.y) : series.y, + color: color2, + markerType: "dashed" + }; + } + if (isDataSeries(series)) { + for (const datum of series.data) { + if (matchesX(targetX, datum.x)) { + const customContent = detailPopoverSeriesContent ? detailPopoverSeriesContent({ series, x: targetX, y: datum.y }) : void 0; + const hasSubItems = !!((_a = customContent === null || customContent === void 0 ? void 0 : customContent.subItems) === null || _a === void 0 ? void 0 : _a.length); + const isExpandable = (customContent === null || customContent === void 0 ? void 0 : customContent.expandable) && hasSubItems; + const isKeyString = typeof (customContent === null || customContent === void 0 ? void 0 : customContent.key) === "string"; + const key = (customContent === null || customContent === void 0 ? void 0 : customContent.key) && (!isExpandable || isKeyString) ? customContent.key : series.title; + if ((customContent === null || customContent === void 0 ? void 0 : customContent.expandable) && !hasSubItems) { + warnOnce("MixedLineBarChart", "`expandable` was set to `true` for a series without sub-items. This property will be ignored."); + } + if (isExpandable && !isKeyString) { + warnOnce("MixedLineBarChart", "A ReactNode was used for the key of an expandable series. The series title will be used instead because nested interactive elements can cause accessiblity issues."); + } + if (!isKeyString && !isExpandable && (customContent === null || customContent === void 0 ? void 0 : customContent.value) && typeof customContent.value !== "string") { + warnOnce("MixedLineBarChart", "Use a ReactNode for the key or the value of a series, but not for both. It is not recommended to use links for key and value at the same time."); + } + return { + key, + value: (customContent === null || customContent === void 0 ? void 0 : customContent.value) || (series.valueFormatter ? series.valueFormatter(datum.y, targetX) : datum.y), + color: color2, + markerType: series.type === "line" ? "line" : "rectangle", + subItems: customContent === null || customContent === void 0 ? void 0 : customContent.subItems, + expandableId: isExpandable ? series.title : void 0 + }; + } + } + } + return null; +} + +// node_modules/@cloudscape-design/components/mixed-line-bar-chart/data-series.js +var import_react158 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/mixed-line-bar-chart/line-series.js +var import_react156 = __toESM(require_react()); +function LineSeries({ axis, series, color: color2, xScale, yScale, chartAreaClipPath }) { + var _a; + const commonProps = { "aria-hidden": true, stroke: color2, clipPath: `url(#${chartAreaClipPath})` }; + if (series.type === "line") { + const lineGenerator = line_default().x((d) => { + let x2 = xScale.d3Scale(d.x) || 0; + if (xScale.isCategorical()) { + const offset = Math.max(0, xScale.d3Scale.bandwidth() - 1) / 2; + x2 += offset; + } + return x2; + }).y((d) => yScale.d3Scale(d.y) || 0); + const visibleData = series.data.filter(({ x: x2 }) => xScale.d3Scale(x2) !== void 0); + return import_react156.default.createElement("path", Object.assign({}, commonProps, { d: lineGenerator(visibleData) || "" })); + } else if (isYThreshold(series)) { + const [x1, x2] = xScale.d3Scale.range(); + const y2 = yScale.d3Scale(series.y); + const coordinates = axis === "x" ? { x1, x2, y1: y2, y2 } : { x1: y2, x2: y2, y1: x1, y2: x2 }; + return import_react156.default.createElement("line", Object.assign({}, commonProps, coordinates)); + } else if (isXThreshold(series)) { + const [y1, y2] = yScale.d3Scale.range(); + const xOffset = xScale.isCategorical() ? Math.max(0, xScale.d3Scale.bandwidth() - 1) / 2 : 0; + const x2 = ((_a = xScale.d3Scale(series.x)) !== null && _a !== void 0 ? _a : NaN) + xOffset; + const coordinates = axis === "x" ? { x1: x2, x2, y1, y2 } : { x1: y1, x2: y2, y1: x2, y2: x2 }; + return import_react156.default.createElement("line", Object.assign({}, commonProps, coordinates)); + } else { + return null; + } +} + +// node_modules/@cloudscape-design/components/mixed-line-bar-chart/bar-series.js +var import_react157 = __toESM(require_react()); +function BarSeries({ axis, series, color: color2, xScale, yScale, highlighted, dimmed, highlightedGroupIndex, stackedBarOffsets, totalSeriesCount, seriesIndex, plotSize, chartAreaClipPath }) { + const isRefresh = useVisualRefresh(); + const xCoordinates = (0, import_react157.useMemo)(() => { + var _a; + if (series.type !== "bar" || !xScale.isCategorical()) { + return []; + } + const yContinuosScale = yScale.d3Scale; + const xPoints = series.data.map(({ x: x2 }) => xScale.d3Scale(x2) || NaN); + const zeroY = (_a = yScale.d3Scale(0)) !== null && _a !== void 0 ? _a : NaN; + const baseY = isFinite(zeroY) ? Math.min(plotSize, zeroY) : plotSize; + let barWidth = xScale.d3Scale.bandwidth(); + const PADDING = 4; + const MINWIDTH = 4; + if (!stackedBarOffsets && totalSeriesCount > 1) { + barWidth = (barWidth - (totalSeriesCount - 1) * PADDING) / totalSeriesCount; + barWidth = Math.max(barWidth, MINWIDTH); + } + return xPoints.map((x2, i) => { + var _a2, _b; + const d = series.data[i]; + let barX = x2; + let yValue = d.y; + if (stackedBarOffsets) { + const offsetMap = d.y < 0 ? stackedBarOffsets.negativeOffsets : stackedBarOffsets.positiveOffsets; + yValue = d.y + (offsetMap.get(getKeyValue(d.x)) || 0); + } else if (totalSeriesCount > 1) { + barX += seriesIndex * (barWidth + PADDING); + } + yValue = yValue < 0 ? yValue - d.y : yValue; + return { + x: barX, + y: (_a2 = yContinuosScale(yValue)) !== null && _a2 !== void 0 ? _a2 : NaN, + width: barWidth, + height: Math.abs(((_b = yContinuosScale(d.y)) !== null && _b !== void 0 ? _b : NaN) - baseY) + }; + }); + }, [series, xScale, yScale, plotSize, stackedBarOffsets, totalSeriesCount, seriesIndex]); + const highlightedXValue = highlightedGroupIndex !== null ? xScale.domain[highlightedGroupIndex] : null; + return import_react157.default.createElement("g", { "aria-label": series.title, clipPath: `url(#${chartAreaClipPath})`, className: clsx_m_default(styles_css_default51.series, styles_css_default51["series--bar"], { + [styles_css_default51["series--highlighted"]]: highlighted, + [styles_css_default51["series--dimmed"]]: dimmed + }) }, xCoordinates.map(({ x: x2, y: y2, width, height }, i) => { + if (!isFinite(x2) || !isFinite(height)) { + return; + } + const baseHeightOffset = stackedBarOffsets ? 3 : 0; + const isSmallBar = height < 4; + const heightOffset = isSmallBar ? 0 : baseHeightOffset; + const widthOffset = 2; + const rx = isRefresh ? isSmallBar ? "2px" : "4px" : "0px"; + const className = clsx_m_default(styles_css_default51.series__rect, { + [styles_css_default51["series--dimmed"]]: highlightedXValue !== null && !matchesX(highlightedXValue, series.data[i].x) + }); + return axis === "x" ? import_react157.default.createElement("rect", { key: `bar-${i}`, fill: color2, x: x2 + widthOffset / 2, y: y2 + heightOffset / 2, width: width - widthOffset, height: height - heightOffset, rx, className }) : import_react157.default.createElement("rect", { key: `bar-${i}`, fill: color2, x: y2 - height + heightOffset / 2, y: x2 + widthOffset / 2, width: height - heightOffset, height: width - widthOffset, rx, className }); + })); +} + +// node_modules/@cloudscape-design/components/mixed-line-bar-chart/data-series.js +var STROKE_WIDTH = 2; +function DataSeries2({ axis, plotHeight, plotWidth, highlightedGroupIndex, highlightedSeries, stackedBars, isGroupNavigation, visibleSeries, xScale, yScale }) { + const chartAreaClipPath = useUniqueId("awsui-mixed-line-bar-chart__chart-area-"); + const lineAreaClipPath = useUniqueId("awsui-line-chart__chart-area-"); + const stackedBarOffsetMaps = (0, import_react158.useMemo)(() => { + if (!stackedBars) { + return []; + } + const barData = []; + visibleSeries.forEach(({ series }) => { + if (series.type === "bar") { + barData.push(series.data); + } + }); + return calculateOffsetMaps(barData); + }, [visibleSeries, stackedBars]); + return import_react158.default.createElement( + import_react158.default.Fragment, + null, + import_react158.default.createElement( + "defs", + { "aria-hidden": "true" }, + import_react158.default.createElement( + "clipPath", + { id: chartAreaClipPath }, + import_react158.default.createElement("rect", { x: 0, y: 0, width: plotWidth, height: plotHeight }) + ), + import_react158.default.createElement( + "clipPath", + { id: lineAreaClipPath }, + import_react158.default.createElement("rect", { x: 0, y: -STROKE_WIDTH / 2, width: plotWidth, height: plotHeight + STROKE_WIDTH }) + ) + ), + import_react158.default.createElement("g", { "aria-hidden": isGroupNavigation ? true : void 0, role: "group" }, visibleSeries.map(({ series, color: color2 }, index) => { + const isHighlighted = series === highlightedSeries; + const isDimmed = !!highlightedSeries && !isHighlighted; + switch (series.type) { + case "line": + case "threshold": { + return import_react158.default.createElement( + "g", + { key: index, role: "group", "aria-label": series.title, className: clsx_m_default(styles_css_default51.series, styles_css_default51[`series--${series.type}`], { + [styles_css_default51["series--highlighted"]]: isHighlighted, + [styles_css_default51["series--dimmed"]]: isDimmed + }) }, + import_react158.default.createElement(LineSeries, { axis, series, color: color2, xScale, yScale, chartAreaClipPath: lineAreaClipPath }) + ); + } + case "bar": + return import_react158.default.createElement(BarSeries, { key: index, axis, series, color: color2, totalSeriesCount: visibleSeries.filter((s2) => s2.series.type === "bar").length, seriesIndex: index, xScale, yScale, plotSize: axis === "y" ? plotWidth : plotHeight, highlighted: isHighlighted, dimmed: isDimmed, chartAreaClipPath, stackedBarOffsets: stackedBarOffsetMaps[index], highlightedGroupIndex }); + } + })) + ); +} + +// node_modules/@cloudscape-design/components/mixed-line-bar-chart/bar-groups.js +var import_react159 = __toESM(require_react()); +var OUTLINE_PADDING = 2; +function BarGroups({ ariaLabel, isRefresh, isPopoverPinned, barGroups, highlightedGroupIndex, highlightedGroupRef }) { + return import_react159.default.createElement("g", { role: "group", "aria-hidden": "true" }, barGroups.map((group, index) => import_react159.default.createElement("rect", { key: index, x: Math.max(0, group.position.x - OUTLINE_PADDING), y: Math.max(0, group.position.y - OUTLINE_PADDING), width: group.position.width + 2 * OUTLINE_PADDING, height: group.position.height + 2 * OUTLINE_PADDING, ref: index === highlightedGroupIndex ? highlightedGroupRef : void 0, rx: isRefresh ? 4 : 2, role: "button", "aria-label": ariaLabel, "aria-haspopup": true, "aria-expanded": isPopoverPinned, fill: "none", className: styles_css_default51["bar-group"] }))); +} + +// node_modules/@cloudscape-design/components/mixed-line-bar-chart/hooks/use-mouse-hover.js +var MAX_HOVER_MARGIN2 = 6; +var POPOVER_DEADZONE2 = 12; +function useMouseHover({ plotRef, popoverRef, scaledSeries, barGroups, highlightPoint, highlightGroup, clearHighlightedSeries, isGroupNavigation, isHandlersDisabled, highlightX }) { + const isMouseOverPopover = (event) => { + var _a; + if ((_a = popoverRef.current) === null || _a === void 0 ? void 0 : _a.firstChild) { + const popoverPosition = popoverRef.current.firstChild.getBoundingClientRect(); + if (event.clientX > popoverPosition.x - POPOVER_DEADZONE2 && event.clientX < popoverPosition.x + popoverPosition.width + POPOVER_DEADZONE2 && event.clientY > popoverPosition.y - POPOVER_DEADZONE2 && event.clientY < popoverPosition.y + popoverPosition.height + POPOVER_DEADZONE2) { + return true; + } + } + return false; + }; + const onSeriesMouseMove = (event) => { + var _a, _b; + const svgRect = event.target.getBoundingClientRect(); + const offsetX = event.clientX - svgRect.left; + const closestX = scaledSeries.map((v) => v.x).reduce((prev, curr) => Math.abs(curr - offsetX) < Math.abs(prev - offsetX) ? curr : prev, -Infinity); + if (isFinite(closestX)) { + const offsetY = event.clientY - svgRect.top; + const closestY = scaledSeries.filter((v) => v.x === closestX || isYThreshold(v.series)).map((v) => v.y).reduce((prev, curr) => Math.abs(curr - offsetY) < Math.abs(prev - offsetY) ? curr : prev, -Infinity); + if (isFinite(closestY) && Math.abs(offsetX - closestX) < MAX_HOVER_MARGIN2 && Math.abs(offsetY - closestY) < MAX_HOVER_MARGIN2) { + const [{ color: color2, datum, series }] = scaledSeries.filter((s2) => (s2.x === closestX || isYThreshold(s2.series)) && s2.y === closestY); + highlightPoint({ x: closestX, y: closestY, color: color2, datum, series }); + } else { + let datumX = null; + for (const point5 of scaledSeries) { + if (point5.x === closestX) { + datumX = (_b = (_a = point5.datum) === null || _a === void 0 ? void 0 : _a.x) !== null && _b !== void 0 ? _b : null; + break; + } + } + highlightX({ scaledX: closestX, label: datumX }); + } + } + }; + const onGroupMouseMove = (event) => { + const svgRect = event.target.getBoundingClientRect(); + const offsetX = event.clientX - svgRect.left; + const offsetY = event.clientY - svgRect.top; + for (let groupIndex = 0; groupIndex < barGroups.length; groupIndex++) { + const { position: { x: x2, y: y2, width, height } } = barGroups[groupIndex]; + if (x2 <= offsetX && offsetX <= x2 + width && y2 <= offsetY && offsetY <= y2 + height) { + highlightGroup(groupIndex); + return; + } + } + clearHighlightedSeries(); + }; + const onSVGMouseMove = (event) => { + if (event.target === plotRef.current.svg && !isHandlersDisabled && !isMouseOverPopover(event)) { + if (isGroupNavigation) { + onGroupMouseMove(event); + } else if (scaledSeries.length > 0) { + onSeriesMouseMove(event); + } + } + }; + const onSVGMouseOut = (event) => { + if (isHandlersDisabled || isMouseOverPopover(event)) { + return; + } + if (!nodeContains(plotRef.current.svg, event.relatedTarget) || event.relatedTarget && event.relatedTarget.classList.contains(styles_css_default51.series)) { + highlightX(null); + clearHighlightedSeries(); + } + }; + const onPopoverLeave = (event) => { + if (!isHandlersDisabled && nodeContains(plotRef.current.svg, event.relatedTarget)) { + highlightX(null); + clearHighlightedSeries(); + } + }; + return { onSVGMouseMove, onSVGMouseOut, onPopoverLeave }; +} + +// node_modules/@cloudscape-design/components/mixed-line-bar-chart/hooks/use-navigation.js +var import_react160 = __toESM(require_react()); +function useNavigation({ series, visibleSeries, scaledSeries, barGroups, xScale, yScale, highlightedPoint, highlightedGroupIndex, highlightedSeries, isHandlersDisabled, pinPopover, highlightSeries, highlightGroup, highlightPoint, highlightX, verticalMarkerX }) { + const [targetX, setTargetX] = (0, import_react160.useState)(null); + const [xIndex, setXIndex] = (0, import_react160.useState)(0); + const isGroupNavigation = (0, import_react160.useMemo)(() => visibleSeries.some(({ series: series2 }) => series2.type === "bar"), [visibleSeries]); + const { navigableSeries } = (0, import_react160.useMemo)(() => findNavigableSeries(visibleSeries), [visibleSeries]); + const containsMultipleSeries = navigableSeries.length > 1; + const onBarGroupFocus = () => { + const groupIndex = highlightedGroupIndex !== null && highlightedGroupIndex !== void 0 ? highlightedGroupIndex : 0; + setTargetX(xScale.domain[groupIndex]); + highlightGroup(groupIndex); + }; + const onLineFocus = () => { + if (verticalMarkerX === null) { + if (containsMultipleSeries) { + moveToLineGroupIndex(0); + } else { + moveBetweenSeries(0); + } + } + }; + const onFocus = () => { + if (isGroupNavigation) { + onBarGroupFocus(); + } else { + onLineFocus(); + } + }; + const allUniqueX = (0, import_react160.useMemo)(() => { + const result = []; + for (let i = 0; i < scaledSeries.length; i += 1) { + const point5 = scaledSeries[i]; + if (point5 !== void 0 && (!result.length || result[result.length - 1].scaledX !== point5.x)) { + result.push({ scaledX: point5.x, datum: point5.datum }); + } + } + return result; + }, [scaledSeries]); + const moveBetweenSeries = (0, import_react160.useCallback)((direction) => { + var _a, _b, _c, _d; + if (isGroupNavigation) { + return; + } + const xOffset = xScale.isCategorical() ? Math.max(0, xScale.d3Scale.bandwidth() - 1) / 2 : 0; + const MAX_SERIES_INDEX = navigableSeries.length - 1; + let previousSeriesIndex = -1; + if (highlightedSeries) { + previousSeriesIndex = navigableSeries.indexOf(highlightedSeries); + } + const firstPossibleIndex = containsMultipleSeries ? -1 : 0; + let nextSeriesIndex = 0; + if (previousSeriesIndex !== null) { + nextSeriesIndex = previousSeriesIndex + direction; + if (nextSeriesIndex > MAX_SERIES_INDEX) { + nextSeriesIndex = firstPossibleIndex; + } else if (nextSeriesIndex < firstPossibleIndex) { + nextSeriesIndex = MAX_SERIES_INDEX; + } + } + if (nextSeriesIndex === -1) { + highlightSeries(null); + highlightPoint(null); + return; + } + const nextSeries = navigableSeries[nextSeriesIndex]; + const nextInternalSeries = series.filter(({ series: series2 }) => series2 === nextSeries)[0]; + let targetXPoint = ((_a = xScale.d3Scale(targetX)) !== null && _a !== void 0 ? _a : NaN) + xOffset; + if (!isFinite(targetXPoint)) { + targetXPoint = 0; + } + if (nextSeries.type === "line") { + const nextScaledSeries = scaledSeries.filter((it) => it.series === nextSeries); + const closestNextSeriesPoint = nextScaledSeries.reduce((prev, curr) => Math.abs(curr.x - targetXPoint) < Math.abs(prev.x - targetXPoint) ? curr : prev, { x: -Infinity, y: -Infinity }); + highlightPoint(Object.assign(Object.assign({}, closestNextSeriesPoint), { color: nextInternalSeries.color, series: nextSeries })); + } else if (isYThreshold(nextSeries)) { + const scaledTargetIndex = scaledSeries.map((it) => { + var _a2; + return ((_a2 = it.datum) === null || _a2 === void 0 ? void 0 : _a2.x) || null; + }).indexOf(targetX); + highlightPoint({ + x: targetXPoint, + y: (_b = yScale.d3Scale(nextSeries.y)) !== null && _b !== void 0 ? _b : NaN, + color: nextInternalSeries.color, + series: nextSeries, + datum: (_c = scaledSeries[scaledTargetIndex]) === null || _c === void 0 ? void 0 : _c.datum + }); + } else if (isXThreshold(nextSeries)) { + highlightPoint({ + x: (_d = xScale.d3Scale(nextSeries.x)) !== null && _d !== void 0 ? _d : NaN, + y: yScale.d3Scale.range()[0], + color: nextInternalSeries.color, + series: nextSeries, + datum: { x: nextSeries.x, y: NaN } + }); + } + }, [ + isGroupNavigation, + xScale, + navigableSeries, + highlightedSeries, + containsMultipleSeries, + highlightSeries, + highlightPoint, + series, + targetX, + scaledSeries, + yScale + ]); + const moveWithinSeries = (0, import_react160.useCallback)((direction) => { + var _a; + const series2 = highlightedSeries || visibleSeries[0].series; + if (series2.type === "line" || isYThreshold(series2)) { + const targetScaledSeries = scaledSeries.filter((it) => it.series === series2); + const previousPoint = highlightedPoint || targetScaledSeries[0]; + const indexOfPreviousPoint = targetScaledSeries.map((it) => it.x).indexOf(previousPoint.x); + const nextPointIndex = circleIndex2(indexOfPreviousPoint + direction, [0, targetScaledSeries.length - 1]); + const nextPoint = targetScaledSeries[nextPointIndex]; + setTargetX(((_a = nextPoint.datum) === null || _a === void 0 ? void 0 : _a.x) || null); + setXIndex(nextPointIndex); + highlightPoint(nextPoint); + } else if (series2.type === "bar") { + const xDomain = xScale.domain; + const MAX_GROUP_INDEX = xDomain.length - 1; + let nextGroupIndex = 0; + if (highlightedGroupIndex !== null) { + nextGroupIndex = highlightedGroupIndex + direction; + if (nextGroupIndex > MAX_GROUP_INDEX) { + nextGroupIndex = 0; + } else if (nextGroupIndex < 0) { + nextGroupIndex = MAX_GROUP_INDEX; + } + } + const nextDomainIndex = nextValidDomainIndex(nextGroupIndex, barGroups, direction); + setTargetX(xDomain[nextDomainIndex]); + highlightGroup(nextDomainIndex); + } + }, [ + highlightedSeries, + visibleSeries, + scaledSeries, + highlightedPoint, + highlightPoint, + xScale.domain, + highlightedGroupIndex, + barGroups, + highlightGroup + ]); + const moveToLineGroupIndex = (0, import_react160.useCallback)((index) => { + var _a, _b, _c, _d; + const point5 = allUniqueX[index]; + setXIndex(index); + setTargetX(((_a = point5.datum) === null || _a === void 0 ? void 0 : _a.x) || null); + highlightX({ scaledX: (_b = point5 === null || point5 === void 0 ? void 0 : point5.scaledX) !== null && _b !== void 0 ? _b : null, label: (_d = (_c = point5.datum) === null || _c === void 0 ? void 0 : _c.x) !== null && _d !== void 0 ? _d : null }); + }, [allUniqueX, highlightX]); + const moveWithinXAxis = (0, import_react160.useCallback)((direction) => { + if (highlightedSeries || isGroupNavigation) { + moveWithinSeries(direction); + } else { + const nextPointGroupIndex = circleIndex2(xIndex + direction, [0, allUniqueX.length - 1]); + moveToLineGroupIndex(nextPointGroupIndex); + } + }, [highlightedSeries, isGroupNavigation, moveWithinSeries, xIndex, allUniqueX.length, moveToLineGroupIndex]); + const onKeyDown = (0, import_react160.useCallback)((event) => { + const keyCode = event.keyCode; + if (keyCode !== KeyCode.up && keyCode !== KeyCode.right && keyCode !== KeyCode.down && keyCode !== KeyCode.left && keyCode !== KeyCode.space && keyCode !== KeyCode.enter) { + return; + } + event.preventDefault(); + if (isHandlersDisabled) { + return; + } + if (keyCode === KeyCode.down || keyCode === KeyCode.up) { + moveBetweenSeries(keyCode === KeyCode.down ? 1 : -1); + } else if (keyCode === KeyCode.left || keyCode === KeyCode.right) { + moveWithinXAxis(keyCode === KeyCode.right ? 1 : -1); + } else if (keyCode === KeyCode.enter || keyCode === KeyCode.space) { + pinPopover(); + } + }, [isHandlersDisabled, moveBetweenSeries, moveWithinXAxis, pinPopover]); + return { isGroupNavigation, onFocus, onKeyDown, xIndex }; +} +function circleIndex2(index, [from, to]) { + if (index < from) { + return to; + } + if (index > to) { + return from; + } + return index; +} + +// node_modules/@cloudscape-design/components/mixed-line-bar-chart/hooks/use-popover.js +var import_react161 = __toESM(require_react()); +function usePopover() { + const [state, setState] = (0, import_react161.useState)("closed"); + const isPopoverOpen = state !== "closed"; + const isPopoverPinned = state === "pinned"; + const showPopover = (0, import_react161.useCallback)(() => setState("open"), []); + const pinPopover = (0, import_react161.useCallback)(() => setState("pinned"), []); + const dismissPopover = (0, import_react161.useCallback)(() => setState("closed"), []); + return { isPopoverOpen, isPopoverPinned, showPopover, pinPopover, dismissPopover }; +} + +// node_modules/@cloudscape-design/components/mixed-line-bar-chart/chart-container.js +var LEFT_LABELS_MARGIN2 = 16; +var BOTTOM_LABELS_OFFSET2 = 12; +var fallbackContainerWidth = 500; +function ChartContainer2(_a) { + var _b, _c; + var { fitHeight, height: explicitPlotHeight, series, visibleSeries, highlightedSeries, onHighlightChange, highlightedPoint, setHighlightedPoint, highlightedGroupIndex, setHighlightedGroupIndex, detailPopoverFooter, detailPopoverSize = "medium", stackedBars = false, horizontalBars = false, xScaleType, yScaleType, xTickFormatter, yTickFormatter, emphasizeBaselineAxis, xTitle, yTitle, ariaLabel, ariaLabelledby, ariaDescription, i18nStrings = {}, detailPopoverSeriesContent } = _a, props2 = __rest(_a, ["fitHeight", "height", "series", "visibleSeries", "highlightedSeries", "onHighlightChange", "highlightedPoint", "setHighlightedPoint", "highlightedGroupIndex", "setHighlightedGroupIndex", "detailPopoverFooter", "detailPopoverSize", "stackedBars", "horizontalBars", "xScaleType", "yScaleType", "xTickFormatter", "yTickFormatter", "emphasizeBaselineAxis", "xTitle", "yTitle", "ariaLabel", "ariaLabelledby", "ariaDescription", "i18nStrings", "detailPopoverSeriesContent"]); + const plotRef = (0, import_react162.useRef)(null); + const verticalMarkerRef = (0, import_react162.useRef)(null); + const [leftLabelsWidth, setLeftLabelsWidth] = (0, import_react162.useState)(0); + const [verticalMarkerX, setVerticalMarkerX] = (0, import_react162.useState)(null); + const [detailsPopoverText, setDetailsPopoverText] = (0, import_react162.useState)(""); + const [containerWidth, containerMeasureRef] = useContainerWidth(fallbackContainerWidth); + const maxLeftLabelsWidth = Math.round(containerWidth / 2); + const plotWidth = containerWidth ? ( + // Calculate the minimum between leftLabelsWidth and maxLeftLabelsWidth for extra safety because leftLabelsWidth could be out of date + Math.max(0, containerWidth - Math.min(leftLabelsWidth, maxLeftLabelsWidth) - LEFT_LABELS_MARGIN2) + ) : fallbackContainerWidth; + const containerRefObject = (0, import_react162.useRef)(null); + const containerRef = useMergeRefs(containerMeasureRef, containerRefObject); + const popoverRef = (0, import_react162.useRef)(null); + const xDomain = props2.xDomain || computeDomainX2(series, xScaleType); + const yDomain = props2.yDomain || computeDomainY2(series, yScaleType, stackedBars); + const linesOnly = series.every(({ series: series2 }) => series2.type === "line" || series2.type === "threshold"); + function getXAxisProps(size, range2) { + const tickCount = getXTickCount(size); + const scale = new ChartScale(xScaleType, xDomain, range2, linesOnly); + const ticks2 = createXTicks(scale, tickCount); + return { + axis: "x", + tickCount, + scale, + ticks: ticks2, + tickFormatter: xTickFormatter, + title: xTitle, + ariaRoleDescription: i18nStrings.xAxisAriaRoleDescription + }; + } + function getYAxisProps(size, range2) { + const tickCount = getYTickCount(size); + const scale = new NumericChartScale(yScaleType, yDomain, range2, props2.yDomain ? null : tickCount); + const ticks2 = createYTicks(scale, tickCount); + return { + axis: "y", + tickCount, + scale, + ticks: ticks2, + tickFormatter: yTickFormatter, + title: yTitle, + ariaRoleDescription: i18nStrings.yAxisAriaRoleDescription + }; + } + const bottomAxisProps = !horizontalBars ? getXAxisProps(plotWidth, [0, plotWidth]) : getYAxisProps(plotWidth, [0, plotWidth]); + const bottomLabelsProps = useBottomLabels(Object.assign({}, bottomAxisProps)); + const plotMeasureRef = (0, import_react162.useRef)(null); + const measuredHeight = useHeightMeasure(() => plotMeasureRef.current, !fitHeight); + const plotHeight = fitHeight ? measuredHeight !== null && measuredHeight !== void 0 ? measuredHeight : 0 : explicitPlotHeight; + const leftAxisProps = !horizontalBars ? getYAxisProps(plotHeight, [plotHeight, 0]) : getXAxisProps(plotHeight, [0, plotHeight]); + const xAxisProps = bottomAxisProps.axis === "x" ? bottomAxisProps : leftAxisProps.axis === "x" ? leftAxisProps : null; + const yAxisProps = bottomAxisProps.axis === "y" ? bottomAxisProps : leftAxisProps.axis === "y" ? leftAxisProps : null; + if (!xAxisProps || !yAxisProps) { + throw new Error("Invariant violation: invalid axis props."); + } + const highlightedPointRef = (0, import_react162.useRef)(null); + const highlightedGroupRef = (0, import_react162.useRef)(null); + const x2 = !horizontalBars ? "x" : "y"; + const y2 = !horizontalBars ? "y" : "x"; + const scaledSeries = makeScaledSeries(visibleSeries, xAxisProps.scale, yAxisProps.scale); + const barGroups = makeScaledBarGroups(visibleSeries, xAxisProps.scale, plotWidth, plotHeight, y2); + const { isPopoverOpen, isPopoverPinned, showPopover, pinPopover, dismissPopover } = usePopover(); + const [isHandlersDisabled, setHandlersDisabled] = (0, import_react162.useState)(!isPopoverPinned); + (0, import_react162.useEffect)(() => { + if (isPopoverPinned) { + setHandlersDisabled(true); + } else { + const timeoutId = setTimeout(() => setHandlersDisabled(false), 25); + return () => clearTimeout(timeoutId); + } + }, [isPopoverPinned]); + const highlightSeries = (0, import_react162.useCallback)((series2) => { + if (series2 !== highlightedSeries) { + onHighlightChange(series2); + } + }, [highlightedSeries, onHighlightChange]); + const highlightPoint = (0, import_react162.useCallback)((point6) => { + var _a2, _b2; + setHighlightedGroupIndex(null); + setHighlightedPoint(point6); + if (point6) { + highlightSeries(point6.series); + setVerticalMarkerX({ + scaledX: point6.x, + label: (_b2 = (_a2 = point6.datum) === null || _a2 === void 0 ? void 0 : _a2.x) !== null && _b2 !== void 0 ? _b2 : null + }); + } + }, [setHighlightedGroupIndex, setHighlightedPoint, highlightSeries]); + const clearAllHighlights = (0, import_react162.useCallback)(() => { + setHighlightedPoint(null); + highlightSeries(null); + setHighlightedGroupIndex(null); + }, [highlightSeries, setHighlightedGroupIndex, setHighlightedPoint]); + const highlightX = (0, import_react162.useCallback)((marker) => { + if (marker) { + clearAllHighlights(); + } + setVerticalMarkerX(marker); + }, [clearAllHighlights]); + const highlightGroup = (0, import_react162.useCallback)((groupIndex) => { + highlightSeries(null); + setHighlightedPoint(null); + setHighlightedGroupIndex(groupIndex); + }, [highlightSeries, setHighlightedPoint, setHighlightedGroupIndex]); + const clearHighlightedSeries = (0, import_react162.useCallback)(() => { + clearAllHighlights(); + dismissPopover(); + }, [dismissPopover, clearAllHighlights]); + const _d = useNavigation({ + series, + visibleSeries, + scaledSeries, + barGroups, + xScale: xAxisProps.scale, + yScale: yAxisProps.scale, + highlightedPoint, + highlightedGroupIndex, + highlightedSeries, + isHandlersDisabled, + pinPopover, + highlightSeries, + highlightGroup, + highlightPoint, + highlightX, + clearHighlightedSeries, + verticalMarkerX + }), { isGroupNavigation } = _d, handlers = __rest(_d, ["isGroupNavigation"]); + const { onSVGMouseMove, onSVGMouseOut, onPopoverLeave } = useMouseHover({ + scaledSeries, + barGroups, + plotRef, + popoverRef, + highlightPoint, + highlightGroup, + clearHighlightedSeries, + isGroupNavigation, + isHandlersDisabled, + highlightX + }); + const highlightedX = (0, import_react162.useMemo)(() => { + var _a2, _b2; + if (highlightedGroupIndex !== null) { + return barGroups[highlightedGroupIndex].x; + } + if (verticalMarkerX !== null) { + return verticalMarkerX.label; + } + return (_b2 = (_a2 = highlightedPoint === null || highlightedPoint === void 0 ? void 0 : highlightedPoint.datum) === null || _a2 === void 0 ? void 0 : _a2.x) !== null && _b2 !== void 0 ? _b2 : null; + }, [highlightedPoint, verticalMarkerX, highlightedGroupIndex, barGroups]); + (0, import_react162.useEffect)(() => { + const onKeyDown = (event) => { + if (event.key === "Escape") { + dismissPopover(); + } + }; + document.addEventListener("keydown", onKeyDown); + return () => document.removeEventListener("keydown", onKeyDown); + }, [dismissPopover]); + (0, import_react162.useLayoutEffect)(() => { + if (highlightedX !== null || highlightedPoint !== null) { + showPopover(); + } + }, [highlightedX, highlightedPoint, showPopover]); + const onPopoverDismiss = (outsideClick) => { + dismissPopover(); + if (!outsideClick) { + setTimeout(() => { + var _a2, _b2; + const isSomeElementHighlighted = !!(highlightedPoint || highlightedGroupIndex !== null || verticalMarkerX); + if (isSomeElementHighlighted) { + (_a2 = plotRef.current) === null || _a2 === void 0 ? void 0 : _a2.focusApplication(); + } else { + (_b2 = plotRef.current) === null || _b2 === void 0 ? void 0 : _b2.focusPlot(); + } + }, 0); + } else { + clearAllHighlights(); + setVerticalMarkerX(null); + } + }; + const onSVGClick = (e) => { + if (isPopoverOpen) { + if (isPopoverPinned) { + dismissPopover(); + } else { + pinPopover(); + e.preventDefault(); + } + } else { + showPopover(); + } + }; + const onApplicationFocus = (event, trigger) => { + if (trigger === "keyboard") { + handlers.onFocus(); + } else { + } + }; + const onApplicationBlur = (event) => { + const blurTarget = event.relatedTarget || event.target; + if (blurTarget === null || !(blurTarget instanceof Element) || !nodeBelongs(containerRefObject.current, blurTarget)) { + clearHighlightedSeries(); + setVerticalMarkerX(null); + if (isPopoverOpen && !isPopoverPinned) { + dismissPopover(); + } + } + }; + const onSVGKeyDown = handlers.onKeyDown; + const xOffset = xAxisProps.scale.isCategorical() ? Math.max(0, xAxisProps.scale.d3Scale.bandwidth() - 1) / 2 : 0; + let verticalLineX = null; + if (verticalMarkerX !== null) { + verticalLineX = verticalMarkerX.scaledX; + } else if (isGroupNavigation && highlightedGroupIndex !== null) { + const x3 = (_b = xAxisProps.scale.d3Scale(barGroups[highlightedGroupIndex].x)) !== null && _b !== void 0 ? _b : null; + if (x3 !== null) { + verticalLineX = xOffset + x3; + } + } + const point5 = (0, import_react162.useMemo)(() => highlightedPoint ? { + key: `${highlightedPoint.x}-${highlightedPoint.y}`, + x: highlightedPoint.x, + y: highlightedPoint.y, + color: highlightedPoint.color + } : null, [highlightedPoint]); + const verticalMarkers = (0, import_react162.useMemo)(() => verticalLineX !== null ? scaledSeries.filter(({ x: x3, y: y3 }) => (x3 === verticalLineX || isNaN(x3)) && !isNaN(y3)).map(({ x: x3, y: y3, color: color2 }, index) => ({ + key: `${index}-${x3}-${y3}`, + x: !horizontalBars ? verticalLineX || 0 : y3, + y: !horizontalBars ? y3 : verticalLineX || 0, + color: color2 + })) : [], [scaledSeries, verticalLineX, horizontalBars]); + const highlightedElementRef = isGroupNavigation ? highlightedGroupRef : highlightedPoint ? highlightedPointRef : verticalMarkerRef; + const highlightDetails = (0, import_react162.useMemo)(() => { + if (highlightedX === null) { + return null; + } + if (highlightedPoint) { + const seriesToShow = visibleSeries.filter((series2) => series2.series === (highlightedPoint === null || highlightedPoint === void 0 ? void 0 : highlightedPoint.series) || isXThreshold(series2.series)); + return formatHighlighted({ + position: highlightedX, + series: seriesToShow, + xTickFormatter, + detailPopoverSeriesContent + }); + } + return formatHighlighted({ + position: highlightedX, + series: visibleSeries, + xTickFormatter, + detailPopoverSeriesContent + }); + }, [highlightedX, highlightedPoint, visibleSeries, xTickFormatter, detailPopoverSeriesContent]); + const detailPopoverFooterContent = (0, import_react162.useMemo)(() => detailPopoverFooter && highlightedX ? detailPopoverFooter(highlightedX) : null, [detailPopoverFooter, highlightedX]); + const activeAriaLabel = highlightDetails && detailsPopoverText ? `${highlightDetails.position}, ${detailsPopoverText}` : ""; + const activeLiveRegion = activeAriaLabel && !highlightedPoint && highlightedGroupIndex === null ? activeAriaLabel : ""; + const isLineXKeyboardFocused = !highlightedPoint && verticalMarkerX; + const isRefresh = useVisualRefresh(); + return import_react162.default.createElement(CartesianChartContainer, { ref: containerRef, minHeight: explicitPlotHeight + bottomLabelsProps.height, fitHeight: !!fitHeight, leftAxisLabel: import_react162.default.createElement(axis_label_default, { axis: y2, position: "left", title: leftAxisProps.title }), leftAxisLabelMeasure: import_react162.default.createElement(labels_measure_default, { ticks: leftAxisProps.ticks, scale: leftAxisProps.scale, tickFormatter: leftAxisProps.tickFormatter, autoWidth: setLeftLabelsWidth, maxLabelsWidth: maxLeftLabelsWidth }), bottomAxisLabel: import_react162.default.createElement(axis_label_default, { axis: x2, position: "bottom", title: bottomAxisProps.title }), chartPlot: import_react162.default.createElement( + chart_plot_default, + { ref: plotRef, width: "100%", height: fitHeight ? `calc(100% - ${bottomLabelsProps.height}px)` : plotHeight, offsetBottom: bottomLabelsProps.height, isClickable: isPopoverOpen && !isPopoverPinned, ariaLabel, ariaLabelledby, ariaDescription, ariaRoleDescription: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.chartAriaRoleDescription, ariaLiveRegion: activeLiveRegion, activeElementRef: highlightedElementRef, activeElementKey: (_c = highlightedGroupIndex === null || highlightedGroupIndex === void 0 ? void 0 : highlightedGroupIndex.toString()) !== null && _c !== void 0 ? _c : isLineXKeyboardFocused ? `point-index-${handlers.xIndex}` : point5 === null || point5 === void 0 ? void 0 : point5.key, activeElementFocusOffset: isGroupNavigation ? 0 : isLineXKeyboardFocused ? { x: 8, y: 0 } : 3, onMouseMove: onSVGMouseMove, onMouseOut: onSVGMouseOut, onClick: onSVGClick, onApplicationFocus, onApplicationBlur, onKeyDown: onSVGKeyDown }, + import_react162.default.createElement("line", { ref: plotMeasureRef, x1: "0", x2: "0", y1: "0", y2: "100%", stroke: "transparent", strokeWidth: 1, style: { pointerEvents: "none" } }), + import_react162.default.createElement(left_labels_default, { axis: y2, ticks: leftAxisProps.ticks, scale: leftAxisProps.scale, tickFormatter: leftAxisProps.tickFormatter, title: leftAxisProps.title, ariaRoleDescription: leftAxisProps.ariaRoleDescription, maxLabelsWidth: maxLeftLabelsWidth, plotWidth, plotHeight }), + horizontalBars && import_react162.default.createElement(vertical_grid_lines_default, { scale: yAxisProps.scale, ticks: yAxisProps.ticks, height: plotHeight }), + emphasizeBaselineAxis && linesOnly && import_react162.default.createElement(emphasized_baseline_default, { axis: x2, scale: yAxisProps.scale, width: plotWidth, height: plotHeight }), + import_react162.default.createElement(DataSeries2, { axis: x2, plotWidth, plotHeight, highlightedSeries: highlightedSeries !== null && highlightedSeries !== void 0 ? highlightedSeries : null, highlightedGroupIndex, stackedBars, isGroupNavigation, visibleSeries, xScale: xAxisProps.scale, yScale: yAxisProps.scale }), + emphasizeBaselineAxis && !linesOnly && import_react162.default.createElement(emphasized_baseline_default, { axis: x2, scale: yAxisProps.scale, width: plotWidth, height: plotHeight }), + import_react162.default.createElement(vertical_marker_default, { key: verticalLineX || "", height: plotHeight, showPoints: highlightedPoint === null, showLine: !isGroupNavigation, points: verticalMarkers, ref: verticalMarkerRef }), + highlightedPoint && import_react162.default.createElement(highlighted_point_default, { ref: highlightedPointRef, point: point5, role: "button", ariaLabel: activeAriaLabel, ariaHasPopup: true, ariaExpanded: isPopoverPinned }), + isGroupNavigation && xAxisProps.scale.isCategorical() && import_react162.default.createElement(BarGroups, { ariaLabel: activeAriaLabel, isRefresh, isPopoverPinned, barGroups, highlightedGroupIndex, highlightedGroupRef }), + import_react162.default.createElement(bottom_labels_default, Object.assign({}, bottomLabelsProps, { axis: x2, scale: bottomAxisProps.scale, title: bottomAxisProps.title, ariaRoleDescription: bottomAxisProps.ariaRoleDescription, height: plotHeight, width: plotWidth, offsetLeft: leftLabelsWidth + BOTTOM_LABELS_OFFSET2, offsetRight: BOTTOM_LABELS_OFFSET2 })) + ), popover: import_react162.default.createElement(chart_popover_default2, { ref: popoverRef, containerRef: containerRefObject, trackRef: highlightedElementRef, isOpen: isPopoverOpen, isPinned: isPopoverPinned, highlightDetails, onDismiss: onPopoverDismiss, size: detailPopoverSize, footer: detailPopoverFooterContent, dismissAriaLabel: i18nStrings.detailPopoverDismissAriaLabel, onMouseLeave: onPopoverLeave, onBlur: onApplicationBlur, setPopoverText: setDetailsPopoverText }) }); +} + +// node_modules/@cloudscape-design/components/mixed-line-bar-chart/internal.js +function InternalMixedLineBarChart(_a) { + var { fitHeight, height, xScaleType, yScaleType, xDomain, yDomain, xTickFormatter, yTickFormatter, highlightedSeries: controlledHighlightedSeries, visibleSeries: controlledVisibleSeries, series: externalSeries, onFilterChange, onHighlightChange: controlledOnHighlightChange, i18nStrings, ariaLabel, ariaLabelledby, ariaDescription, xTitle, yTitle, stackedBars, horizontalBars, hideFilter, additionalFilters, hideLegend, legendTitle, statusType, detailPopoverSize, detailPopoverFooter, detailPopoverSeriesContent, emphasizeBaselineAxis, empty, noMatch, errorText, loadingText, recoveryText, onRecoveryClick, __internalRootRef = null } = _a, props2 = __rest(_a, ["fitHeight", "height", "xScaleType", "yScaleType", "xDomain", "yDomain", "xTickFormatter", "yTickFormatter", "highlightedSeries", "visibleSeries", "series", "onFilterChange", "onHighlightChange", "i18nStrings", "ariaLabel", "ariaLabelledby", "ariaDescription", "xTitle", "yTitle", "stackedBars", "horizontalBars", "hideFilter", "additionalFilters", "hideLegend", "legendTitle", "statusType", "detailPopoverSize", "detailPopoverFooter", "detailPopoverSeriesContent", "emphasizeBaselineAxis", "empty", "noMatch", "errorText", "loadingText", "recoveryText", "onRecoveryClick", "__internalRootRef"]); + const baseProps = getBaseProps(props2); + const containerRef = (0, import_react163.useRef)(null); + (0, import_react163.useEffect)(() => { + const gotBarSeries = externalSeries.some((s2) => s2.type === "bar"); + const gotLineSeries = externalSeries.some((s2) => s2.type === "line"); + if (xScaleType !== "categorical" && gotBarSeries) { + warnOnce("MixedLineBarChart", `Bar series cannot be used with a ${xScaleType} scale. Use a categorical x axis instead.`); + } + if (horizontalBars && gotLineSeries) { + warnOnce("MixedLineBarChart", `Property horizontalBars can only be used with charts that contain only bar or threshold series.`); + } + for (const s2 of externalSeries) { + if (s2.type === "threshold" && s2.x !== void 0 && s2.y !== void 0) { + warnOnce("MixedLineBarChart", `Series of type "threshold" must contain either x or y property.`); + } + if (s2.type === "threshold" && s2.x === void 0 && s2.y === void 0) { + warnOnce("MixedLineBarChart", `Series of type "threshold" must contain either x or y property.`); + } + } + }, [xScaleType, horizontalBars, externalSeries]); + const series = (0, import_react163.useMemo)(() => { + const colors = createCategoryColorScale(externalSeries, (it) => isYThreshold(it) || isXThreshold(it), (it) => it.color || null); + return externalSeries.map((s2, i) => ({ index: i, color: colors[i], series: s2 })); + }, [externalSeries]); + const [highlightedPoint, setHighlightedPoint] = (0, import_react163.useState)(null); + const [highlightedGroupIndex, setHighlightedGroupIndex] = (0, import_react163.useState)(null); + const [highlightedSeries = null, setHighlightedSeries] = useControllable(controlledHighlightedSeries, controlledOnHighlightChange, null, { + componentName: "MixedLineBarChart", + controlledProp: "highlightedSeries", + changeHandler: "onHighlightChange" + }); + const [legendSeries, setLegendSeries] = (0, import_react163.useState)(highlightedSeries); + (0, import_react163.useEffect)(() => { + setLegendSeries(controlledHighlightedSeries || null); + }, [controlledHighlightedSeries]); + const [externalVisibleSeries, setExternalVisibleSeries] = useControllable(controlledVisibleSeries, onFilterChange, externalSeries, { + componentName: "MixedLineBarChart", + controlledProp: "visibleSeries", + changeHandler: "onFilterChange" + }); + if (isDevelopment) { + const previousSeries = usePrevious(externalSeries); + const hasPrevious = !!(previousSeries && previousSeries.length); + const hasCurrent = !!externalSeries.length; + if (hasPrevious && hasCurrent && externalSeries !== previousSeries && !controlledVisibleSeries && !hideFilter) { + warnOnce("MixedLineBarChart", "The `series` value passed into the component changed. This may cause problems with filtering - we recommend that you make the `series` value constant, or provide a `visibleSeries` value that derives from the current `series` value."); + } + } + const visibleSeries = (0, import_react163.useMemo)(() => series.filter((s2) => (externalVisibleSeries === null || externalVisibleSeries === void 0 ? void 0 : externalVisibleSeries.indexOf(s2.series)) !== -1), [series, externalVisibleSeries]); + const filterChange = (selectedSeries) => { + setExternalVisibleSeries(selectedSeries); + fireNonCancelableEvent(onFilterChange, { + visibleSeries: selectedSeries + }); + }; + const onHighlightChange = (series2) => { + setHighlightedSeries(series2); + fireNonCancelableEvent(controlledOnHighlightChange, { + highlightedSeries: series2 + }); + setLegendSeries(series2); + }; + const onBlur = (event) => { + if (event.relatedTarget && !nodeBelongs(containerRef.current, event.relatedTarget)) { + highlightedSeries && onHighlightChange(highlightedSeries); + setHighlightedPoint(null); + setHighlightedGroupIndex(null); + setLegendSeries(null); + } + }; + const { isEmpty, isNoMatch, showChart } = getChartStatus({ + externalData: externalSeries, + visibleData: visibleSeries || [], + statusType + }); + const showFilters = statusType === "finished" && (!isEmpty || isNoMatch) && (additionalFilters || !hideFilter); + const showLegend = !hideLegend && !isEmpty && statusType === "finished"; + const reserveLegendSpace = !showChart && !hideLegend; + const reserveFilterSpace = !showChart && !isNoMatch && (!hideFilter || additionalFilters); + const mergedRef = useMergeRefs(containerRef, __internalRootRef); + const filterItems = series.map(({ series: series2, color: color2 }) => ({ + label: series2.title, + type: chartLegendMap[series2.type], + color: color2, + datum: series2 + })); + return import_react163.default.createElement(ChartWrapper, Object.assign({ ref: mergedRef }, baseProps, { className: clsx_m_default(baseProps.className, styles_css_default51.root), fitHeight: !!fitHeight, contentMinHeight: height, defaultFilter: showFilters && !hideFilter ? import_react163.default.createElement(chart_filter_default, { series: filterItems, onChange: filterChange, selectedSeries: externalVisibleSeries || [], i18nStrings }) : null, additionalFilters: showFilters ? additionalFilters : null, reserveFilterSpace: !!reserveFilterSpace, reserveLegendSpace: !!reserveLegendSpace, chartStatus: import_react163.default.createElement(ChartStatusContainer, { isEmpty, isNoMatch, showChart, statusType, empty, noMatch, loadingText, errorText, recoveryText, onRecoveryClick }), chart: showChart ? import_react163.default.createElement(ChartContainer2, { fitHeight, height, xScaleType, yScaleType, xDomain, yDomain, xTickFormatter: xTickFormatter !== null && xTickFormatter !== void 0 ? xTickFormatter : i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.xTickFormatter, yTickFormatter: yTickFormatter !== null && yTickFormatter !== void 0 ? yTickFormatter : i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.yTickFormatter, emphasizeBaselineAxis, stackedBars, horizontalBars, series, visibleSeries, highlightedSeries, onHighlightChange, highlightedPoint, setHighlightedPoint, highlightedGroupIndex, setHighlightedGroupIndex, detailPopoverSize, detailPopoverFooter, detailPopoverSeriesContent, xTitle, yTitle, ariaLabel, ariaLabelledby, ariaDescription, i18nStrings }) : null, legend: showLegend ? import_react163.default.createElement(InternalChartLegend, { series, visibleSeries: externalVisibleSeries || [], highlightedSeries: legendSeries, onHighlightChange, legendTitle, ariaLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.legendAriaLabel, plotContainerRef: containerRef }) : null, onBlur })); +} + +// node_modules/@cloudscape-design/components/bar-chart/index.js +function BarChart(_a) { + var { series = [], height = 500, xScaleType = "categorical", yScaleType = "linear", stackedBars = false, horizontalBars = false, detailPopoverSize = "medium", statusType = "finished", emphasizeBaselineAxis = true, detailPopoverSeriesContent } = _a, props2 = __rest(_a, ["series", "height", "xScaleType", "yScaleType", "stackedBars", "horizontalBars", "detailPopoverSize", "statusType", "emphasizeBaselineAxis", "detailPopoverSeriesContent"]); + const baseComponentProps = useBaseComponent("BarChart", { + props: { + detailPopoverSize, + emphasizeBaselineAxis, + fitHeight: props2.fitHeight, + hideFilter: props2.hideFilter, + hideLegend: props2.hideLegend, + horizontalBars, + stackedBars, + xScaleType, + yScaleType + } + }); + const baseProps = getBaseProps(props2); + const className = clsx_m_default(baseProps.className, styles_css_default50.root); + return import_react164.default.createElement(InternalMixedLineBarChart, Object.assign({}, props2, baseComponentProps, { className, height, xScaleType, yScaleType, stackedBars, horizontalBars, series, detailPopoverSize, statusType, emphasizeBaselineAxis, detailPopoverSeriesContent })); +} +applyDisplayName(BarChart, "BarChart"); +var bar_chart_default = BarChart; + +// node_modules/@cloudscape-design/components/breadcrumb-group/index.js +var import_react168 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/breadcrumb-group/internal.js +var import_react167 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/breadcrumb-group/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/breadcrumb-group/styles.scoped.css"; +var styles_css_default52 = { + "breadcrumb-group": "awsui_breadcrumb-group_d19fg_z6pwg_99", + "item": "awsui_item_d19fg_z6pwg_137", + "breadcrumb-group-list": "awsui_breadcrumb-group-list_d19fg_z6pwg_172", + "ellipsis": "awsui_ellipsis_d19fg_z6pwg_184", + "icon": "awsui_icon_d19fg_z6pwg_194", + "mobile": "awsui_mobile_d19fg_z6pwg_199", + "mobile-short": "awsui_mobile-short_d19fg_z6pwg_212" +}; + +// node_modules/@cloudscape-design/components/breadcrumb-group/item/item.js +var import_react166 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/breadcrumb-group/item/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/breadcrumb-group/item/styles.scoped.css"; +var styles_css_default53 = { + "link": "awsui_link_1kosq_r0i6w_99", + "breadcrumb": "awsui_breadcrumb_1kosq_r0i6w_103", + "icon": "awsui_icon_1kosq_r0i6w_106", + "anchor": "awsui_anchor_1kosq_r0i6w_111", + "last": "awsui_last_1kosq_r0i6w_157", + "compressed": "awsui_compressed_1kosq_r0i6w_167", + "text": "awsui_text_1kosq_r0i6w_171", + "virtual-item": "awsui_virtual-item_1kosq_r0i6w_178" +}; + +// node_modules/@cloudscape-design/components/internal/components/tooltip/index.js +var import_react165 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/internal/components/tooltip/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/internal/components/tooltip/styles.scoped.css"; +var styles_css_default54 = { + "root": "awsui_root_1qprf_160mh_5" +}; + +// node_modules/@cloudscape-design/components/internal/components/tooltip/index.js +function Tooltip2({ value, trackRef }) { + return import_react165.default.createElement( + Portal, + null, + import_react165.default.createElement( + "div", + { className: styles_css_default54.root }, + import_react165.default.createElement(Transition2, { in: true }, () => import_react165.default.createElement( + PopoverContainer, + { trackRef, trackKey: value, size: "small", fixedWidth: false, position: "top", arrow: (position) => import_react165.default.createElement( + "div", + { className: clsx_m_default(styles_css_default2.arrow, styles_css_default2[`arrow-position-${position}`]) }, + import_react165.default.createElement("div", { className: styles_css_default2["arrow-outer"] }), + import_react165.default.createElement("div", { className: styles_css_default2["arrow-inner"] }) + ) }, + import_react165.default.createElement(PopoverBody, { dismissButton: false, dismissAriaLabel: void 0, onDismiss: void 0, header: void 0 }, value) + )) + ) + ); +} + +// node_modules/@cloudscape-design/components/breadcrumb-group/item/item.js +var BreadcrumbItemWithPopover = (_a) => { + var { item, isLast, anchorAttributes, funnelAttributes } = _a, itemAttributes = __rest(_a, ["item", "isLast", "anchorAttributes", "funnelAttributes"]); + const [showPopover, setShowPopover] = (0, import_react166.useState)(false); + const textRef = (0, import_react166.useRef)(null); + const virtualTextRef = (0, import_react166.useRef)(null); + const isTruncated = (textRef2, virtualTextRef2) => { + if (!textRef2 || !virtualTextRef2 || !textRef2.current || !virtualTextRef2.current) { + return false; + } + const virtualTextWidth = virtualTextRef2.current.getBoundingClientRect().width; + const textWidth = textRef2.current.getBoundingClientRect().width; + if (virtualTextWidth > textWidth) { + return true; + } + return false; + }; + const popoverContent = import_react166.default.createElement(Tooltip2, { trackRef: textRef, value: item.text }); + (0, import_react166.useEffect)(() => { + const onKeyDown = (event) => { + if (event.key === "Escape") { + setShowPopover(false); + } + }; + if (showPopover) { + document.addEventListener("keydown", onKeyDown); + } + return () => { + document.removeEventListener("keydown", onKeyDown); + }; + }, [showPopover]); + return import_react166.default.createElement( + import_react166.default.Fragment, + null, + import_react166.default.createElement( + Item2, + Object.assign({ isLast }, itemAttributes, { onFocus: () => { + isTruncated(textRef, virtualTextRef) && setShowPopover(true); + }, onBlur: () => setShowPopover(false), onMouseEnter: () => { + isTruncated(textRef, virtualTextRef) && setShowPopover(true); + }, onMouseLeave: () => setShowPopover(false), anchorAttributes }), + import_react166.default.createElement("span", Object.assign({}, funnelAttributes, { className: styles_css_default53.text, ref: textRef }), item.text), + import_react166.default.createElement("span", { className: styles_css_default53["virtual-item"], ref: virtualTextRef }, item.text) + ), + showPopover && popoverContent + ); +}; +var Item2 = (_a) => { + var { anchorAttributes, children: children2, isLast } = _a, itemAttributes = __rest(_a, ["anchorAttributes", "children", "isLast"]); + return isLast ? import_react166.default.createElement("span", Object.assign({}, itemAttributes), children2) : import_react166.default.createElement("a", Object.assign({}, itemAttributes, anchorAttributes), children2); +}; +function BreadcrumbItem({ item, onClick, onFollow, isDisplayed, isLast = false, isCompressed = false }) { + const preventDefault2 = (event) => event.preventDefault(); + const onClickHandler = (event) => { + if (isPlainLeftClick(event)) { + fireCancelableEvent(onFollow, getEventDetail(item), event); + } + fireCancelableEvent(onClick, getEventDetail(item), event); + }; + const itemAttributes = { + className: clsx_m_default(styles_css_default53.anchor, { [styles_css_default53.compressed]: isCompressed }) + }; + const anchorAttributes = { + href: item.href || "#", + onClick: isLast ? preventDefault2 : onClickHandler + }; + const funnelAttributes = {}; + if (isLast) { + funnelAttributes[DATA_ATTR_FUNNEL_KEY] = FUNNEL_KEY_FUNNEL_NAME; + } + return import_react166.default.createElement( + "div", + { className: clsx_m_default(styles_css_default53.breadcrumb, isLast && styles_css_default53.last) }, + isDisplayed && isCompressed ? import_react166.default.createElement(BreadcrumbItemWithPopover, Object.assign({ item, isLast, anchorAttributes, funnelAttributes }, itemAttributes)) : import_react166.default.createElement( + Item2, + Object.assign({ isLast, anchorAttributes }, itemAttributes), + import_react166.default.createElement("span", Object.assign({}, funnelAttributes, { className: styles_css_default53.text }), item.text) + ), + !isLast ? import_react166.default.createElement( + "span", + { className: styles_css_default53.icon }, + import_react166.default.createElement(internal_default, { name: "angle-right" }) + ) : null + ); +} + +// node_modules/@cloudscape-design/components/breadcrumb-group/internal.js +var DEFAULT_EXPAND_ARIA_LABEL = "Show path"; +var getDropdownTrigger = ({ ariaLabel, triggerRef, disabled, testUtilsClass, isOpen, onClick }) => { + return import_react167.default.createElement(InternalButton, { ref: triggerRef, className: testUtilsClass, disabled, onClick: (event) => { + event.preventDefault(); + onClick(); + }, ariaExpanded: isOpen, "aria-haspopup": true, ariaLabel, variant: "breadcrumb-group", formAction: "none" }, "..."); +}; +var EllipsisDropdown = ({ ariaLabel, dropdownItems, onDropdownItemClick, onDropdownItemFollow }) => { + var _a; + const i18n = useInternalI18n("breadcrumb-group"); + return import_react167.default.createElement( + "li", + { className: styles_css_default52.ellipsis }, + import_react167.default.createElement(internal_default11, { ariaLabel: (_a = i18n("expandAriaLabel", ariaLabel)) !== null && _a !== void 0 ? _a : DEFAULT_EXPAND_ARIA_LABEL, items: dropdownItems, onItemClick: onDropdownItemClick, onItemFollow: onDropdownItemFollow, customTriggerBuilder: getDropdownTrigger }), + import_react167.default.createElement( + "span", + { className: styles_css_default52.icon }, + import_react167.default.createElement(internal_default, { name: "angle-right" }) + ) + ); +}; +var getEventDetail = (item) => ({ + item, + text: item.text, + href: item.href +}); +function InternalBreadcrumbGroup(_a) { + var { items = [], ariaLabel, expandAriaLabel, onClick, onFollow, __internalRootRef } = _a, props2 = __rest(_a, ["items", "ariaLabel", "expandAriaLabel", "onClick", "onFollow", "__internalRootRef"]); + for (const item of items) { + checkSafeUrl("BreadcrumbGroup", item.href); + } + const baseProps = getBaseProps(props2); + const isMobile = useMobile(); + let breadcrumbItems = items.map((item, index) => { + const isLast = index === items.length - 1; + return import_react167.default.createElement( + "li", + { className: styles_css_default52.item, key: index }, + import_react167.default.createElement(BreadcrumbItem, { item, onClick, onFollow, isCompressed: isMobile, isLast, isDisplayed: !isMobile || isLast || index === 0 }) + ); + }); + const getEventItem = (e) => { + const { id } = e.detail; + return items[parseInt(id)]; + }; + if (breadcrumbItems.length >= 2) { + const dropdownItems = items.slice(1, items.length - 1).map((item, index) => ({ + id: (index + 1).toString(), + text: item.text, + href: item.href || "#" + })); + breadcrumbItems = [ + breadcrumbItems[0], + import_react167.default.createElement(EllipsisDropdown, { key: "ellipsis", ariaLabel: expandAriaLabel, dropdownItems, onDropdownItemClick: (e) => fireCancelableEvent(onClick, getEventDetail(getEventItem(e)), e), onDropdownItemFollow: (e) => fireCancelableEvent(onFollow, getEventDetail(getEventItem(e)), e) }), + ...breadcrumbItems.slice(1) + ]; + } + return import_react167.default.createElement( + "nav", + Object.assign({}, baseProps, { className: clsx_m_default(styles_css_default52["breadcrumb-group"], isMobile && styles_css_default52.mobile, items.length <= 2 && styles_css_default52["mobile-short"], baseProps.className), "aria-label": ariaLabel || void 0, ref: __internalRootRef }), + import_react167.default.createElement("ol", { className: styles_css_default52["breadcrumb-group-list"] }, breadcrumbItems) + ); +} + +// node_modules/@cloudscape-design/components/breadcrumb-group/index.js +function BreadcrumbGroup(_a) { + var { items = [] } = _a, props2 = __rest(_a, ["items"]); + const baseComponentProps = useBaseComponent("BreadcrumbGroup"); + return import_react168.default.createElement(InternalBreadcrumbGroup, Object.assign({ items }, props2, baseComponentProps)); +} +applyDisplayName(BreadcrumbGroup, "BreadcrumbGroup"); + +// node_modules/@cloudscape-design/components/button-dropdown/index.js +var import_react169 = __toESM(require_react()); +var ButtonDropdown = import_react169.default.forwardRef((_a, ref) => { + var { items, variant = "normal", loading = false, loadingText, disabled = false, expandableGroups = false, expandToViewport = false, ariaLabel, children: children2, onItemClick, onItemFollow, mainAction } = _a, props2 = __rest(_a, ["items", "variant", "loading", "loadingText", "disabled", "expandableGroups", "expandToViewport", "ariaLabel", "children", "onItemClick", "onItemFollow", "mainAction"]); + const baseComponentProps = useBaseComponent("ButtonDropdown", { + props: { expandToViewport, expandableGroups, variant } + }); + const baseProps = getBaseProps(props2); + return import_react169.default.createElement(internal_default11, Object.assign({}, baseProps, baseComponentProps, { ref, items, variant, loading, loadingText, disabled, expandableGroups, expandToViewport, ariaLabel, onItemClick, onItemFollow, mainAction }), children2); +}); +applyDisplayName(ButtonDropdown, "ButtonDropdown"); +var button_dropdown_default = ButtonDropdown; + +// node_modules/@cloudscape-design/components/calendar/index.js +var import_react177 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/calendar/internal.js +var import_react176 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/calendar/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/calendar/styles.scoped.css"; +var styles_css_default55 = { + "calendar": "awsui_calendar_1ykar_1boof_99", + "awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-0_1ykar_1boof_1", + "root": "awsui_root_1ykar_1boof_130", + "calendar-inner": "awsui_calendar-inner_1ykar_1boof_171", + "calendar-header": "awsui_calendar-header_1ykar_1boof_175", + "calendar-header-title": "awsui_calendar-header-title_1ykar_1boof_180", + "calendar-next-btn": "awsui_calendar-next-btn_1ykar_1boof_188", + "calendar-prev-btn": "awsui_calendar-prev-btn_1ykar_1boof_191", + "calendar-grid": "awsui_calendar-grid_1ykar_1boof_194", + "calendar-grid-dense": "awsui_calendar-grid-dense_1ykar_1boof_198", + "calendar-grid-cell": "awsui_calendar-grid-cell_1ykar_1boof_206", + "calendar-date-header": "awsui_calendar-date-header_1ykar_1boof_211", + "calendar-date": "awsui_calendar-date_1ykar_1boof_211", + "calendar-date-enabled": "awsui_calendar-date-enabled_1ykar_1boof_231", + "calendar-date-current-page": "awsui_calendar-date-current-page_1ykar_1boof_241", + "calendar-date-selected": "awsui_calendar-date-selected_1ykar_1boof_252", + "calendar-date-current": "awsui_calendar-date-current_1ykar_1boof_241", + "calendar-date-dense": "awsui_calendar-date-dense_1ykar_1boof_273", + "date-inner": "awsui_date-inner_1ykar_1boof_281", + "calendar-row": "awsui_calendar-row_1ykar_1boof_356" +}; + +// node_modules/@cloudscape-design/components/calendar/header/index.js +var import_react171 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/calendar/header/header-button.js +var import_react170 = __toESM(require_react()); +function HeaderPrevButton({ ariaLabel, onChange }) { + return import_react170.default.createElement(InternalButton, { iconName: "angle-left", ariaLabel, variant: "icon", onClick: () => onChange(-1), formAction: "none", className: styles_css_default55["calendar-prev-btn"] }); +} +function HeaderNextButton({ ariaLabel, onChange }) { + return import_react170.default.createElement(InternalButton, { iconName: "angle-right", ariaLabel, variant: "icon", onClick: () => onChange(1), formAction: "none", className: styles_css_default55["calendar-next-btn"] }); +} + +// node_modules/@cloudscape-design/components/calendar/header/index.js +var CalendarHeader = ({ formattedDate, onChange, previousLabel, nextLabel, headingId }) => { + return import_react171.default.createElement( + "div", + { className: styles_css_default55["calendar-header"] }, + import_react171.default.createElement(HeaderPrevButton, { ariaLabel: previousLabel, onChange }), + import_react171.default.createElement("h2", { className: styles_css_default55["calendar-header-title"], id: headingId }, formattedDate), + import_react171.default.createElement(HeaderNextButton, { ariaLabel: nextLabel, onChange }) + ); +}; +var header_default = CalendarHeader; + +// node_modules/@cloudscape-design/components/calendar/grid/index.js +var import_react172 = __toESM(require_react()); +function Grid({ isDateEnabled, focusedDate, focusableDate, onSelectDate, selectedDate, ariaLabelledby, header, rows, isCurrentPage, renderDate, renderDateAnnouncement, isSameDate, onGridKeyDownHandler }) { + const focusedDateRef = (0, import_react172.useRef)(null); + useEffectOnUpdate(() => { + if (focusedDate && focusedDateRef.current) { + focusedDateRef.current.focus(); + } + }, [focusedDate]); + const rowLength = rows[0].length; + const denseGrid = rowLength > 3; + return import_react172.default.createElement( + "table", + { role: "grid", className: clsx_m_default(styles_css_default55["calendar-grid"], denseGrid && styles_css_default55["calendar-grid-dense"]), "aria-labelledby": ariaLabelledby }, + header, + import_react172.default.createElement("tbody", { onKeyDown: onGridKeyDownHandler }, rows.map((row, rowIndex) => import_react172.default.createElement("tr", { key: rowIndex, className: styles_css_default55["calendar-row"] }, row.map((date2, dateIndex) => { + const isFocusable = !!focusableDate && isSameDate(date2, focusableDate); + const isSelected = !!selectedDate && isSameDate(date2, selectedDate); + const isEnabled = !isDateEnabled || isDateEnabled(date2); + const isCurrentDate = isSameDate(date2, /* @__PURE__ */ new Date()); + let tabIndex = void 0; + if (isFocusable && isEnabled) { + tabIndex = 0; + } else if (isEnabled) { + tabIndex = -1; + } + return import_react172.default.createElement( + "td", + { + key: `${rowIndex}:${dateIndex}`, + ref: tabIndex === 0 ? focusedDateRef : void 0, + tabIndex, + "aria-current": isCurrentDate ? "date" : void 0, + "aria-selected": isEnabled ? isSelected : void 0, + "aria-disabled": !isEnabled, + // Do not attach click event when the date is disabled, otherwise VO+safari announces clickable + onClick: isEnabled ? () => onSelectDate(date2) : void 0, + className: clsx_m_default(styles_css_default55["calendar-grid-cell"], styles_css_default55["calendar-date"], { + [styles_css_default55["calendar-date-current-page"]]: isCurrentPage(date2), + [styles_css_default55["calendar-date-enabled"]]: isEnabled, + [styles_css_default55["calendar-date-selected"]]: isSelected, + [styles_css_default55["calendar-date-current"]]: isCurrentDate, + [styles_css_default55["calendar-date-dense"]]: denseGrid + }) + }, + import_react172.default.createElement("span", { className: styles_css_default55["date-inner"], "aria-hidden": "true" }, renderDate(date2)), + import_react172.default.createElement(ScreenreaderOnly, null, renderDateAnnouncement(date2, isCurrentDate)) + ); + })))) + ); +} + +// node_modules/@cloudscape-design/components/internal/utils/locale/merge-locales.js +function mergeLocales(locale2, fullLocale) { + const isShort = locale2.length === 2; + if (isShort && fullLocale.indexOf(locale2) === 0) { + return fullLocale; + } + return locale2; +} + +// node_modules/@cloudscape-design/components/internal/utils/locale/normalize-locale.js +function normalizeLocale(component, locale2) { + var _a; + locale2 = checkLocale(component, locale2); + const browserLocale = getBrowserLocale(); + if (locale2) { + return mergeLocales(locale2, browserLocale); + } + const htmlLocale = checkLocale(component, (_a = getHtmlElement()) === null || _a === void 0 ? void 0 : _a.getAttribute("lang")); + if (htmlLocale) { + return mergeLocales(htmlLocale, browserLocale); + } + return browserLocale; +} +function checkLocale(component, locale2) { + if (!locale2 || locale2 === "") { + return ""; + } + locale2 = locale2 && locale2.replace(/^([a-z]{2})_/, "$1-"); + if (locale2 && !locale2.match(/^[a-z]{2}(-[A-Z]{2})?$/)) { + warnOnce(component, `Invalid locale provided: ${locale2}. Falling back to default`); + locale2 = ""; + } + return locale2; +} +function getHtmlElement() { + return typeof document !== "undefined" ? document.querySelector("html") : null; +} +function getBrowserLocale() { + return new Intl.DateTimeFormat().resolvedOptions().locale; +} + +// node_modules/weekstart/dist/es-module/api.js +function getWeekStartByRegion(regionCode, regionDayMap2) { + var code = regionDayMap2[typeof regionCode === "string" ? regionCode.toUpperCase() : regionCode]; + return typeof code === "number" ? code : 1; +} +function getWeekStartByLocale(locale2, langRegionMap2, regionDayMap2) { + if (locale2) { + var data = locale2.toLowerCase().split(/[-_]/); + var language = data[0]; + var country; + if (data[1] && data[1].length === 4) { + language += "_" + data[1]; + country = data[2]; + } else { + country = data[1]; + } + if (!country) { + country = langRegionMap2[language]; + } + if (country) { + return getWeekStartByRegion(country.match(/^\d+$/) ? Number(country) : country, regionDayMap2); + } + } + return 1; +} + +// node_modules/weekstart/dist/es-module/langRegionMap.js +var langRegionMap = { + en: "US", + zh: "CN", + zh_hans: "CN", + hans: "CN", + wuu: "CN", + hsn: "CN", + hak: "CN", + nan: "CN", + gan: "CN", + hi: "IN", + te: "IN", + mr: "IN", + ta: "IN", + gu: "IN", + kn: "IN", + or: "IN", + ml: "IN", + pa_guru: "IN", + bho: "IN", + awa: "IN", + as: "IN", + mwr: "IN", + mai: "IN", + mag: "IN", + bgc: "IN", + hne: "IN", + dcc: "IN", + dz: "BT", + tn: "BW", + am: "ET", + om: "ET", + quc: "GT", + id: "ID", + jv: "ID", + su: "ID", + mad: "ID", + ms_arab: "ID", + ga: "IE", + he: "IL", + jam: "JM", + ja: "JP", + km: "KH", + ko: "KR", + lo: "LA", + mh: "MH", + my: "MM", + mt: "MT", + ne: "NP", + fil: "PH", + ceb: "PH", + ilo: "PH", + ur: "PK", + pa: "PK", + pa_arab: "PK", + arab: "PK", + lah: "PK", + ps: "PK", + sd: "PK", + sd_arab: "PK", + skr: "PK", + gn: "PY", + th: "TH", + tts: "TH", + aeb: "TN", + zh_hant: "TW", + hant: "TW", + sm: "WS", + zu: "ZA", + sn: "ZW", + arq: "DZ", + ar: "EG", + arz: "EG", + fa: "IR", + az_arab: "IR", + ary: "MA", + bn: "BD", + rkt: "BD", + dv: "MV" +}; +var langRegionMap_default = langRegionMap; + +// node_modules/weekstart/dist/es-module/regionDayMap.js +var regionDayMap = { + AG: 0, + ATG: 0, + 28: 0, + AR: 0, + ARG: 0, + 32: 0, + AS: 0, + ASM: 0, + 16: 0, + AU: 0, + AUS: 0, + 36: 0, + BR: 0, + BRA: 0, + 76: 0, + BS: 0, + BHS: 0, + 44: 0, + BT: 0, + BTN: 0, + 64: 0, + BW: 0, + BWA: 0, + 72: 0, + BZ: 0, + BLZ: 0, + 84: 0, + CA: 0, + CAN: 0, + 124: 0, + CN: 0, + CHN: 0, + 156: 0, + CO: 0, + COL: 0, + 170: 0, + DM: 0, + DMA: 0, + 212: 0, + DO: 0, + DOM: 0, + 214: 0, + ET: 0, + ETH: 0, + 231: 0, + GT: 0, + GTM: 0, + 320: 0, + GU: 0, + GUM: 0, + 316: 0, + HK: 0, + HKG: 0, + 344: 0, + HN: 0, + HND: 0, + 340: 0, + ID: 0, + IDN: 0, + 360: 0, + IE: 0, + IRL: 0, + 372: 0, + IL: 0, + ISR: 0, + 376: 0, + IN: 0, + IND: 0, + 356: 0, + JM: 0, + JAM: 0, + 388: 0, + JP: 0, + JPN: 0, + 392: 0, + KE: 0, + KEN: 0, + 404: 0, + KH: 0, + KHM: 0, + 116: 0, + KR: 0, + KOR: 0, + 410: 0, + LA: 0, + LA0: 0, + 418: 0, + MH: 0, + MHL: 0, + 584: 0, + MM: 0, + MMR: 0, + 104: 0, + MO: 0, + MAC: 0, + 446: 0, + MT: 0, + MLT: 0, + 470: 0, + MX: 0, + MEX: 0, + 484: 0, + MZ: 0, + MOZ: 0, + 508: 0, + NI: 0, + NIC: 0, + 558: 0, + NP: 0, + NPL: 0, + 524: 0, + NZ: 0, + NZL: 0, + 554: 0, + PA: 0, + PAN: 0, + 591: 0, + PE: 0, + PER: 0, + 604: 0, + PH: 0, + PHL: 0, + 608: 0, + PK: 0, + PAK: 0, + 586: 0, + PR: 0, + PRI: 0, + 630: 0, + PY: 0, + PRY: 0, + 600: 0, + SA: 0, + SAU: 0, + 682: 0, + SG: 0, + SGP: 0, + 702: 0, + SV: 0, + SLV: 0, + 222: 0, + TH: 0, + THA: 0, + 764: 0, + TN: 0, + TUN: 0, + 788: 0, + TT: 0, + TTO: 0, + 780: 0, + TW: 0, + TWN: 0, + 158: 0, + UM: 0, + UMI: 0, + 581: 0, + US: 0, + USA: 0, + 840: 0, + VE: 0, + VEN: 0, + 862: 0, + VI: 0, + VIR: 0, + 850: 0, + WS: 0, + WSM: 0, + 882: 0, + YE: 0, + YEM: 0, + 887: 0, + ZA: 0, + ZAF: 0, + 710: 0, + ZW: 0, + ZWE: 0, + 716: 0, + AE: 6, + ARE: 6, + 784: 6, + AF: 6, + AFG: 6, + 4: 6, + BH: 6, + BHR: 6, + 48: 6, + DJ: 6, + DJI: 6, + 262: 6, + DZ: 6, + DZA: 6, + 12: 6, + EG: 6, + EGY: 6, + 818: 6, + IQ: 6, + IRQ: 6, + 368: 6, + IR: 6, + IRN: 6, + 364: 6, + JO: 6, + JOR: 6, + 400: 6, + KW: 6, + KWT: 6, + 414: 6, + LY: 6, + LBY: 6, + 434: 6, + MA: 6, + MAR: 6, + 504: 6, + OM: 6, + OMN: 6, + 512: 6, + QA: 6, + QAT: 6, + 634: 6, + SD: 6, + SDN: 6, + 729: 6, + SY: 6, + SYR: 6, + 760: 6, + BD: 5, + BGD: 5, + 50: 5, + MV: 5, + MDV: 5, + 462: 5 +}; +var regionDayMap_default = regionDayMap; + +// node_modules/weekstart/dist/es-module/main.js +function getWeekStartByLocale$1(locale2) { + return getWeekStartByLocale(locale2, langRegionMap_default, regionDayMap_default); +} + +// node_modules/@cloudscape-design/components/internal/utils/locale/normalize-start-of-week.js +function normalizeStartOfWeek(startOfWeek, locale2) { + return typeof startOfWeek === "number" ? startOfWeek % 7 : getWeekStartByLocale$1(locale2); +} + +// node_modules/@cloudscape-design/components/calendar/utils/navigation.js +function moveNextDay(startDate, isDateEnabled) { + return moveDay(startDate, isDateEnabled, 1); +} +function movePrevDay(startDate, isDateEnabled) { + return moveDay(startDate, isDateEnabled, -1); +} +function moveNextWeek(startDate, isDateEnabled) { + return moveDay(startDate, isDateEnabled, 7); +} +function movePrevWeek(startDate, isDateEnabled) { + return moveDay(startDate, isDateEnabled, -7); +} +function moveNextMonth(startDate, isDateEnabled) { + return moveMonth(startDate, isDateEnabled, 1); +} +function movePrevMonth(startDate, isDateEnabled) { + return moveMonth(startDate, isDateEnabled, -1); +} +function moveMonthDown(startDate, isDateEnabled) { + return moveMonth(startDate, isDateEnabled, 3); +} +function moveMonthUp(startDate, isDateEnabled) { + return moveMonth(startDate, isDateEnabled, -3); +} +function getBaseDay(date2, isDateEnabled) { + return getBaseDate({ date: date2, isDateEnabled, granularity: "day" }); +} +function getBaseMonth(date2, isDateEnabled) { + return getBaseDate({ date: date2, isDateEnabled, granularity: "month" }); +} +function getBaseDate({ date: date2, granularity, isDateEnabled }) { + const isMonthGranularity = granularity === "month"; + const getStartDate = isMonthGranularity ? startOfYear : startOfMonth; + const moveDate2 = isMonthGranularity ? moveMonth : moveDay; + const isSamePage = isMonthGranularity ? isSameYear : isSameMonth; + const startDate = getStartDate(date2); + if (isDateEnabled(startDate)) { + return startDate; + } + const firstEnabledDate = moveDate2(startDate, isDateEnabled, 1); + return isSamePage(startDate, firstEnabledDate) ? firstEnabledDate : startDate; +} +function moveDay(startDate, isDateEnabled, step2) { + return moveDate({ startDate, granularity: "day", isDateEnabled, step: step2 }); +} +function moveMonth(startDate, isDateEnabled, step2) { + return moveDate({ startDate, granularity: "month", isDateEnabled, step: step2 }); +} +function moveDate({ startDate, granularity, isDateEnabled, step: step2 }) { + const isMonthGranularity = granularity === "month"; + const addSteps = isMonthGranularity ? addMonths : addDays; + const limitYears = isMonthGranularity ? 1 : 10; + let current = addSteps(startDate, step2); + while (!isDateEnabled(current)) { + if (Math.abs(differenceInYears(startDate, current)) > limitYears) { + return startDate; + } + current = addSteps(current, step2); + } + return current; +} + +// node_modules/@cloudscape-design/components/internal/hooks/use-date-cache/index.js +var import_react173 = __toESM(require_react()); +function useDateCache() { + const cacheRef = (0, import_react173.useRef)(/* @__PURE__ */ new Map()); + return (date2) => { + const current = cacheRef.current.get(date2.getTime()); + if (current) { + return current; + } + cacheRef.current.set(date2.getTime(), date2); + return date2; + }; +} + +// node_modules/@cloudscape-design/components/calendar/utils/intl.js +function setDayIndex(date2, dayIndex) { + const diff = dayIndex - date2.getDay(); + date2.setDate(date2.getDate() + diff); +} +function renderDayName(locale2, dayIndex, mode) { + const tempDate = /* @__PURE__ */ new Date(); + setDayIndex(tempDate, dayIndex); + return tempDate.toLocaleDateString(locale2, { weekday: mode }); +} +function renderMonthAndYear(locale2, baseDate) { + const result = baseDate.toLocaleDateString(locale2, { + year: "numeric", + month: "long" + }); + return result; +} +function renderYear(locale2, date2) { + return date2.toLocaleDateString(locale2, { + year: "numeric" + }); +} +var dayLabelCache = /* @__PURE__ */ new Map(); +function getDateLabel(locale2, date2, mode = "full") { + const cacheKey = locale2 + date2.getTime() + mode; + const cachedValue = dayLabelCache.get(cacheKey); + if (cachedValue) { + return cachedValue; + } + const value = date2.toLocaleDateString(locale2, { + weekday: mode === "full" ? "long" : void 0, + month: "long", + day: "numeric", + year: "numeric" + }); + dayLabelCache.set(cacheKey, value); + return value; +} +function renderTimeLabel(locale2, date2, format2) { + let options = {}; + if (format2 === "hh") { + options = { hour: "2-digit" }; + } + if (format2 === "hh:mm") { + options = { hour: "2-digit", minute: "2-digit" }; + } + const value = date2.toLocaleTimeString(locale2, options); + return value; +} + +// node_modules/@cloudscape-design/components/calendar/use-calendar-labels.js +function useCalendarLabels({ granularity, locale: locale2, i18nStrings, previousMonthAriaLabel, nextMonthAriaLabel, todayAriaLabel }) { + var _a, _b, _c; + const i18n = useInternalI18n("calendar"); + const isMonthPicker = granularity === "month"; + const previousButtonLabel = isMonthPicker ? i18n("i18nStrings.previousYearAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.previousYearAriaLabel) : i18n("previousMonthAriaLabel", (_a = i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.previousMonthAriaLabel) !== null && _a !== void 0 ? _a : previousMonthAriaLabel); + const nextButtonLabel = isMonthPicker ? i18n("i18nStrings.nextYearAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.nextYearAriaLabel) : i18n("nextMonthAriaLabel", (_b = i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.nextMonthAriaLabel) !== null && _b !== void 0 ? _b : nextMonthAriaLabel); + const currentDateLabel = isMonthPicker ? i18n("i18nStrings.currentMonthAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.currentMonthAriaLabel) : i18n("todayAriaLabel", (_c = i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.todayAriaLabel) !== null && _c !== void 0 ? _c : todayAriaLabel); + const renderDate = (date2) => isMonthPicker ? date2.toLocaleString(locale2, { month: "short" }) : date2.getDate().toString(); + const renderDateAnnouncement = (date2, isCurrentDate) => { + const formattedDate = isMonthPicker ? renderMonthAndYear(locale2, date2) : getDateLabel(locale2, date2, "short"); + if (isCurrentDate && currentDateLabel) { + return formattedDate + ". " + currentDateLabel; + } + return formattedDate; + }; + const renderHeaderText = (date2) => isMonthPicker ? date2.getFullYear().toString() : renderMonthAndYear(locale2, date2); + return { + previousButtonLabel, + nextButtonLabel, + renderDate, + renderDateAnnouncement, + renderHeaderText + }; +} + +// node_modules/@cloudscape-design/components/calendar/grid/use-calendar-grid-rows.js +var import_react174 = __toESM(require_react()); + +// node_modules/mnth/web/add-days.js +var addDays2 = function addDays3(date2, days) { + var result = new Date(date2); + result.setDate(result.getDate() + days); + return result; +}; + +// node_modules/mnth/web/set-date.js +var setDate = function setDate2(date2, day) { + var result = new Date(date2); + result.setDate(day); + return result; +}; + +// node_modules/mnth/web/index.js +function ownKeys(object2, enumerableOnly) { + var keys = Object.keys(object2); + if (Object.getOwnPropertySymbols) { + var symbols2 = Object.getOwnPropertySymbols(object2); + if (enumerableOnly) symbols2 = symbols2.filter(function(sym) { + return Object.getOwnPropertyDescriptor(object2, sym).enumerable; + }); + keys.push.apply(keys, symbols2); + } + return keys; +} +function _objectSpread(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i] != null ? arguments[i] : {}; + if (i % 2) { + ownKeys(Object(source), true).forEach(function(key) { + _defineProperty(target, key, source[key]); + }); + } else if (Object.getOwnPropertyDescriptors) { + Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); + } else { + ownKeys(Object(source)).forEach(function(key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); + } + } + return target; +} +var DAYS_IN_WEEK = 7; +var getCalendarMonth = function getCalendarMonth2(date2, options) { + var _firstDayOfWeek$optio = _objectSpread({ + firstDayOfWeek: 1 + }, options), firstDayOfWeek = _firstDayOfWeek$optio.firstDayOfWeek; + var firstDateOfMonth = new Date(date2.getFullYear(), date2.getMonth(), 1); + var lastDateOfMonth = new Date(date2.getFullYear(), date2.getMonth() + 1, 0); + var firstWeekdayOfMonth = firstDateOfMonth.getDay(); + var lastWeekdayOfMonth = lastDateOfMonth.getDay(); + var daysInMonth = lastDateOfMonth.getDate(); + var daysToPrepend = (firstWeekdayOfMonth - firstDayOfWeek + DAYS_IN_WEEK) % DAYS_IN_WEEK; + var daysToAppend = (DAYS_IN_WEEK - 1 - lastWeekdayOfMonth + firstDayOfWeek) % DAYS_IN_WEEK; + var month = []; + var week = []; + for (var i = 1 - daysToPrepend; i <= daysInMonth + daysToAppend + 1; i++) { + if (i <= 0) { + week.push(addDays2(firstDateOfMonth, i - 1)); + } else if (i > daysInMonth) { + week.push(addDays2(lastDateOfMonth, i - daysInMonth)); + } else { + week.push(setDate(date2, i)); + } + if (week.length === 7) { + month.push(week); + week = []; + } + } + return month; +}; + +// node_modules/@cloudscape-design/components/calendar/grid/use-calendar-grid-rows.js +function useCalendarGridRows({ baseDate, granularity, locale: locale2, startOfWeek }) { + const isMonthPicker = granularity === "month"; + const rows = (0, import_react174.useMemo)(() => isMonthPicker ? getCalendarYear(baseDate) : getCalendarMonth(baseDate, { firstDayOfWeek: normalizeStartOfWeek(startOfWeek, locale2) }), [baseDate, isMonthPicker, startOfWeek, locale2]); + return rows; +} +function getCalendarYear(date2) { + const year = date2.getFullYear(); + return new Array(4).fill(0).map((_, i) => new Array(3).fill(0).map((_2, j) => new Date(year, i * 3 + j))); +} + +// node_modules/@cloudscape-design/components/internal/utils/handle-key.js +function handleKey(event, { onActivate, onBlockEnd, onBlockStart, onEnd, onHome, onInlineEnd, onInlineStart, onPageDown, onPageUp }) { + switch (event.keyCode) { + case KeyCode.down: + onBlockEnd === null || onBlockEnd === void 0 ? void 0 : onBlockEnd(); + break; + case KeyCode.end: + onEnd === null || onEnd === void 0 ? void 0 : onEnd(); + break; + case KeyCode.enter: + case KeyCode.space: + onActivate === null || onActivate === void 0 ? void 0 : onActivate(); + break; + case KeyCode.home: + onHome === null || onHome === void 0 ? void 0 : onHome(); + break; + case KeyCode.left: + isRtl(event.currentTarget) ? onInlineEnd === null || onInlineEnd === void 0 ? void 0 : onInlineEnd() : onInlineStart === null || onInlineStart === void 0 ? void 0 : onInlineStart(); + break; + case KeyCode.pageDown: + onPageDown === null || onPageDown === void 0 ? void 0 : onPageDown(); + break; + case KeyCode.pageUp: + onPageUp === null || onPageUp === void 0 ? void 0 : onPageUp(); + break; + case KeyCode.right: + isRtl(event.currentTarget) ? onInlineStart === null || onInlineStart === void 0 ? void 0 : onInlineStart() : onInlineEnd === null || onInlineEnd === void 0 ? void 0 : onInlineEnd(); + break; + case KeyCode.up: + onBlockStart === null || onBlockStart === void 0 ? void 0 : onBlockStart(); + break; + } +} + +// node_modules/@cloudscape-design/components/calendar/grid/use-calendar-grid-keyboard-navigation.js +function useCalendarGridKeyboardNavigation({ baseDate, focusableDate, granularity, isDateEnabled, onChangePage, onFocusDate, onSelectDate }) { + const isMonthPicker = granularity === "month"; + const moveDown = isMonthPicker ? moveMonthDown : moveNextWeek; + const moveLeft = isMonthPicker ? movePrevMonth : movePrevDay; + const moveRight = isMonthPicker ? moveNextMonth : moveNextDay; + const moveUp = isMonthPicker ? moveMonthUp : movePrevWeek; + const isSamePage = isMonthPicker ? isSameYear : isSameMonth; + const onGridKeyDownHandler = (event) => { + let updatedFocusDate; + const keys = [KeyCode.up, KeyCode.down, KeyCode.left, KeyCode.right, KeyCode.space, KeyCode.enter]; + if (focusableDate === null || keys.indexOf(event.keyCode) === -1) { + return; + } + event.preventDefault(); + handleKey(event, { + onActivate: () => { + onFocusDate(null); + onSelectDate(focusableDate); + }, + onBlockEnd: () => updatedFocusDate = moveDown(focusableDate, isDateEnabled), + onBlockStart: () => updatedFocusDate = moveUp(focusableDate, isDateEnabled), + onInlineStart: () => updatedFocusDate = moveLeft(focusableDate, isDateEnabled), + onInlineEnd: () => updatedFocusDate = moveRight(focusableDate, isDateEnabled) + }); + if (!updatedFocusDate) { + return; + } + if (!isSamePage(updatedFocusDate, baseDate)) { + onChangePage(updatedFocusDate); + } + onFocusDate(updatedFocusDate); + }; + return onGridKeyDownHandler; +} + +// node_modules/@cloudscape-design/components/calendar/grid/calendar-grid-header.js +var import_react175 = __toESM(require_react()); +function CalendarGridHeader({ locale: locale2, rows }) { + return import_react175.default.createElement( + "thead", + null, + import_react175.default.createElement("tr", null, rows[0].map((date2) => date2.getDay()).map((dayIndex) => import_react175.default.createElement( + "th", + { key: dayIndex, scope: "col", className: clsx_m_default(styles_css_default55["calendar-grid-cell"], styles_css_default55["calendar-date-header"]) }, + import_react175.default.createElement("span", { "aria-hidden": "true" }, renderDayName(locale2, dayIndex, "short")), + import_react175.default.createElement(ScreenreaderOnly, null, renderDayName(locale2, dayIndex, "long")) + ))) + ); +} + +// node_modules/@cloudscape-design/components/calendar/internal.js +function Calendar(_a) { + var { value, locale: locale2 = "", startOfWeek, isDateEnabled = () => true, ariaLabel, ariaLabelledby, ariaDescribedby, onChange, __internalRootRef, i18nStrings, granularity = "day", previousMonthAriaLabel, nextMonthAriaLabel, todayAriaLabel } = _a, rest = __rest(_a, ["value", "locale", "startOfWeek", "isDateEnabled", "ariaLabel", "ariaLabelledby", "ariaDescribedby", "onChange", "__internalRootRef", "i18nStrings", "granularity", "previousMonthAriaLabel", "nextMonthAriaLabel", "todayAriaLabel"]); + checkControlled("Calendar", "value", value, "onChange", onChange); + const baseProps = getBaseProps(rest); + const normalizedLocale = normalizeLocale("Calendar", locale2); + const gridWrapperRef = (0, import_react176.useRef)(null); + const [focusedDate, setFocusedDate] = (0, import_react176.useState)(null); + const valueDateCache = useDateCache(); + const focusedDateCache = useDateCache(); + const parsedValue = value && value.length >= 4 ? parseDate(value) : null; + const memoizedValue = parsedValue ? valueDateCache(parsedValue) : null; + const defaultDisplayedDate = memoizedValue !== null && memoizedValue !== void 0 ? memoizedValue : /* @__PURE__ */ new Date(); + const [displayedDate, setDisplayedDate] = (0, import_react176.useState)(defaultDisplayedDate); + const headingId = useUniqueId("calendar-heading"); + const isMonthPicker = granularity === "month"; + const baseDate = isMonthPicker ? getBaseMonth(displayedDate, isDateEnabled) : getBaseDay(displayedDate, isDateEnabled); + const isSameDate = isMonthPicker ? isSameMonth : isSameDay; + const isSamePage = isMonthPicker ? isSameYear : isSameMonth; + const isCurrentPage = (date2) => isMonthPicker || isSameMonth(date2, baseDate); + const { previousButtonLabel, nextButtonLabel, renderDate, renderDateAnnouncement, renderHeaderText } = useCalendarLabels({ + granularity, + i18nStrings, + locale: normalizedLocale, + previousMonthAriaLabel, + nextMonthAriaLabel, + todayAriaLabel + }); + const gridRows = useCalendarGridRows({ baseDate, granularity, startOfWeek, locale: normalizedLocale }); + (0, import_react176.useEffect)(() => { + memoizedValue && setDisplayedDate((prev) => prev.getTime() !== memoizedValue.getTime() ? memoizedValue : prev); + }, [memoizedValue]); + const selectFocusedDate = (selected, baseDate2) => { + if (selected && isDateEnabled(selected) && isSamePage(selected, baseDate2)) { + return selected; + } + const today = /* @__PURE__ */ new Date(); + if (isDateEnabled(today) && isSamePage(today, baseDate2)) { + return today; + } + if (isDateEnabled(baseDate2)) { + return baseDate2; + } + return null; + }; + const focusableDate = focusedDate || selectFocusedDate(memoizedValue, baseDate); + const onHeaderChangePageHandler = (amount) => { + const movePage = isMonthPicker ? addYears : addMonths; + const newDate2 = movePage(baseDate, amount); + onChangePageHandler(newDate2); + }; + const onChangePageHandler = (newDate2) => { + setDisplayedDate(newDate2); + setFocusedDate(null); + }; + const onGridFocusDateHandler = (date2) => { + if (date2) { + setFocusedDate(date2 ? focusedDateCache(date2) : null); + } + }; + const onGridSelectDateHandler = (date2) => { + fireNonCancelableEvent(onChange, { value: formatDate(date2, granularity) }); + setFocusedDate(null); + }; + const onGridBlur = (event) => { + var _a2; + const newFocusTargetIsInGrid = event.relatedTarget && ((_a2 = gridWrapperRef.current) === null || _a2 === void 0 ? void 0 : _a2.contains(event.relatedTarget)); + if (!newFocusTargetIsInGrid) { + setFocusedDate(null); + } + }; + const onGridKeyDownHandler = useCalendarGridKeyboardNavigation({ + baseDate, + focusableDate, + granularity, + isDateEnabled, + onChangePage: onChangePageHandler, + onFocusDate: onGridFocusDateHandler, + onSelectDate: onGridSelectDateHandler + }); + const headerText = renderHeaderText(baseDate); + return import_react176.default.createElement( + "div", + Object.assign({ ref: __internalRootRef }, baseProps, { role: "group", "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, className: clsx_m_default(styles_css_default55.root, styles_css_default55.calendar, baseProps.className) }), + import_react176.default.createElement( + "div", + { className: styles_css_default55["calendar-inner"] }, + import_react176.default.createElement(header_default, { formattedDate: headerText, onChange: onHeaderChangePageHandler, previousLabel: previousButtonLabel, nextLabel: nextButtonLabel, headingId }), + import_react176.default.createElement( + "div", + { onBlur: onGridBlur, ref: gridWrapperRef }, + import_react176.default.createElement(Grid, { isDateEnabled, focusedDate, focusableDate, onSelectDate: onGridSelectDateHandler, onFocusDate: onGridFocusDateHandler, onChangePage: onChangePageHandler, selectedDate: memoizedValue, ariaLabelledby: headingId, header: isMonthPicker ? null : import_react176.default.createElement(CalendarGridHeader, { locale: normalizedLocale, rows: gridRows }), rows: gridRows, isCurrentPage, renderDate, renderDateAnnouncement, isSameDate, onGridKeyDownHandler }) + ) + ) + ); +} + +// node_modules/@cloudscape-design/components/calendar/index.js +function Calendar2(_a) { + var { locale: locale2 = "", isDateEnabled = () => true, granularity = "day" } = _a, props2 = __rest(_a, ["locale", "isDateEnabled", "granularity"]); + const baseComponentProps = useBaseComponent("Calendar"); + return import_react177.default.createElement(Calendar, Object.assign({}, props2, baseComponentProps, { locale: locale2, isDateEnabled, granularity })); +} +applyDisplayName(Calendar2, "Calendar"); + +// node_modules/@cloudscape-design/components/cards/index.js +var import_react178 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/cards/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/cards/styles.scoped.css"; +var styles_css_default56 = { + "card-inner": "awsui_card-inner_p8a6i_6eu0b_103", + "root": "awsui_root_p8a6i_6eu0b_139", + "header-variant-full-page": "awsui_header-variant-full-page_p8a6i_6eu0b_181", + "header-refresh": "awsui_header-refresh_p8a6i_6eu0b_181", + "list": "awsui_list_p8a6i_6eu0b_190", + "list-grid-1": "awsui_list-grid-1_p8a6i_6eu0b_201", + "card": "awsui_card_p8a6i_6eu0b_103", + "list-grid-2": "awsui_list-grid-2_p8a6i_6eu0b_204", + "list-grid-3": "awsui_list-grid-3_p8a6i_6eu0b_207", + "list-grid-4": "awsui_list-grid-4_p8a6i_6eu0b_210", + "list-grid-5": "awsui_list-grid-5_p8a6i_6eu0b_213", + "list-grid-6": "awsui_list-grid-6_p8a6i_6eu0b_216", + "list-grid-7": "awsui_list-grid-7_p8a6i_6eu0b_219", + "list-grid-8": "awsui_list-grid-8_p8a6i_6eu0b_222", + "list-grid-9": "awsui_list-grid-9_p8a6i_6eu0b_225", + "list-grid-10": "awsui_list-grid-10_p8a6i_6eu0b_228", + "list-grid-11": "awsui_list-grid-11_p8a6i_6eu0b_231", + "list-grid-12": "awsui_list-grid-12_p8a6i_6eu0b_234", + "list-grid-13": "awsui_list-grid-13_p8a6i_6eu0b_237", + "list-grid-14": "awsui_list-grid-14_p8a6i_6eu0b_240", + "list-grid-15": "awsui_list-grid-15_p8a6i_6eu0b_243", + "list-grid-16": "awsui_list-grid-16_p8a6i_6eu0b_246", + "list-grid-17": "awsui_list-grid-17_p8a6i_6eu0b_249", + "list-grid-18": "awsui_list-grid-18_p8a6i_6eu0b_252", + "list-grid-19": "awsui_list-grid-19_p8a6i_6eu0b_255", + "list-grid-20": "awsui_list-grid-20_p8a6i_6eu0b_258", + "selection-control": "awsui_selection-control_p8a6i_6eu0b_262", + "loading": "awsui_loading_p8a6i_6eu0b_272", + "empty": "awsui_empty_p8a6i_6eu0b_273", + "has-header": "awsui_has-header_p8a6i_6eu0b_280", + "refresh": "awsui_refresh_p8a6i_6eu0b_283", + "remove-high-contrast-header": "awsui_remove-high-contrast-header_p8a6i_6eu0b_283", + "card-header": "awsui_card-header_p8a6i_6eu0b_354", + "card-header-inner": "awsui_card-header-inner_p8a6i_6eu0b_362", + "card-selectable": "awsui_card-selectable_p8a6i_6eu0b_366", + "card-selected": "awsui_card-selected_p8a6i_6eu0b_369", + "section": "awsui_section_p8a6i_6eu0b_377", + "section-header": "awsui_section-header_p8a6i_6eu0b_385", + "section-content": "awsui_section-content_p8a6i_6eu0b_391", + "footer-pagination": "awsui_footer-pagination_p8a6i_6eu0b_401" +}; + +// node_modules/@cloudscape-design/components/cards/cards-layout-helper.js +var WIDTHS = [1920, 1400, 1200, 992, 768]; +var defaultCardsPerRow = WIDTHS.map((value, index, widths) => ({ + minWidth: value, + cards: widths.length + 1 - index +})); +var getCardsPerRow = (width, config) => { + if (config.length === 0) { + config = defaultCardsPerRow; + } + let cardsPerRow = 1; + const sortedConfig = config.slice().map((value) => ({ + minWidth: value.minWidth || 0, + cards: value.cards + })).sort((a2, b) => b.minWidth - a2.minWidth); + sortedConfig.some((layout) => { + if (width >= layout.minWidth) { + cardsPerRow = layout.cards; + return true; + } + }); + return cardsPerRow; +}; + +// node_modules/@cloudscape-design/components/cards/index.js +var Cards = import_react178.default.forwardRef(function(_a, ref) { + var { items = [], cardDefinition, cardsPerRow = [], header, filter, pagination, preferences, empty, loading, loadingText, trackBy, selectedItems, selectionType, isItemDisabled, onSelectionChange, ariaLabels, visibleSections, stickyHeader, stickyHeaderVerticalOffset, variant = "container", renderAriaLive, firstIndex, totalItemsCount, entireCardClickable } = _a, rest = __rest(_a, ["items", "cardDefinition", "cardsPerRow", "header", "filter", "pagination", "preferences", "empty", "loading", "loadingText", "trackBy", "selectedItems", "selectionType", "isItemDisabled", "onSelectionChange", "ariaLabels", "visibleSections", "stickyHeader", "stickyHeaderVerticalOffset", "variant", "renderAriaLive", "firstIndex", "totalItemsCount", "entireCardClickable"]); + const { __internalRootRef } = useBaseComponent("Cards", { + props: { entireCardClickable, selectionType, stickyHeader, variant } + }); + const baseProps = getBaseProps(rest); + const isRefresh = useVisualRefresh(); + const isMobile = useMobile(); + const computedVariant = isRefresh ? variant : "container"; + const headerIdRef = (0, import_react178.useRef)(void 0); + const setHeaderRef = (0, import_react178.useCallback)((id) => { + headerIdRef.current = id; + }, []); + const isLabelledByHeader = !(ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.cardsLabel) && !!header; + const [columns, measureRef] = useContainerQuery(({ contentBoxWidth }) => getCardsPerRow(contentBoxWidth, cardsPerRow), [cardsPerRow]); + const refObject = (0, import_react178.useRef)(null); + const mergedRef = useMergeRefs(measureRef, refObject, __internalRootRef); + const getMouseDownTarget = useMouseDownTarget(); + const i18n = useInternalI18n("cards"); + const { isItemSelected, getItemSelectionProps, updateShiftToggle } = useSelection({ + items, + trackBy, + selectedItems, + selectionType, + isItemDisabled, + onSelectionChange, + ariaLabels: { + itemSelectionLabel: ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.itemSelectionLabel, + selectionGroupLabel: i18n("ariaLabels.selectionGroupLabel", ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.selectionGroupLabel) + } + }); + const hasToolsHeader = header || filter || pagination || preferences; + const hasFooterPagination = isMobile && variant === "full-page" && !!pagination; + const headerRef = (0, import_react178.useRef)(null); + const { scrollToTop, scrollToItem } = stickyScrolling(refObject, headerRef); + stickyHeader = supportsStickyPosition() && !isMobile && stickyHeader; + const onCardFocus = (event) => { + if (stickyHeader && !event.currentTarget.contains(getMouseDownTarget())) { + scrollToItem(event.currentTarget); + } + }; + (0, import_react178.useImperativeHandle)(ref, () => ({ + scrollToTop: () => { + if (stickyHeader) { + scrollToTop(); + } + } + }), [stickyHeader, scrollToTop]); + let status; + if (loading) { + status = import_react178.default.createElement( + "div", + { className: styles_css_default56.loading }, + import_react178.default.createElement( + StatusIndicator, + { type: "loading" }, + import_react178.default.createElement(live_region_default, { visible: true }, loadingText) + ) + ); + } else if (empty && !items.length) { + status = import_react178.default.createElement("div", { className: styles_css_default56.empty }, empty); + } + return import_react178.default.createElement( + LinkDefaultVariantContext.Provider, + { value: { defaultVariant: "primary" } }, + import_react178.default.createElement( + AnalyticsFunnelSubStep, + null, + import_react178.default.createElement( + "div", + Object.assign({}, baseProps, { className: clsx_m_default(baseProps.className, styles_css_default56.root), ref: mergedRef }), + import_react178.default.createElement( + InternalContainerAsSubstep, + { header: hasToolsHeader && import_react178.default.createElement( + "div", + { className: clsx_m_default(styles_css_default56.header, isRefresh && styles_css_default56["header-refresh"], styles_css_default56[`header-variant-${computedVariant}`], shouldRemoveHighContrastHeader() && styles_css_default56["remove-high-contrast-header"]) }, + import_react178.default.createElement( + CollectionLabelContext.Provider, + { value: { assignId: setHeaderRef } }, + import_react178.default.createElement(ToolsHeader, { header, filter, pagination, preferences }) + ) + ), footer: hasFooterPagination && import_react178.default.createElement("div", { className: styles_css_default56["footer-pagination"] }, pagination), disableContentPaddings: true, disableHeaderPaddings: computedVariant === "full-page", variant: computedVariant === "container" ? "cards" : computedVariant, __stickyHeader: stickyHeader, __stickyOffset: stickyHeaderVerticalOffset, __headerRef: headerRef, __darkHeader: computedVariant === "full-page", __disableFooterDivider: true }, + import_react178.default.createElement( + "div", + { className: clsx_m_default(hasToolsHeader && styles_css_default56["has-header"], isRefresh && styles_css_default56.refresh, styles_css_default56[`header-variant-${computedVariant}`], shouldRemoveHighContrastHeader() && styles_css_default56["remove-high-contrast-header"]) }, + !!renderAriaLive && !!firstIndex && import_react178.default.createElement( + live_region_default, + null, + import_react178.default.createElement("span", null, renderAriaLive({ totalItemsCount, firstIndex, lastIndex: firstIndex + items.length - 1 })) + ), + status !== null && status !== void 0 ? status : import_react178.default.createElement(CardsList, { items, cardDefinition, trackBy, selectionType, columns, isItemSelected, getItemSelectionProps, visibleSections, updateShiftToggle, onFocus: onCardFocus, ariaLabel: ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.cardsLabel, ariaLabelledby: isLabelledByHeader && headerIdRef.current ? headerIdRef.current : void 0, entireCardClickable }) + ) + ) + ) + ) + ); +}); +var cards_default = Cards; +var CardsList = ({ items, cardDefinition, trackBy, selectionType, columns, isItemSelected, getItemSelectionProps, visibleSections, updateShiftToggle, onFocus, ariaLabelledby, ariaLabel, entireCardClickable }) => { + const selectable = !!selectionType; + const canClickEntireCard = selectable && entireCardClickable; + const isRefresh = useVisualRefresh(); + const { moveFocusDown, moveFocusUp } = useSelectionFocusMove(selectionType, items.length); + let visibleSectionsDefinition = cardDefinition.sections || []; + visibleSectionsDefinition = visibleSections ? visibleSectionsDefinition.filter((section) => section.id && visibleSections.indexOf(section.id) !== -1) : visibleSectionsDefinition; + let listRole = void 0; + let listItemRole = void 0; + if (selectable) { + listRole = "group"; + listItemRole = "presentation"; + } + return import_react178.default.createElement("ol", Object.assign({ className: clsx_m_default(styles_css_default56.list, styles_css_default56[`list-grid-${columns || 1}`]), role: listRole, "aria-labelledby": ariaLabelledby, "aria-label": ariaLabel }, focusMarkers && focusMarkers.root), items.map((item, index) => import_react178.default.createElement( + "li", + Object.assign({ className: clsx_m_default(styles_css_default56.card, { + [styles_css_default56["card-selectable"]]: selectable, + [styles_css_default56["card-selected"]]: selectable && isItemSelected(item) + }), key: getItemKey(trackBy, item, index), onFocus }, focusMarkers && focusMarkers.item, { role: listItemRole }), + import_react178.default.createElement( + "div", + { className: clsx_m_default(styles_css_default56["card-inner"], isRefresh && styles_css_default56.refresh), onClick: canClickEntireCard ? (event) => { + var _a; + getItemSelectionProps(item).onChange(); + (_a = event.currentTarget.querySelector("input")) === null || _a === void 0 ? void 0 : _a.focus(); + } : void 0 }, + import_react178.default.createElement( + "div", + { className: styles_css_default56["card-header"] }, + import_react178.default.createElement("div", { className: styles_css_default56["card-header-inner"] }, cardDefinition.header ? cardDefinition.header(item) : ""), + selectable && import_react178.default.createElement( + "div", + { className: styles_css_default56["selection-control"] }, + import_react178.default.createElement(SelectionControl, Object.assign({ onFocusDown: moveFocusDown, onFocusUp: moveFocusUp, onShiftToggle: updateShiftToggle }, getItemSelectionProps(item))) + ) + ), + visibleSectionsDefinition.map(({ width = 100, header, content, id }, index2) => import_react178.default.createElement( + "div", + { key: id || index2, className: styles_css_default56.section, style: { width: `${width}%` } }, + header ? import_react178.default.createElement("div", { className: styles_css_default56["section-header"] }, header) : "", + content ? import_react178.default.createElement("div", { className: styles_css_default56["section-content"] }, content(item)) : "" + )) + ) + ))); +}; +applyDisplayName(Cards, "Cards"); + +// node_modules/@cloudscape-design/components/checkbox/index.js +var import_react179 = __toESM(require_react()); +var Checkbox = import_react179.default.forwardRef((_a, ref) => { + var props2 = __rest(_a, []); + const baseComponentProps = useBaseComponent("Checkbox"); + return import_react179.default.createElement(internal_default5, Object.assign({}, props2, baseComponentProps, { ref })); +}); +applyDisplayName(Checkbox, "Checkbox"); +var checkbox_default = Checkbox; + +// node_modules/@cloudscape-design/components/code-editor/index.js +var import_react190 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/code-editor/pane.js +var import_react181 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/code-editor/resizable-box/index.js +var import_react180 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/code-editor/resizable-box/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/code-editor/resizable-box/styles.scoped.css"; +var styles_css_default57 = { + "resizable-box": "awsui_resizable-box_cufu9_1kvmu_17", + "resizable-box-handle": "awsui_resizable-box-handle_cufu9_1kvmu_22", + "resize-active": "awsui_resize-active_cufu9_1kvmu_49" +}; + +// node_modules/@cloudscape-design/components/code-editor/resizable-box/index.js +function ResizableBox({ children: children2, height, minHeight, onResize }) { + const [dragOffset, setDragOffset] = (0, import_react180.useState)(null); + const onResizeStable = useStableCallback(onResize); + const containerRef = (0, import_react180.useRef)(null); + const onMouseDown = (event) => { + if (event.button !== 0 || !containerRef.current) { + return; + } + const containerBottom = containerRef.current.getBoundingClientRect().bottom; + setDragOffset(containerBottom - event.clientY); + }; + (0, import_react180.useEffect)(() => { + if (dragOffset === null || !containerRef.current) { + return; + } + const container = containerRef.current; + const onMouseMove = (event) => { + const { top } = container.getBoundingClientRect(); + const cursor = event.clientY; + onResizeStable(Math.max(cursor + dragOffset - top, minHeight)); + }; + const onMouseUp = () => { + setDragOffset(null); + }; + document.body.classList.add(styles_css_default57["resize-active"]); + document.addEventListener("mousemove", onMouseMove); + document.addEventListener("mouseup", onMouseUp); + return () => { + document.removeEventListener("mousemove", onMouseMove); + document.removeEventListener("mouseup", onMouseUp); + document.body.classList.remove(styles_css_default57["resize-active"]); + }; + }, [dragOffset, minHeight, onResizeStable]); + return import_react180.default.createElement( + "div", + { ref: containerRef, className: styles_css_default57["resizable-box"], style: { height } }, + children2, + import_react180.default.createElement("span", { className: styles_css_default57["resizable-box-handle"], onMouseDown }) + ); +} + +// node_modules/@cloudscape-design/components/code-editor/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/code-editor/styles.scoped.css"; +var styles_css_default58 = { + "code-editor-refresh": "awsui_code-editor-refresh_1gl9c_162o6_104", + "code-editor": "awsui_code-editor_1gl9c_162o6_104", + "pane": "awsui_pane_1gl9c_162o6_450", + "pane__close-container": "awsui_pane__close-container_1gl9c_162o6_461", + "pane__list": "awsui_pane__list_1gl9c_162o6_466", + "pane__table": "awsui_pane__table_1gl9c_162o6_473", + "pane__item": "awsui_pane__item_1gl9c_162o6_479", + "pane__cell": "awsui_pane__cell_1gl9c_162o6_479", + "pane__item--highlighted": "awsui_pane__item--highlighted_1gl9c_162o6_493", + "pane__location": "awsui_pane__location_1gl9c_162o6_514", + "pane__description": "awsui_pane__description_1gl9c_162o6_514", + "focus-lock": "awsui_focus-lock_1gl9c_162o6_529", + "editor": "awsui_editor_1gl9c_162o6_580", + "editor-refresh": "awsui_editor-refresh_1gl9c_162o6_608", + "status-bar": "awsui_status-bar_1gl9c_162o6_613", + "status-bar-with-hidden-pane": "awsui_status-bar-with-hidden-pane_1gl9c_162o6_621", + "status-bar__left": "awsui_status-bar__left_1gl9c_162o6_625", + "status-bar__left-virtual": "awsui_status-bar__left-virtual_1gl9c_162o6_632", + "status-bar__right": "awsui_status-bar__right_1gl9c_162o6_636", + "status-bar__language-mode": "awsui_status-bar__language-mode_1gl9c_162o6_640", + "status-bar__cursor-position": "awsui_status-bar__cursor-position_1gl9c_162o6_640", + "status-bar__cog-button": "awsui_status-bar__cog-button_1gl9c_162o6_646", + "status-bar-virtual": "awsui_status-bar-virtual_1gl9c_162o6_651", + "tab-button": "awsui_tab-button_1gl9c_162o6_657", + "tab-button--refresh": "awsui_tab-button--refresh_1gl9c_162o6_689", + "tab-button--warnings": "awsui_tab-button--warnings_1gl9c_162o6_692", + "tab-button--active": "awsui_tab-button--active_1gl9c_162o6_701", + "tab-button--disabled": "awsui_tab-button--disabled_1gl9c_162o6_717", + "tab-button--divider": "awsui_tab-button--divider_1gl9c_162o6_750", + "tab-button--errors": "awsui_tab-button--errors_1gl9c_162o6_757", + "loading-screen": "awsui_loading-screen_1gl9c_162o6_761", + "error-screen": "awsui_error-screen_1gl9c_162o6_762" +}; + +// node_modules/@cloudscape-design/components/code-editor/ace-modes.js +var AceModes = [ + { value: "abap", label: "ABAP" }, + { value: "abc", label: "ABC" }, + { value: "actionscript", label: "ActionScript" }, + { value: "ada", label: "ADA" }, + { value: "alda", label: "Alda" }, + { value: "apache_conf", label: "Apache Conf" }, + { value: "apex", label: "Apex" }, + { value: "aql", label: "AQL" }, + { value: "asciidoc", label: "AsciiDoc" }, + { value: "asl", label: "ASL" }, + { value: "assembly_x86", label: "Assembly x86" }, + { value: "autohotkey", label: "AutoHotkey/AutoIt" }, + { value: "batchfile", label: "BatchFile" }, + { value: "c_cpp", label: "C/C++" }, + { value: "c9search", label: "C9Search" }, + { value: "cirru", label: "Cirru" }, + { value: "clojure", label: "Clojure" }, + { value: "cobol", label: "Cobol" }, + { value: "coffee", label: "CoffeeScript" }, + { value: "coldfusion", label: "ColdFusion" }, + { value: "crystal", label: "Crystal" }, + { value: "csharp", label: "C#" }, + { value: "csound_document", label: "Csound Document" }, + { value: "csound_orchestra", label: "Csound" }, + { value: "csound_score", label: "Csound Score" }, + { value: "css", label: "CSS" }, + { value: "curly", label: "Curly" }, + { value: "d", label: "D" }, + { value: "dart", label: "Dart" }, + { value: "diff", label: "Diff" }, + { value: "django", label: "Django" }, + { value: "dockerfile", label: "Dockerfile" }, + { value: "dot", label: "Dot" }, + { value: "drools", label: "Drools" }, + { value: "edifact", label: "Edifact" }, + { value: "eiffel", label: "Eiffel" }, + { value: "ejs", label: "EJS" }, + { value: "elixir", label: "Elixir" }, + { value: "elm", label: "Elm" }, + { value: "erlang", label: "Erlang" }, + { value: "forth", label: "Forth" }, + { value: "fortran", label: "Fortran" }, + { value: "fsharp", label: "FSharp" }, + { value: "fsl", label: "FSL" }, + { value: "ftl", label: "FreeMarker" }, + { value: "gcode", label: "Gcode" }, + { value: "gherkin", label: "Gherkin" }, + { value: "gitignore", label: "Gitignore" }, + { value: "glsl", label: "Glsl" }, + { value: "gobstones", label: "Gobstones" }, + { value: "golang", label: "Go" }, + { value: "graphqlschema", label: "GraphQLSchema" }, + { value: "groovy", label: "Groovy" }, + { value: "haml", label: "HAML" }, + { value: "handlebars", label: "Handlebars" }, + { value: "haskell", label: "Haskell" }, + { value: "haskell_cabal", label: "Haskell Cabal" }, + { value: "haxe", label: "haXe" }, + { value: "hjson", label: "Hjson" }, + { value: "html", label: "HTML" }, + { value: "html_elixir", label: "HTML (Elixir)" }, + { value: "html_ruby", label: "HTML (Ruby)" }, + { value: "ini", label: "INI" }, + { value: "io", label: "Io" }, + { value: "jack", label: "Jack" }, + { value: "jade", label: "Jade" }, + { value: "java", label: "Java" }, + { value: "javascript", label: "JavaScript" }, + { value: "json", label: "JSON" }, + { value: "json5", label: "JSON5" }, + { value: "jsoniq", label: "JSONiq" }, + { value: "jsp", label: "JSP" }, + { value: "jssm", label: "JSSM" }, + { value: "jsx", label: "JSX" }, + { value: "julia", label: "Julia" }, + { value: "kotlin", label: "Kotlin" }, + { value: "latex", label: "LaTeX" }, + { value: "less", label: "LESS" }, + { value: "liquid", label: "Liquid" }, + { value: "lisp", label: "Lisp" }, + { value: "livescript", label: "LiveScript" }, + { value: "logiql", label: "LogiQL" }, + { value: "lsl", label: "LSL" }, + { value: "lua", label: "Lua" }, + { value: "luapage", label: "LuaPage" }, + { value: "lucene", label: "Lucene" }, + { value: "makefile", label: "Makefile" }, + { value: "markdown", label: "Markdown" }, + { value: "mask", label: "Mask" }, + { value: "matlab", label: "MATLAB" }, + { value: "maze", label: "Maze" }, + { value: "mediawiki", label: "MediaWiki" }, + { value: "mel", label: "MEL" }, + { value: "mixal", label: "MIXAL" }, + { value: "mushcode", label: "MUSHCode" }, + { value: "mysql", label: "MySQL" }, + { value: "nginx", label: "Nginx" }, + { value: "nim", label: "Nim" }, + { value: "nix", label: "Nix" }, + { value: "nsis", label: "NSIS" }, + { value: "nunjucks", label: "Nunjucks" }, + { value: "objectivec", label: "Objective-C" }, + { value: "ocaml", label: "OCaml" }, + { value: "pascal", label: "Pascal" }, + { value: "perl", label: "Perl" }, + { value: "perl6", label: "Perl 6" }, + { value: "pgsql", label: "pgSQL" }, + { value: "php", label: "PHP" }, + { value: "php_laravel_blade", label: "PHP (Blade Template)" }, + { value: "pig", label: "Pig" }, + { value: "powershell", label: "Powershell" }, + { value: "praat", label: "Praat" }, + { value: "prisma", label: "Prisma" }, + { value: "prolog", label: "Prolog" }, + { value: "properties", label: "Properties" }, + { value: "protobuf", label: "Protobuf" }, + { value: "puppet", label: "Puppet" }, + { value: "python", label: "Python" }, + { value: "qml", label: "QML" }, + { value: "r", label: "R" }, + { value: "razor", label: "Razor" }, + { value: "rdoc", label: "RDoc" }, + { value: "red", label: "Red" }, + { value: "rhtml", label: "RHTML" }, + { value: "rst", label: "RST" }, + { value: "ruby", label: "Ruby" }, + { value: "rust", label: "Rust" }, + { value: "sass", label: "SASS" }, + { value: "scad", label: "SCAD" }, + { value: "scala", label: "Scala" }, + { value: "scheme", label: "Scheme" }, + { value: "scss", label: "SCSS" }, + { value: "sh", label: "SH" }, + { value: "sjs", label: "SJS" }, + { value: "slim", label: "Slim" }, + { value: "smarty", label: "Smarty" }, + { value: "snippets", label: "snippets" }, + { value: "soy_template", label: "Soy Template" }, + { value: "space", label: "Space" }, + { value: "sql", label: "SQL" }, + { value: "sqlserver", label: "SQLServer" }, + { value: "stylus", label: "Stylus" }, + { value: "svg", label: "SVG" }, + { value: "swift", label: "Swift" }, + { value: "tcl", label: "Tcl" }, + { value: "terraform", label: "Terraform" }, + { value: "tex", label: "Tex" }, + { value: "text", label: "Text" }, + { value: "textile", label: "Textile" }, + { value: "toml", label: "Toml" }, + { value: "tsx", label: "TSX" }, + { value: "twig", label: "Twig" }, + { value: "typescript", label: "TypeScript" }, + { value: "vala", label: "Vala" }, + { value: "vbscript", label: "VBScript" }, + { value: "velocity", label: "Velocity" }, + { value: "verilog", label: "Verilog" }, + { value: "vhdl", label: "VHDL" }, + { value: "visualforce", label: "Visualforce" }, + { value: "wollok", label: "Wollok" }, + { value: "xml", label: "XML" }, + { value: "xquery", label: "XQuery" }, + { value: "yaml", label: "YAML" }, + { value: "zeek", label: "Zeek" } +]; + +// node_modules/@cloudscape-design/components/code-editor/ace-themes.js +var LightThemes = [ + { value: "chrome", label: "Chrome" }, + { value: "clouds", label: "Clouds" }, + { value: "crimson_editor", label: "Crimson Editor" }, + { value: "dawn", label: "Dawn" }, + { value: "dreamweaver", label: "Dreamweaver" }, + { value: "eclipse", label: "Eclipse" }, + { value: "github", label: "GitHub" }, + { value: "iplastic", label: "IPlastic" }, + { value: "solarized_light", label: "Solarized Light" }, + { value: "textmate", label: "TextMate" }, + { value: "tomorrow", label: "Tomorrow" }, + { value: "xcode", label: "Xcode" }, + { value: "kuroir", label: "Kuroir" }, + { value: "katzenmilch", label: "KatzenMilch" }, + { value: "sqlserver", label: "SQL Server" }, + { value: "cloud_editor", label: "CloudEditor" } +]; +var DarkThemes = [ + { value: "ambiance", label: "Ambiance" }, + { value: "chaos", label: "Chaos" }, + { value: "clouds_midnight", label: "Clouds Midnight" }, + { value: "dracula", label: "Dracula" }, + { value: "cobalt", label: "Cobalt" }, + { value: "gruvbox", label: "Gruvbox" }, + { value: "gob", label: "Green on Black" }, + { value: "idle_fingers", label: "idle Fingers" }, + { value: "kr_theme", label: "krTheme" }, + { value: "merbivore", label: "Merbivore" }, + { value: "merbivore_soft", label: "Merbivore Soft" }, + { value: "mono_industrial", label: "Mono Industrial" }, + { value: "monokai", label: "Monokai" }, + { value: "nord_dark", label: "Nord Dark" }, + { value: "pastel_on_dark", label: "Pastel on dark" }, + { value: "solarized_dark", label: "Solarized Dark" }, + { value: "terminal", label: "Terminal" }, + { value: "tomorrow_night", label: "Tomorrow Night" }, + { value: "tomorrow_night_blue", label: "Tomorrow Night Blue" }, + { value: "tomorrow_night_bright", label: "Tomorrow Night Bright" }, + { value: "tomorrow_night_eighties", label: "Tomorrow Night 80s" }, + { value: "twilight", label: "Twilight" }, + { value: "vibrant_ink", label: "Vibrant Ink" }, + { value: "cloud_editor_dark", label: "CloudEditor Dark" } +]; + +// node_modules/@cloudscape-design/components/code-editor/util.js +var CLOUD_EDITOR_LIGHT_THEME = "cloud_editor"; +var CLOUD_EDITOR_DARK_THEME = "cloud_editor_dark"; +var FALLBACK_LIGHT_THEME = "dawn"; +var FALLBACK_DARK_THEME = "tomorrow_night_bright"; +var DEFAULT_AVAILABLE_THEMES = { + light: LightThemes.map((theme) => theme.value).filter((value) => value !== CLOUD_EDITOR_LIGHT_THEME), + dark: DarkThemes.map((theme) => theme.value).filter((value) => value !== CLOUD_EDITOR_DARK_THEME) +}; +function isAceVersionAtLeast(ace, minVersion) { + var _a; + const semanticVersion = (_a = ace === null || ace === void 0 ? void 0 : ace.version) === null || _a === void 0 ? void 0 : _a.split(".").map((part) => { + const parsed = parseInt(part); + return Number.isNaN(parsed) ? part : parsed; + }); + return !!semanticVersion && typeof semanticVersion[0] === "number" && semanticVersion[0] >= minVersion[0] && typeof semanticVersion[1] === "number" && semanticVersion[1] >= minVersion[1] && typeof semanticVersion[2] === "number" && semanticVersion[2] >= minVersion[2]; +} +function supportsKeyboardAccessibility(ace) { + return isAceVersionAtLeast(ace, [1, 23, 0]); +} +function getDefaultConfig(ace) { + return Object.assign({ behavioursEnabled: true }, supportsKeyboardAccessibility(ace) ? { enableKeyboardAccessibility: true } : {}); +} +function getDefaultTheme(mode, themes) { + if (mode === "light") { + return (themes === null || themes === void 0 ? void 0 : themes.light.some((value) => value === CLOUD_EDITOR_LIGHT_THEME)) ? CLOUD_EDITOR_LIGHT_THEME : FALLBACK_LIGHT_THEME; + } else { + return (themes === null || themes === void 0 ? void 0 : themes.dark.some((value) => value === CLOUD_EDITOR_DARK_THEME)) ? CLOUD_EDITOR_DARK_THEME : FALLBACK_DARK_THEME; + } +} +function getAceTheme(theme) { + return `ace/theme/${theme}`; +} +function getLanguageLabel(language) { + var _a; + return ((_a = AceModes.filter((mode) => mode.value === language)[0]) === null || _a === void 0 ? void 0 : _a.label) || language; +} +function getStatusButtonId({ paneId, paneStatus }) { + return paneId ? `${paneId}-button-${paneStatus}` : void 0; +} + +// node_modules/@cloudscape-design/components/code-editor/pane.js +var ANNOTATION_ITEM_HEIGHT = 31; +var PANE_ANNOTATIONS_PADDING = 12; +var MIN_HEIGHT = 3 * ANNOTATION_ITEM_HEIGHT + 2 * PANE_ANNOTATIONS_PADDING; +var Pane = ({ id, paneStatus, visible, annotations, highlighted, onClose, onAnnotationClick, onAnnotationClear, cursorPositionLabel, closeButtonAriaLabel }) => { + const [paneHeight, setPaneHeight] = (0, import_react181.useState)(MIN_HEIGHT); + const listRef = (0, import_react181.useRef)(null); + (0, import_react181.useEffect)(() => { + var _a; + if (!highlighted) { + return; + } + const { row, column } = highlighted; + const highlightedAnnotationIndex = annotations.indexOf(annotations.filter((a2) => a2.row === row && a2.column === column)[0]); + if (highlightedAnnotationIndex > -1) { + const errorItem = (_a = listRef.current) === null || _a === void 0 ? void 0 : _a.children[highlightedAnnotationIndex]; + errorItem === null || errorItem === void 0 ? void 0 : errorItem.focus(); + } + }, [highlighted, annotations]); + const onItemClick = (annotation) => { + onAnnotationClick(annotation); + }; + const onItemKeyDown = (annotation, event) => { + if (event.keyCode === KeyCode.enter || event.keyCode === KeyCode.space) { + event.preventDefault(); + onAnnotationClick(annotation); + } + }; + const onEscKeyDown = (event) => { + if (event.keyCode === KeyCode.escape) { + event.preventDefault(); + onClose(); + } + }; + const ariaLabelledBy = getStatusButtonId({ paneId: id, paneStatus }); + if (!visible) { + return null; + } + return import_react181.default.createElement( + "div", + { id, className: styles_css_default58.pane, onKeyDown: onEscKeyDown, role: "tabpanel", "aria-labelledby": ariaLabelledBy }, + import_react181.default.createElement( + ResizableBox, + { height: paneHeight, minHeight: MIN_HEIGHT, onResize: (newHeight) => setPaneHeight(newHeight) }, + import_react181.default.createElement( + focus_lock_default, + { className: styles_css_default58["focus-lock"], autoFocus: true, restoreFocus: true }, + import_react181.default.createElement( + "div", + { className: styles_css_default58.pane__list, tabIndex: -1 }, + import_react181.default.createElement( + "table", + { className: styles_css_default58.pane__table, role: "presentation" }, + import_react181.default.createElement( + "colgroup", + null, + import_react181.default.createElement("col", { + style: { width: 1 } + /* shrink to fit content */ + }), + import_react181.default.createElement("col", { style: { width: "auto" } }) + ), + import_react181.default.createElement("tbody", { ref: listRef }, annotations.map((annotation, i) => { + var _a; + return import_react181.default.createElement( + "tr", + { key: i, role: "link", className: styles_css_default58.pane__item, onMouseOver: onAnnotationClear, onClick: onItemClick.bind(null, annotation), onKeyDown: onItemKeyDown.bind(null, annotation), tabIndex: 0 }, + import_react181.default.createElement("td", { className: clsx_m_default(styles_css_default58.pane__location, styles_css_default58.pane__cell), tabIndex: -1 }, (_a = cursorPositionLabel === null || cursorPositionLabel === void 0 ? void 0 : cursorPositionLabel((annotation.row || 0) + 1, (annotation.column || 0) + 1)) !== null && _a !== void 0 ? _a : ""), + import_react181.default.createElement("td", { className: clsx_m_default(styles_css_default58.pane__description, styles_css_default58.pane__cell), tabIndex: -1 }, annotation.text) + ); + })) + ) + ), + import_react181.default.createElement( + "div", + { className: styles_css_default58["pane__close-container"] }, + import_react181.default.createElement(InternalButton, { formAction: "none", variant: "icon", iconName: "close", onClick: onClose, ariaLabel: closeButtonAriaLabel }) + ) + ) + ) + ); +}; + +// node_modules/@cloudscape-design/components/code-editor/listeners.js +var import_react182 = __toESM(require_react()); +function useChangeEffect(editor, onChange, onDelayedChange) { + const debouncedChangeHandler = useDebounceCallback((detail) => { + fireNonCancelableEvent(onDelayedChange, detail); + }, 0); + const handleChange = useStableCallback(() => { + const changeDetail = { value: (editor === null || editor === void 0 ? void 0 : editor.getValue()) || "" }; + fireNonCancelableEvent(onChange, changeDetail); + debouncedChangeHandler(changeDetail); + }); + (0, import_react182.useEffect)(() => { + if (!editor) { + return; + } + editor.on("change", handleChange); + return () => editor.off("change", handleChange); + }, [editor, handleChange]); +} + +// node_modules/@cloudscape-design/components/code-editor/setup-editor.js +function setupEditor(ace, editor, setAnnotations, setCursorPosition, setHighlightedAnnotation, setPaneStatus) { + setEditorDefaults(ace, editor); + editor.session.selection.on("changeCursor", () => { + setCursorPosition(editor.getCursorPosition()); + }); + editor.session.on("changeAnnotation", () => { + const editorAnnotations = editor.session.getAnnotations(); + const newAnnotations = editorAnnotations.filter((a2) => a2.type !== "info"); + if (editorAnnotations.length !== newAnnotations.length) { + editor.session.setAnnotations(newAnnotations); + } + setAnnotations(newAnnotations); + }); + const moveCursorToAnnotation = (a2) => { + if (typeof a2.row === "number") { + editor.gotoLine(a2.row + 1, a2.column || 0, false); + } + }; + const openAnnotation = (row) => { + const currentAnnotations = editor.session.getAnnotations().filter((a2) => a2.row === row && a2.type !== "info"); + const errors = currentAnnotations.filter((a2) => a2.type === "error"); + if (errors.length > 0) { + setHighlightedAnnotation(errors[0]); + setPaneStatus("error"); + moveCursorToAnnotation(errors[0]); + } else if (currentAnnotations.length > 0) { + setHighlightedAnnotation(currentAnnotations[0]); + setPaneStatus("warning"); + moveCursorToAnnotation(currentAnnotations[0]); + } else { + setHighlightedAnnotation(void 0); + setPaneStatus("hidden"); + editor.gotoLine(row + 1, 0, false); + } + }; + editor.on("gutterclick", (e) => { + const { row } = e.getDocumentPosition(); + openAnnotation(row); + }); + editor.on("gutterkeydown", (e) => { + if (e.isInAnnotationLane() && (e.getKey() === "space" || e.getKey() === "return")) { + const row = e.getRow(); + openAnnotation(row); + } + }); + editor.on("change", () => { + if (editor.getValue().length === 0) { + editor.session.clearAnnotations(); + } + }); +} +function setEditorDefaults(ace, editor) { + ace.config.loadModule("ace/ext/language_tools", function() { + editor.setOptions({ + displayIndentGuides: false, + enableSnippets: true, + enableBasicAutocompletion: true + }); + }); + editor.setAutoScrollEditorIntoView(true); + if (!supportsKeyboardAccessibility(ace)) { + editor.commands.addCommand({ + name: "exitCodeEditor", + bindKey: "Esc", + exec: () => { + editor.container.focus(); + } + }); + } + editor.on("focus", () => { + editor.textInput.getElement().setAttribute("tabindex", 0); + }); + editor.on("blur", () => { + editor.textInput.getElement().setAttribute("tabindex", -1); + }); + editor.textInput.getElement().setAttribute("tabindex", -1); + editor.commands.removeCommand("showSettingsMenu", false); + editor.on("guttermousedown", (e) => { + e.stop(); + }); + editor.setHighlightActiveLine(false); + editor.$updateHighlightActiveLine = function() { + const session = this.getSession(); + let highlight; + if (this.$highlightActiveLine) { + if (this.$selectionStyle !== "line" || !this.selection.isMultiLine()) { + highlight = this.getCursorPosition(); + } + if (this.renderer.$maxLines && this.session.getLength() === 1 && !(this.renderer.$minLines > 1)) { + highlight = false; + } + } + if (session.$highlightLineMarker && !highlight) { + session.removeMarker(session.$highlightLineMarker.id); + session.$highlightLineMarker = null; + } else if (!session.$highlightLineMarker && highlight) { + const range2 = new ace.Range(highlight.row, 0, highlight.row, Infinity); + range2.id = session.addMarker(range2, "ace_active-line", "fullLine"); + session.$highlightLineMarker = range2; + } else if (highlight) { + session.$highlightLineMarker.start.row = highlight.row; + session.$highlightLineMarker.end.row = highlight.row; + session.$highlightLineMarker.start.column = 0; + session._signal("changeBackMarker"); + } + }; + editor.setHighlightActiveLine(true); + editor.on("showGutterTooltip", (tooltip) => { + tooltip.hide(); + }); +} + +// node_modules/@cloudscape-design/components/code-editor/preferences-modal.js +var import_react184 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/select/internal.js +var import_react183 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/select/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/select/styles.scoped.css"; +var styles_css_default59 = { + "root": "awsui_root_r2vco_wvvus_99" +}; + +// node_modules/@cloudscape-design/components/select/internal.js +var InternalSelect = import_react183.default.forwardRef((_a, externalRef) => { + var _b; + var { options, filteringType = "none", filteringPlaceholder, filteringAriaLabel, filteringClearAriaLabel, filteringResultsText, ariaRequired, placeholder, disabled, ariaLabel, statusType = "finished", empty, loadingText, finishedText, errorText, noMatch, triggerVariant = "label", renderHighlightedAriaLive, selectedOption, onBlur, onFocus, onLoadItems, onChange, virtualScroll, expandToViewport, autoFocus, __inFilteringToken, __internalRootRef = null } = _a, restProps = __rest(_a, ["options", "filteringType", "filteringPlaceholder", "filteringAriaLabel", "filteringClearAriaLabel", "filteringResultsText", "ariaRequired", "placeholder", "disabled", "ariaLabel", "statusType", "empty", "loadingText", "finishedText", "errorText", "noMatch", "triggerVariant", "renderHighlightedAriaLive", "selectedOption", "onBlur", "onFocus", "onLoadItems", "onChange", "virtualScroll", "expandToViewport", "autoFocus", "__inFilteringToken", "__internalRootRef"]); + const baseProps = getBaseProps(restProps); + const formFieldContext = useFormFieldContext(restProps); + const i18n = useInternalI18n("select"); + const errorIconAriaLabel = i18n("errorIconAriaLabel", restProps.errorIconAriaLabel); + const selectedAriaLabel = i18n("selectedAriaLabel", restProps.selectedAriaLabel); + const recoveryText = i18n("recoveryText", restProps.recoveryText); + if (restProps.recoveryText && !onLoadItems) { + warnOnce("Select", "`onLoadItems` must be provided for `recoveryText` to be displayed."); + } + const { handleLoadMore, handleRecoveryClick, fireLoadItems } = useLoadItems({ + onLoadItems, + options, + statusType + }); + checkControlled("Select", "selectedOption", selectedOption, "onChange", onChange); + checkOptionValueField("Select", "options", options); + const [filteringValue, setFilteringValue] = (0, import_react183.useState)(""); + const { filteredOptions, parentMap, totalCount, matchesCount } = prepareOptions(options, filteringType, filteringValue); + const rootRef = (0, import_react183.useRef)(null); + const triggerRef = (0, import_react183.useRef)(null); + const selfControlId = useUniqueId("trigger"); + const controlId = (_b = formFieldContext.controlId) !== null && _b !== void 0 ? _b : selfControlId; + const scrollToIndex = (0, import_react183.useRef)(null); + const { isOpen, highlightType, highlightedOption, highlightedIndex, getTriggerProps, getDropdownProps, getFilterProps, getMenuProps, getOptionProps: getOptionProps2, highlightOption, selectOption, announceSelected } = useSelect({ + selectedOptions: selectedOption ? [selectedOption] : [], + updateSelectedOption: (option) => fireNonCancelableEvent(onChange, { selectedOption: option }), + options: filteredOptions, + filteringType, + onBlur, + onFocus, + externalRef, + fireLoadItems, + setFilteringValue, + statusType + }); + const handleNativeSearch = useNativeSearch({ + isEnabled: filteringType === "none", + options: filteredOptions, + highlightOption: !isOpen ? selectOption : highlightOption, + highlightedOption: !isOpen ? selectedOption : highlightedOption === null || highlightedOption === void 0 ? void 0 : highlightedOption.option + }); + const selectAriaLabelId = useUniqueId("select-arialabel-"); + const footerId = useUniqueId("footer"); + (0, import_react183.useEffect)(() => { + var _a2; + (_a2 = scrollToIndex.current) === null || _a2 === void 0 ? void 0 : _a2.call(scrollToIndex, highlightedIndex); + }, [highlightedIndex]); + const filter = import_react183.default.createElement(filter_default, Object.assign({ clearAriaLabel: filteringClearAriaLabel, filteringType, placeholder: filteringPlaceholder, ariaLabel: filteringAriaLabel, ariaRequired, value: filteringValue }, getFilterProps())); + const trigger = import_react183.default.createElement(trigger_default, Object.assign({ ref: triggerRef, placeholder, disabled, triggerVariant, triggerProps: getTriggerProps(disabled, autoFocus), selectedOption, isOpen, inFilteringToken: __inFilteringToken }, formFieldContext, { controlId, ariaLabelledby: joinStrings(formFieldContext.ariaLabelledby, selectAriaLabelId) })); + const isEmpty = !options || options.length === 0; + const isNoMatch = filteredOptions && filteredOptions.length === 0; + const isFiltered = filteringType !== "none" && filteringValue.length > 0 && filteredOptions && filteredOptions.length > 0; + const filteredText = isFiltered ? filteringResultsText === null || filteringResultsText === void 0 ? void 0 : filteringResultsText(matchesCount, totalCount) : void 0; + const dropdownStatus = useDropdownStatus({ + statusType, + empty, + loadingText, + finishedText, + errorText, + recoveryText, + isEmpty, + isNoMatch, + noMatch, + isFiltered, + filteringResultsText: filteredText, + errorIconAriaLabel, + onRecoveryClick: handleRecoveryClick, + hasRecoveryCallback: !!onLoadItems + }); + const menuProps = Object.assign(Object.assign({}, getMenuProps()), { onLoadMore: handleLoadMore, ariaLabelledby: joinStrings(selectAriaLabelId, controlId), ariaDescribedby: dropdownStatus.content ? footerId : void 0 }); + const announcement = useAnnouncement({ + announceSelected, + highlightedOption, + getParent: (option) => { + var _a2; + return (_a2 = parentMap.get(option)) === null || _a2 === void 0 ? void 0 : _a2.option; + }, + selectedAriaLabel, + renderHighlightedAriaLive + }); + const ListComponent = virtualScroll ? virtual_list_default : plain_list_default; + const handleMouseDown = (event) => { + const target = event.target; + if (target !== document.activeElement) { + event.preventDefault(); + } + }; + const mergedRef = useMergeRefs(rootRef, __internalRootRef); + const dropdownProps = getDropdownProps(); + return import_react183.default.createElement( + "div", + Object.assign({}, baseProps, { ref: mergedRef, className: clsx_m_default(styles_css_default59.root, baseProps.className), onKeyDown: handleNativeSearch }), + import_react183.default.createElement( + dropdown_default, + Object.assign({}, dropdownProps, { ariaLabelledby: dropdownProps.dropdownContentRole ? joinStrings(selectAriaLabelId, controlId) : void 0, ariaDescribedby: dropdownProps.dropdownContentRole ? dropdownStatus.content ? footerId : void 0 : void 0, open: isOpen, stretchTriggerHeight: __inFilteringToken, stretchBeyondTriggerWidth: true, trigger, header: filter, onMouseDown: handleMouseDown, footer: dropdownStatus.isSticky ? import_react183.default.createElement(dropdown_footer_default, { content: isOpen ? dropdownStatus.content : null, id: footerId }) : null, expandToViewport }), + import_react183.default.createElement(ListComponent, { listBottom: !dropdownStatus.isSticky ? import_react183.default.createElement(dropdown_footer_default, { content: isOpen ? dropdownStatus.content : null, id: footerId }) : null, menuProps, getOptionProps: getOptionProps2, filteredOptions, filteringValue, ref: scrollToIndex, hasDropdownStatus: dropdownStatus.content !== null, screenReaderContent: announcement, highlightType }) + ), + import_react183.default.createElement(ScreenreaderOnly, { id: selectAriaLabelId }, ariaLabel) + ); +}); +var internal_default16 = InternalSelect; + +// node_modules/@cloudscape-design/components/code-editor/preferences-modal.js +function filterThemes(allThemes, available) { + return allThemes.filter((theme) => available.indexOf(theme.value) > -1); +} +var preferences_modal_default = (props2) => { + var _a, _b, _c, _d; + const [wrapLines, setWrapLines] = (0, import_react184.useState)((_b = (_a = props2.preferences) === null || _a === void 0 ? void 0 : _a.wrapLines) !== null && _b !== void 0 ? _b : true); + const [theme, setTheme] = (0, import_react184.useState)((_d = (_c = props2.preferences) === null || _c === void 0 ? void 0 : _c.theme) !== null && _d !== void 0 ? _d : props2.defaultTheme); + const themeOptions = [ + { + label: props2.i18nStrings.lightThemes, + options: filterThemes(LightThemes, props2.themes.light) + }, + { + label: props2.i18nStrings.darkThemes, + options: filterThemes(DarkThemes, props2.themes.dark) + } + ]; + const [selectedThemeOption, setSelectedThemeOption] = (0, import_react184.useState)(() => [...LightThemes, ...DarkThemes].filter((t) => t.value === theme)[0]); + const onThemeSelected = (e) => { + setTheme(e.detail.selectedOption.value); + setSelectedThemeOption(e.detail.selectedOption); + }; + return import_react184.default.createElement( + InternalModal, + { size: "medium", visible: true, getModalRoot: props2.getModalRoot, removeModalRoot: props2.removeModalRoot, onDismiss: props2.onDismiss, header: props2.i18nStrings.header, closeAriaLabel: props2.i18nStrings.cancel, footer: import_react184.default.createElement( + InternalBox, + { float: "right" }, + import_react184.default.createElement( + InternalSpaceBetween, + { direction: "horizontal", size: "xs" }, + import_react184.default.createElement(InternalButton, { onClick: props2.onDismiss }, props2.i18nStrings.cancel), + import_react184.default.createElement(InternalButton, { onClick: () => props2.onConfirm({ wrapLines, theme }), variant: "primary" }, props2.i18nStrings.confirm) + ) + ) }, + import_react184.default.createElement( + ColumnLayout, + { columns: 2, variant: "text-grid" }, + import_react184.default.createElement( + "div", + null, + import_react184.default.createElement(internal_default5, { checked: wrapLines, onChange: (e) => setWrapLines(e.detail.checked) }, props2.i18nStrings.wrapLines) + ), + import_react184.default.createElement( + "div", + null, + import_react184.default.createElement( + InternalFormField, + { label: props2.i18nStrings.theme }, + import_react184.default.createElement(internal_default16, { selectedOption: selectedThemeOption, onChange: onThemeSelected, options: themeOptions, filteringType: "auto", filteringAriaLabel: props2.i18nStrings.themeFilteringAriaLabel, filteringClearAriaLabel: props2.i18nStrings.themeFilteringClearAriaLabel, filteringPlaceholder: props2.i18nStrings.themeFilteringPlaceholder }) + ) + ) + ) + ); +}; + +// node_modules/@cloudscape-design/components/code-editor/loading-screen.js +var import_react185 = __toESM(require_react()); +var loading_screen_default = (props2) => import_react185.default.createElement( + "div", + { className: styles_css_default58["loading-screen"] }, + import_react185.default.createElement(InternalSpinner, { size: "normal", variant: "normal" }), + " ", + props2.children +); + +// node_modules/@cloudscape-design/components/code-editor/error-screen.js +var import_react186 = __toESM(require_react()); +var error_screen_default = ({ children: children2, recoveryText, onRecoveryClick }) => { + const onFollow = (0, import_react186.useCallback)(() => fireNonCancelableEvent(onRecoveryClick), [onRecoveryClick]); + return import_react186.default.createElement( + "div", + { className: styles_css_default58["error-screen"] }, + import_react186.default.createElement(internal_default, { name: "status-negative", variant: "error" }), + " ", + children2, + " ", + import_react186.default.createElement(internal_default12, { variant: "recovery", onFollow }, recoveryText) + ); +}; + +// node_modules/@cloudscape-design/components/code-editor/status-bar.js +var import_react188 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/code-editor/tab-button.js +var import_react187 = __toESM(require_react()); +var TabButton = import_react187.default.forwardRef(({ active, disabled, iconName, onClick, onFocus, onBlur, tabIndex, ariaHidden, ariaLabel, paneId, isRefresh, text, className, id }, ref) => { + return import_react187.default.createElement( + "button", + { className: clsx_m_default([styles_css_default58["tab-button"], className], { + [styles_css_default58["tab-button--active"]]: active, + [styles_css_default58["tab-button--disabled"]]: disabled, + [styles_css_default58["tab-button--refresh"]]: isRefresh + }), id, type: "button", onClick, onFocus, onBlur, disabled, ref, tabIndex, role: "tab", "aria-selected": active, "aria-controls": paneId, "aria-hidden": ariaHidden, "aria-label": ariaLabel }, + import_react187.default.createElement(internal_default, { name: iconName }), + " ", + text + ); +}); + +// node_modules/@cloudscape-design/components/code-editor/status-bar.js +function InternalStatusBar({ languageLabel, cursorPosition, paneStatus, onErrorPaneToggle, onWarningPaneToggle, onTabFocus, onTabBlur, errorsTabRef, warningsTabRef, isTabFocused, paneId, onPreferencesOpen, i18nStrings, errorCount, warningCount, leftBarRef, isVirtual, minifyCounters, isRefresh }) { + const i18n = useInternalI18n("code-editor"); + const errorText = `${i18n("i18nStrings.errorsTab", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.errorsTab)}: ${errorCount}`; + const warningText = `${i18n("i18nStrings.warningsTab", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.warningsTab)}: ${warningCount}`; + const errorButtonId = !isVirtual ? getStatusButtonId({ paneId, paneStatus: "error" }) : void 0; + const warningButtonId = !isVirtual ? getStatusButtonId({ paneId, paneStatus: "warning" }) : void 0; + return import_react188.default.createElement( + "div", + { className: clsx_m_default(styles_css_default58["status-bar"], { + [styles_css_default58["status-bar-with-hidden-pane"]]: paneStatus === "hidden", + [styles_css_default58["status-bar-virtual"]]: isVirtual + }), "aria-hidden": isVirtual }, + import_react188.default.createElement( + "div", + { className: clsx_m_default(styles_css_default58["status-bar__left"], { + [styles_css_default58["status-bar__left-virtual"]]: isVirtual + }), ref: leftBarRef }, + import_react188.default.createElement("span", { className: styles_css_default58["status-bar__language-mode"] }, languageLabel), + import_react188.default.createElement("span", { className: styles_css_default58["status-bar__cursor-position"] }, cursorPosition), + import_react188.default.createElement( + "div", + { role: "tablist" }, + import_react188.default.createElement(TabButton, { id: errorButtonId, text: minifyCounters ? ` ${errorCount}` : errorText, className: styles_css_default58["tab-button--errors"], iconName: "status-negative", disabled: errorCount === 0 || isVirtual, active: paneStatus === "error", onClick: onErrorPaneToggle, onFocus: onTabFocus, onBlur: onTabBlur, ref: errorsTabRef, ariaLabel: errorText, paneId, isRefresh }), + import_react188.default.createElement("span", { className: styles_css_default58["tab-button--divider"] }), + import_react188.default.createElement(TabButton, { id: warningButtonId, text: minifyCounters ? ` ${warningCount}` : warningText, className: styles_css_default58["tab-button--warnings"], iconName: "status-warning", disabled: warningCount === 0 || isVirtual, active: paneStatus === "warning", onClick: onWarningPaneToggle, onFocus: onTabFocus, onBlur: onTabBlur, ref: warningsTabRef, tabIndex: paneStatus === "error" && isTabFocused ? -1 : void 0, ariaHidden: paneStatus === "error" && isTabFocused ? true : void 0, ariaLabel: warningText, paneId, isRefresh }) + ), + import_react188.default.createElement( + live_region_default, + { assertive: true }, + import_react188.default.createElement( + "span", + null, + errorText, + " " + ), + import_react188.default.createElement("span", null, warningText) + ) + ), + import_react188.default.createElement( + "div", + { className: styles_css_default58["status-bar__right"] }, + import_react188.default.createElement( + "div", + { className: styles_css_default58["status-bar__cog-button"] }, + import_react188.default.createElement(InternalButton, { disabled: isVirtual, formAction: "none", variant: "icon", iconName: "settings", iconAlt: "Settings", ariaLabel: i18n("i18nStrings.preferencesButtonAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.preferencesButtonAriaLabel), onClick: onPreferencesOpen, __nativeAttributes: { + tabIndex: paneStatus !== "hidden" && isTabFocused ? -1 : void 0, + "aria-hidden": paneStatus !== "hidden" && isTabFocused ? true : void 0 + } }) + ) + ) + ); +} +var StatusBar = (_a) => { + var { errorsTabRef, warningsTabRef } = _a, restProps = __rest(_a, ["errorsTabRef", "warningsTabRef"]); + const [realWidth, statusLeftBarRef] = useContainerQuery((rect) => rect.contentBoxWidth); + const [virtualWidth, virtualStatusLeftBarRef] = useContainerQuery((rect) => rect.contentBoxWidth); + const minifyCounters = virtualWidth !== null && realWidth !== null && virtualWidth > realWidth; + return import_react188.default.createElement( + import_react188.default.Fragment, + null, + import_react188.default.createElement(InternalStatusBar, Object.assign({}, restProps, { isVirtual: false, leftBarRef: statusLeftBarRef, errorsTabRef, warningsTabRef, minifyCounters })), + import_react188.default.createElement(InternalStatusBar, Object.assign({}, restProps, { isVirtual: true, leftBarRef: virtualStatusLeftBarRef, minifyCounters: false })) + ); +}; + +// node_modules/@cloudscape-design/components/code-editor/use-editor.js +var import_react189 = __toESM(require_react()); +function useEditor(ace, themes, loading) { + const editorRef = (0, import_react189.useRef)(null); + const [editor, setEditor] = (0, import_react189.useState)(null); + const [initialTheme] = (0, import_react189.useState)(getAceTheme(getDefaultTheme(useCurrentMode(editorRef), themes))); + (0, import_react189.useEffect)(() => { + const elem = editorRef.current; + if (!ace || !elem) { + return; + } + const config = getDefaultConfig(ace); + setEditor(ace.edit(elem, Object.assign(Object.assign({}, config), { theme: initialTheme }))); + }, [ace, loading, initialTheme]); + return { editorRef, editor }; +} +function useSyncEditorLabels(editor, { controlId, ariaLabel, ariaLabelledby, ariaDescribedby }) { + (0, import_react189.useEffect)(() => { + if (!editor) { + return; + } + const { textarea } = editor.renderer; + if (!textarea) { + return; + } + const updateAttribute = (attribute, value) => value ? textarea.setAttribute(attribute, value) : textarea.removeAttribute(attribute); + updateAttribute("id", controlId); + updateAttribute("aria-label", ariaLabel); + updateAttribute("aria-labelledby", ariaLabelledby); + updateAttribute("aria-describedby", ariaDescribedby); + }, [ariaLabel, ariaDescribedby, ariaLabelledby, controlId, editor]); +} +function useSyncEditorSize(editor, { width, height }) { + (0, import_react189.useEffect)(() => { + editor === null || editor === void 0 ? void 0 : editor.resize(); + }, [editor, width, height]); + const onResize = (0, import_react189.useCallback)(() => { + editor === null || editor === void 0 ? void 0 : editor.resize(); + }, [editor]); + return { onResize }; +} +function useSyncEditorValue(editor, value) { + (0, import_react189.useEffect)(() => { + if (!editor) { + return; + } + if (value === editor.getValue()) { + return; + } + const pos = editor.session.selection.toJSON(); + editor.setValue(value, -1); + editor.session.selection.fromJSON(pos); + }, [editor, value]); +} +function useSyncEditorLanguage(editor, language) { + (0, import_react189.useEffect)(() => { + editor === null || editor === void 0 ? void 0 : editor.session.setMode(`ace/mode/${language}`); + }, [editor, language]); +} +function useSyncEditorWrapLines(editor, wrapLines) { + (0, import_react189.useEffect)(() => { + editor === null || editor === void 0 ? void 0 : editor.session.setUseWrapMode(wrapLines !== null && wrapLines !== void 0 ? wrapLines : true); + }, [editor, wrapLines]); +} +function useSyncEditorTheme(editor, theme) { + (0, import_react189.useEffect)(() => { + editor === null || editor === void 0 ? void 0 : editor.setTheme(getAceTheme(theme)); + }, [editor, theme]); +} + +// node_modules/@cloudscape-design/components/code-editor/index.js +var CodeEditor = (0, import_react190.forwardRef)((props2, ref) => { + var _a, _b; + const { ace, value, language, i18nStrings, editorContentHeight, onEditorContentResize, ariaLabel, languageLabel: customLanguageLabel, preferences, loading, themes, getModalRoot, removeModalRoot } = props2, rest = __rest(props2, ["ace", "value", "language", "i18nStrings", "editorContentHeight", "onEditorContentResize", "ariaLabel", "languageLabel", "preferences", "loading", "themes", "getModalRoot", "removeModalRoot"]); + const { __internalRootRef } = useBaseComponent("CodeEditor", { props: { language } }); + const { controlId, ariaLabelledby, ariaDescribedby } = useFormFieldContext(props2); + const [editorHeight = 480, setEditorHeight] = useControllable(editorContentHeight, onEditorContentResize, 480, { + componentName: "code-editor", + changeHandler: "onEditorContentResize", + controlledProp: "editorContentHeight" + }); + const mode = useCurrentMode(__internalRootRef); + const isRefresh = useVisualRefresh(); + const baseProps = getBaseProps(rest); + const i18n = useInternalI18n("code-editor"); + const errorsTabRef = (0, import_react190.useRef)(null); + const warningsTabRef = (0, import_react190.useRef)(null); + const [codeEditorWidth, codeEditorMeasureRef] = useContainerQuery((rect) => rect.contentBoxWidth); + const mergedRef = useMergeRefs(codeEditorMeasureRef, __internalRootRef); + const paneId = useUniqueId("code-editor-pane"); + const [paneStatus, setPaneStatus] = (0, import_react190.useState)("hidden"); + const [annotations, setAnnotations] = (0, import_react190.useState)([]); + const [highlightedAnnotation, setHighlightedAnnotation] = (0, import_react190.useState)(); + const [cursorPosition, setCursorPosition] = (0, import_react190.useState)({ row: 0, column: 0 }); + const [isTabFocused, setTabFocused] = (0, import_react190.useState)(false); + const { editorRef, editor } = useEditor(ace, themes, loading); + useForwardFocus(ref, editorRef); + (0, import_react190.useEffect)(() => { + if (!ace || !editor) { + return; + } + setupEditor(ace, editor, setAnnotations, setCursorPosition, setHighlightedAnnotation, setPaneStatus); + return () => { + editor === null || editor === void 0 ? void 0 : editor.destroy(); + }; + }, [ace, editor]); + useSyncEditorLabels(editor, { controlId, ariaLabel, ariaLabelledby, ariaDescribedby }); + const { onResize } = useSyncEditorSize(editor, { width: codeEditorWidth, height: editorContentHeight }); + useSyncEditorValue(editor, value); + useSyncEditorLanguage(editor, language); + useSyncEditorWrapLines(editor, preferences === null || preferences === void 0 ? void 0 : preferences.wrapLines); + const defaultTheme = getDefaultTheme(mode, themes); + useSyncEditorTheme(editor, (_a = preferences === null || preferences === void 0 ? void 0 : preferences.theme) !== null && _a !== void 0 ? _a : defaultTheme); + useChangeEffect(editor, props2.onChange, props2.onDelayedChange); + (0, import_react190.useEffect)(() => { + if (annotations.length === 0) { + setPaneStatus("hidden"); + } + if (props2.onValidate) { + fireNonCancelableEvent(props2.onValidate, { annotations }); + } + }, [annotations, props2.onValidate]); + const languageLabel = customLanguageLabel !== null && customLanguageLabel !== void 0 ? customLanguageLabel : getLanguageLabel(language); + const errorCount = annotations.filter((a2) => a2.type === "error").length; + const warningCount = annotations.filter((a2) => a2.type === "warning").length; + const currentAnnotations = (0, import_react190.useMemo)(() => annotations.filter((a2) => a2.type === paneStatus), [annotations, paneStatus]); + const onEditorKeydown = (0, import_react190.useCallback)((e) => { + if (editor && e.target === editor.container && e.keyCode === KeyCode.enter) { + e.stopPropagation(); + e.preventDefault(); + editor.focus(); + } + }, [editor]); + const onTabFocus = (0, import_react190.useCallback)(() => setTabFocused(true), []); + const onTabBlur = (0, import_react190.useCallback)(() => setTabFocused(false), []); + const onErrorPaneToggle = (0, import_react190.useCallback)(() => { + setPaneStatus(paneStatus !== "error" ? "error" : "hidden"); + }, [paneStatus]); + const onWarningPaneToggle = (0, import_react190.useCallback)(() => { + setPaneStatus(paneStatus !== "warning" ? "warning" : "hidden"); + }, [paneStatus]); + const onPaneClose = () => { + setPaneStatus("hidden"); + }; + const onAnnotationClick = ({ row = 0, column = 0 }) => { + if (!editor) { + return; + } + editor.focus(); + editor.gotoLine(row + 1, column, false); + setHighlightedAnnotation(void 0); + }; + const onAnnotationClear = (0, import_react190.useCallback)(() => { + setHighlightedAnnotation(void 0); + }, []); + const [isPreferencesModalVisible, setPreferencesModalVisible] = (0, import_react190.useState)(false); + const onPreferencesOpen = () => setPreferencesModalVisible(true); + const onPreferencesConfirm = (p) => { + fireNonCancelableEvent(props2.onPreferencesChange, p); + setPreferencesModalVisible(false); + }; + const onPreferencesDismiss = () => setPreferencesModalVisible(false); + const isPaneVisible = paneStatus !== "hidden"; + return import_react190.default.createElement( + "div", + Object.assign({}, baseProps, { className: clsx_m_default(styles_css_default58["code-editor"], baseProps.className, { [styles_css_default58["code-editor-refresh"]]: isRefresh }), ref: mergedRef }), + loading && import_react190.default.createElement( + loading_screen_default, + null, + import_react190.default.createElement(live_region_default, { visible: true }, i18n("i18nStrings.loadingState", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.loadingState)) + ), + !ace && !loading && import_react190.default.createElement(error_screen_default, { recoveryText: i18n("i18nStrings.errorStateRecovery", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.errorStateRecovery), onRecoveryClick: props2.onRecoveryClick }, i18n("i18nStrings.errorState", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.errorState)), + ace && !loading && import_react190.default.createElement( + import_react190.default.Fragment, + null, + import_react190.default.createElement( + ResizableBox, + { height: Math.max(editorHeight, 20), minHeight: 20, onResize: (height) => { + setEditorHeight(height); + onResize(); + fireNonCancelableEvent(onEditorContentResize, { height }); + } }, + import_react190.default.createElement("div", { ref: editorRef, className: clsx_m_default(styles_css_default58.editor, styles_css_default58.ace, isRefresh && styles_css_default58["editor-refresh"]), onKeyDown: onEditorKeydown, tabIndex: 0, role: "group", "aria-label": i18n("i18nStrings.editorGroupAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.editorGroupAriaLabel) }) + ), + import_react190.default.createElement( + "div", + { role: "group", "aria-label": i18n("i18nStrings.statusBarGroupAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.statusBarGroupAriaLabel) }, + import_react190.default.createElement(StatusBar, { languageLabel, cursorPosition: i18n("i18nStrings.cursorPosition", (_b = i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.cursorPosition) === null || _b === void 0 ? void 0 : _b.call(i18nStrings, cursorPosition.row + 1, cursorPosition.column + 1), (format2) => format2({ row: cursorPosition.row + 1, column: cursorPosition.column + 1 })), errorCount, warningCount, paneStatus, onErrorPaneToggle, onWarningPaneToggle, onTabFocus, onTabBlur, errorsTabRef, warningsTabRef, i18nStrings, isTabFocused, paneId: isPaneVisible ? paneId : void 0, onPreferencesOpen, isRefresh }), + import_react190.default.createElement(Pane, { id: paneId, paneStatus, visible: isPaneVisible, annotations: currentAnnotations, highlighted: highlightedAnnotation, onAnnotationClick, onAnnotationClear, onClose: onPaneClose, cursorPositionLabel: i18n("i18nStrings.cursorPosition", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.cursorPosition, (format2) => (row, column) => format2({ row, column })), closeButtonAriaLabel: i18n("i18nStrings.paneCloseButtonAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.paneCloseButtonAriaLabel) }) + ), + isPreferencesModalVisible && import_react190.default.createElement(preferences_modal_default, { getModalRoot, removeModalRoot, onConfirm: onPreferencesConfirm, onDismiss: onPreferencesDismiss, themes: themes !== null && themes !== void 0 ? themes : DEFAULT_AVAILABLE_THEMES, preferences, defaultTheme, i18nStrings: { + header: i18n("i18nStrings.preferencesModalHeader", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.preferencesModalHeader), + cancel: i18n("i18nStrings.preferencesModalCancel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.preferencesModalCancel), + confirm: i18n("i18nStrings.preferencesModalConfirm", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.preferencesModalConfirm), + wrapLines: i18n("i18nStrings.preferencesModalWrapLines", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.preferencesModalWrapLines), + theme: i18n("i18nStrings.preferencesModalTheme", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.preferencesModalTheme), + lightThemes: i18n("i18nStrings.preferencesModalLightThemes", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.preferencesModalLightThemes), + darkThemes: i18n("i18nStrings.preferencesModalDarkThemes", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.preferencesModalDarkThemes), + themeFilteringAriaLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.preferencesModalThemeFilteringAriaLabel, + themeFilteringClearAriaLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.preferencesModalThemeFilteringClearAriaLabel, + themeFilteringPlaceholder: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.preferencesModalThemeFilteringPlaceholder + } }) + ) + ); +}); +applyDisplayName(CodeEditor, "CodeEditor"); +var code_editor_default = CodeEditor; + +// node_modules/@cloudscape-design/components/column-layout/index.js +var import_react191 = __toESM(require_react()); +function ColumnLayout2(_a) { + var { columns = 1, variant = "default", borders = "none", disableGutters = false } = _a, props2 = __rest(_a, ["columns", "variant", "borders", "disableGutters"]); + const baseComponentProps = useBaseComponent("ColumnLayout", { + props: { borders, columns, disableGutters, minColumnWidth: props2.minColumnWidth, variant } + }); + const externalProps = getExternalProps(props2); + return import_react191.default.createElement(ColumnLayout, Object.assign({ columns, variant, borders, disableGutters }, externalProps, baseComponentProps)); +} +applyDisplayName(ColumnLayout2, "ColumnLayout"); + +// node_modules/@cloudscape-design/components/container/index.js +var import_react192 = __toESM(require_react()); +function Container(_a) { + var { variant = "default", disableHeaderPaddings = false, disableContentPaddings = false, fitHeight = false } = _a, props2 = __rest(_a, ["variant", "disableHeaderPaddings", "disableContentPaddings", "fitHeight"]); + const analyticsMetadata = getAnalyticsMetadataProps(props2); + const baseComponentProps = useBaseComponent("Container", { + props: { disableContentPaddings, disableHeaderPaddings, fitHeight, variant } + }, analyticsMetadata); + const externalProps = getExternalProps(props2); + return import_react192.default.createElement( + AnalyticsFunnelSubStep, + { instanceIdentifier: analyticsMetadata === null || analyticsMetadata === void 0 ? void 0 : analyticsMetadata.instanceIdentifier, errorContext: analyticsMetadata === null || analyticsMetadata === void 0 ? void 0 : analyticsMetadata.errorContext }, + import_react192.default.createElement(InternalContainerAsSubstep, Object.assign({ variant, disableContentPaddings, disableHeaderPaddings, fitHeight }, props2, externalProps, baseComponentProps)) + ); +} +applyDisplayName(Container, "Container"); + +// node_modules/@cloudscape-design/components/content-layout/index.js +var import_react194 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/content-layout/internal.js +var import_react193 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/content-layout/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/content-layout/styles.scoped.css"; +var styles_css_default60 = { + "layout": "awsui_layout_5gtk3_set91_105", + "is-visual-refresh": "awsui_is-visual-refresh_5gtk3_set91_105", + "background": "awsui_background_5gtk3_set91_108", + "header": "awsui_header_5gtk3_set91_111", + "is-overlap-disabled": "awsui_is-overlap-disabled_5gtk3_set91_127", + "content": "awsui_content_5gtk3_set91_135", + "has-header": "awsui_has-header_5gtk3_set91_139" +}; + +// node_modules/@cloudscape-design/components/content-layout/internal.js +function InternalContentLayout(_a) { + var { children: children2, disableOverlap, header, __internalRootRef } = _a, rest = __rest(_a, ["children", "disableOverlap", "header", "__internalRootRef"]); + const baseProps = getBaseProps(rest); + const isVisualRefresh = useVisualRefresh(); + const overlapElement = useDynamicOverlap(); + const isOverlapDisabled = !children2 || disableOverlap; + return import_react193.default.createElement( + "div", + Object.assign({}, baseProps, { className: clsx_m_default(baseProps.className, styles_css_default60.layout, { + [styles_css_default60["is-overlap-disabled"]]: isOverlapDisabled, + [styles_css_default60["is-visual-refresh"]]: isVisualRefresh, + [styles_css_default60["has-header"]]: !!header + }), ref: __internalRootRef }), + import_react193.default.createElement("div", { className: clsx_m_default(styles_css_default60.background, { [styles_css_default60["is-overlap-disabled"]]: isOverlapDisabled }, getContentHeaderClassName()), ref: overlapElement }), + header && import_react193.default.createElement("div", { className: clsx_m_default(styles_css_default60.header, getContentHeaderClassName()) }, header), + import_react193.default.createElement("div", { className: styles_css_default60.content }, children2) + ); +} + +// node_modules/@cloudscape-design/components/content-layout/index.js +function ContentLayout(props2) { + const baseComponentProps = useBaseComponent("ContentLayout", { + props: { disableOverlap: props2.disableOverlap } + }); + return import_react194.default.createElement(InternalContentLayout, Object.assign({}, props2, baseComponentProps)); +} +applyDisplayName(ContentLayout, "ContentLayout"); + +// node_modules/@cloudscape-design/components/copy-to-clipboard/index.js +var import_react196 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/popover/internal.js +var import_react195 = __toESM(require_react()); +var internal_default17 = import_react195.default.forwardRef(InternalPopover); +function InternalPopover(_a, ref) { + var { position = "right", size = "medium", fixedWidth = false, triggerType = "text", dismissButton: dismissButton2 = true, children: children2, header, content, triggerAriaLabel, renderWithPortal = false, __onOpen, __internalRootRef = null } = _a, restProps = __rest(_a, ["position", "size", "fixedWidth", "triggerType", "dismissButton", "children", "header", "content", "triggerAriaLabel", "renderWithPortal", "__onOpen", "__internalRootRef"]); + const baseProps = getBaseProps(restProps); + const triggerRef = (0, import_react195.useRef)(null); + const popoverRef = (0, import_react195.useRef)(null); + const clickFrameId = (0, import_react195.useRef)(null); + const i18n = useInternalI18n("popover"); + const dismissAriaLabel = i18n("dismissAriaLabel", restProps.dismissAriaLabel); + const [visible, setVisible] = (0, import_react195.useState)(false); + const focusTrigger = (0, import_react195.useCallback)(() => { + var _a2, _b; + if (triggerType === "text") { + (_a2 = triggerRef.current) === null || _a2 === void 0 ? void 0 : _a2.focus(); + } else { + triggerRef.current && ((_b = getFirstFocusable(triggerRef.current)) === null || _b === void 0 ? void 0 : _b.focus()); + } + }, [triggerType]); + const onTriggerClick = (0, import_react195.useCallback)(() => { + fireNonCancelableEvent(__onOpen); + setVisible(true); + }, [__onOpen]); + const onDismiss = (0, import_react195.useCallback)(() => { + setVisible(false); + focusTrigger(); + }, [focusTrigger]); + const onTriggerKeyDown = (0, import_react195.useCallback)((event) => { + const isEscapeKey = event.keyCode === KeyCode.escape; + const isTabKey = event.keyCode === KeyCode.tab; + if (isEscapeKey && visible) { + event.stopPropagation(); + } + if (isTabKey || isEscapeKey) { + setVisible(false); + } + }, [visible]); + (0, import_react195.useImperativeHandle)(ref, () => ({ + dismissPopover: onDismiss + })); + (0, import_react195.useEffect)(() => { + if (!triggerRef.current) { + return; + } + const document2 = triggerRef.current.ownerDocument; + const onDocumentClick = () => { + if (clickFrameId.current === null) { + setVisible(false); + } + }; + document2.addEventListener("mousedown", onDocumentClick, false); + return () => { + document2.removeEventListener("mousedown", onDocumentClick, false); + }; + }, []); + const popoverClasses = usePortalModeClasses(triggerRef); + const triggerProps = { + // https://github.com/microsoft/TypeScript/issues/36659 + // eslint-disable-next-line @typescript-eslint/no-explicit-any + ref: triggerRef, + onClick: onTriggerClick, + onKeyDown: onTriggerKeyDown, + className: clsx_m_default(styles_css_default2.trigger, styles_css_default2[`trigger-type-${triggerType}`]) + }; + const { tabIndex: triggerTabIndex } = useSingleTabStopNavigation(triggerRef); + const referrerId = useUniqueId(); + const popoverContent = import_react195.default.createElement("div", { "aria-live": dismissButton2 ? void 0 : "polite", "aria-atomic": dismissButton2 ? void 0 : true, className: clsx_m_default(popoverClasses, !renderWithPortal && styles_css_default2["popover-inline-content"]), "data-awsui-referrer-id": referrerId }, visible && import_react195.default.createElement( + PopoverContainer, + { size, fixedWidth, position, trackRef: triggerRef, arrow: (position2) => import_react195.default.createElement(arrow_default, { position: position2 }), renderWithPortal, zIndex: renderWithPortal ? 7e3 : void 0 }, + import_react195.default.createElement( + LinkDefaultVariantContext.Provider, + { value: { defaultVariant: "primary" } }, + import_react195.default.createElement(PopoverBody, { dismissButton: dismissButton2, dismissAriaLabel, header, onDismiss, overflowVisible: "both" }, content) + ) + )); + const mergedRef = useMergeRefs(popoverRef, __internalRootRef); + return import_react195.default.createElement( + "span", + Object.assign({}, baseProps, { className: clsx_m_default(styles_css_default2.root, baseProps.className), ref: mergedRef, onMouseDown: () => { + clickFrameId.current = requestAnimationFrame(() => { + clickFrameId.current = null; + }); + } }), + triggerType === "text" ? import_react195.default.createElement( + "button", + Object.assign({}, triggerProps, { tabIndex: triggerTabIndex, type: "button", "aria-haspopup": "dialog", id: referrerId, "aria-label": triggerAriaLabel }), + import_react195.default.createElement("span", { className: styles_css_default2["trigger-inner-text"] }, children2) + ) : import_react195.default.createElement("span", Object.assign({}, triggerProps, { id: referrerId }), children2), + import_react195.default.createElement(reset_contexts_for_modal_default, null, renderWithPortal ? import_react195.default.createElement(Portal, null, popoverContent) : popoverContent) + ); +} + +// node_modules/@cloudscape-design/components/copy-to-clipboard/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/copy-to-clipboard/styles.scoped.css"; +var styles_css_default61 = { + "root": "awsui_root_5a145_jw759_9", + "inline-container": "awsui_inline-container_5a145_jw759_13", + "inline-container-trigger": "awsui_inline-container-trigger_5a145_jw759_16" +}; + +// node_modules/@cloudscape-design/components/copy-to-clipboard/test-classes/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/copy-to-clipboard/test-classes/styles.scoped.css"; +var styles_css_default62 = { + "root": "awsui_root_ljpwc_1spew_5", + "text-to-copy": "awsui_text-to-copy_ljpwc_1spew_9" +}; + +// node_modules/@cloudscape-design/components/copy-to-clipboard/index.js +function CopyToClipboard(_a) { + var { variant = "button", copyButtonAriaLabel, copyButtonText, copySuccessText, copyErrorText, textToCopy } = _a, restProps = __rest(_a, ["variant", "copyButtonAriaLabel", "copyButtonText", "copySuccessText", "copyErrorText", "textToCopy"]); + const { __internalRootRef } = useBaseComponent("CopyToClipboard", { + props: { variant } + }); + const baseProps = getBaseProps(restProps); + const copyButtonProps = variant === "button" ? { children: copyButtonText, ariaLabel: copyButtonAriaLabel } : { ariaLabel: copyButtonAriaLabel !== null && copyButtonAriaLabel !== void 0 ? copyButtonAriaLabel : copyButtonText }; + const [status, setStatus] = (0, import_react196.useState)("pending"); + const [statusText, setStatusText] = (0, import_react196.useState)(""); + const onClick = () => { + if (navigator.clipboard) { + setStatus("pending"); + setStatusText(""); + navigator.clipboard.writeText(textToCopy).then(() => { + setStatus("success"); + setStatusText(copySuccessText); + }).catch(() => { + setStatus("error"); + setStatusText(copyErrorText); + }); + } + }; + const triggerVariant = { + button: "normal", + icon: "icon", + inline: "inline-icon" + }[variant]; + const trigger = import_react196.default.createElement( + internal_default17, + { size: "medium", position: "top", triggerType: "custom", dismissButton: false, renderWithPortal: true, content: import_react196.default.createElement(StatusIndicator, { type: status }, statusText) }, + import_react196.default.createElement(internal_default2, Object.assign({}, copyButtonProps, { iconName: "copy", onClick, variant: triggerVariant, wrapText: false, formAction: "none" })) + ); + return import_react196.default.createElement("span", Object.assign({ ref: __internalRootRef }, baseProps, { className: clsx_m_default(baseProps.className, styles_css_default61.root, styles_css_default62.root) }), variant === "inline" ? import_react196.default.createElement( + "span", + { className: styles_css_default61["inline-container"] }, + import_react196.default.createElement("span", { className: styles_css_default61["inline-container-trigger"] }, trigger), + import_react196.default.createElement("span", { className: styles_css_default62["text-to-copy"] }, textToCopy) + ) : trigger); +} +applyDisplayName(CopyToClipboard, "CopyToClipboard"); + +// node_modules/@cloudscape-design/components/date-input/index.js +var import_react199 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/date-input/internal.js +var import_react198 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/internal/components/masked-input/index.js +var import_react197 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/internal/components/masked-input/utils/keys.js +var isSpecialCommand = (keyCode) => { + return keyCode > 7 && keyCode < 47 && keyCode !== KeyCode.space; +}; +var isClipboardCommand = (ctrlKey, metaKey) => ctrlKey || metaKey; +var isCommand = (keyCode, ctrlKey, metaKey) => isSpecialCommand(keyCode) || isClipboardCommand(ctrlKey, metaKey); +var isDigit = (char) => !isNaN(parseInt(char, 10)); + +// node_modules/@cloudscape-design/components/internal/components/masked-input/keyboard-handler.js +var backspaceHandler = (initialValue, format2, selectionStart, selectionEnd) => { + const multiCharDelete = selectionStart !== selectionEnd; + if (multiCharDelete) { + const isCursorAtEnd = selectionEnd === initialValue.length; + if (!isCursorAtEnd) { + return format2.replaceDigitsWithZeroes(initialValue, selectionStart, selectionEnd); + } + return { + value: initialValue.slice(0, selectionStart), + position: selectionStart + }; + } + const isSeparator = format2.isSegmentStart(selectionStart); + const atEnd = selectionStart === initialValue.length; + if (!atEnd) { + if (isSeparator) { + return format2.deleteSeparator(initialValue, selectionStart); + } else { + return format2.deleteDigit(initialValue, selectionStart); + } + } + if (isSeparator) { + return { + value: initialValue.slice(0, selectionStart - 2), + position: selectionStart - 2 + }; + } + return { + value: initialValue.slice(0, selectionStart - 1), + position: selectionStart - 1 + }; +}; +var keyHandler = (initialValue, key, format2, selectionStart, selectionEnd) => { + let value = initialValue; + const position = selectionStart; + if (selectionStart === value.length && value.length === format2.getMaxLength()) { + return { value, position }; + } + if (selectionStart !== value.length && selectionEnd === value.length) { + const sliceEnd = format2.isCursorAtSeparator(selectionStart) ? selectionStart + 1 : selectionStart; + value = initialValue.slice(0, sliceEnd); + } + if (format2.isCursorAtSeparator(position)) { + return { value, position: position + 1 }; + } + return format2.processKey(value, key, position); +}; +var enterHandler = (value, format2) => { + if (!value) { + return { value: "", position: 0 }; + } + const autoCompletedValue = format2.autoComplete(value); + const position = autoCompletedValue.length; + return { value: autoCompletedValue, position }; +}; + +// node_modules/@cloudscape-design/components/internal/components/masked-input/use-mask.js +var onAutoComplete = (value, onChange, maskFormat) => { + if (!value) { + return; + } + const autoCompletedValue = maskFormat.autoComplete(value); + if (autoCompletedValue !== value) { + onChange(autoCompletedValue); + } +}; +var preventDefault = (event, result) => result && event.preventDefault(); +var useMask = ({ value = "", onBlur, onChange, onKeyDown, format: format2, inputRef, autofix = false, disableAutocompleteOnBlur = false, setPosition }) => { + if (!format2.isValid(value)) { + warnOnce("useMask", `Invalid string "${value}" provided`); + } + const onMaskChange = (updatedValue) => { + const autofixedUpdatedValue = autofix ? format2.correctMinMaxValues(updatedValue) : updatedValue; + if (autofixedUpdatedValue === value || !format2.isValid(autofixedUpdatedValue)) { + return; + } + onChange(autofixedUpdatedValue); + }; + const initialValue = autofix ? format2.correctMinMaxValues(value) : value; + const maskedValue = format2.getValidValue(initialValue); + return { + value: maskedValue, + onKeyDown: (event) => { + var _a, _b; + const selectionStart = ((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.selectionStart) || 0; + const selectionEnd = ((_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.selectionEnd) || 0; + let result; + const { keyCode, key, ctrlKey, metaKey } = event.detail; + if (isDigit(key) || format2.isSeparator(key)) { + result = keyHandler(maskedValue, key, format2, selectionStart, selectionEnd); + preventDefault(event, result); + } else if (keyCode === KeyCode.backspace) { + result = backspaceHandler(maskedValue, format2, selectionStart, selectionEnd); + preventDefault(event, result); + } else if (keyCode === KeyCode.enter) { + result = enterHandler(maskedValue, format2); + } else if (!isCommand(keyCode, ctrlKey, metaKey)) { + event.preventDefault(); + } + if (result) { + const { value: value2, position } = result; + onMaskChange(value2); + setPosition(position); + } + onKeyDown && onKeyDown(event); + }, + onChange: ({ detail }) => onMaskChange(detail.value), + onBlur: () => { + if (!disableAutocompleteOnBlur) { + onAutoComplete(maskedValue, onChange, format2); + } + onBlur && onBlur(); + }, + onPaste: (event) => { + var _a, _b; + const text = (event.clipboardData || window.clipboardData).getData("text"); + const selectionStart = ((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.selectionStart) || 0; + const selectionEnd = ((_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.selectionEnd) || 0; + const formattedText = format2.formatPastedText(text, maskedValue, selectionStart, selectionEnd); + onMaskChange(formattedText); + } + }; +}; +var use_mask_default = useMask; + +// node_modules/@cloudscape-design/components/internal/components/masked-input/utils/strings.js +var insertAt = (text, toInsert, start, end = start) => text.slice(0, start) + toInsert + text.slice(end); + +// node_modules/@cloudscape-design/components/internal/components/masked-input/utils/mask-format.js +var MaskFormat = class { + constructor({ separator, inputSeparators = [], segments }) { + this.positionFormats = /* @__PURE__ */ new Map(); + this.segments = []; + this.separator = separator; + this.inputSeparators = [...inputSeparators, separator]; + this.enrichSegmentDefinitions(segments); + } + tryAppendSeparator(value) { + const withSeparator = `${value}${this.separator}`; + return this.isValid(withSeparator) ? withSeparator : value; + } + isSeparator(key) { + return this.inputSeparators.indexOf(key) !== -1; + } + isValid(value) { + const inputSegments = value.split(this.separator); + if (inputSegments.length > this.segments.length) { + return false; + } + return inputSegments.every((segmentValue, i) => { + const segment = this.segments[i]; + if (segmentValue === "") { + if (i === inputSegments.length - 1) { + return true; + } else { + return false; + } + } + if (!segmentValue.match(/^\d+$/)) { + return false; + } + if (segmentValue.length < segment.length && i !== inputSegments.length - 1) { + return false; + } + const intValue = parseInt(segmentValue, 10); + if (segmentValue.length > segment.length) { + return false; + } + if (intValue < segment.min || intValue > segment.max(value)) { + if (i === inputSegments.length - 1 && segmentValue.length < segment.length) { + return true; + } + return false; + } + return true; + }); + } + getValidValue(value) { + let validValue = value; + do { + if (this.isValid(validValue)) { + return this.tryAppendSeparator(validValue); + } + validValue = validValue.substring(0, validValue.length - 1); + } while (validValue.length > 0); + return ""; + } + autoComplete(value) { + const [lastSegmentValue, ...completeSegmentValues] = value.split(this.separator).reverse(); + const lastSegment = this.segments[completeSegmentValues.length]; + const paddedLastSegmentValue = this.padWithDefaultValue(lastSegmentValue, lastSegment); + const partial = [...completeSegmentValues.reverse(), paddedLastSegmentValue]; + while (partial.length < this.segments.length) { + const nextSegment = this.segments[partial.length]; + const segmentValue = this.padWithDefaultValue("", nextSegment); + partial.push(segmentValue); + } + value = partial.join(this.separator); + value = this.correctMinMaxValues(value); + return value; + } + getSegmentValueWithAddition(position, value, enteredDigit) { + const segment = this.positionFormats.get(position); + const segmentValue = value.substr(segment.start, segment.length); + const segmentPosition = position - segment.start; + const newValue = insertAt(segmentValue, enteredDigit, segmentPosition, segmentPosition + 1); + return parseInt(newValue, 10); + } + replaceDigitsWithZeroes(value, cursorStart, cursorEnd) { + const position = this.isCursorAtSeparator(cursorStart) ? cursorStart + 1 : cursorStart; + if (this.isCursorAtSeparator(cursorStart)) { + cursorStart++; + } + if (!this.isSegmentStart(cursorStart)) { + const segment = this.positionFormats.get(cursorStart); + value = insertAt(value, padLeftZeros("", segment.end - cursorStart), cursorStart, segment.end); + cursorStart = segment.end + 1; + } + let currentSegment; + while (cursorStart < cursorEnd && (currentSegment = this.positionFormats.get(cursorStart + 1))) { + const insertionEnd = Math.min(cursorEnd, currentSegment.end); + value = insertAt(value, padLeftZeros("", insertionEnd - currentSegment.start), currentSegment.start, insertionEnd); + cursorStart = insertionEnd + 1; + } + value = this.correctMinMaxValues(value); + return { + value, + position + }; + } + handleSeparatorInput(value, position) { + if (position === value.length && !this.isSegmentStart(position)) { + const segment = this.positionFormats.get(position); + let segmentValue = value.substr(segment.start, segment.length); + segmentValue = this.padWithDefaultValue(segmentValue, segment); + value = insertAt(value, segmentValue, segment.start, segment.end); + value = this.correctMinMaxValues(value); + return { + value, + position: value.length + }; + } + } + isCursorAtSeparator(position) { + return 0 < position && position < this.getMaxLength() && this.positionFormats.get(position) === void 0; + } + isSegmentStart(position) { + return position === 0 || this.isCursorAtSeparator(position - 1); + } + getSegmentMaxValue(value, position) { + return this.positionFormats.get(position).max(value); + } + getSegmentMinValue(value, position) { + return this.positionFormats.get(position).min; + } + getMaxLength() { + const last = this.segments[this.segments.length - 1]; + return last.start + last.length; + } + deleteSeparator(value, position) { + value = insertAt(value, "0", position - 2, position - 1); + return { + value: this.correctMinMaxValues(value), + position: position - 2 + }; + } + deleteDigit(value, position) { + value = insertAt(value, "0", position - 1, position); + const length = value.length; + if (value.slice(length - 2) === "0:") { + value = value.slice(0, length - 2); + } + return { + value: this.correctMinMaxValues(value), + position: position - 1 + }; + } + correctMinMaxValues(value) { + let segment = this.positionFormats.get(0); + while (segment && value.length >= segment.end) { + const segmentValue = parseInt(value.substr(segment.start, segment.length), 10); + const segmentMax = segment.max(value); + if (segmentValue < segment.min) { + let toInsert = segment.min.toFixed(); + toInsert = padLeftZeros(toInsert, segment.length); + value = insertAt(value, toInsert, segment.start, segment.end); + } + if (segmentValue > segmentMax) { + value = insertAt(value, segmentMax.toFixed(), segment.start, segment.end); + } + segment = this.positionFormats.get(segment.end + 1); + } + return value.substr(0, this.segments[this.segments.length - 1].end); + } + formatPastedText(text, value, cursorStart, cursorEnd) { + const keyArr = text.trim().split(""); + let position = cursorStart; + let formattedValue = value; + if (cursorEnd > cursorStart && cursorEnd === value.length) { + formattedValue = value.slice(0, cursorStart); + } + for (const key of keyArr) { + if (position >= this.getMaxLength()) { + break; + } + const result = this.processKey(formattedValue, key, position); + formattedValue = result.value; + position = result.position; + } + return this.tryAppendSeparator(formattedValue); + } + processKey(initialValue, key, initialPosition) { + let value = initialValue; + let position = initialPosition; + if (this.isSeparator(key)) { + const result = this.handleSeparatorInput(value, position); + if (result) { + value = result.value; + position = result.position; + } + } else { + const isCursorAtEnd = position === value.length; + const segmentValue = this.getSegmentValueWithAddition(position, value, key); + const segmentMaxValue = this.getSegmentMaxValue(value, position); + const segmentMinValue = this.getSegmentMinValue(value, position); + const firstDigitGreater = parseInt(key, 10) > parseInt(segmentMaxValue.toFixed()[0], 10); + const isValidPosition = isCursorAtEnd || segmentValue.toFixed().length === 1; + const exceedsMaxAtSegmentStart = this.isSegmentStart(position) && isValidPosition && firstDigitGreater; + if (exceedsMaxAtSegmentStart) { + value = insertAt(value, `0${key}`, position, position + 2); + position += 2; + } else if (segmentValue > segmentMaxValue && this.isSegmentStart(position)) { + value = insertAt(value, segmentMaxValue.toFixed(), position, position + segmentMaxValue.toFixed().length); + position += segmentMaxValue.toFixed().length; + } else if (segmentValue > segmentMaxValue) { + value = insertAt(value, segmentMaxValue.toFixed(), position - 1, position + 1); + position += 1; + } else if (segmentValue < segmentMinValue && !this.isSegmentStart(position)) { + value = insertAt(value, segmentMinValue.toFixed(), position, position + 1); + position += 1; + } else { + value = insertAt(value, key, position, position + 1); + position += 1; + } + } + value = this.tryAppendSeparator(value); + if (this.isCursorAtSeparator(position)) { + position++; + } + return { value, position }; + } + padWithDefaultValue(segmentValue, segment) { + let defaultValue = (segment.default || segment.min).toFixed(); + defaultValue = padLeftZeros(defaultValue, segment.length); + return insertAt(defaultValue, segmentValue, segment.length - segmentValue.length, segment.length); + } + enrichSegmentDefinitions(segments) { + this.positionFormats = /* @__PURE__ */ new Map(); + this.segments = []; + let position = 0; + for (const segment of segments) { + const max3 = segment.max; + const fullSegment = Object.assign(Object.assign({}, segment), { max: typeof max3 === "number" ? () => max3 : max3, start: position, end: position + segment.length }); + this.segments.push(fullSegment); + for (let j = 0; j < fullSegment.length; j++) { + this.positionFormats.set(position++, fullSegment); + } + position++; + } + } +}; +var mask_format_default = MaskFormat; + +// node_modules/@cloudscape-design/components/internal/components/masked-input/index.js +var MaskedInput = import_react197.default.forwardRef((_a, ref) => { + var { value, onBlur, onChange, onKeyDown, mask, autofix = false, disableAutocompleteOnBlur = false } = _a, rest = __rest(_a, ["value", "onBlur", "onChange", "onKeyDown", "mask", "autofix", "disableAutocompleteOnBlur"]); + const baseProps = getBaseProps(rest); + const formFieldContext = useFormFieldContext(rest); + const inputRef = import_react197.default.useRef(null); + const [cursorPosition, setCursorPosition] = (0, import_react197.useState)(null); + (0, import_react197.useLayoutEffect)(() => { + var _a2; + if (cursorPosition !== null) { + (_a2 = inputRef.current) === null || _a2 === void 0 ? void 0 : _a2.setSelectionRange(cursorPosition, cursorPosition); + } + }, [cursorPosition, inputRef]); + const _b = use_mask_default({ + format: new mask_format_default(mask), + value, + inputRef, + autofix, + disableAutocompleteOnBlur, + onChange: (value2) => !rest.readOnly && fireNonCancelableEvent(onChange, { value: value2 }), + onKeyDown: (event) => !rest.readOnly && onKeyDown && fireCancelableEvent(onKeyDown, event.detail, event), + onBlur: () => fireNonCancelableEvent(onBlur), + setPosition: setCursorPosition + }), { onPaste } = _b, maskProps = __rest(_b, ["onPaste"]); + const inputProps = Object.assign(Object.assign(Object.assign(Object.assign({}, rest), baseProps), formFieldContext), maskProps); + const mergedRef = useMergeRefs(ref, inputRef); + return import_react197.default.createElement(internal_default4, Object.assign({}, inputProps, { ref: mergedRef, __nativeAttributes: { + onPaste + } })); +}); +var masked_input_default = MaskedInput; + +// node_modules/@cloudscape-design/components/date-input/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/date-input/styles.scoped.css"; +var styles_css_default63 = { + "root": "awsui_root_yodkx_im8v7_5" +}; + +// node_modules/@cloudscape-design/components/date-input/internal.js +function daysMax(value) { + const baseDate = displayToIso(value).substring(0, 7); + return getDaysInMonth(parseDate(baseDate)); +} +var yearMask = { min: 0, max: 9999, default: 2e3, length: 4 }; +var monthMask = { min: 1, max: 12, length: 2 }; +var dayMask = { min: 1, max: daysMax, length: 2 }; +var InternalDateInput = import_react198.default.forwardRef((_a, ref) => { + var { value, onChange, granularity, __internalRootRef = null } = _a, props2 = __rest(_a, ["value", "onChange", "granularity", "__internalRootRef"]); + const maskArgs = { + separator: "/", + inputSeparators: ["-", ".", " "], + segments: granularity === "month" ? [yearMask, monthMask] : [yearMask, monthMask, dayMask] + }; + return import_react198.default.createElement(masked_input_default, Object.assign({ ref }, props2, { value: isoToDisplay(value || ""), onChange: (event) => fireNonCancelableEvent(onChange, { value: displayToIso(event.detail.value) }), className: clsx_m_default(styles_css_default63.root, props2.className), mask: maskArgs, autofix: true, autoComplete: false, disableAutocompleteOnBlur: false, disableBrowserAutocorrect: true, __internalRootRef })); +}); +var internal_default18 = InternalDateInput; + +// node_modules/@cloudscape-design/components/date-input/index.js +var DateInput = import_react199.default.forwardRef((props2, ref) => { + const baseComponentProps = useBaseComponent("DateInput", { + props: { autoFocus: props2.autoFocus, readOnly: props2.readOnly } + }); + return import_react199.default.createElement(internal_default18, Object.assign({}, props2, baseComponentProps, { ref })); +}); +applyDisplayName(DateInput, "DateInput"); +var date_input_default = DateInput; + +// node_modules/@cloudscape-design/components/date-picker/index.js +var import_react201 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/date-picker/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/date-picker/styles.scoped.css"; +var styles_css_default64 = { + "root": "awsui_root_145pa_ot559_99", + "focus-lock": "awsui_focus-lock_145pa_ot559_134", + "calendar": "awsui_calendar_145pa_ot559_138", + "date-picker-container": "awsui_date-picker-container_145pa_ot559_154", + "date-picker-trigger": "awsui_date-picker-trigger_145pa_ot559_159", + "date-picker-input": "awsui_date-picker-input_145pa_ot559_163", + "open-calendar-button": "awsui_open-calendar-button_145pa_ot559_168" +}; + +// node_modules/@cloudscape-design/components/internal/hooks/use-focus-tracker.js +var import_react200 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/internal/focus-tracker.js +var FocusTracker = class { + constructor(node, { onFocusEnter, onFocusLeave }) { + this.node = node; + this.currentlyFocused = false; + this.focusInListener = (event) => { + const focusIsInside = nodeBelongs(this.node, event.target); + if (!this.currentlyFocused && focusIsInside) { + this.triggerFocus(); + } + }; + this.focusOutListener = (event) => { + const nextFocused = event.relatedTarget; + const isNextFocusedInParent = !nodeBelongs(this.node, nextFocused); + if (this.currentlyFocused && (nextFocused === null || isNextFocusedInParent)) { + this.triggerBlur(); + } + }; + this.onFocusEnter = onFocusEnter; + this.onFocusLeave = onFocusLeave; + } + initialize() { + this.currentlyFocused = nodeBelongs(this.node, document.activeElement); + document.addEventListener("focusin", this.focusInListener); + document.addEventListener("focusout", this.focusOutListener); + } + destroy() { + document.removeEventListener("focusin", this.focusInListener); + document.removeEventListener("focusout", this.focusOutListener); + } + triggerBlur() { + this.currentlyFocused = false; + this.onFocusLeave(); + } + triggerFocus() { + this.currentlyFocused = true; + this.onFocusEnter(); + } +}; + +// node_modules/@cloudscape-design/components/internal/hooks/use-focus-tracker.js +var useFocusTracker = ({ rootRef, onBlur, onFocus }) => { + const focusTracker = (0, import_react200.useRef)(null); + (0, import_react200.useEffect)(() => { + if (!rootRef.current) { + return; + } + focusTracker.current = new FocusTracker(rootRef.current, { + onFocusLeave: () => { + fireNonCancelableEvent(onBlur); + }, + onFocusEnter: () => { + fireNonCancelableEvent(onFocus); + } + }); + focusTracker.current.initialize(); + return () => { + var _a; + (_a = focusTracker.current) === null || _a === void 0 ? void 0 : _a.destroy(); + }; + }, [rootRef, onBlur, onFocus]); +}; + +// node_modules/@cloudscape-design/components/date-picker/utils.js +function isValidFullDate({ date: date2, granularity }) { + const regex = granularity === "month" ? /^\d{4}-\d{2}(-\d{2})?$/ : /^\d{4}-\d{2}-\d{2}$/; + return !!date2.match(regex); +} +function getSelectedDateLabel({ date: date2, granularity, locale: locale2 }) { + return granularity === "month" ? renderMonthAndYear(locale2, date2) : getDateLabel(locale2, date2); +} +function getBaseDateLabel({ date: date2, granularity, locale: locale2 }) { + return granularity === "month" ? renderYear(locale2, date2) : renderMonthAndYear(locale2, date2); +} + +// node_modules/@cloudscape-design/components/date-picker/index.js +var DatePicker = import_react201.default.forwardRef((_a, ref) => { + var _b, _c, _d; + var { locale: locale2 = "", startOfWeek, isDateEnabled, nextMonthAriaLabel, previousMonthAriaLabel, todayAriaLabel, i18nStrings, placeholder = "", value = "", readOnly = false, disabled = false, onBlur, autoFocus = false, onChange, onFocus, name, ariaLabel, ariaRequired, controlId, invalid, openCalendarAriaLabel, expandToViewport, granularity = "day" } = _a, restProps = __rest(_a, ["locale", "startOfWeek", "isDateEnabled", "nextMonthAriaLabel", "previousMonthAriaLabel", "todayAriaLabel", "i18nStrings", "placeholder", "value", "readOnly", "disabled", "onBlur", "autoFocus", "onChange", "onFocus", "name", "ariaLabel", "ariaRequired", "controlId", "invalid", "openCalendarAriaLabel", "expandToViewport", "granularity"]); + const { __internalRootRef } = useBaseComponent("DatePicker", { + props: { autoFocus, expandToViewport, granularity, readOnly } + }); + checkControlled("DatePicker", "value", value, "onChange", onChange); + const contextLocale = useLocale(); + const normalizedLocale = normalizeLocale("DatePicker", locale2 || contextLocale); + const baseProps = getBaseProps(restProps); + const [isDropDownOpen, setIsDropDownOpen] = (0, import_react201.useState)(false); + const { ariaLabelledby, ariaDescribedby } = useFormFieldContext(restProps); + const internalInputRef = (0, import_react201.useRef)(null); + const buttonRef = (0, import_react201.useRef)(null); + useForwardFocus(ref, internalInputRef); + const rootRef = (0, import_react201.useRef)(null); + const dropdownId = useUniqueId("calender"); + const calendarDescriptionId = useUniqueId("calendar-description-"); + const mergedRef = useMergeRefs(rootRef, __internalRootRef); + useFocusTracker({ rootRef, onBlur, onFocus }); + const onDropdownCloseHandler = (0, import_react201.useCallback)(() => setIsDropDownOpen(false), [setIsDropDownOpen]); + const onButtonClickHandler = () => { + if (!isDropDownOpen) { + setIsDropDownOpen(true); + } + }; + const onWrapperKeyDownHandler = (event) => { + var _a2; + if (event.keyCode === KeyCode.escape && isDropDownOpen) { + event.stopPropagation(); + (_a2 = buttonRef.current) === null || _a2 === void 0 ? void 0 : _a2.focus(); + setIsDropDownOpen(false); + } + }; + const onInputChangeHandler = (event) => { + fireNonCancelableEvent(onChange, { value: event.detail.value }); + }; + const onInputBlurHandler = () => { + if (!isDropDownOpen) { + setIsDropDownOpen(false); + } + }; + const parsedValue = value && value.length >= 4 ? parseDate(value) : null; + const baseDate = parsedValue || /* @__PURE__ */ new Date(); + const hasFullValue = isValidFullDate({ date: value, granularity }); + const buttonAriaLabel = openCalendarAriaLabel && openCalendarAriaLabel(hasFullValue && parsedValue ? getSelectedDateLabel({ date: parsedValue, granularity, locale: normalizedLocale }) : null); + const trigger = import_react201.default.createElement( + "div", + { className: styles_css_default64["date-picker-trigger"] }, + import_react201.default.createElement( + "div", + { className: styles_css_default64["date-picker-input"] }, + import_react201.default.createElement(internal_default18, { name, invalid, controlId, ariaLabelledby, ariaDescribedby, ariaLabel, ariaRequired, value, disabled, readOnly, onChange: onInputChangeHandler, onBlur: onInputBlurHandler, placeholder, ref: internalInputRef, autoFocus, onFocus: onDropdownCloseHandler, granularity }) + ), + import_react201.default.createElement( + "div", + null, + import_react201.default.createElement(InternalButton, { iconName: "calendar", className: styles_css_default64["open-calendar-button"], onClick: onButtonClickHandler, ref: buttonRef, ariaLabel: buttonAriaLabel, disabled: disabled || readOnly, formAction: "none" }) + ) + ); + baseProps.className = clsx_m_default(baseProps.className, styles_css_default64.root, styles_css_default64["date-picker-container"]); + const handleMouseDown = (event) => { + event.preventDefault(); + }; + return import_react201.default.createElement("div", Object.assign({}, baseProps, { ref: mergedRef, onKeyDown: !disabled && !readOnly ? onWrapperKeyDownHandler : void 0 }), disabled || readOnly ? trigger : import_react201.default.createElement(dropdown_default, { stretchWidth: true, stretchHeight: true, open: isDropDownOpen, onDropdownClose: onDropdownCloseHandler, onMouseDown: handleMouseDown, trigger, expandToViewport, scrollable: false, dropdownId }, isDropDownOpen && import_react201.default.createElement( + focus_lock_default, + { className: styles_css_default64["focus-lock"], autoFocus: true }, + import_react201.default.createElement( + "div", + { tabIndex: 0, className: styles_css_default64.calendar, role: "dialog", "aria-modal": "true" }, + import_react201.default.createElement(Calendar, { value, onChange: (e) => { + var _a2; + fireNonCancelableEvent(onChange, e.detail); + (_a2 = buttonRef === null || buttonRef === void 0 ? void 0 : buttonRef.current) === null || _a2 === void 0 ? void 0 : _a2.focus(); + setIsDropDownOpen(false); + }, locale: normalizedLocale, startOfWeek, ariaDescribedby: calendarDescriptionId, ariaLabel, ariaLabelledby, granularity, isDateEnabled, i18nStrings: Object.assign(Object.assign({}, i18nStrings), { todayAriaLabel: (_b = i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.todayAriaLabel) !== null && _b !== void 0 ? _b : todayAriaLabel, nextMonthAriaLabel: (_c = i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.nextMonthAriaLabel) !== null && _c !== void 0 ? _c : nextMonthAriaLabel, previousMonthAriaLabel: (_d = i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.previousMonthAriaLabel) !== null && _d !== void 0 ? _d : previousMonthAriaLabel }) }), + import_react201.default.createElement(live_region_default, { id: calendarDescriptionId }, getBaseDateLabel({ date: baseDate, granularity, locale: normalizedLocale })) + ) + ))); +}); +applyDisplayName(DatePicker, "DatePicker"); +var date_picker_default = DatePicker; + +// node_modules/@cloudscape-design/components/date-range-picker/index.js +var import_react215 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/date-range-picker/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/date-range-picker/styles.scoped.css"; +var styles_css_default65 = { + "calendar": "awsui_calendar_mgja0_1vaht_99", + "awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-0_mgja0_1vaht_1", + "root": "awsui_root_mgja0_1vaht_126", + "wide": "awsui_wide_mgja0_1vaht_160", + "focus-lock": "awsui_focus-lock_mgja0_1vaht_167", + "trigger-wrapper": "awsui_trigger-wrapper_mgja0_1vaht_171", + "trigger-flexbox": "awsui_trigger-flexbox_mgja0_1vaht_175", + "calendar-container": "awsui_calendar-container_mgja0_1vaht_179", + "one-grid": "awsui_one-grid_mgja0_1vaht_182", + "calendar-header": "awsui_calendar-header_mgja0_1vaht_186", + "calendar-header-months-wrapper": "awsui_calendar-header-months-wrapper_mgja0_1vaht_192", + "calendar-header-month": "awsui_calendar-header-month_mgja0_1vaht_192", + "calendar-next-month-btn": "awsui_calendar-next-month-btn_mgja0_1vaht_211", + "calendar-prev-month-btn": "awsui_calendar-prev-month-btn_mgja0_1vaht_214", + "first-grid": "awsui_first-grid_mgja0_1vaht_218", + "second-grid": "awsui_second-grid_mgja0_1vaht_219", + "date-and-time-container": "awsui_date-and-time-container_mgja0_1vaht_223", + "date-and-time-wrapper": "awsui_date-and-time-wrapper_mgja0_1vaht_229", + "footer": "awsui_footer_mgja0_1vaht_236", + "has-clear-button": "awsui_has-clear-button_mgja0_1vaht_245", + "footer-button-wrapper": "awsui_footer-button-wrapper_mgja0_1vaht_254", + "icon-wrapper": "awsui_icon-wrapper_mgja0_1vaht_261", + "label": "awsui_label_mgja0_1vaht_266", + "label-enabled": "awsui_label-enabled_mgja0_1vaht_271", + "label-text": "awsui_label-text_mgja0_1vaht_275", + "label-token-nowrap": "awsui_label-token-nowrap_mgja0_1vaht_280", + "mode-switch": "awsui_mode-switch_mgja0_1vaht_284", + "dropdown": "awsui_dropdown_mgja0_1vaht_288", + "dropdown-content": "awsui_dropdown-content_mgja0_1vaht_310", + "start-date-input": "awsui_start-date-input_mgja0_1vaht_319", + "start-time-input": "awsui_start-time-input_mgja0_1vaht_320", + "end-date-input": "awsui_end-date-input_mgja0_1vaht_321", + "end-time-input": "awsui_end-time-input_mgja0_1vaht_322", + "validation-section": "awsui_validation-section_mgja0_1vaht_326", + "validation-error": "awsui_validation-error_mgja0_1vaht_330", + "clear-button": "awsui_clear-button_mgja0_1vaht_334", + "apply-button": "awsui_apply-button_mgja0_1vaht_338", + "cancel-button": "awsui_cancel-button_mgja0_1vaht_342", + "calendar-aria-live": "awsui_calendar-aria-live_mgja0_1vaht_346" +}; + +// node_modules/@cloudscape-design/components/date-range-picker/dropdown.js +var import_react214 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/date-range-picker/calendar/index.js +var import_react208 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/date-range-picker/calendar/header/index.js +var import_react203 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/date-range-picker/calendar/header/header-button.js +var import_react202 = __toESM(require_react()); +function PrevMonthButton({ ariaLabel, baseDate, onChangeMonth }) { + return import_react202.default.createElement(InternalButton, { iconName: "angle-left", ariaLabel, variant: "icon", onClick: () => onChangeMonth(addMonths(baseDate, -1)), formAction: "none", className: styles_css_default65["calendar-prev-month-btn"] }); +} +function NextMonthButton({ ariaLabel, baseDate, onChangeMonth }) { + return import_react202.default.createElement(InternalButton, { iconName: "angle-right", ariaLabel, variant: "icon", onClick: () => onChangeMonth(addMonths(baseDate, 1)), formAction: "none", className: styles_css_default65["calendar-next-month-btn"] }); +} + +// node_modules/@cloudscape-design/components/date-range-picker/calendar/header/index.js +function CalendarHeader2({ baseDate, locale: locale2, onChangeMonth, previousMonthLabel, nextMonthLabel, isSingleGrid, headingIdPrefix }) { + const i18n = useInternalI18n("calendar"); + const prevMonthLabel = renderMonthAndYear(locale2, add(baseDate, { months: -1 })); + const currentMonthLabel = renderMonthAndYear(locale2, baseDate); + return import_react203.default.createElement( + import_react203.default.Fragment, + null, + import_react203.default.createElement( + "div", + { className: styles_css_default65["calendar-header"] }, + import_react203.default.createElement(PrevMonthButton, { ariaLabel: i18n("previousMonthAriaLabel", previousMonthLabel), baseDate, onChangeMonth }), + import_react203.default.createElement( + "h2", + { className: styles_css_default65["calendar-header-months-wrapper"] }, + !isSingleGrid && import_react203.default.createElement("span", { className: styles_css_default65["calendar-header-month"], id: `${headingIdPrefix}-prevmonth` }, prevMonthLabel), + import_react203.default.createElement("span", { className: styles_css_default65["calendar-header-month"], id: `${headingIdPrefix}-currentmonth` }, currentMonthLabel) + ), + import_react203.default.createElement(NextMonthButton, { ariaLabel: i18n("nextMonthAriaLabel", nextMonthLabel), baseDate, onChangeMonth }) + ), + import_react203.default.createElement(live_region_default, null, isSingleGrid ? currentMonthLabel : `${prevMonthLabel}, ${currentMonthLabel}`) + ); +} + +// node_modules/@cloudscape-design/components/date-range-picker/calendar/grids/index.js +var import_react205 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/date-range-picker/calendar/grids/grid.js +var import_react204 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/date-range-picker/calendar/grids/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/date-range-picker/calendar/grids/styles.scoped.css"; +var styles_css_default66 = { + "grid": "awsui_grid_1mfbn_f3jvf_103", + "grid-cell": "awsui_grid-cell_1mfbn_f3jvf_108", + "day-header": "awsui_day-header_1mfbn_f3jvf_115", + "week": "awsui_week_1mfbn_f3jvf_125", + "day": "awsui_day_1mfbn_f3jvf_115", + "day-inner": "awsui_day-inner_1mfbn_f3jvf_172", + "in-first-row": "awsui_in-first-row_1mfbn_f3jvf_177", + "in-previous-month": "awsui_in-previous-month_1mfbn_f3jvf_177", + "last-day-of-month": "awsui_last-day-of-month_1mfbn_f3jvf_181", + "in-next-month": "awsui_in-next-month_1mfbn_f3jvf_185", + "in-first-column": "awsui_in-first-column_1mfbn_f3jvf_189", + "in-current-month": "awsui_in-current-month_1mfbn_f3jvf_192", + "enabled": "awsui_enabled_1mfbn_f3jvf_196", + "in-range": "awsui_in-range_1mfbn_f3jvf_202", + "end-date": "awsui_end-date_1mfbn_f3jvf_202", + "start-date": "awsui_start-date_1mfbn_f3jvf_202", + "no-range": "awsui_no-range_1mfbn_f3jvf_202", + "selected": "awsui_selected_1mfbn_f3jvf_212", + "today": "awsui_today_1mfbn_f3jvf_217", + "range-start-date": "awsui_range-start-date_1mfbn_f3jvf_262", + "in-range-border-bottom": "awsui_in-range-border-bottom_1mfbn_f3jvf_265", + "range-end-date": "awsui_range-end-date_1mfbn_f3jvf_268", + "in-range-border-top": "awsui_in-range-border-top_1mfbn_f3jvf_271", + "in-range-border-block-start": "awsui_in-range-border-block-start_1mfbn_f3jvf_284", + "in-range-border-inline-end": "awsui_in-range-border-inline-end_1mfbn_f3jvf_287", + "in-range-border-block-end": "awsui_in-range-border-block-end_1mfbn_f3jvf_290", + "in-range-border-inline-start": "awsui_in-range-border-inline-start_1mfbn_f3jvf_293" +}; + +// node_modules/@cloudscape-design/components/date-range-picker/calendar/grids/grid.js +function Grid2({ baseDate, selectedStartDate, selectedEndDate, rangeStartDate, rangeEndDate, focusedDate, focusedDateRef, onSelectDate, onGridKeyDownHandler, onFocusedDateChange, isDateEnabled, locale: locale2, startOfWeek, todayAriaLabel, ariaLabelledby, className }) { + const baseDateTime = baseDate === null || baseDate === void 0 ? void 0 : baseDate.getTime(); + const weeks = (0, import_react204.useMemo)( + () => getCalendarMonth(baseDate, { firstDayOfWeek: startOfWeek }), + // eslint-disable-next-line react-hooks/exhaustive-deps + [baseDateTime, startOfWeek] + ); + const weekdays = weeks[0].map((date2) => date2.getDay()); + return import_react204.default.createElement( + "table", + { role: "grid", "aria-labelledby": ariaLabelledby, className: clsx_m_default(styles_css_default66.grid, className) }, + import_react204.default.createElement( + "thead", + null, + import_react204.default.createElement("tr", null, weekdays.map((dayIndex) => import_react204.default.createElement( + "th", + { key: dayIndex, scope: "col", className: clsx_m_default(styles_css_default66["grid-cell"], styles_css_default66["day-header"]) }, + import_react204.default.createElement("span", { "aria-hidden": "true" }, renderDayName(locale2, dayIndex, "short")), + import_react204.default.createElement(ScreenreaderOnly, null, renderDayName(locale2, dayIndex, "long")) + ))) + ), + import_react204.default.createElement("tbody", { onKeyDown: onGridKeyDownHandler }, weeks.map((week, weekIndex) => { + return import_react204.default.createElement("tr", { key: weekIndex, className: styles_css_default66.week }, week.map((date2, dateIndex) => { + const isStartDate = !!selectedStartDate && isSameDay(date2, selectedStartDate); + const isEndDate = !!selectedEndDate && isSameDay(date2, selectedEndDate); + const isSelected = isStartDate || isEndDate; + const isRangeStartDate = !!rangeStartDate && isSameDay(date2, rangeStartDate); + const isRangeEndDate = !!rangeEndDate && isSameDay(date2, rangeEndDate); + const isFocused = !!focusedDate && isSameDay(date2, focusedDate) && isSameMonth(date2, baseDate); + const dateIsInRange = isStartDate || isEndDate || isInRange(date2, rangeStartDate, rangeEndDate); + const inRangeStartWeek = rangeStartDate && isInRange(date2, rangeStartDate, addDays(addWeeks(rangeStartDate, 1), -1)); + const inRangeEndWeek = rangeEndDate && isInRange(date2, rangeEndDate, addDays(addWeeks(rangeEndDate, -1), 1)); + const onlyOneSelected = !!rangeStartDate && !!rangeEndDate ? isSameDay(rangeStartDate, rangeEndDate) : !selectedStartDate || !selectedEndDate; + const isEnabled = !isDateEnabled || isDateEnabled(date2); + const isFocusable = isFocused && isEnabled; + const baseClasses = { + [styles_css_default66.day]: true, + [styles_css_default66["grid-cell"]]: true, + [styles_css_default66["in-first-row"]]: weekIndex === 0, + [styles_css_default66["in-first-column"]]: dateIndex === 0 + }; + if (!isSameMonth(date2, baseDate)) { + return import_react204.default.createElement("td", { key: `${weekIndex}:${dateIndex}`, ref: isFocused ? focusedDateRef : void 0, className: clsx_m_default(baseClasses, { + [styles_css_default66["in-previous-month"]]: isBefore(date2, baseDate), + [styles_css_default66["last-day-of-month"]]: isLastDayOfMonth(date2), + [styles_css_default66["in-next-month"]]: isAfter(date2, baseDate) + }) }); + } + const handlers = {}; + if (isEnabled) { + handlers.onClick = () => onSelectDate(date2); + handlers.onFocus = () => onFocusedDateChange(date2); + } + let tabIndex = void 0; + if (isFocusable && isEnabled) { + tabIndex = 0; + } else if (isEnabled) { + tabIndex = -1; + } + let dayAnnouncement = getDateLabel(locale2, date2, "short"); + if (isToday(date2)) { + dayAnnouncement += ". " + todayAriaLabel; + } + return import_react204.default.createElement( + "td", + Object.assign({ ref: isFocused ? focusedDateRef : void 0, key: `${weekIndex}:${dateIndex}`, className: clsx_m_default(baseClasses, { + [styles_css_default66["in-current-month"]]: isSameMonth(date2, baseDate), + [styles_css_default66.enabled]: isEnabled, + [styles_css_default66.selected]: isSelected, + [styles_css_default66["start-date"]]: isStartDate, + [styles_css_default66["end-date"]]: isEndDate, + [styles_css_default66["range-start-date"]]: isRangeStartDate, + [styles_css_default66["range-end-date"]]: isRangeEndDate, + [styles_css_default66["no-range"]]: isSelected && onlyOneSelected, + [styles_css_default66["in-range"]]: dateIsInRange, + [styles_css_default66["in-range-border-block-start"]]: !!inRangeStartWeek || date2.getDate() <= 7, + [styles_css_default66["in-range-border-block-end"]]: !!inRangeEndWeek || date2.getDate() > getDaysInMonth(date2) - 7, + [styles_css_default66["in-range-border-inline-start"]]: dateIndex === 0 || date2.getDate() === 1 || isRangeStartDate, + [styles_css_default66["in-range-border-inline-end"]]: dateIndex === week.length - 1 || isLastDayOfMonth(date2) || isRangeEndDate, + [styles_css_default66.today]: isToday(date2) + }), "aria-selected": isEnabled ? isSelected || dateIsInRange : void 0, "aria-current": isToday(date2) ? "date" : void 0, "data-date": formatDate(date2), "aria-disabled": !isEnabled, tabIndex }, handlers), + import_react204.default.createElement("span", { className: styles_css_default66["day-inner"], "aria-hidden": "true" }, date2.getDate()), + import_react204.default.createElement(ScreenreaderOnly, null, dayAnnouncement) + ); + })); + })) + ); +} +function isInRange(date2, dateOne, dateTwo) { + if (!dateOne || !dateTwo || isSameDay(dateOne, dateTwo)) { + return false; + } + const inRange = isAfter(date2, dateOne) && isBefore(date2, dateTwo) || isAfter(date2, dateTwo) && isBefore(date2, dateOne); + return inRange || isSameDay(date2, dateOne) || isSameDay(date2, dateTwo); +} + +// node_modules/@cloudscape-design/components/internal/utils/has-value.js +function hasValue(value) { + return value !== null && value !== void 0; +} + +// node_modules/@cloudscape-design/components/date-range-picker/calendar/utils.js +function findDateToFocus(selected, baseDate, isDateEnabled) { + if (selected && isDateEnabled(selected) && isSameMonth(selected, baseDate)) { + return selected; + } + const today = /* @__PURE__ */ new Date(); + if (isDateEnabled(today) && isSameMonth(today, baseDate)) { + return today; + } + if (isDateEnabled(baseDate)) { + return baseDate; + } + return null; +} +function findMonthToDisplay(value, isSingleGrid) { + if (value.start.date) { + const startDate = parseDate(value.start.date); + if (isSingleGrid) { + return startOfMonth(startDate); + } + return startOfMonth(addMonths(startDate, 1)); + } + if (value.end.date) { + return startOfMonth(parseDate(value.end.date)); + } + return startOfMonth(Date.now()); +} + +// node_modules/@cloudscape-design/components/date-range-picker/calendar/grids/index.js +function isVisible(date2, baseDate, isSingleGrid) { + if (isSingleGrid) { + return isSameMonth(date2, baseDate); + } + const previousMonth = addMonths(baseDate, -1); + return isSameMonth(date2, previousMonth) || isSameMonth(date2, baseDate); +} +var Grids = ({ baseDate, selectedStartDate, selectedEndDate, focusedDate, onFocusedDateChange, isDateEnabled, isSingleGrid, onSelectDate, onChangeMonth, locale: locale2, startOfWeek, todayAriaLabel, headingIdPrefix }) => { + const containerRef = (0, import_react205.useRef)(null); + const [gridHasFocus, setGridHasFocus] = (0, import_react205.useState)(false); + const focusedDateRef = (0, import_react205.useRef)(null); + const dateCache = useDateCache(); + baseDate = dateCache(baseDate); + focusedDate = focusedDate ? dateCache(focusedDate) : null; + (0, import_react205.useEffect)(() => { + if (focusedDate && !isVisible(focusedDate, baseDate, isSingleGrid)) { + const direction = isAfter(focusedDate, baseDate) ? -1 : 1; + const newMonth = !isSingleGrid && direction === -1 ? addMonths(baseDate, -1) : baseDate; + const nearestBaseDate = getBaseDay(newMonth, isDateEnabled); + const newFocusedDate = findDateToFocus(focusedDate, nearestBaseDate, isDateEnabled); + onFocusedDateChange(newFocusedDate); + } + }, [baseDate, focusedDate, isSingleGrid, isDateEnabled, onFocusedDateChange]); + const onGridKeyDownHandler = (event) => { + let updatedFocusDate; + const keys = [KeyCode.up, KeyCode.down, KeyCode.left, KeyCode.right, KeyCode.space, KeyCode.enter]; + if (focusedDate === null || keys.indexOf(event.keyCode) === -1) { + return; + } + event.preventDefault(); + handleKey(event, { + onActivate: () => focusedDate && onSelectDate(focusedDate), + onBlockEnd: () => focusedDate && (updatedFocusDate = moveNextWeek(focusedDate, isDateEnabled)), + onBlockStart: () => focusedDate && (updatedFocusDate = movePrevWeek(focusedDate, isDateEnabled)), + onInlineEnd: () => focusedDate && (updatedFocusDate = moveNextDay(focusedDate, isDateEnabled)), + onInlineStart: () => focusedDate && (updatedFocusDate = movePrevDay(focusedDate, isDateEnabled)) + }); + if (!updatedFocusDate) { + return; + } + const updatedDateIsVisible = isVisible(updatedFocusDate, baseDate, isSingleGrid); + if (!updatedDateIsVisible) { + const newMonthIsOnLeftSide = !isSingleGrid && isBefore(updatedFocusDate, baseDate); + onChangeMonth(newMonthIsOnLeftSide ? addMonths(updatedFocusDate, 1) : updatedFocusDate); + } + onFocusedDateChange(updatedFocusDate); + }; + (0, import_react205.useEffect)(() => { + if (focusedDate !== null && gridHasFocus) { + if (focusedDateRef.current && focusedDateRef.current !== document.activeElement) { + focusedDateRef.current.focus(); + } + } + }, [focusedDate, gridHasFocus]); + const onGridBlur = (event) => { + var _a; + const newFocusTarget = event.relatedTarget || document.activeElement; + const newFocusTargetIsInGrid = (_a = containerRef.current) === null || _a === void 0 ? void 0 : _a.contains(newFocusTarget); + if (newFocusTarget && !newFocusTargetIsInGrid && gridHasFocus) { + setGridHasFocus(false); + } + }; + const onGridFocus = () => { + if (!gridHasFocus) { + setGridHasFocus(true); + } + }; + const isRangeVisible = selectedStartDate && selectedEndDate || gridHasFocus; + const rangeEnds = [selectedStartDate !== null && selectedStartDate !== void 0 ? selectedStartDate : focusedDate, selectedEndDate !== null && selectedEndDate !== void 0 ? selectedEndDate : focusedDate].filter(hasValue); + const rangeStartDate = min(rangeEnds); + const rangeEndDate = max(rangeEnds); + return import_react205.default.createElement( + "div", + { ref: containerRef, onFocus: onGridFocus, onBlur: onGridBlur }, + import_react205.default.createElement( + InternalSpaceBetween, + { size: "xs", direction: "horizontal" }, + !isSingleGrid && import_react205.default.createElement(Grid2, { className: styles_css_default65["first-grid"], baseDate: addMonths(baseDate, -1), selectedEndDate, selectedStartDate, rangeStartDate: isRangeVisible ? rangeStartDate : null, rangeEndDate: isRangeVisible ? rangeEndDate : null, focusedDate, focusedDateRef, isDateEnabled, onSelectDate, onGridKeyDownHandler, onFocusedDateChange, locale: locale2, startOfWeek, todayAriaLabel, ariaLabelledby: `${headingIdPrefix}-prevmonth` }), + import_react205.default.createElement(Grid2, { className: styles_css_default65["second-grid"], baseDate, selectedEndDate, selectedStartDate, rangeStartDate: isRangeVisible ? rangeStartDate : null, rangeEndDate: isRangeVisible ? rangeEndDate : null, focusedDate, focusedDateRef, isDateEnabled, onSelectDate, onGridKeyDownHandler, onFocusedDateChange, locale: locale2, startOfWeek, todayAriaLabel, ariaLabelledby: `${headingIdPrefix}-currentmonth` }) + ) + ); +}; + +// node_modules/@cloudscape-design/components/date-range-picker/calendar/range-inputs.js +var import_react207 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/time-input/internal.js +var import_react206 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/time-input/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/time-input/styles.scoped.css"; +var styles_css_default67 = { + "root": "awsui_root_l809c_im8v7_5" +}; + +// node_modules/@cloudscape-design/components/time-input/internal.js +var getMaskArgs = (format2, use24Hour) => { + const segments = [ + use24Hour ? { min: 0, max: 23, length: 2 } : { min: 1, max: 12, length: 2 }, + { min: 0, max: 59, length: 2 }, + { min: 0, max: 59, length: 2 } + ]; + return { + separator: ":", + segments: segments.slice(0, format2.split(":").length) + }; +}; +var InternalTimeInput = import_react206.default.forwardRef((_a, ref) => { + var { format: format2 = "hh:mm:ss", use24Hour = true, autoComplete = true, __internalRootRef = null } = _a, props2 = __rest(_a, ["format", "use24Hour", "autoComplete", "__internalRootRef"]); + const inputRef = (0, import_react206.useRef)(null); + useForwardFocus(ref, inputRef); + const maskArgs = getMaskArgs(format2, use24Hour); + return import_react206.default.createElement(masked_input_default, Object.assign({}, props2, { __internalRootRef, ref: inputRef, className: clsx_m_default(styles_css_default67.root, props2.className), autoComplete, disableBrowserAutocorrect: true, mask: maskArgs })); +}); +var internal_default19 = InternalTimeInput; + +// node_modules/@cloudscape-design/components/date-range-picker/calendar/range-inputs.js +function RangeInputs({ startDate, onChangeStartDate, startTime, onChangeStartTime, endDate, onChangeEndDate, endTime, onChangeEndTime, i18nStrings, dateOnly, timeInputFormat }) { + const i18n = useInternalI18n("date-range-picker"); + return import_react207.default.createElement( + InternalFormField, + { constraintText: i18n("i18nStrings.dateTimeConstraintText", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.dateTimeConstraintText) }, + import_react207.default.createElement( + "div", + { className: styles_css_default65["date-and-time-container"] }, + import_react207.default.createElement( + "div", + { className: styles_css_default65["date-and-time-wrapper"] }, + import_react207.default.createElement( + InternalFormField, + { label: i18n("i18nStrings.startDateLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.startDateLabel), stretch: true }, + import_react207.default.createElement(internal_default18, { value: startDate, className: styles_css_default65["start-date-input"], onChange: (event) => onChangeStartDate(event.detail.value), placeholder: "YYYY/MM/DD" }) + ), + !dateOnly && import_react207.default.createElement( + InternalFormField, + { label: i18n("i18nStrings.startTimeLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.startTimeLabel), stretch: true }, + import_react207.default.createElement(internal_default19, { value: startTime, onChange: (event) => onChangeStartTime(event.detail.value), format: timeInputFormat, placeholder: timeInputFormat, className: styles_css_default65["start-time-input"] }) + ) + ), + import_react207.default.createElement( + "div", + { className: styles_css_default65["date-and-time-wrapper"] }, + import_react207.default.createElement( + InternalFormField, + { label: i18n("i18nStrings.endDateLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.endDateLabel), stretch: true }, + import_react207.default.createElement(internal_default18, { value: endDate, className: styles_css_default65["end-date-input"], onChange: (event) => onChangeEndDate(event.detail.value), placeholder: "YYYY/MM/DD" }) + ), + !dateOnly && import_react207.default.createElement( + InternalFormField, + { label: i18n("i18nStrings.endTimeLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.endTimeLabel), stretch: true }, + import_react207.default.createElement(internal_default19, { value: endTime, onChange: (event) => onChangeEndTime(event.detail.value), format: timeInputFormat, placeholder: timeInputFormat, className: styles_css_default65["end-time-input"] }) + ) + ) + ) + ); +} + +// node_modules/@cloudscape-design/components/date-range-picker/calendar/index.js +function DateRangePickerCalendar({ value, setValue, locale: locale2 = "", startOfWeek, isDateEnabled = () => true, i18nStrings, dateOnly = false, timeInputFormat = "hh:mm:ss", customAbsoluteRangeControl }) { + const isSingleGrid = useMobile(); + const normalizedLocale = normalizeLocale("DateRangePicker", locale2); + const normalizedStartOfWeek = normalizeStartOfWeek(startOfWeek, normalizedLocale); + const i18n = useInternalI18n("date-range-picker"); + const [announcement, setAnnouncement] = (0, import_react208.useState)(""); + const [currentMonth, setCurrentMonth] = (0, import_react208.useState)(() => findMonthToDisplay(value, isSingleGrid)); + const [focusedDate, setFocusedDate] = (0, import_react208.useState)(() => { + if (value.start.date) { + const startDate = parseDate(value.start.date); + if (isSameMonth(startDate, currentMonth)) { + return startDate; + } + if (!isSingleGrid && isSameMonth(startDate, addMonths(currentMonth, -1))) { + return startDate; + } + } + return findDateToFocus(parseDate(value.start.date), currentMonth, isDateEnabled); + }); + const updateCurrentMonth = (startDate) => { + if (startDate.length >= 8) { + const newCurrentMonth = startOfMonth(parseDate(startDate)); + setCurrentMonth(isSingleGrid ? newCurrentMonth : addMonths(newCurrentMonth, 1)); + } + }; + const announceStart = (startDate) => { + return i18n("i18nStrings.startDateLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.startDateLabel) + ", " + getDateLabel(normalizedLocale, startDate) + ", " + i18n("i18nStrings.startTimeLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.startTimeLabel) + ", " + renderTimeLabel(normalizedLocale, startDate, timeInputFormat) + ". "; + }; + const announceEnd = (endDate) => { + return i18n("i18nStrings.endDateLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.endDateLabel) + ", " + getDateLabel(normalizedLocale, endDate) + ", " + i18n("i18nStrings.endTimeLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.endTimeLabel) + ", " + renderTimeLabel(normalizedLocale, endDate, timeInputFormat) + ". "; + }; + const renderSelectedAbsoluteRangeAriaLive = i18n("i18nStrings.renderSelectedAbsoluteRangeAriaLive", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.renderSelectedAbsoluteRangeAriaLive, (format2) => (startDate, endDate) => format2({ startDate, endDate })); + const announceRange = (startDate, endDate) => { + if (!renderSelectedAbsoluteRangeAriaLive) { + return `${getDateLabel(normalizedLocale, startDate)} – ${getDateLabel(normalizedLocale, endDate)}`; + } + return renderSelectedAbsoluteRangeAriaLive(getDateLabel(normalizedLocale, startDate), getDateLabel(normalizedLocale, endDate)); + }; + const onSelectDateHandler = (selectedDate) => { + const { start, end } = value; + let newStart = void 0; + let newEnd = void 0; + let announcement2 = ""; + if (!start.date && !end.date) { + newStart = startOfDay(selectedDate); + announcement2 = announceStart(newStart); + } else if (start.date && end.date) { + newStart = startOfDay(selectedDate); + newEnd = null; + announcement2 = announceStart(newStart); + } else if (start.date && !end.date) { + const parsedStartDate = parseDate(start.date); + if (isBefore(selectedDate, parsedStartDate)) { + newStart = startOfDay(selectedDate); + newEnd = endOfDay(parsedStartDate); + announcement2 = announceStart(newStart) + announceRange(newStart, newEnd); + } else { + newEnd = endOfDay(selectedDate); + announcement2 = announceEnd(newEnd) + announceRange(parsedStartDate, newEnd); + } + } else if (!start.date && end.date) { + const existingEndDate = parseDate(end.date); + if (isAfter(selectedDate, existingEndDate)) { + newStart = startOfDay(existingEndDate); + newEnd = endOfDay(selectedDate); + announcement2 = announceEnd(newEnd) + announceRange(newStart, newEnd); + } else { + newStart = startOfDay(selectedDate); + announcement2 = announceStart(newStart) + announceRange(newStart, existingEndDate); + } + } + const formatValue2 = (date2, previous) => { + if (date2 === null) { + return { date: "", time: "" }; + } else if (date2 === void 0) { + return previous; + } + return splitDateTime(formatDateTime(date2)); + }; + setValue({ + start: formatValue2(newStart, value.start), + end: formatValue2(newEnd, value.end) + }); + setAnnouncement(announcement2); + }; + const onHeaderChangeMonthHandler = (newCurrentMonth) => { + setCurrentMonth(newCurrentMonth); + const newBaseDateMonth = isSingleGrid ? newCurrentMonth : addMonths(newCurrentMonth, -1); + const newBaseDate = getBaseDay(newBaseDateMonth, isDateEnabled); + setFocusedDate(newBaseDate); + }; + const onChangeStartDate = (value2) => { + setValue((oldValue) => Object.assign(Object.assign({}, oldValue), { start: Object.assign(Object.assign({}, oldValue.start), { date: value2 }) })); + updateCurrentMonth(value2); + }; + const interceptedSetValue = (newValue) => { + setValue((oldValue) => { + const updated = typeof newValue === "function" ? newValue(oldValue) : newValue; + updateCurrentMonth(updated.start.date); + return updated; + }); + }; + const headingIdPrefix = useUniqueId("date-range-picker-calendar-heading"); + return import_react208.default.createElement( + import_react208.default.Fragment, + null, + import_react208.default.createElement( + "div", + { className: clsx_m_default(styles_css_default65["calendar-container"], { + [styles_css_default65["one-grid"]]: isSingleGrid + }) }, + import_react208.default.createElement( + InternalSpaceBetween, + { size: "s" }, + import_react208.default.createElement( + "div", + { className: clsx_m_default(styles_css_default65.calendar, { + [styles_css_default65["one-grid"]]: isSingleGrid + }) }, + import_react208.default.createElement(CalendarHeader2, { baseDate: currentMonth, locale: normalizedLocale, onChangeMonth: onHeaderChangeMonthHandler, previousMonthLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.previousMonthAriaLabel, nextMonthLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.nextMonthAriaLabel, isSingleGrid, headingIdPrefix }), + import_react208.default.createElement(Grids, { isSingleGrid, locale: normalizedLocale, baseDate: currentMonth, focusedDate, onFocusedDateChange: setFocusedDate, isDateEnabled, onSelectDate: onSelectDateHandler, onChangeMonth: setCurrentMonth, startOfWeek: normalizedStartOfWeek, todayAriaLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.todayAriaLabel, selectedStartDate: parseDate(value.start.date, true), selectedEndDate: parseDate(value.end.date, true), headingIdPrefix }) + ), + import_react208.default.createElement(RangeInputs, { startDate: value.start.date, onChangeStartDate, startTime: value.start.time, onChangeStartTime: (value2) => setValue((oldValue) => Object.assign(Object.assign({}, oldValue), { start: Object.assign(Object.assign({}, oldValue.start), { time: value2 }) })), endDate: value.end.date, onChangeEndDate: (value2) => setValue((oldValue) => Object.assign(Object.assign({}, oldValue), { end: Object.assign(Object.assign({}, oldValue.end), { date: value2 }) })), endTime: value.end.time, onChangeEndTime: (value2) => setValue((oldValue) => Object.assign(Object.assign({}, oldValue), { end: Object.assign(Object.assign({}, oldValue.end), { time: value2 }) })), i18nStrings, dateOnly, timeInputFormat }), + customAbsoluteRangeControl && import_react208.default.createElement("div", null, customAbsoluteRangeControl(value, interceptedSetValue)) + ) + ), + import_react208.default.createElement(live_region_default, { className: styles_css_default65["calendar-aria-live"] }, announcement) + ); +} + +// node_modules/@cloudscape-design/components/date-range-picker/relative-range/index.js +var import_react209 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/date-range-picker/relative-range/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/date-range-picker/relative-range/styles.scoped.css"; +var styles_css_default68 = { + "custom-range": "awsui_custom-range_16zmw_1bi9d_99", + "custom-range--no-padding": "awsui_custom-range--no-padding_16zmw_1bi9d_105", + "custom-range-form-controls": "awsui_custom-range-form-controls_16zmw_1bi9d_109", + "custom-range-duration": "awsui_custom-range-duration_16zmw_1bi9d_113", + "custom-range-unit": "awsui_custom-range-unit_16zmw_1bi9d_114", + "vertical": "awsui_vertical_16zmw_1bi9d_120", + "custom-range-duration-input": "awsui_custom-range-duration-input_16zmw_1bi9d_131", + "custom-range-unit-select": "awsui_custom-range-unit-select_16zmw_1bi9d_132", + "relative-range-radio-group": "awsui_relative-range-radio-group_16zmw_1bi9d_136" +}; + +// node_modules/@cloudscape-design/components/date-range-picker/relative-range/index.js +var dayUnits = ["day", "week", "month", "year"]; +var units = ["second", "minute", "hour", ...dayUnits]; +var CUSTOM_OPTION_SELECT_KEY = "awsui-internal-custom-duration-key"; +function RelativeRangePicker({ dateOnly, options: clientOptions = [], initialSelection: initialRange, onChange: onChangeRangeSize, i18nStrings, isSingleGrid }) { + var _a; + const i18n = useInternalI18n("date-range-picker"); + const formatRelativeRange = i18n("i18nStrings.formatRelativeRange", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.formatRelativeRange, (format2) => ({ amount, unit: unit2 }) => format2({ amount, unit: unit2 })); + const formatUnit = i18n("i18nStrings.formatUnit", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.formatUnit, (format2) => (unit2, amount) => format2({ amount, unit: unit2 })); + const radioOptions = clientOptions.map((option) => ({ + value: option.key, + label: formatRelativeRange === null || formatRelativeRange === void 0 ? void 0 : formatRelativeRange(option) + })); + radioOptions.push({ + value: CUSTOM_OPTION_SELECT_KEY, + label: i18n("i18nStrings.customRelativeRangeOptionLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.customRelativeRangeOptionLabel), + description: i18n("i18nStrings.customRelativeRangeOptionDescription", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.customRelativeRangeOptionDescription) + }); + const [selectedRadio, setSelectedRadio] = (0, import_react209.useState)(() => { + var _a2; + if (initialRange && !initialRange.key) { + return CUSTOM_OPTION_SELECT_KEY; + } + return (_a2 = initialRange === null || initialRange === void 0 ? void 0 : initialRange.key) !== null && _a2 !== void 0 ? _a2 : null; + }); + const [customDuration, setCustomDuration] = (0, import_react209.useState)(() => { + if (initialRange) { + return initialRange.amount; + } + return NaN; + }); + const initialCustomTimeUnit = dateOnly ? "day" : "minute"; + const [customUnitOfTime, setCustomUnitOfTime] = (0, import_react209.useState)((_a = initialRange === null || initialRange === void 0 ? void 0 : initialRange.unit) !== null && _a !== void 0 ? _a : initialCustomTimeUnit); + const showRadioControl = clientOptions.length > 0; + const showCustomControls = clientOptions.length === 0 || selectedRadio === CUSTOM_OPTION_SELECT_KEY; + return import_react209.default.createElement( + "div", + null, + import_react209.default.createElement( + InternalSpaceBetween, + { size: "xs", direction: "vertical" }, + showRadioControl && import_react209.default.createElement( + InternalFormField, + { label: i18n("i18nStrings.relativeRangeSelectionHeading", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.relativeRangeSelectionHeading) }, + import_react209.default.createElement(internal_default6, { className: styles_css_default68["relative-range-radio-group"], onChange: ({ detail }) => { + setSelectedRadio(detail.value); + if (detail.value === CUSTOM_OPTION_SELECT_KEY) { + setCustomDuration(NaN); + setCustomUnitOfTime(initialCustomTimeUnit); + onChangeRangeSize({ + amount: NaN, + unit: initialCustomTimeUnit, + type: "relative" + }); + } else { + const option = clientOptions.filter((o) => o.key === detail.value)[0]; + onChangeRangeSize(option); + } + }, value: selectedRadio, items: radioOptions }) + ), + showCustomControls && import_react209.default.createElement( + InternalSpaceBetween, + { direction: "vertical", size: "xs" }, + !showRadioControl && import_react209.default.createElement(InternalBox, { fontSize: "body-m", color: "text-body-secondary" }, i18n("i18nStrings.customRelativeRangeOptionDescription", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.customRelativeRangeOptionDescription)), + import_react209.default.createElement( + "div", + { className: clsx_m_default(styles_css_default68["custom-range"], { + [styles_css_default68["custom-range--no-padding"]]: !showRadioControl + }) }, + import_react209.default.createElement( + "div", + { className: clsx_m_default(styles_css_default68["custom-range-form-controls"], { + [styles_css_default68.vertical]: isSingleGrid + }) }, + import_react209.default.createElement( + "div", + { className: styles_css_default68["custom-range-duration"] }, + import_react209.default.createElement( + InternalFormField, + { label: i18n("i18nStrings.customRelativeRangeDurationLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.customRelativeRangeDurationLabel) }, + import_react209.default.createElement(internal_default4, { type: "number", className: styles_css_default68["custom-range-duration-input"], value: isNaN(customDuration) || customDuration === 0 ? "" : customDuration === null || customDuration === void 0 ? void 0 : customDuration.toString(), onChange: (e) => { + const amount = Number(e.detail.value); + setCustomDuration(amount); + onChangeRangeSize({ amount, unit: customUnitOfTime, type: "relative" }); + }, placeholder: i18n("i18nStrings.customRelativeRangeDurationPlaceholder", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.customRelativeRangeDurationPlaceholder), __inheritFormFieldProps: true }) + ) + ), + import_react209.default.createElement( + "div", + { className: styles_css_default68["custom-range-unit"] }, + import_react209.default.createElement( + InternalFormField, + { label: i18n("i18nStrings.customRelativeRangeUnitLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.customRelativeRangeUnitLabel) }, + import_react209.default.createElement(internal_default16, { className: styles_css_default68["custom-range-unit-select"], selectedOption: { + value: customUnitOfTime, + label: formatUnit === null || formatUnit === void 0 ? void 0 : formatUnit(customUnitOfTime, customDuration) + }, onChange: (e) => { + const { value: unit2 } = e.detail.selectedOption; + setCustomUnitOfTime(unit2); + onChangeRangeSize({ amount: customDuration, unit: unit2, type: "relative" }); + }, options: (dateOnly ? dayUnits : units).map((unit2) => ({ + value: unit2, + label: formatUnit === null || formatUnit === void 0 ? void 0 : formatUnit(unit2, customDuration) + })), renderHighlightedAriaLive: (option) => option.label || option.value || "" }) + ) + ) + ) + ) + ) + ) + ); +} + +// node_modules/@cloudscape-design/components/date-range-picker/mode-switcher.js +var import_react213 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/segmented-control/internal.js +var import_react212 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/segmented-control/internal-segmented-control.js +var import_react211 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/segmented-control/segment.js +var import_react210 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/segmented-control/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/segmented-control/styles.scoped.css"; +var styles_css_default69 = { + "segment": "awsui_segment_8cbea_97spt_103", + "disabled": "awsui_disabled_8cbea_97spt_183", + "selected": "awsui_selected_8cbea_97spt_191", + "icon": "awsui_icon_8cbea_97spt_212", + "with-text": "awsui_with-text_8cbea_97spt_216", + "with-no-text": "awsui_with-no-text_8cbea_97spt_222", + "root": "awsui_root_8cbea_97spt_231", + "segment-part": "awsui_segment-part_8cbea_97spt_266", + "select": "awsui_select_8cbea_97spt_191", + "segment-count-2": "awsui_segment-count-2_8cbea_97spt_285", + "segment-count-3": "awsui_segment-count-3_8cbea_97spt_290", + "segment-count-4": "awsui_segment-count-4_8cbea_97spt_295", + "segment-count-5": "awsui_segment-count-5_8cbea_97spt_300", + "segment-count-6": "awsui_segment-count-6_8cbea_97spt_305" +}; + +// node_modules/@cloudscape-design/components/segmented-control/segment.js +var Segment = import_react210.default.forwardRef(({ disabled, text, iconName, iconAlt, iconUrl, iconSvg, isActive, onClick, onKeyDown, tabIndex }, ref) => { + return import_react210.default.createElement( + "button", + { className: clsx_m_default(styles_css_default69.segment, { [styles_css_default69.disabled]: !!disabled }, { [styles_css_default69.selected]: isActive }), ref, onClick, onKeyDown, disabled, type: "button", tabIndex, "aria-pressed": isActive ? "true" : "false", "aria-label": !text ? iconAlt : void 0 }, + (iconName || iconUrl || iconSvg) && import_react210.default.createElement(internal_default, { className: clsx_m_default(styles_css_default69.icon, text ? styles_css_default69["with-text"] : styles_css_default69["with-no-text"]), name: iconName, url: iconUrl, svg: iconSvg, alt: iconAlt, variant: disabled ? "disabled" : "normal" }), + import_react210.default.createElement("span", null, text) + ); +}); + +// node_modules/@cloudscape-design/components/segmented-control/internal-segmented-control.js +function InternalSegmentedControl({ selectedId, options, label, ariaLabelledby, onChange }) { + const segmentByIdRef = (0, import_react211.useRef)({}); + const selectedOptions = (options || []).filter((option) => { + return option.id === selectedId; + }); + const currentSelectedOption = selectedOptions.length ? selectedOptions[0] : null; + const enabledSegments = (options || []).filter((option) => !option.disabled); + const moveHighlight2 = (event, activeIndex) => { + var _a; + if (event.keyCode !== KeyCode.right && event.keyCode !== KeyCode.left) { + return; + } + let nextIndex = activeIndex; + handleKey(event, { + onInlineStart: () => nextIndex = activeIndex === 0 ? enabledSegments.length - 1 : activeIndex - 1, + onInlineEnd: () => nextIndex = activeIndex + 1 === enabledSegments.length ? 0 : activeIndex + 1 + }); + const nextSegmentId = enabledSegments[nextIndex].id; + (_a = segmentByIdRef.current[nextSegmentId]) === null || _a === void 0 ? void 0 : _a.focus(); + }; + return import_react211.default.createElement("div", { className: clsx_m_default(styles_css_default69["segment-part"], styles_css_default69[`segment-count-${options === null || options === void 0 ? void 0 : options.length}`]), "aria-label": label, "aria-labelledby": ariaLabelledby, role: "toolbar" }, options && options.map((option, index) => { + const isActive = selectedId === option.id; + const enabledSegmentIndex = enabledSegments.indexOf(option); + let tabIndex = isActive ? 0 : -1; + if (currentSelectedOption === null && enabledSegmentIndex === 0) { + tabIndex = 0; + } + return import_react211.default.createElement(Segment, { key: index, id: option.id, disabled: !!option.disabled, iconName: option.iconName, iconAlt: option.iconAlt, iconUrl: option.iconUrl, iconSvg: option.iconSvg, text: option.text, isActive, tabIndex, ref: (node) => { + if (node) { + segmentByIdRef.current[option.id] = node; + } else { + delete segmentByIdRef.current[option.id]; + } + }, onClick: () => { + if (selectedId !== option.id) { + fireNonCancelableEvent(onChange, { selectedId: option.id }); + } + }, onKeyDown: (event) => moveHighlight2(event, enabledSegmentIndex) }); + })); +} + +// node_modules/@cloudscape-design/components/segmented-control/internal.js +function InternalSegmentedControl2(_a) { + var { selectedId, options, label, ariaLabelledby, onChange, __internalRootRef = null } = _a, props2 = __rest(_a, ["selectedId", "options", "label", "ariaLabelledby", "onChange", "__internalRootRef"]); + const baseProps = getBaseProps(props2); + const selectOptions = (options || []).map((option) => { + const label2 = option.text || option.iconAlt; + return Object.assign(Object.assign({}, option), { label: label2, value: option.id }); + }); + const selectedOptions = selectOptions.filter((option) => { + return option.value === selectedId; + }); + const currentSelectedOption = selectedOptions.length ? selectedOptions[0] : null; + const selectProps = { + options: selectOptions, + selectedOption: currentSelectedOption, + triggerVariant: "option", + onChange: (event) => fireNonCancelableEvent(onChange, { selectedId: event.detail.selectedOption.value }) + }; + return import_react212.default.createElement( + "div", + Object.assign({}, baseProps, { className: clsx_m_default(baseProps.className, styles_css_default69.root), ref: __internalRootRef }), + import_react212.default.createElement(InternalSegmentedControl, { selectedId, options, label, ariaLabelledby, onChange }), + import_react212.default.createElement( + "div", + { className: styles_css_default69.select }, + ariaLabelledby && import_react212.default.createElement(internal_default16, Object.assign({}, selectProps, { ariaLabelledby })), + !ariaLabelledby && label && import_react212.default.createElement( + InternalFormField, + { label, stretch: true }, + import_react212.default.createElement(internal_default16, Object.assign({}, selectProps)) + ), + !ariaLabelledby && !label && import_react212.default.createElement(internal_default16, Object.assign({}, selectProps)) + ) + ); +} + +// node_modules/@cloudscape-design/components/date-range-picker/mode-switcher.js +function ModeSwitcher({ i18nStrings, mode, onChange }) { + const i18n = useInternalI18n("date-range-picker"); + return import_react213.default.createElement(InternalSegmentedControl2, { className: styles_css_default65["mode-switch"], selectedId: mode, label: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.modeSelectionLabel, options: [ + { id: "relative", text: i18n("i18nStrings.relativeModeTitle", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.relativeModeTitle) }, + { id: "absolute", text: i18n("i18nStrings.absoluteModeTitle", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.absoluteModeTitle) } + ], onChange: (e) => onChange(e.detail.selectedId) }); +} + +// node_modules/@cloudscape-design/components/date-range-picker/time-offset.js +function setTimeOffset(value, timeOffset) { + if (!((value === null || value === void 0 ? void 0 : value.type) === "absolute")) { + return value; + } + return { + type: "absolute", + startDate: value.startDate + formatTimeOffsetISO(value.startDate, timeOffset.startDate), + endDate: value.endDate + formatTimeOffsetISO(value.endDate, timeOffset.endDate) + }; +} +function shiftTimeOffset(value, timeOffset) { + if (!value || value.type !== "absolute") { + return value; + } + const dateTimeRegex = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2})?(\.\d{1,3})?(((\+|-)\d{2}(:\d{2})?)|Z)?$/; + if (!dateTimeRegex.test(value.startDate) || !dateTimeRegex.test(value.endDate)) { + warnOnce("DateRangePicker", "You have provided a misformatted start or end date. The component will fall back to an empty value. Dates have to be ISO8601-formatted with an optional time zone offset."); + return null; + } + return { + type: "absolute", + startDate: shiftTimezoneOffset(value.startDate, timeOffset.startDate), + endDate: shiftTimezoneOffset(value.endDate, timeOffset.endDate) + }; +} +function normalizeTimeOffset(value, getTimeOffset, timeOffset) { + if (value && value.type === "absolute") { + if (getTimeOffset) { + return { + startDate: getTimeOffset(parseDateUTC(value.startDate)), + endDate: getTimeOffset(parseDateUTC(value.endDate)) + }; + } else if (timeOffset !== void 0) { + return { startDate: timeOffset, endDate: timeOffset }; + } + } + return { startDate: void 0, endDate: void 0 }; +} +function parseDateUTC(isoDateString) { + const date2 = new Date(isoDateString); + return addMinutes(date2, parseTimezoneOffset(isoDateString)); +} + +// node_modules/@cloudscape-design/components/date-range-picker/utils.js +function formatValue(value, { timeOffset, dateOnly }) { + if (!value || value.type === "relative") { + return value; + } + if (dateOnly) { + return { + type: "absolute", + startDate: value.startDate.split("T")[0], + endDate: value.endDate.split("T")[0] + }; + } + return setTimeOffset(value, timeOffset); +} +function getDefaultMode(value, relativeOptions, rangeSelectorMode) { + if (value && value.type) { + return value.type; + } + if (rangeSelectorMode === "relative-only") { + return "relative"; + } + if (rangeSelectorMode === "absolute-only") { + return "absolute"; + } + return relativeOptions.length > 0 ? "relative" : "absolute"; +} +function splitAbsoluteValue(value) { + if (!value) { + return { + start: { date: "", time: "" }, + end: { date: "", time: "" } + }; + } + return { start: splitDateTime(value.startDate), end: splitDateTime(value.endDate) }; +} +function joinAbsoluteValue(value) { + const startTime = normalizeTimeString(value.start.time || "00:00:00"); + const endTime = normalizeTimeString(value.end.time || "23:59:59"); + return { + type: "absolute", + startDate: joinDateTime(value.start.date, startTime), + endDate: joinDateTime(value.end.date, endTime) + }; +} + +// node_modules/@cloudscape-design/components/date-range-picker/dropdown.js +var VALID_RANGE = { valid: true }; +function DateRangePickerDropdown({ locale: locale2 = "", startOfWeek, isDateEnabled, isValidRange, value, onClear: clearValue, onApply: applyValue, onDropdownClose, relativeOptions, showClearButton, isSingleGrid, i18nStrings, dateOnly, timeInputFormat, rangeSelectorMode, ariaLabelledby, ariaDescribedby, customAbsoluteRangeControl }) { + const i18n = useInternalI18n("date-range-picker"); + const [rangeSelectionMode, setRangeSelectionMode] = (0, import_react214.useState)(getDefaultMode(value, relativeOptions, rangeSelectorMode)); + const [selectedAbsoluteRange, setSelectedAbsoluteRange] = (0, import_react214.useState)(() => splitAbsoluteValue((value === null || value === void 0 ? void 0 : value.type) === "absolute" ? value : null)); + const [selectedRelativeRange, setSelectedRelativeRange] = (0, import_react214.useState)((value === null || value === void 0 ? void 0 : value.type) === "relative" ? value : null); + const scrollableContainerRef = (0, import_react214.useRef)(null); + const applyButtonRef = (0, import_react214.useRef)(null); + const [applyClicked, setApplyClicked] = (0, import_react214.useState)(false); + const [validationResult, setValidationResult] = (0, import_react214.useState)(VALID_RANGE); + const closeDropdown = () => { + setApplyClicked(false); + onDropdownClose(); + }; + const onClear = () => { + closeDropdown(); + clearValue(); + }; + const onApply = () => { + const newValue = rangeSelectionMode === "relative" ? selectedRelativeRange : joinAbsoluteValue(selectedAbsoluteRange); + const newValidationResult = applyValue(newValue); + if (newValidationResult.valid === false) { + setApplyClicked(true); + setValidationResult(newValidationResult); + } else { + setApplyClicked(false); + closeDropdown(); + } + }; + (0, import_react214.useEffect)(() => { + if (applyClicked) { + const visibleRange = rangeSelectionMode === "relative" ? selectedRelativeRange : joinAbsoluteValue(selectedAbsoluteRange); + const newValidationResult = isValidRange(visibleRange); + setValidationResult(newValidationResult || VALID_RANGE); + } + }, [ + applyClicked, + isValidRange, + rangeSelectionMode, + selectedRelativeRange, + selectedAbsoluteRange, + setValidationResult + ]); + (0, import_react214.useEffect)(() => { + var _a; + return (_a = scrollableContainerRef.current) === null || _a === void 0 ? void 0 : _a.focus(); + }, [scrollableContainerRef]); + return import_react214.default.createElement( + import_react214.default.Fragment, + null, + import_react214.default.createElement( + focus_lock_default, + { className: styles_css_default65["focus-lock"], autoFocus: true }, + import_react214.default.createElement( + "div", + { ref: scrollableContainerRef, className: styles_css_default65.dropdown, tabIndex: 0, role: "dialog", "aria-modal": "true", "aria-label": i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.ariaLabel, "aria-labelledby": ariaLabelledby !== null && ariaLabelledby !== void 0 ? ariaLabelledby : i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.ariaLabelledby, "aria-describedby": ariaDescribedby !== null && ariaDescribedby !== void 0 ? ariaDescribedby : i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.ariaDescribedby }, + import_react214.default.createElement( + "div", + { className: clsx_m_default(styles_css_default65["dropdown-content"], { + [styles_css_default65["one-grid"]]: isSingleGrid + }) }, + import_react214.default.createElement( + InternalSpaceBetween, + { size: "l" }, + import_react214.default.createElement( + InternalBox, + { padding: { top: "m", horizontal: "l" } }, + import_react214.default.createElement( + InternalSpaceBetween, + { direction: "vertical", size: "s" }, + rangeSelectorMode === "default" && import_react214.default.createElement(ModeSwitcher, { mode: rangeSelectionMode, onChange: (mode) => { + setRangeSelectionMode(mode); + setApplyClicked(false); + setValidationResult(VALID_RANGE); + }, i18nStrings }), + rangeSelectionMode === "absolute" && import_react214.default.createElement(DateRangePickerCalendar, { value: selectedAbsoluteRange, setValue: setSelectedAbsoluteRange, locale: locale2, startOfWeek, isDateEnabled, i18nStrings, dateOnly, timeInputFormat, customAbsoluteRangeControl }), + rangeSelectionMode === "relative" && import_react214.default.createElement(RelativeRangePicker, { isSingleGrid, options: relativeOptions, dateOnly, initialSelection: selectedRelativeRange, onChange: (range2) => setSelectedRelativeRange(range2), i18nStrings }) + ), + import_react214.default.createElement(InternalBox, { className: styles_css_default65["validation-section"], margin: !validationResult.valid ? { top: "s" } : void 0 }, !validationResult.valid && import_react214.default.createElement( + import_react214.default.Fragment, + null, + import_react214.default.createElement( + internal_default10, + { type: "error", statusIconAriaLabel: i18n("i18nStrings.errorIconAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.errorIconAriaLabel) }, + import_react214.default.createElement("span", { className: styles_css_default65["validation-error"] }, validationResult.errorMessage) + ), + import_react214.default.createElement(live_region_default, null, validationResult.errorMessage) + )) + ), + import_react214.default.createElement( + "div", + { className: clsx_m_default(styles_css_default65.footer, { + [styles_css_default65["one-grid"]]: isSingleGrid, + [styles_css_default65["has-clear-button"]]: showClearButton + }) }, + showClearButton && import_react214.default.createElement( + "div", + { className: styles_css_default65["footer-button-wrapper"] }, + import_react214.default.createElement(InternalButton, { onClick: onClear, className: styles_css_default65["clear-button"], variant: "link", formAction: "none" }, i18n("i18nStrings.clearButtonLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.clearButtonLabel)) + ), + import_react214.default.createElement( + "div", + { className: styles_css_default65["footer-button-wrapper"] }, + import_react214.default.createElement( + InternalSpaceBetween, + { size: "xs", direction: "horizontal" }, + import_react214.default.createElement(InternalButton, { onClick: closeDropdown, className: styles_css_default65["cancel-button"], variant: "link", formAction: "none" }, i18n("i18nStrings.cancelButtonLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.cancelButtonLabel)), + import_react214.default.createElement(InternalButton, { onClick: onApply, className: styles_css_default65["apply-button"], ref: applyButtonRef, formAction: "none" }, i18n("i18nStrings.applyButtonLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.applyButtonLabel)) + ) + ) + ) + ) + ) + ) + ) + ); +} + +// node_modules/@cloudscape-design/components/date-range-picker/index.js +function renderDateRange({ locale: locale2, range: range2, placeholder = "", formatRelativeRange, absoluteFormat, hideTimeOffset, timeOffset }) { + var _a; + if (!range2) { + return import_react215.default.createElement("span", { className: styles_css_default65["label-text"], "aria-disabled": true }, placeholder); + } + const formatted = range2.type === "relative" ? (_a = formatRelativeRange === null || formatRelativeRange === void 0 ? void 0 : formatRelativeRange(range2)) !== null && _a !== void 0 ? _a : "" : import_react215.default.createElement(BreakSpaces, { text: formatDateRange({ + startDate: range2.startDate, + endDate: range2.endDate, + timeOffset, + hideTimeOffset, + format: absoluteFormat, + locale: locale2 + }) }); + return import_react215.default.createElement(InternalBox, { fontWeight: "normal", display: "inline", color: "inherit", variant: "span" }, formatted); +} +function BreakSpaces({ text }) { + const tokens = text.split(/( )/); + return import_react215.default.createElement(import_react215.default.Fragment, null, tokens.map((token, index) => import_react215.default.createElement( + import_react215.default.Fragment, + { key: index }, + token.length > 1 ? import_react215.default.createElement("span", { className: styles_css_default65["label-token-nowrap"] }, token) : token, + token === " " && import_react215.default.createElement("wbr", null) + ))); +} +function isDateOnly(value) { + if (!value || value.type !== "absolute") { + return false; + } + return isIsoDateOnly(value.startDate) && isIsoDateOnly(value.endDate); +} +var DateRangePicker = import_react215.default.forwardRef((_a, ref) => { + var _b, _c; + var { locale: locale2 = "", startOfWeek, isDateEnabled = () => true, value, placeholder, readOnly = false, disabled = false, onChange, onBlur, onFocus, relativeOptions = [], i18nStrings, isValidRange = () => ({ valid: true }), showClearButton = true, dateOnly = false, timeOffset, getTimeOffset, timeInputFormat = "hh:mm:ss", expandToViewport = false, rangeSelectorMode = "default", customAbsoluteRangeControl, absoluteFormat = "iso", hideTimeOffset } = _a, rest = __rest(_a, ["locale", "startOfWeek", "isDateEnabled", "value", "placeholder", "readOnly", "disabled", "onChange", "onBlur", "onFocus", "relativeOptions", "i18nStrings", "isValidRange", "showClearButton", "dateOnly", "timeOffset", "getTimeOffset", "timeInputFormat", "expandToViewport", "rangeSelectorMode", "customAbsoluteRangeControl", "absoluteFormat", "hideTimeOffset"]); + const { __internalRootRef } = useBaseComponent("DateRangePicker", { + props: { + absoluteFormat, + dateOnly, + expandToViewport, + rangeSelectorMode, + readOnly, + showClearButton, + timeInputFormat + } + }); + checkControlled("DateRangePicker", "value", value, "onChange", onChange); + const normalizedTimeOffset = normalizeTimeOffset(value, getTimeOffset, timeOffset); + value = isDateOnly(value) ? value : shiftTimeOffset(value, normalizedTimeOffset); + const baseProps = getBaseProps(rest); + const { invalid, controlId, ariaDescribedby, ariaLabelledby } = useFormFieldContext(Object.assign({ ariaLabelledby: (_b = rest.ariaLabelledby) !== null && _b !== void 0 ? _b : i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.ariaLabelledby, ariaDescribedby: (_c = rest.ariaDescribedby) !== null && _c !== void 0 ? _c : i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.ariaDescribedby }, rest)); + const isSingleGrid = useMobile(); + const triggerRef = (0, import_react215.useRef)(null); + useForwardFocus(ref, triggerRef); + const rootRef = (0, import_react215.useRef)(null); + const dropdownId = useUniqueId("date-range-picker-dropdown"); + const triggerContentId = useUniqueId("date-range-picker-trigger"); + useFocusTracker({ rootRef, onBlur, onFocus }); + const [isDropDownOpen, setIsDropDownOpen] = (0, import_react215.useState)(false); + const normalizedLocale = normalizeLocale("DateRangePicker", locale2); + const closeDropdown = (focusTrigger = false) => { + var _a2; + setIsDropDownOpen(false); + if (focusTrigger) { + (_a2 = triggerRef.current) === null || _a2 === void 0 ? void 0 : _a2.focus(); + } + }; + const onWrapperKeyDownHandler = (event) => { + if (event.keyCode === KeyCode.escape) { + if (isDropDownOpen) { + event.stopPropagation(); + } + closeDropdown(true); + } + }; + const onClear = () => { + fireNonCancelableEvent(onChange, { value: null }); + }; + const onApply = (newValue) => { + const validationResult = isValidRange(newValue); + if ((validationResult === null || validationResult === void 0 ? void 0 : validationResult.valid) === false) { + return validationResult; + } + if (isDevelopment) { + if ((newValue === null || newValue === void 0 ? void 0 : newValue.type) === "absolute") { + const [startDateWithoutTime] = newValue.startDate.split("T"); + const [endDateWithoutTime] = newValue.endDate.split("T"); + if (!startDateWithoutTime || !endDateWithoutTime) { + warnOnce("DateRangePicker", "You have provided an `isValidRange` prop that did not catch a missing start or end date."); + } + } + } + fireNonCancelableEvent(onChange, { + value: formatValue(newValue, { + dateOnly, + timeOffset: normalizeTimeOffset(newValue, getTimeOffset, timeOffset) + }) + }); + return validationResult || { valid: true }; + }; + const prevDateOnly = usePrevious(dateOnly); + (0, import_react215.useEffect)(() => { + if (prevDateOnly !== void 0 && prevDateOnly !== dateOnly) { + warnOnce("DateRangePicker", `The provided \`dateOnly\` flag has been changed from "${prevDateOnly}" to "${dateOnly}" which can lead to unexpected value format. Consider using separate components.`); + } + }, [prevDateOnly, dateOnly]); + if (value && value.type !== "absolute" && value.type !== "relative") { + warnOnce("DateRangePicker", "You provided an invalid value. Reverting back to default."); + value = null; + } + if ((value === null || value === void 0 ? void 0 : value.type) === "absolute" && rangeSelectorMode === "relative-only" || (value === null || value === void 0 ? void 0 : value.type) === "relative" && rangeSelectorMode === "absolute-only") { + warnOnce("DateRangePicker", "The provided value does not correspond to the current range selector mode. Reverting back to default."); + value = null; + } + const i18n = useInternalI18n("date-range-picker"); + const formatRelativeRange = i18n("i18nStrings.formatRelativeRange", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.formatRelativeRange, (format2) => ({ amount, unit: unit2 }) => format2({ amount, unit: unit2 })); + if (isDevelopment) { + if (!formatRelativeRange && rangeSelectorMode !== "absolute-only") { + warnOnce("DateRangePicker", "A function for i18nStrings.formatRelativeRange was not provided. Relative ranges will not be correctly rendered."); + } + } + const formattedDate = renderDateRange({ + locale: normalizedLocale, + range: value, + placeholder, + formatRelativeRange, + absoluteFormat, + hideTimeOffset, + timeOffset: normalizedTimeOffset + }); + const trigger = import_react215.default.createElement( + "div", + { className: styles_css_default65["trigger-wrapper"] }, + import_react215.default.createElement( + button_trigger_default, + { ref: triggerRef, id: controlId, invalid, ariaLabelledby: joinStrings(ariaLabelledby, triggerContentId), ariaLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.ariaLabel, ariaDescribedby, className: clsx_m_default(styles_css_default65.label, { + [styles_css_default65["label-enabled"]]: !readOnly && !disabled + }), hideCaret: true, onClick: () => { + if (!readOnly && !disabled) { + setIsDropDownOpen(true); + } + }, disabled, readOnly, ariaHasPopup: "dialog" }, + import_react215.default.createElement( + "span", + { className: styles_css_default65["trigger-flexbox"] }, + import_react215.default.createElement( + "span", + { className: styles_css_default65["icon-wrapper"] }, + import_react215.default.createElement(internal_default, { name: "calendar", variant: disabled || readOnly ? "disabled" : "normal" }) + ), + import_react215.default.createElement("span", { id: triggerContentId }, formattedDate) + ) + ) + ); + const mergedRef = useMergeRefs(rootRef, __internalRootRef); + return import_react215.default.createElement( + "div", + Object.assign({}, baseProps, { ref: mergedRef, className: clsx_m_default(baseProps.className, styles_css_default65.root, absoluteFormat === "long-localized" && !dateOnly && styles_css_default65.wide), onKeyDown: onWrapperKeyDownHandler }), + import_react215.default.createElement( + dropdown_default, + { stretchWidth: true, stretchHeight: true, open: isDropDownOpen, onDropdownClose: () => closeDropdown(), trigger, stretchToTriggerWidth: false, expandToViewport, dropdownId }, + import_react215.default.createElement(reset_contexts_for_modal_default, null, isDropDownOpen && import_react215.default.createElement(DateRangePickerDropdown, { startOfWeek, locale: normalizedLocale, isSingleGrid, onDropdownClose: () => closeDropdown(true), value, showClearButton, isDateEnabled, i18nStrings, onClear, onApply, relativeOptions, isValidRange, dateOnly, timeInputFormat, rangeSelectorMode, ariaLabelledby, ariaDescribedby, customAbsoluteRangeControl })) + ) + ); +}); +applyDisplayName(DateRangePicker, "DateRangePicker"); +var date_range_picker_default = DateRangePicker; + +// node_modules/@cloudscape-design/components/drawer/index.js +var import_react216 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/drawer/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/drawer/styles.scoped.css"; +var styles_css_default70 = { + "drawer": "awsui_drawer_1sxt8_1oeyq_100", + "header": "awsui_header_1sxt8_1oeyq_140", + "test-utils-drawer-content": "awsui_test-utils-drawer-content_1sxt8_1oeyq_169" +}; + +// node_modules/@cloudscape-design/components/drawer/index.js +function Drawer2(_a) { + var { header, children: children2, loading, i18nStrings } = _a, restProps = __rest(_a, ["header", "children", "loading", "i18nStrings"]); + const { __internalRootRef } = useBaseComponent("Drawer"); + const baseProps = getBaseProps(restProps); + const i18n = useInternalI18n("drawer"); + const containerProps = Object.assign(Object.assign({}, baseProps), { className: clsx_m_default(baseProps.className, styles_css_default70.drawer) }); + return loading ? import_react216.default.createElement( + "div", + Object.assign({}, containerProps, { ref: __internalRootRef }), + import_react216.default.createElement( + StatusIndicator, + { type: "loading" }, + import_react216.default.createElement(live_region_default, { visible: true }, i18n("i18nStrings.loadingText", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.loadingText)) + ) + ) : import_react216.default.createElement( + "div", + Object.assign({}, containerProps, { ref: __internalRootRef }), + header && import_react216.default.createElement("div", { className: clsx_m_default(styles_css_default70.header) }, header), + import_react216.default.createElement("div", { className: clsx_m_default(styles_css_default70["test-utils-drawer-content"]) }, children2) + ); +} +applyDisplayName(Drawer2, "Drawer"); + +// node_modules/@cloudscape-design/components/expandable-section/index.js +var import_react217 = __toESM(require_react()); +function ExpandableSection(_a) { + var { variant = "default" } = _a, props2 = __rest(_a, ["variant"]); + const baseComponentProps = useBaseComponent("ExpandableSection", { + props: { + disableContentPaddings: props2.disableContentPaddings, + headingTagOverride: props2.headingTagOverride, + variant + } + }); + return import_react217.default.createElement(InternalExpandableSection, Object.assign({ variant }, props2, baseComponentProps)); +} +applyDisplayName(ExpandableSection, "ExpandableSection"); + +// node_modules/@cloudscape-design/components/flashbar/index.js +var import_react222 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/flashbar/collapsible-flashbar.js +var import_react220 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/flashbar/flash.js +var import_react218 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/flashbar/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/flashbar/styles.scoped.css"; +var styles_css_default71 = { + "flash-with-motion": "awsui_flash-with-motion_1q84n_pgrle_99", + "enter": "awsui_enter_1q84n_pgrle_99", + "flash-body": "awsui_flash-body_1q84n_pgrle_113", + "flash-message": "awsui_flash-message_1q84n_pgrle_113", + "flash-header": "awsui_flash-header_1q84n_pgrle_113", + "flash-content": "awsui_flash-content_1q84n_pgrle_114", + "action-button-wrapper": "awsui_action-button-wrapper_1q84n_pgrle_115", + "dismiss-button-wrapper": "awsui_dismiss-button-wrapper_1q84n_pgrle_116", + "flash-icon": "awsui_flash-icon_1q84n_pgrle_139", + "entering": "awsui_entering_1q84n_pgrle_152", + "entered": "awsui_entered_1q84n_pgrle_173", + "exiting": "awsui_exiting_1q84n_pgrle_278", + "stack": "awsui_stack_1q84n_pgrle_300", + "animation-running": "awsui_animation-running_1q84n_pgrle_300", + "item": "awsui_item_1q84n_pgrle_300", + "flash-list-item": "awsui_flash-list-item_1q84n_pgrle_301", + "notification-bar": "awsui_notification-bar_1q84n_pgrle_302", + "collapsed": "awsui_collapsed_1q84n_pgrle_322", + "animation-ready": "awsui_animation-ready_1q84n_pgrle_322", + "expanded-only": "awsui_expanded-only_1q84n_pgrle_322", + "expanded": "awsui_expanded_1q84n_pgrle_322", + "flash": "awsui_flash_1q84n_pgrle_99", + "collapsible": "awsui_collapsible_1q84n_pgrle_386", + "short-list": "awsui_short-list_1q84n_pgrle_392", + "visual-refresh": "awsui_visual-refresh_1q84n_pgrle_392", + "status": "awsui_status_1q84n_pgrle_605", + "header": "awsui_header_1q84n_pgrle_605", + "item-count": "awsui_item-count_1q84n_pgrle_606", + "button": "awsui_button_1q84n_pgrle_607", + "type-count": "awsui_type-count_1q84n_pgrle_640", + "count-number": "awsui_count-number_1q84n_pgrle_640", + "icon": "awsui_icon_1q84n_pgrle_674", + "floating": "awsui_floating_1q84n_pgrle_715", + "flashbar": "awsui_flashbar_1q84n_pgrle_723", + "flash-refresh": "awsui_flash-refresh_1q84n_pgrle_798", + "flash-list": "awsui_flash-list_1q84n_pgrle_301", + "flash-focus-container": "awsui_flash-focus-container_1q84n_pgrle_819", + "flash-text": "awsui_flash-text_1q84n_pgrle_849", + "dismiss-button": "awsui_dismiss-button_1q84n_pgrle_116", + "breakpoint-default": "awsui_breakpoint-default_1q84n_pgrle_891", + "action-button": "awsui_action-button_1q84n_pgrle_115", + "action-slot": "awsui_action-slot_1q84n_pgrle_901", + "flash-type-success": "awsui_flash-type-success_1q84n_pgrle_905", + "flash-type-error": "awsui_flash-type-error_1q84n_pgrle_909", + "flash-type-info": "awsui_flash-type-info_1q84n_pgrle_913", + "flash-type-in-progress": "awsui_flash-type-in-progress_1q84n_pgrle_914", + "flash-type-warning": "awsui_flash-type-warning_1q84n_pgrle_918" +}; + +// node_modules/@cloudscape-design/components/flashbar/utils.js +var FOCUS_THROTTLE_DELAY = 2e3; +var typesToColors = { + error: "red", + info: "blue", + "in-progress": "blue", + success: "green", + warning: "yellow" +}; +function getColorFromType(type) { + const defaultColor = "blue"; + return type ? typesToColors[type] || defaultColor : defaultColor; +} +function getItemType(item) { + if (item.loading) { + return "in-progress"; + } else { + return item.type || "info"; + } +} +function getItemColor(item) { + return getColorFromType(getItemType(item)); +} +function getVisibleCollapsedItems(items, desiredLength) { + const itemsOnTop = []; + const itemsToPromote = []; + const addedColors = /* @__PURE__ */ new Set(); + const allPossibleColors = Object.keys(typesToColors).length; + const finalLength = Math.min(items.length, desiredLength); + for (let i = 0; i < items.length; i++) { + const item = items[i]; + const color2 = getItemColor(item); + const isColorRepeated = addedColors.has(color2); + if (i < finalLength) { + itemsOnTop.push({ item: Object.assign(Object.assign({}, item), { expandedIndex: i }), isColorRepeated }); + } else { + if (addedColors.size === allPossibleColors) { + break; + } else if (!isColorRepeated) { + itemsToPromote.push(Object.assign(Object.assign({}, item), { expandedIndex: i })); + } + } + addedColors.add(color2); + } + const reversedInitialSelection = []; + let slotsReservedForPromotions = 0; + for (let j = itemsOnTop.length - 1; j >= 0; j--) { + const item = itemsOnTop[j]; + if (item.isColorRepeated && slotsReservedForPromotions < itemsToPromote.length) { + slotsReservedForPromotions += 1; + } else { + reversedInitialSelection.push(item.item); + } + } + const selectedItems = reversedInitialSelection.reverse(); + for (let k2 = 0; selectedItems.length < desiredLength; k2++) { + selectedItems.push(itemsToPromote[k2]); + } + return selectedItems; +} +function getFlashTypeCount(items) { + const count = { error: 0, info: 0, "in-progress": 0, success: 0, warning: 0 }; + for (const item of items) { + const type = getItemType(item); + count[type] += 1; + } + return count; +} +var counterTypes = [ + { type: "error", labelName: "errorIconAriaLabel", iconName: "status-negative" }, + { type: "warning", labelName: "warningIconAriaLabel", iconName: "status-warning" }, + { type: "success", labelName: "successIconAriaLabel", iconName: "status-positive" }, + { type: "info", labelName: "infoIconAriaLabel", iconName: "status-info" }, + { type: "in-progress", labelName: "inProgressIconAriaLabel", iconName: "status-in-progress" } +]; + +// node_modules/@cloudscape-design/components/flashbar/internal/analytics.js +var metrics = new Metrics(PACKAGE_SOURCE, PACKAGE_VERSION); +var eventContext = "csa_flashbar"; +var sendRenderMetric = (items) => { + const countByType = getFlashTypeCount(items); + metrics.sendPanoramaMetric({ + eventContext, + eventType: "render", + eventValue: items.length.toString(), + eventDetail: countByType + }); +}; +var sendToggleMetric = (itemsCount, expanded) => { + metrics.sendPanoramaMetric({ + eventContext, + eventType: expanded ? "expand" : "collapse", + eventValue: itemsCount.toString() + }); +}; +var sendDismissMetric = (itemType) => { + metrics.sendPanoramaMetric({ + eventContext, + eventType: "dismiss", + eventValue: itemType + }); +}; + +// node_modules/@cloudscape-design/components/flashbar/flash.js +var ICON_TYPES = { + success: "status-positive", + warning: "status-warning", + info: "status-info", + error: "status-negative", + "in-progress": "status-in-progress" +}; +var useDiscoveredAction2 = createUseDiscoveredAction(awsuiPluginsInternal.flashbar.onActionRegistered); +function dismissButton(dismissLabel, onDismiss) { + return import_react218.default.createElement( + "div", + { className: styles_css_default71["dismiss-button-wrapper"] }, + import_react218.default.createElement(InternalButton, { onClick: onDismiss, className: styles_css_default71["dismiss-button"], variant: "flashbar-icon", iconName: "close", formAction: "none", ariaLabel: dismissLabel }) + ); +} +var focusFlashById = throttle((element, itemId) => { + var _a; + const selector = `[data-itemid="${CSS.escape(itemId)}"] .${styles_css_default71["flash-focus-container"]}`; + (_a = element === null || element === void 0 ? void 0 : element.querySelector(selector)) === null || _a === void 0 ? void 0 : _a.focus(); +}, FOCUS_THROTTLE_DELAY, { trailing: false }); +var Flash = import_react218.default.forwardRef((_a, ref) => { + var { id, header, content, dismissible, dismissLabel, loading, action, buttonText, onButtonClick, onDismiss, className, transitionState, ariaRole, i18nStrings, type = "info" } = _a, props2 = __rest(_a, ["id", "header", "content", "dismissible", "dismissLabel", "loading", "action", "buttonText", "onButtonClick", "onDismiss", "className", "transitionState", "ariaRole", "i18nStrings", "type"]); + if (isDevelopment) { + if (buttonText && !onButtonClick) { + warnOnce("Flashbar", `You provided a \`buttonText\` prop without an \`onButtonClick\` handler. This will render a non-interactive action button.`); + } + if (dismissible && !onDismiss) { + warnOnce("Flashbar", `You have set the \`dismissible\` prop without an \`onDismiss\` handler. This will render a non-interactive dismiss button.`); + } + } + const analyticsMetadata = getAnalyticsMetadataProps(props2); + const elementRef = useComponentMetadata("Flash", PACKAGE_VERSION, Object.assign({}, analyticsMetadata)); + const mergedRef = useMergeRefs(ref, elementRef); + const { discoveredActions, headerRef, contentRef } = useDiscoveredAction2(type); + const iconType = ICON_TYPES[type]; + const icon = loading ? import_react218.default.createElement(InternalSpinner, null) : import_react218.default.createElement(internal_default, { name: iconType }); + const effectiveType = loading ? "info" : type; + const handleDismiss = (event) => { + sendDismissMetric(effectiveType); + onDismiss && onDismiss(event); + }; + const analyticsAttributes = { + [DATA_ATTR_ANALYTICS_FLASHBAR]: effectiveType + }; + const statusIconAriaLabel = props2.statusIconAriaLabel || (i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings[`${loading || type === "in-progress" ? "inProgress" : type}IconAriaLabel`]); + return ( + // We're not using "polite" or "assertive" here, just turning default behavior off. + // eslint-disable-next-line @cloudscape-design/prefer-live-region + import_react218.default.createElement( + "div", + Object.assign({ ref: mergedRef, role: ariaRole, "aria-live": ariaRole ? "off" : void 0, "data-itemid": id, className: clsx_m_default(styles_css_default71.flash, styles_css_default71[`flash-type-${effectiveType}`], className, transitionState && { + [styles_css_default71.enter]: transitionState === "enter", + [styles_css_default71.entering]: transitionState === "entering", + [styles_css_default71.entered]: transitionState === "entered", + [styles_css_default71.exit]: transitionState === "exit", + [styles_css_default71.exiting]: transitionState === "exiting", + [styles_css_default71.exited]: transitionState === "exited" + }, getVisualContextClassname(type === "warning" && !loading ? "flashbar-warning" : "flashbar")) }, analyticsAttributes), + import_react218.default.createElement( + "div", + { className: styles_css_default71["flash-body"] }, + import_react218.default.createElement( + "div", + { className: styles_css_default71["flash-focus-container"], tabIndex: -1 }, + import_react218.default.createElement("div", { className: clsx_m_default(styles_css_default71["flash-icon"], styles_css_default71["flash-text"]), role: "img", "aria-label": statusIconAriaLabel }, icon), + import_react218.default.createElement( + "div", + { className: clsx_m_default(styles_css_default71["flash-message"], styles_css_default71["flash-text"]) }, + import_react218.default.createElement("div", { className: styles_css_default71["flash-header"], ref: headerRef }, header), + import_react218.default.createElement("div", { className: styles_css_default71["flash-content"], ref: contentRef }, content) + ) + ), + import_react218.default.createElement(ActionsWrapper, { className: styles_css_default71["action-button-wrapper"], testUtilClasses: { + actionSlot: styles_css_default71["action-slot"], + actionButton: styles_css_default71["action-button"] + }, action, discoveredActions, buttonText, onButtonClick }) + ), + dismissible && dismissButton(dismissLabel, handleDismiss), + ariaRole === "status" && import_react218.default.createElement(live_region_default, { source: [statusIconAriaLabel, headerRef, contentRef] }) + ) + ); +}); + +// node_modules/@cloudscape-design/components/internal/animate.js +function getDOMRects(elements) { + const rects = {}; + for (const id in elements) { + const element = elements[id]; + if (element) { + rects[id] = element.getBoundingClientRect(); + } + } + return rects; +} +function animate({ oldState, elements, onTransitionsEnd, newElementInitialState }) { + for (const id in elements) { + const element = elements[id]; + const oldRect = oldState[id]; + if (element) { + const newRect = element.getBoundingClientRect(); + const noOpTransform = { scale: 1, x: 0, y: 0 }; + const calculatedInverseTransform = oldRect ? { + scale: oldRect.width / newRect.width, + x: (oldRect.left + oldRect.right) / 2 - (newRect.left + newRect.right) / 2, + y: (oldRect.top + oldRect.bottom) / 2 - (newRect.top + newRect.bottom) / 2 + } : newElementInitialState ? newElementInitialState(newRect) : {}; + const inverseTransform = Object.assign(Object.assign({}, noOpTransform), calculatedInverseTransform); + element.style.transitionProperty = "none"; + element.style.transform = `scale(${inverseTransform.scale}) translate(${inverseTransform.x}px, ${inverseTransform.y}px)`; + if (!oldRect) { + element.style.opacity = "0"; + } + } + } + requestAnimationFrame(() => { + const ongoingAnimations = /* @__PURE__ */ new Set(); + for (const id in elements) { + const element = elements[id]; + if (element) { + const oldRect = oldState[id]; + if (oldRect) { + element.style.transitionProperty = `transform`; + element.style.transform = ""; + } else { + element.style.transitionProperty = `transform, opacity`; + element.style.transform = ""; + element.style.opacity = ""; + } + const onTransitionStart = (event) => { + if (event.target === element) { + ongoingAnimations.add(id); + element.removeEventListener("transitionstart", onTransitionStart); + } + }; + const onTransitionEnd = (event) => { + if (event.target === element) { + element.style.transitionProperty = ""; + element.removeEventListener("transitionstart", onTransitionEnd); + if (onTransitionsEnd) { + ongoingAnimations.delete(id); + if (ongoingAnimations.size === 0) { + onTransitionsEnd(); + } + } + } + }; + element.addEventListener("transitionstart", onTransitionStart); + element.addEventListener("transitionend", onTransitionEnd); + } + } + }); +} + +// node_modules/@cloudscape-design/components/flashbar/common.js +var import_react219 = __toESM(require_react()); +function useFlashbar(_a) { + var { items, onItemsAdded, onItemsChanged, onItemsRemoved } = _a, restProps = __rest(_a, ["items", "onItemsAdded", "onItemsChanged", "onItemsRemoved"]); + const { __internalRootRef } = useBaseComponent("Flashbar", { + props: { stackItems: restProps.stackItems } + }); + const allItemsHaveId = (0, import_react219.useMemo)(() => items.every((item) => "id" in item), [items]); + const baseProps = getBaseProps(restProps); + const ref = (0, import_react219.useRef)(null); + const [breakpoint, breakpointRef] = useContainerBreakpoints(["xs"]); + const mergedRef = useMergeRefs(ref, breakpointRef, __internalRootRef); + const isReducedMotion = useReducedMotion(ref); + const isVisualRefresh = useVisualRefresh(); + const [previousItems, setPreviousItems] = (0, import_react219.useState)(items); + const [nextFocusId, setNextFocusId] = (0, import_react219.useState)(null); + if (isDevelopment) { + if (items === null || items === void 0 ? void 0 : items.some((item) => item.ariaRole === "alert" && !item.id)) { + warnOnce("Flashbar", `You provided \`ariaRole="alert"\` for a flashbar item without providing an \`id\`. Focus will not be moved to the newly added flash message.`); + } + } + if (items) { + const newItems = items.filter(({ id }) => id && !previousItems.some((item) => item.id === id)); + const removedItems = previousItems.filter(({ id }) => id && !items.some((item) => item.id === id)); + if (newItems.length > 0 || removedItems.length > 0) { + setPreviousItems(items); + onItemsAdded === null || onItemsAdded === void 0 ? void 0 : onItemsAdded(newItems); + onItemsRemoved === null || onItemsRemoved === void 0 ? void 0 : onItemsRemoved(removedItems); + onItemsChanged === null || onItemsChanged === void 0 ? void 0 : onItemsChanged({ allItemsHaveId, isReducedMotion }); + const newFocusItems = newItems.filter(({ ariaRole }) => ariaRole === "alert"); + if (newFocusItems.length > 0) { + setNextFocusId(newFocusItems[0].id); + } + } + } + (0, import_react219.useEffect)(() => { + if (nextFocusId) { + focusFlashById(ref.current, nextFocusId); + } + }, [nextFocusId, ref]); + return { + allItemsHaveId, + baseProps, + breakpoint, + isReducedMotion, + isVisualRefresh, + mergedRef, + ref + }; +} + +// node_modules/@cloudscape-design/components/flashbar/collapsible-flashbar.js +var maxNonCollapsibleItems = 1; +var resizeListenerThrottleDelay = 100; +function CollapsibleFlashbar(_a) { + var { items } = _a, restProps = __rest(_a, ["items"]); + const [enteringItems, setEnteringItems] = (0, import_react220.useState)([]); + const [exitingItems, setExitingItems] = (0, import_react220.useState)([]); + const [isFlashbarStackExpanded, setIsFlashbarStackExpanded] = (0, import_react220.useState)(false); + const getElementsToAnimate = (0, import_react220.useCallback)(() => { + const flashElements = isFlashbarStackExpanded ? expandedItemRefs.current : collapsedItemRefs.current; + return Object.assign(Object.assign({}, flashElements), { notificationBar: notificationBarRef.current }); + }, [isFlashbarStackExpanded]); + const prepareAnimations = (0, import_react220.useCallback)(() => { + const rects = getDOMRects(getElementsToAnimate()); + setInitialAnimationState(rects); + }, [getElementsToAnimate]); + const { baseProps, breakpoint, isReducedMotion, isVisualRefresh, mergedRef, ref } = useFlashbar(Object.assign(Object.assign({ items }, restProps), { onItemsAdded: (newItems) => { + setEnteringItems([...enteringItems, ...newItems]); + }, onItemsChanged: (options) => { + if ((options === null || options === void 0 ? void 0 : options.allItemsHaveId) && !(options === null || options === void 0 ? void 0 : options.isReducedMotion)) { + prepareAnimations(); + } + }, onItemsRemoved: (removedItems) => { + setExitingItems([...exitingItems, ...removedItems]); + } })); + const collapsedItemRefs = (0, import_react220.useRef)({}); + const expandedItemRefs = (0, import_react220.useRef)({}); + const [initialAnimationState, setInitialAnimationState] = (0, import_react220.useState)(null); + const listElementRef = (0, import_react220.useRef)(null); + const notificationBarRef = (0, import_react220.useRef)(null); + const [transitioning, setTransitioning] = (0, import_react220.useState)(false); + const flashbarElementId = useUniqueId("flashbar"); + const itemCountElementId = useUniqueId("item-count"); + if (items.length <= maxNonCollapsibleItems && isFlashbarStackExpanded) { + setIsFlashbarStackExpanded(false); + } + const animateFlash = !isReducedMotion; + function toggleCollapseExpand() { + sendToggleMetric(items.length, !isFlashbarStackExpanded); + if (!isReducedMotion) { + prepareAnimations(); + } + setIsFlashbarStackExpanded((prev) => !prev); + } + (0, import_react220.useLayoutEffect)(() => { + if (isFlashbarStackExpanded && (items === null || items === void 0 ? void 0 : items.length)) { + const mostRecentItem = items[0]; + if (mostRecentItem.id !== void 0) { + focusFlashById(ref.current, mostRecentItem.id); + } + } + }, [isFlashbarStackExpanded]); + useEffectOnUpdate(() => { + if (!isFlashbarStackExpanded && notificationBarRef.current) { + scrollElementIntoView(notificationBarRef.current); + } + }, [isFlashbarStackExpanded]); + const updateBottomSpacing = (0, import_react220.useMemo)(() => throttle(() => { + const listElement = listElementRef === null || listElementRef === void 0 ? void 0 : listElementRef.current; + const flashbar = listElement === null || listElement === void 0 ? void 0 : listElement.parentElement; + if (listElement && flashbar) { + flashbar.classList.remove(styles_css_default71.floating); + const windowHeight = window.innerHeight; + const outerElement = findUpUntil(flashbar, (element) => element.getAttribute("role") === "region") || flashbar; + const applySpacing = isFlashbarStackExpanded && Math.ceil(outerElement.getBoundingClientRect().bottom) >= windowHeight; + if (!applySpacing) { + flashbar.classList.add(styles_css_default71.floating); + } + } + }, resizeListenerThrottleDelay), [isFlashbarStackExpanded]); + (0, import_react220.useLayoutEffect)(() => { + window.addEventListener("resize", updateBottomSpacing); + return () => { + window.removeEventListener("resize", updateBottomSpacing); + updateBottomSpacing.cancel(); + }; + }, [updateBottomSpacing]); + const { i18nStrings } = restProps; + const i18n = useInternalI18n("flashbar"); + const ariaLabel = i18n("i18nStrings.ariaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.ariaLabel); + const notificationBarText = i18n("i18nStrings.notificationBarText", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.notificationBarText); + const notificationBarAriaLabel = i18n("i18nStrings.notificationBarAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.notificationBarAriaLabel); + const iconAriaLabels = { + errorIconAriaLabel: i18n("i18nStrings.errorIconAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.errorIconAriaLabel), + inProgressIconAriaLabel: i18n("i18nStrings.inProgressIconAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.inProgressIconAriaLabel), + infoIconAriaLabel: i18n("i18nStrings.infoIconAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.infoIconAriaLabel), + successIconAriaLabel: i18n("i18nStrings.successIconAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.successIconAriaLabel), + warningIconAriaLabel: i18n("i18nStrings.warningIconAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.warningIconAriaLabel) + }; + (0, import_react220.useLayoutEffect)(() => { + if (initialAnimationState) { + updateBottomSpacing(); + animate({ + elements: getElementsToAnimate(), + oldState: initialAnimationState, + newElementInitialState: ({ top }) => ({ scale: 0.9, y: -0.2 * top }), + onTransitionsEnd: () => setTransitioning(false) + }); + setTransitioning(true); + setInitialAnimationState(null); + } + }, [updateBottomSpacing, getElementsToAnimate, initialAnimationState, isFlashbarStackExpanded]); + const isCollapsible = items.length > maxNonCollapsibleItems; + const countByType = getFlashTypeCount(items); + const numberOfColorsInStack = new Set(items.map(getItemColor)).size; + const maxSlots = Math.max(numberOfColorsInStack, 3); + const stackDepth = Math.min(maxSlots, items.length); + const itemsToShow = isFlashbarStackExpanded ? items.map((item, index) => Object.assign(Object.assign({}, item), { expandedIndex: index })) : getVisibleCollapsedItems(items, stackDepth).map((item, index) => Object.assign(Object.assign({}, item), { collapsedIndex: index })); + const getItemId = (item) => { + var _a2, _b; + return (_b = (_a2 = item.id) !== null && _a2 !== void 0 ? _a2 : item.expandedIndex) !== null && _b !== void 0 ? _b : 0; + }; + const hasEntered = (item) => enteringItems.some((_item) => _item.id && _item.id === item.id); + const hasLeft = (item) => !("expandedIndex" in item); + const hasEnteredOrLeft = (item) => hasEntered(item) || hasLeft(item); + const showInnerContent = (item) => isFlashbarStackExpanded || hasLeft(item) || "expandedIndex" in item && item.expandedIndex === 0; + const shouldUseStandardAnimation = (item, index) => index === 0 && hasEnteredOrLeft(item); + const getAnimationElementId = (item) => `flash-${getItemId(item)}`; + const renderList = () => import_react220.default.createElement( + "ul", + { ref: listElementRef, className: clsx_m_default(styles_css_default71["flash-list"], isFlashbarStackExpanded ? styles_css_default71.expanded : styles_css_default71.collapsed, transitioning && styles_css_default71["animation-running"], initialAnimationState && styles_css_default71["animation-ready"], isVisualRefresh && styles_css_default71["visual-refresh"]), id: flashbarElementId, "aria-label": ariaLabel, "aria-describedby": isCollapsible ? itemCountElementId : void 0, style: !isFlashbarStackExpanded || transitioning ? { + [custom_css_properties_default.flashbarStackDepth]: stackDepth + } : void 0 }, + import_react220.default.createElement(ListWrapper, { withMotion: !isReducedMotion }, itemsToShow.map((item, index) => import_react220.default.createElement(Transition2, { key: getItemId(item), in: !hasLeft(item), onStatusChange: (status) => { + if (status === "entered") { + setEnteringItems([]); + } else if (status === "exited") { + setExitingItems([]); + } + } }, (state, transitionRootElement) => { + var _a2, _b, _c; + return import_react220.default.createElement("li", { "aria-hidden": !showInnerContent(item), className: showInnerContent(item) ? clsx_m_default(styles_css_default71["flash-list-item"], !isFlashbarStackExpanded && styles_css_default71.item, !collapsedItemRefs.current[getAnimationElementId(item)] && styles_css_default71["expanded-only"]) : clsx_m_default(styles_css_default71.flash, styles_css_default71[`flash-type-${(_a2 = item.type) !== null && _a2 !== void 0 ? _a2 : "info"}`], styles_css_default71.item), ref: (element) => { + if (isFlashbarStackExpanded) { + expandedItemRefs.current[getAnimationElementId(item)] = element; + } else { + collapsedItemRefs.current[getAnimationElementId(item)] = element; + } + }, style: !isFlashbarStackExpanded || transitioning ? { + [custom_css_properties_default.flashbarStackIndex]: (_c = (_b = item.collapsedIndex) !== null && _b !== void 0 ? _b : item.expandedIndex) !== null && _c !== void 0 ? _c : index + } : void 0, key: getItemId(item) }, showInnerContent(item) && import_react220.default.createElement( + Flash, + Object.assign({ + // eslint-disable-next-line react/forbid-component-props + className: clsx_m_default(animateFlash && styles_css_default71["flash-with-motion"], isVisualRefresh && styles_css_default71["flash-refresh"]), + key: getItemId(item), + ref: shouldUseStandardAnimation(item, index) ? transitionRootElement : void 0, + transitionState: shouldUseStandardAnimation(item, index) ? state : void 0, + i18nStrings: iconAriaLabels + }, item) + )); + }))) + ); + return import_react220.default.createElement( + "div", + Object.assign({}, baseProps, { className: clsx_m_default(baseProps.className, styles_css_default71.flashbar, styles_css_default71[`breakpoint-${breakpoint}`], styles_css_default71.stack, isCollapsible && styles_css_default71.collapsible, items.length === 2 && styles_css_default71["short-list"], isFlashbarStackExpanded && styles_css_default71.expanded, isVisualRefresh && styles_css_default71["visual-refresh"]), ref: mergedRef }), + isFlashbarStackExpanded && renderList(), + isCollapsible && import_react220.default.createElement( + "div", + { className: clsx_m_default( + styles_css_default71["notification-bar"], + isVisualRefresh && styles_css_default71["visual-refresh"], + isFlashbarStackExpanded ? styles_css_default71.expanded : styles_css_default71.collapsed, + transitioning && styles_css_default71["animation-running"], + items.length === 2 && styles_css_default71["short-list"], + getVisualContextClassname("flashbar") + // Visual context is needed for focus ring to be white + ), onClick: toggleCollapseExpand, ref: notificationBarRef }, + import_react220.default.createElement( + "span", + { "aria-live": "polite", className: styles_css_default71.status, role: "status", id: itemCountElementId }, + notificationBarText && import_react220.default.createElement("h2", { className: styles_css_default71.header }, notificationBarText), + import_react220.default.createElement("span", { className: styles_css_default71["item-count"] }, counterTypes.map(({ type, labelName, iconName }) => import_react220.default.createElement(NotificationTypeCount, { key: type, iconName, label: iconAriaLabels[labelName], count: countByType[type] }))) + ), + import_react220.default.createElement( + "button", + { "aria-controls": flashbarElementId, "aria-describedby": itemCountElementId, "aria-expanded": isFlashbarStackExpanded, "aria-label": notificationBarAriaLabel, className: clsx_m_default(styles_css_default71.button, isFlashbarStackExpanded && styles_css_default71.expanded) }, + import_react220.default.createElement(internal_default, { className: styles_css_default71.icon, size: "normal", name: "angle-down" }) + ) + ), + !isFlashbarStackExpanded && renderList() + ); +} +var NotificationTypeCount = ({ iconName, label, count }) => { + return import_react220.default.createElement( + "span", + { className: styles_css_default71["type-count"] }, + import_react220.default.createElement( + "span", + { "aria-label": label, role: "img" }, + import_react220.default.createElement( + "span", + { title: label, "aria-hidden": "true" }, + import_react220.default.createElement(internal_default, { name: iconName }) + ) + ), + import_react220.default.createElement("span", { className: styles_css_default71["count-number"] }, count) + ); +}; +var ListWrapper = ({ children: children2, withMotion }) => withMotion ? import_react220.default.createElement(TransitionGroup_default, { component: null }, children2) : import_react220.default.createElement(import_react220.default.Fragment, null, children2); + +// node_modules/@cloudscape-design/components/flashbar/non-collapsible-flashbar.js +var import_react221 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/flashbar/constant.js +var TIMEOUT_FOR_ENTERING_ANIMATION = 115; + +// node_modules/@cloudscape-design/components/flashbar/non-collapsible-flashbar.js +function NonCollapsibleFlashbar(_a) { + var { items, i18nStrings } = _a, restProps = __rest(_a, ["items", "i18nStrings"]); + const { allItemsHaveId, baseProps, breakpoint, isReducedMotion, isVisualRefresh, mergedRef } = useFlashbar(Object.assign({ items }, restProps)); + const i18n = useInternalI18n("flashbar"); + const ariaLabel = i18n("i18nStrings.ariaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.ariaLabel); + const iconAriaLabels = { + errorIconAriaLabel: i18n("i18nStrings.errorIconAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.errorIconAriaLabel), + inProgressIconAriaLabel: i18n("i18nStrings.inProgressIconAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.inProgressIconAriaLabel), + infoIconAriaLabel: i18n("i18nStrings.infoIconAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.infoIconAriaLabel), + successIconAriaLabel: i18n("i18nStrings.successIconAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.successIconAriaLabel), + warningIconAriaLabel: i18n("i18nStrings.warningIconAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.warningIconAriaLabel) + }; + const motionDisabled = isReducedMotion || !isVisualRefresh || !allItemsHaveId; + const animateFlash = !isReducedMotion && isVisualRefresh; + function renderFlatItemsWithTransitions() { + if (motionDisabled || !items) { + return; + } + return ( + // This is a proxy for
    , so we're not applying a class to another actual component. + // eslint-disable-next-line react/forbid-component-props + import_react221.default.createElement(TransitionGroup_default, { component: "ul", className: styles_css_default71["flash-list"], "aria-label": ariaLabel }, items.map((item, index) => { + var _a2; + return import_react221.default.createElement(Transition2, { transitionChangeDelay: { entering: TIMEOUT_FOR_ENTERING_ANIMATION }, key: (_a2 = item.id) !== null && _a2 !== void 0 ? _a2 : index, in: true }, (state, transitionRootElement) => { + var _a3; + return import_react221.default.createElement("li", { className: styles_css_default71["flash-list-item"] }, renderItem(item, (_a3 = item.id) !== null && _a3 !== void 0 ? _a3 : index, transitionRootElement, state)); + }); + })) + ); + } + function renderFlatItemsWithoutTransitions() { + if (!motionDisabled || !items) { + return; + } + return import_react221.default.createElement("ul", { className: styles_css_default71["flash-list"], "aria-label": ariaLabel }, items.map((item, index) => { + var _a2, _b; + return import_react221.default.createElement("li", { key: (_a2 = item.id) !== null && _a2 !== void 0 ? _a2 : index, className: styles_css_default71["flash-list-item"] }, renderItem(item, (_b = item.id) !== null && _b !== void 0 ? _b : index)); + })); + } + function renderItem(item, key, transitionRootElement, transitionState) { + return import_react221.default.createElement( + Flash, + Object.assign({ + // eslint-disable-next-line react/forbid-component-props + className: clsx_m_default(animateFlash && styles_css_default71["flash-with-motion"], isVisualRefresh && styles_css_default71["flash-refresh"]), + key, + ref: transitionRootElement, + transitionState, + i18nStrings: iconAriaLabels + }, item) + ); + } + return import_react221.default.createElement( + "div", + Object.assign({}, baseProps, { className: clsx_m_default(baseProps.className, styles_css_default71.flashbar, styles_css_default71[`breakpoint-${breakpoint}`]), ref: mergedRef }), + renderFlatItemsWithTransitions(), + renderFlatItemsWithoutTransitions() + ); +} + +// node_modules/@cloudscape-design/components/flashbar/index.js +function Flashbar(props2) { + (0, import_react222.useEffect)(() => { + if (props2.items.length > 0) { + sendRenderMetric(props2.items); + } + }, [props2.items]); + if (props2.stackItems) { + return import_react222.default.createElement(CollapsibleFlashbar, Object.assign({}, props2)); + } else { + return import_react222.default.createElement(NonCollapsibleFlashbar, Object.assign({}, props2)); + } +} +applyDisplayName(Flashbar, "Flashbar"); + +// node_modules/@cloudscape-design/components/form/index.js +var import_react224 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/form/internal.js +var import_react223 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/form/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/form/styles.scoped.css"; +var styles_css_default72 = { + "root": "awsui_root_1i0s3_19kut_99", + "header": "awsui_header_1i0s3_19kut_134", + "full-page": "awsui_full-page_1i0s3_19kut_134", + "content": "awsui_content_1i0s3_19kut_138", + "error": "awsui_error_1i0s3_19kut_142", + "footer": "awsui_footer_1i0s3_19kut_146", + "actions-section": "awsui_actions-section_1i0s3_19kut_150", + "secondary-actions": "awsui_secondary-actions_1i0s3_19kut_159", + "actions": "awsui_actions_1i0s3_19kut_150" +}; + +// node_modules/@cloudscape-design/components/form/internal.js +function InternalForm(_a) { + var { children: children2, header, errorText, errorIconAriaLabel: errorIconAriaLabelOverride, actions, secondaryActions, variant, __internalRootRef } = _a, props2 = __rest(_a, ["children", "header", "errorText", "errorIconAriaLabel", "actions", "secondaryActions", "variant", "__internalRootRef"]); + const baseProps = getBaseProps(props2); + const i18n = useInternalI18n("form"); + const errorIconAriaLabel = i18n("errorIconAriaLabel", errorIconAriaLabelOverride); + const { funnelInteractionId, submissionAttempt, errorCount } = useFunnel(); + (0, import_react223.useEffect)(() => { + if (funnelInteractionId && errorText) { + errorCount.current++; + FunnelMetrics.funnelError({ funnelInteractionId }); + return () => { + errorCount.current--; + }; + } + }, [funnelInteractionId, errorText, submissionAttempt, errorCount]); + return import_react223.default.createElement( + "div", + Object.assign({}, baseProps, { ref: __internalRootRef, className: clsx_m_default(styles_css_default72.root, baseProps.className) }), + import_react223.default.createElement( + FormLayout, + { header: header && import_react223.default.createElement("div", { className: clsx_m_default(styles_css_default72.header, variant === "full-page" && styles_css_default72["full-page"]) }, header), variant }, + children2 && import_react223.default.createElement("div", { className: styles_css_default72.content }, children2), + errorText && import_react223.default.createElement( + InternalBox, + { margin: { top: "l" } }, + import_react223.default.createElement( + internal_default10, + { type: "error", statusIconAriaLabel: errorIconAriaLabel }, + import_react223.default.createElement("div", { className: styles_css_default72.error }, errorText) + ) + ), + (actions || secondaryActions) && import_react223.default.createElement( + "div", + { className: styles_css_default72.footer }, + import_react223.default.createElement( + "div", + { className: styles_css_default72["actions-section"] }, + actions && import_react223.default.createElement("div", { className: styles_css_default72.actions }, actions), + secondaryActions && import_react223.default.createElement("div", { className: styles_css_default72["secondary-actions"] }, secondaryActions) + ) + ), + errorText && import_react223.default.createElement( + live_region_default, + { assertive: true }, + errorIconAriaLabel, + ", ", + errorText + ) + ) + ); +} +function FormLayout({ children: children2, header, variant }) { + return variant === "full-page" && header ? import_react223.default.createElement(InternalContentLayout, { header }, children2) : import_react223.default.createElement( + import_react223.default.Fragment, + null, + header, + children2 + ); +} + +// node_modules/@cloudscape-design/components/form/index.js +var FormWithAnalytics = (_a) => { + var { variant = "full-page", actions } = _a, props2 = __rest(_a, ["variant", "actions"]); + const { funnelProps, funnelSubmit, funnelNextOrSubmitAttempt } = useFunnel(); + const { funnelStepProps } = useFunnelStep(); + const handleActionButtonClick = ({ variant: variant2 }) => { + if (variant2 === "primary") { + funnelNextOrSubmitAttempt(); + funnelSubmit(); + } + }; + return import_react224.default.createElement( + ButtonContext.Provider, + { value: { onClick: handleActionButtonClick } }, + import_react224.default.createElement(InternalForm, Object.assign({ variant, actions }, props2, funnelProps, funnelStepProps)) + ); +}; +function Form(_a) { + var { variant = "full-page" } = _a, props2 = __rest(_a, ["variant"]); + const analyticsMetadata = getAnalyticsMetadataProps(props2); + const baseComponentProps = useBaseComponent("Form", { props: { variant } }, analyticsMetadata); + const inheritedFunnelNameSelector = useFunnelNameSelector(); + const funnelNameSelector = inheritedFunnelNameSelector || `.${styles_css_default4["heading-text"]}`; + return import_react224.default.createElement( + AnalyticsFunnel, + { instanceIdentifier: analyticsMetadata === null || analyticsMetadata === void 0 ? void 0 : analyticsMetadata.instanceIdentifier, flowType: analyticsMetadata === null || analyticsMetadata === void 0 ? void 0 : analyticsMetadata.flowType, errorContext: analyticsMetadata === null || analyticsMetadata === void 0 ? void 0 : analyticsMetadata.errorContext, funnelType: "single-page", optionalStepNumbers: [], totalFunnelSteps: 1, funnelNameSelectors: [funnelNameSelector, `.${styles_css_default72.header}`] }, + import_react224.default.createElement( + AnalyticsFunnelStep, + { instanceIdentifier: analyticsMetadata === null || analyticsMetadata === void 0 ? void 0 : analyticsMetadata.instanceIdentifier, errorContext: analyticsMetadata === null || analyticsMetadata === void 0 ? void 0 : analyticsMetadata.errorContext, stepNumber: 1 }, + import_react224.default.createElement(FormWithAnalytics, Object.assign({ variant }, props2, baseComponentProps)) + ) + ); +} +applyDisplayName(Form, "Form"); + +// node_modules/@cloudscape-design/components/grid/index.js +var import_react225 = __toESM(require_react()); +function Grid3(_a) { + var { gridDefinition = [], disableGutters = false, children: children2 } = _a, restProps = __rest(_a, ["gridDefinition", "disableGutters", "children"]); + const baseComponentProps = useBaseComponent("Grid", { + props: { disableGutters } + }); + const baseProps = getBaseProps(restProps); + const [breakpoint, ref] = useContainerBreakpoints(void 0); + return import_react225.default.createElement(internal_default3, Object.assign({}, baseProps, baseComponentProps, { ref, __breakpoint: breakpoint, gridDefinition, disableGutters }), children2); +} +applyDisplayName(Grid3, "Grid"); + +// node_modules/@cloudscape-design/components/help-panel/index.js +var import_react226 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/help-panel/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/help-panel/styles.scoped.css"; +var styles_css_default73 = { + "help-panel": "awsui_help-panel_1d237_xb6zh_100", + "header": "awsui_header_1d237_xb6zh_269", + "content": "awsui_content_1d237_xb6zh_300", + "footer": "awsui_footer_1d237_xb6zh_346" +}; + +// node_modules/@cloudscape-design/components/help-panel/index.js +function HelpPanel(_a) { + var { header, footer, children: children2, loading, loadingText } = _a, restProps = __rest(_a, ["header", "footer", "children", "loading", "loadingText"]); + const { __internalRootRef } = useBaseComponent("HelpPanel"); + const baseProps = getBaseProps(restProps); + const i18n = useInternalI18n("help-panel"); + const containerProps = Object.assign(Object.assign({}, baseProps), { className: clsx_m_default(baseProps.className, styles_css_default73["help-panel"]) }); + return loading ? import_react226.default.createElement( + "div", + Object.assign({}, containerProps, { ref: __internalRootRef }), + import_react226.default.createElement( + StatusIndicator, + { type: "loading" }, + import_react226.default.createElement(live_region_default, { visible: true }, i18n("loadingText", loadingText)) + ) + ) : import_react226.default.createElement( + "div", + Object.assign({}, containerProps, { ref: __internalRootRef }), + header && import_react226.default.createElement("div", { className: clsx_m_default(styles_css_default73.header) }, header), + import_react226.default.createElement( + LinkDefaultVariantContext.Provider, + { value: { defaultVariant: "primary" } }, + import_react226.default.createElement("div", { className: clsx_m_default(styles_css_default73.content) }, children2) + ), + footer && import_react226.default.createElement("div", { className: styles_css_default73.footer }, footer) + ); +} +applyDisplayName(HelpPanel, "HelpPanel"); + +// node_modules/@cloudscape-design/components/hotspot/index.js +var import_react227 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/hotspot/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/hotspot/styles.scoped.css"; +var styles_css_default74 = { + "root": "awsui_root_cqcqk_134pw_99", + "wrapper": "awsui_wrapper_cqcqk_134pw_103", + "elementWrapper": "awsui_elementWrapper_cqcqk_134pw_107", + "markerWrapper": "awsui_markerWrapper_cqcqk_134pw_111", + "placement-right": "awsui_placement-right_cqcqk_134pw_116", + "placement-left": "awsui_placement-left_cqcqk_134pw_121", + "inlineWrapper": "awsui_inlineWrapper_cqcqk_134pw_126" +}; + +// node_modules/@cloudscape-design/components/hotspot/index.js +function Hotspot(_a) { + var { children: children2, hotspotId, side = "right", direction = "top" } = _a, restProps = __rest(_a, ["children", "hotspotId", "side", "direction"]); + const { __internalRootRef } = useBaseComponent("Hotspot", { props: { direction, side } }); + const baseProps = getBaseProps(restProps); + const hotspotContext2 = (0, import_react227.useContext)(hotspotContext); + const content = hotspotContext2.getContentForId(hotspotId, direction); + const { unregisterHotspot, registerHotspot } = hotspotContext2; + (0, import_react227.useEffect)(() => { + registerHotspot(hotspotId); + return () => unregisterHotspot(hotspotId); + }, [hotspotId, unregisterHotspot, registerHotspot]); + if (children2) { + return import_react227.default.createElement( + "div", + Object.assign({}, baseProps, { className: clsx_m_default(baseProps.className, styles_css_default74.root, styles_css_default74.wrapper), ref: __internalRootRef }), + import_react227.default.createElement("div", { className: styles_css_default74.elementWrapper }, children2), + import_react227.default.createElement("div", { className: clsx_m_default(styles_css_default74.markerWrapper, styles_css_default74[`placement-${side}`]), onClick: (e) => e.stopPropagation() }, content) + ); + } + return import_react227.default.createElement("span", Object.assign({}, baseProps, { className: clsx_m_default(baseProps.className, styles_css_default74.root, styles_css_default74.inlineWrapper), ref: __internalRootRef, onClick: (e) => e.stopPropagation() }), content); +} +applyDisplayName(Hotspot, "Hotspot"); + +// node_modules/@cloudscape-design/components/icon/index.js +var import_react228 = __toESM(require_react()); +function Icon(_a) { + var { size = "normal", variant = "normal" } = _a, props2 = __rest(_a, ["size", "variant"]); + const baseComponentProps = useBaseComponent("Icon", { props: { name: props2.name, size, variant } }); + return import_react228.default.createElement(internal_default, Object.assign({ size, variant }, props2, baseComponentProps)); +} +applyDisplayName(Icon, "Icon"); + +// node_modules/@cloudscape-design/components/input/index.js +var import_react229 = __toESM(require_react()); +var Input = import_react229.default.forwardRef((_a, ref) => { + var { value, type = "text", step: step2, inputMode, autoComplete = true, spellcheck, disabled, readOnly, disableBrowserAutocorrect, onKeyDown, onKeyUp, onChange, onBlur, onFocus, ariaRequired, name, placeholder, autoFocus, ariaLabel, ariaLabelledby, ariaDescribedby, invalid, controlId, clearAriaLabel } = _a, rest = __rest(_a, ["value", "type", "step", "inputMode", "autoComplete", "spellcheck", "disabled", "readOnly", "disableBrowserAutocorrect", "onKeyDown", "onKeyUp", "onChange", "onBlur", "onFocus", "ariaRequired", "name", "placeholder", "autoFocus", "ariaLabel", "ariaLabelledby", "ariaDescribedby", "invalid", "controlId", "clearAriaLabel"]); + const baseComponentProps = useBaseComponent("Input", { + props: { autoComplete, autoFocus, disableBrowserAutocorrect, inputMode, readOnly, spellcheck, type } + }); + const baseProps = getBaseProps(rest); + const inputRef = (0, import_react229.useRef)(null); + (0, import_react229.useImperativeHandle)(ref, () => ({ + focus(...args) { + var _a2; + (_a2 = inputRef.current) === null || _a2 === void 0 ? void 0 : _a2.focus(...args); + }, + select() { + var _a2; + (_a2 = inputRef.current) === null || _a2 === void 0 ? void 0 : _a2.select(); + } + }), [inputRef]); + return import_react229.default.createElement(internal_default4, Object.assign({ ref: inputRef }, Object.assign(Object.assign(Object.assign({}, baseProps), baseComponentProps), { + autoComplete, + ariaLabel, + ariaRequired, + autoFocus, + disabled, + disableBrowserAutocorrect, + name, + onKeyDown, + onKeyUp, + onChange, + onBlur, + onFocus, + placeholder, + readOnly, + type, + step: step2, + inputMode, + spellcheck, + value, + ariaDescribedby, + ariaLabelledby, + invalid, + controlId, + clearAriaLabel + }), { className: clsx_m_default(styles_css_default3.root, baseProps.className), __inheritFormFieldProps: true })); +}); +applyDisplayName(Input, "Input"); +var input_default = Input; + +// node_modules/@cloudscape-design/components/line-chart/index.js +var import_react230 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/line-chart/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/line-chart/styles.scoped.css"; +var styles_css_default75 = { + "root": "awsui_root_g9v3m_im8v7_5" +}; + +// node_modules/@cloudscape-design/components/line-chart/index.js +function LineChart(_a) { + var { series = [], height = 500, xScaleType = "linear", yScaleType = "linear", detailPopoverSize = "medium", statusType = "finished", emphasizeBaselineAxis = true } = _a, props2 = __rest(_a, ["series", "height", "xScaleType", "yScaleType", "detailPopoverSize", "statusType", "emphasizeBaselineAxis"]); + const baseComponentProps = useBaseComponent("LineChart", { + props: { + detailPopoverSize, + emphasizeBaselineAxis, + fitHeight: props2.fitHeight, + hideFilter: props2.hideFilter, + hideLegend: props2.hideLegend, + xScaleType, + yScaleType + } + }); + const baseProps = getBaseProps(props2); + const className = clsx_m_default(baseProps.className, styles_css_default75.root); + return import_react230.default.createElement(InternalMixedLineBarChart, Object.assign({}, props2, baseComponentProps, { className, height, xScaleType, yScaleType, stackedBars: false, horizontalBars: false, series, detailPopoverSize, statusType, emphasizeBaselineAxis })); +} +applyDisplayName(LineChart, "LineChart"); +var line_chart_default = LineChart; + +// node_modules/@cloudscape-design/components/link/index.js +var import_react231 = __toESM(require_react()); +var Link = import_react231.default.forwardRef((_a, ref) => { + var { fontSize = "body-m", color: color2 = "normal", external = false } = _a, props2 = __rest(_a, ["fontSize", "color", "external"]); + const baseComponentProps = useBaseComponent("Link", { + props: { color: color2, external, fontSize, rel: props2.rel, target: props2.target, variant: props2.variant } + }); + return import_react231.default.createElement(internal_default12, Object.assign({ fontSize, color: color2, external }, props2, baseComponentProps, { ref })); +}); +applyDisplayName(Link, "Link"); +var link_default = Link; + +// node_modules/@cloudscape-design/components/mixed-line-bar-chart/index.js +var import_react232 = __toESM(require_react()); +function MixedLineBarChart(_a) { + var { series = [], height = 500, xScaleType = "linear", yScaleType = "linear", stackedBars = false, horizontalBars = false, statusType = "finished", detailPopoverSize = "medium", emphasizeBaselineAxis = true } = _a, props2 = __rest(_a, ["series", "height", "xScaleType", "yScaleType", "stackedBars", "horizontalBars", "statusType", "detailPopoverSize", "emphasizeBaselineAxis"]); + const baseComponentProps = useBaseComponent("MixedLineBarChart", { + props: { + detailPopoverSize, + emphasizeBaselineAxis, + fitHeight: props2.fitHeight, + hideFilter: props2.hideFilter, + hideLegend: props2.hideLegend, + horizontalBars, + stackedBars, + xScaleType, + yScaleType + } + }); + return import_react232.default.createElement(InternalMixedLineBarChart, Object.assign({ series, height, xScaleType, yScaleType, stackedBars, horizontalBars, statusType, detailPopoverSize, emphasizeBaselineAxis }, props2, baseComponentProps)); +} +applyDisplayName(MixedLineBarChart, "MixedLineBarChart"); +var mixed_line_bar_chart_default = MixedLineBarChart; + +// node_modules/@cloudscape-design/components/modal/index.js +var import_react233 = __toESM(require_react()); +function Modal(_a) { + var { size = "medium" } = _a, props2 = __rest(_a, ["size"]); + const baseComponentProps = useBaseComponent("Modal", { + props: { size, disableContentPaddings: props2.disableContentPaddings } + }); + return import_react233.default.createElement(InternalModal, Object.assign({ size }, props2, baseComponentProps)); +} +applyDisplayName(Modal, "Modal"); + +// node_modules/@cloudscape-design/components/multiselect/index.js +var import_react234 = __toESM(require_react()); +var Multiselect = import_react234.default.forwardRef((_a, ref) => { + var { options = [], filteringType = "none", statusType = "finished", selectedOptions = [], keepOpen = true, hideTokens = false } = _a, restProps = __rest(_a, ["options", "filteringType", "statusType", "selectedOptions", "keepOpen", "hideTokens"]); + const baseComponentProps = useBaseComponent("Multiselect", { + props: { + autoFocus: restProps.autoFocus, + expandToViewport: restProps.expandToViewport, + filteringType, + hideTokens, + keepOpen, + tokenLimit: restProps.tokenLimit, + virtualScroll: restProps.virtualScroll + } + }); + const inlineTokens = Boolean(restProps.inlineTokens); + return import_react234.default.createElement(internal_default13, Object.assign({ options, filteringType, statusType, selectedOptions, keepOpen, hideTokens, inlineTokens }, restProps, baseComponentProps, { ref })); +}); +applyDisplayName(Multiselect, "Multiselect"); +var multiselect_default = Multiselect; + +// node_modules/@cloudscape-design/components/pie-chart/index.js +var import_react239 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/pie-chart/pie-chart.js +var import_react238 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/pie-chart/labels.js +var import_react236 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/pie-chart/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/pie-chart/styles.scoped.css"; +var styles_css_default76 = { + "segment__path": "awsui_segment__path_1edmh_18vxs_103", + "segment": "awsui_segment_1edmh_18vxs_103", + "segment__hover": "awsui_segment__hover_1edmh_18vxs_130", + "label": "awsui_label_1edmh_18vxs_144", + "root": "awsui_root_1edmh_18vxs_162", + "content": "awsui_content_1edmh_18vxs_166", + "content--small": "awsui_content--small_1edmh_18vxs_166", + "content--fit-height": "awsui_content--fit-height_1edmh_18vxs_169", + "content--without-labels": "awsui_content--without-labels_1edmh_18vxs_172", + "content--medium": "awsui_content--medium_1edmh_18vxs_178", + "content--large": "awsui_content--large_1edmh_18vxs_190", + "status-container": "awsui_status-container_1edmh_18vxs_207", + "chart-container": "awsui_chart-container_1edmh_18vxs_211", + "chart-container--fit-height": "awsui_chart-container--fit-height_1edmh_18vxs_215", + "chart-container-chart-plot": "awsui_chart-container-chart-plot_1edmh_18vxs_220", + "chart-container-chart-plot--fit-height": "awsui_chart-container-chart-plot--fit-height_1edmh_18vxs_223", + "inner-content": "awsui_inner-content_1edmh_18vxs_229", + "segment__highlight": "awsui_segment__highlight_1edmh_18vxs_240", + "segment--dimmed": "awsui_segment--dimmed_1edmh_18vxs_255", + "segment--highlighted": "awsui_segment--highlighted_1edmh_18vxs_258", + "label--dimmed": "awsui_label--dimmed_1edmh_18vxs_275", + "label--align-right": "awsui_label--align-right_1edmh_18vxs_278", + "label-text": "awsui_label-text_1edmh_18vxs_286", + "label__description": "awsui_label__description_1edmh_18vxs_294", + "label-line": "awsui_label-line_1edmh_18vxs_301", + "label--highlighted": "awsui_label--highlighted_1edmh_18vxs_305", + "popover-header": "awsui_popover-header_1edmh_18vxs_309" +}; + +// node_modules/@cloudscape-design/components/pie-chart/utils.js +var minRadius = 30; +var paddingLabels = 44; +var defaultPadding = 12; +var smallPadding = 8; +var minLabelLineAngularPadding = Math.PI / 20; +var dimensionsBySize = { + small: { + innerRadius: 33, + outerRadius: 50, + innerLabelPadding: smallPadding, + padding: smallPadding, + paddingLabels + }, + medium: { + innerRadius: 66, + outerRadius: 100, + innerLabelPadding: defaultPadding, + padding: defaultPadding, + paddingLabels + }, + large: { + innerRadius: 93, + outerRadius: 140, + innerLabelPadding: defaultPadding, + padding: defaultPadding, + paddingLabels + } +}; +var refreshDimensionsBySize = { + small: Object.assign(Object.assign({}, dimensionsBySize.small), { innerRadius: 38, cornerRadius: 3 }), + medium: Object.assign(Object.assign({}, dimensionsBySize.medium), { innerRadius: 75, cornerRadius: 4 }), + large: Object.assign(Object.assign({}, dimensionsBySize.large), { innerRadius: 105, cornerRadius: 5 }) +}; +function getDimensionsBySize({ size, hasLabels, visualRefresh }) { + if (typeof size === "string") { + const dimensions = visualRefresh ? refreshDimensionsBySize[size] : dimensionsBySize[size]; + return Object.assign(Object.assign({}, dimensions), { size }); + } + const sizeSpec = visualRefresh ? refreshDimensionsBySize : dimensionsBySize; + const getPixelSize = (d) => d.outerRadius * 2 + d.padding * 2 + (hasLabels ? d.paddingLabels : 0) * 2; + let matchedSize = "small"; + if (size > getPixelSize(sizeSpec.medium)) { + matchedSize = "medium"; + } + if (size > getPixelSize(sizeSpec.large)) { + matchedSize = "large"; + } + const padding = sizeSpec[matchedSize].padding; + const paddingLabels2 = hasLabels ? sizeSpec[matchedSize].paddingLabels : 0; + const radiiRatio = sizeSpec[matchedSize].outerRadius / sizeSpec[matchedSize].innerRadius; + const outerRadius = Math.max(minRadius, (size - 2 * paddingLabels2 - 2 * padding) / 2); + const innerRadius = outerRadius / radiiRatio; + return Object.assign(Object.assign({}, sizeSpec[matchedSize]), { outerRadius, innerRadius, size: matchedSize }); +} +var defaultDetails = (i18n, i18nStrings) => (datum, dataSum) => [ + { key: i18n("i18nStrings.detailsValue", i18nStrings.detailsValue) || "", value: datum.value }, + { + key: i18n("i18nStrings.detailsPercentage", i18nStrings.detailsPercentage) || "", + value: `${(datum.value * 100 / dataSum).toFixed(0)}%` + } +]; +var balanceLabelNodes = (nodes, markers, leftSide, radius) => { + var _a; + const MARGIN = 10; + let previousBBox = null; + let i = leftSide ? nodes.length - 1 : 0; + while (leftSide && i >= 0 || !leftSide && i < nodes.length) { + const node = nodes[i]; + const x2 = parseFloat(node.getAttribute("data-x") || "0"); + const y2 = parseFloat(node.getAttribute("data-y") || "0"); + const box = { + x: x2, + y: y2, + height: node.getBoundingClientRect().height + }; + const marker = markers[i]; + if (leftSide) { + i--; + } else { + i++; + } + if (!previousBBox) { + previousBBox = box; + node.setAttribute("transform", ""); + continue; + } + if (!leftSide && box.x < 0 || leftSide && box.x >= 0) { + break; + } + node.setAttribute("transform", ""); + const yOffset = previousBBox.y + previousBBox.height + MARGIN - box.y; + if (yOffset > 0) { + const xOffset = computeXOffset(box, yOffset, radius) * (leftSide ? -1 : 1); + node.setAttribute("transform", `translate(${xOffset} ${yOffset})`); + const lineNode = (_a = node.parentNode) === null || _a === void 0 ? void 0 : _a.querySelector(`.${styles_css_default76["label-line"]}`); + if (lineNode) { + const { endY, endX } = marker; + lineNode.setAttribute("y2", "" + (endY + yOffset)); + lineNode.setAttribute("x2", "" + (endX + xOffset)); + } + box.y += yOffset; + box.x += xOffset; + } + previousBBox = box; + } +}; +var squareDistance = (edge) => Math.pow(edge[0], 2) + Math.pow(edge[1], 2); +var computeXOffset = (box, yOffset, radius) => { + const upperEdge = [box.x, box.y + yOffset]; + const lowerEdge = [box.x, box.y + box.height + yOffset]; + const closestEdge = squareDistance(upperEdge) < squareDistance(lowerEdge) ? upperEdge : lowerEdge; + if (squareDistance(closestEdge) < Math.pow(radius, 2)) { + return Math.sqrt(Math.pow(radius, 2) - Math.pow(closestEdge[1], 2)) - Math.abs(closestEdge[0]); + } + return 0; +}; +var computeSmartAngle = (startAngle, endAngle, optimize = false) => { + if (!optimize || endAngle - startAngle < 2 * minLabelLineAngularPadding) { + return (endAngle + startAngle) / 2; + } + const paddedStartAngle = startAngle + minLabelLineAngularPadding; + const paddedEndAngle = endAngle - minLabelLineAngularPadding; + if (paddedStartAngle < 0 && paddedEndAngle > 0) { + return 0; + } + if (paddedStartAngle < Math.PI && paddedEndAngle > Math.PI) { + return Math.PI; + } + const endAngleMinDistance = Math.min(paddedEndAngle, Math.abs(Math.PI - paddedEndAngle), 2 * Math.PI - paddedEndAngle); + const startAngleMinDistance = Math.min(paddedStartAngle, Math.abs(Math.PI - paddedStartAngle), 2 * Math.PI - paddedStartAngle); + if (endAngleMinDistance < startAngleMinDistance) { + return paddedEndAngle; + } + return paddedStartAngle; +}; + +// node_modules/@cloudscape-design/components/pie-chart/responsive-text.js +var import_react235 = __toESM(require_react()); +var responsive_text_default2 = (0, import_react235.memo)(ResponsiveText2); +function ResponsiveText2({ x: x2, y: y2, rightSide, className, children: children2, containerBoundaries }) { + const actualRef = (0, import_react235.useRef)(null); + const virtualRef = (0, import_react235.useRef)(null); + (0, import_react235.useEffect)(() => { + const timeoutId = setTimeout(() => { + const groupRect = virtualRef.current.getBoundingClientRect(); + const visibleWidth = containerBoundaries ? getVisibleWidth(groupRect, containerBoundaries) : 0; + renderTextContent(actualRef.current, children2, visibleWidth); + }, 25); + return () => clearTimeout(timeoutId); + }); + return import_react235.default.createElement( + import_react235.default.Fragment, + null, + import_react235.default.createElement("text", { ref: virtualRef, x: x2, y: y2, style: { textAnchor: rightSide ? "start" : "end", visibility: "hidden" }, "aria-hidden": "true", className }, children2), + import_react235.default.createElement("text", { ref: actualRef, x: x2, y: y2, style: { textAnchor: rightSide ? "start" : "end" }, className }, children2) + ); +} +function getVisibleWidth(element, container) { + if (element.left < container.left) { + return element.right - container.left; + } else if (element.right > container.right) { + return container.right - element.left; + } else { + return container.right - container.left; + } +} + +// node_modules/@cloudscape-design/components/pie-chart/labels.js +function LabelElement({ x: x2, y: y2, hideTitles, hideDescriptions, rightSide, title, description, containerBoundaries }) { + return ( + // Reset the transform property to prepare for `balanceLabelNodes`. + // The dataset attributes are also needed in the function for IE11 support. + import_react236.default.createElement( + "g", + { className: styles_css_default76["label-text"], transform: "", "data-x": x2, "data-y": y2 }, + !hideTitles && import_react236.default.createElement(responsive_text_default2, { x: x2, y: y2, rightSide, containerBoundaries }, title), + !hideDescriptions && description && import_react236.default.createElement(responsive_text_default2, { x: x2, y: y2 + (hideTitles ? 0 : 18), rightSide, className: styles_css_default76.label__description, containerBoundaries }, description) + ) + ); +} +var labels_default = ({ pieData, dimensions, highlightedSegment, segmentDescription, visibleDataSum, hideTitles, hideDescriptions, containerRef }) => { + const containerBoundaries = useElementBoundaries(containerRef); + const shouldOptimizeLabels = containerBoundaries.right - containerBoundaries.left - (dimensions.outerRadius + dimensions.innerLabelPadding) * 2 < 300; + const markers = (0, import_react236.useMemo)(() => { + const { outerRadius: radius, innerLabelPadding } = dimensions; + const arcMarkerStart = arc_default().innerRadius(radius - 1).outerRadius(radius - 1); + const arcMarkerBreak = arc_default().innerRadius(radius + innerLabelPadding).outerRadius(radius + innerLabelPadding); + return pieData.map((datum, i) => { + const labelDatum = pieData[i]; + const smartAngle = computeSmartAngle(labelDatum.startAngle, labelDatum.endAngle, shouldOptimizeLabels); + const lineExtension = 0.5 * Math.cos(2 * smartAngle) + 0.5; + arcMarkerBreak.outerRadius(radius + 20 * lineExtension); + arcMarkerBreak.innerRadius(radius + 20 * lineExtension); + const [startX, startY] = arcMarkerStart.centroid(Object.assign(Object.assign({}, datum), { startAngle: smartAngle, endAngle: smartAngle })); + const [breakX, breakY] = arcMarkerBreak.centroid(Object.assign(Object.assign({}, datum), { startAngle: smartAngle, endAngle: smartAngle })); + const rightSide = smartAngle < Math.PI; + const endX = shouldOptimizeLabels ? breakX + 20 * (rightSide ? 1 : -1) : (radius + 20) * (rightSide ? 1 : -1); + const textX = endX + 5 * (rightSide ? 1 : -1); + return { + startX, + startY, + breakX, + breakY, + endX, + endY: breakY, + textX, + textY: breakY, + rightSide, + datum + }; + }); + }, [pieData, dimensions, shouldOptimizeLabels]); + const rootRef = (0, import_react236.useRef)(null); + (0, import_react236.useLayoutEffect)(() => { + if (!rootRef.current) { + return; + } + const labelNodes = rootRef.current.querySelectorAll(`.${styles_css_default76["label-text"]}`); + balanceLabelNodes(labelNodes, markers, false, dimensions.outerRadius + dimensions.innerLabelPadding); + balanceLabelNodes(labelNodes, markers, true, dimensions.outerRadius + dimensions.innerLabelPadding); + }, [markers, pieData, dimensions]); + return import_react236.default.createElement("g", { className: styles_css_default76.markers, "aria-hidden": "true", ref: rootRef }, markers.map(({ startX, startY, breakX, breakY, endX, endY, textX, textY, rightSide, datum }) => { + const segment = datum.data.datum; + const description = segmentDescription === null || segmentDescription === void 0 ? void 0 : segmentDescription(segment, visibleDataSum); + if (hideTitles && !description || hideDescriptions && !segment.title) { + return null; + } + return import_react236.default.createElement( + "g", + { key: datum.data.index, className: clsx_m_default(styles_css_default76.label, { + [styles_css_default76["label--highlighted"]]: highlightedSegment === segment, + [styles_css_default76["label--dimmed"]]: highlightedSegment !== null && highlightedSegment !== segment, + [styles_css_default76["label--align-right"]]: !rightSide + }) }, + import_react236.default.createElement("line", { x1: startX, y1: startY, x2: breakX, y2: breakY }), + import_react236.default.createElement("line", { x1: breakX, y1: breakY, x2: endX, y2: endY, className: styles_css_default76["label-line"] }), + import_react236.default.createElement(LabelElement, { x: textX, y: textY, rightSide, title: segment.title, description, hideTitles, hideDescriptions, containerBoundaries }) + ); + })); +}; +function useElementBoundaries(ref) { + const [state, setState] = (0, import_react236.useState)({ left: 0, right: 0 }); + useResizeObserver(ref, (entry) => { + const elementRect = entry.target.getBoundingClientRect(); + setState({ left: elementRect.left, right: elementRect.right }); + }); + return state; +} + +// node_modules/@cloudscape-design/components/pie-chart/segments.js +var import_react237 = __toESM(require_react()); +function Segments({ pieData, highlightedSegment, dimensions, variant, focusedSegmentRef, popoverTrackRef, segmentAriaRoleDescription, onMouseDown, onMouseOver }) { + const i18n = useInternalI18n("pie-chart"); + const { arcFactory, highlightedArcFactory } = (0, import_react237.useMemo)(() => { + const radius = dimensions.outerRadius; + const innerRadius = variant === "pie" ? 0 : dimensions.innerRadius; + const cornerRadius = dimensions.cornerRadius || 0; + const arcFactory2 = arc_default().innerRadius(innerRadius).outerRadius(radius).cornerRadius(cornerRadius); + const highlightedArcFactory2 = arc_default().innerRadius(radius + 4).outerRadius(radius + 6); + return { + arcFactory: arcFactory2, + highlightedArcFactory: highlightedArcFactory2 + }; + }, [dimensions, variant]); + const centroid = (0, import_react237.useMemo)(() => { + for (const datum of pieData) { + if (datum.data.datum === highlightedSegment) { + const [centroidLeft, centroidTop] = arcFactory.centroid(datum); + return { cx: centroidLeft, cy: centroidTop }; + } + } + return null; + }, [highlightedSegment, pieData, arcFactory]); + return import_react237.default.createElement( + "g", + null, + pieData.map((datum) => { + const isHighlighted = highlightedSegment === datum.data.datum; + const isDimmed = highlightedSegment !== null && !isHighlighted; + const arcPath = arcFactory(datum) || void 0; + const highlightedPath = highlightedArcFactory(datum) || void 0; + return import_react237.default.createElement( + "g", + { key: datum.data.index, onMouseDown: (e) => { + onMouseDown(datum.data); + e.preventDefault(); + }, onMouseOver: () => onMouseOver(datum.data), className: clsx_m_default(styles_css_default76.segment, { + [styles_css_default76["segment--highlighted"]]: isHighlighted, + [styles_css_default76["segment--dimmed"]]: isDimmed + }), ref: isHighlighted ? focusedSegmentRef : void 0, "aria-label": `${datum.data.datum.title} (${datum.data.datum.value})`, role: "button", "aria-roledescription": i18n("i18nStrings.segmentAriaRoleDescription", segmentAriaRoleDescription) }, + import_react237.default.createElement("path", { d: arcPath, fill: datum.data.color, className: styles_css_default76.segment__path, "aria-hidden": "true" }), + import_react237.default.createElement("path", { d: highlightedPath, fill: datum.data.color, className: clsx_m_default(styles_css_default76.segment__path, styles_css_default76.segment__highlight), "aria-hidden": "true" }) + ); + }), + import_react237.default.createElement("circle", Object.assign({}, centroid, { ref: popoverTrackRef, r: "1", opacity: "0", "aria-hidden": "true" })) + ); +} + +// node_modules/@cloudscape-design/components/pie-chart/pie-chart.js +var pie_chart_default = ({ fitHeight, height: explicitHeight, variant, size, width, i18nStrings, ariaLabel, ariaLabelledby, ariaDescription, innerMetricValue, innerMetricDescription, hideTitles, hideDescriptions, detailPopoverContent, detailPopoverSize, detailPopoverFooter, segmentDescription, highlightedSegment, onHighlightChange, legendSegment, pieData, dataSum }) => { + var _a, _b; + const [pinnedSegment, setPinnedSegment] = (0, import_react238.useState)(null); + const plotRef = (0, import_react238.useRef)(null); + const containerRef = (0, import_react238.useRef)(null); + const focusedSegmentRef = (0, import_react238.useRef)(null); + const popoverTrackRef = (0, import_react238.useRef)(null); + const popoverRef = (0, import_react238.useRef)(null); + const hasLabels = !(hideTitles && hideDescriptions); + const isRefresh = useVisualRefresh(); + const height = (_a = useHeightMeasure(() => { + var _a2, _b2; + return (_b2 = (_a2 = plotRef.current) === null || _a2 === void 0 ? void 0 : _a2.svg) !== null && _b2 !== void 0 ? _b2 : null; + }, !fitHeight)) !== null && _a !== void 0 ? _a : explicitHeight; + const dimensions = (0, import_react238.useMemo)(() => getDimensionsBySize({ size: fitHeight ? Math.min(height, width) : size, hasLabels, visualRefresh: isRefresh }), [fitHeight, height, width, size, hasLabels, isRefresh]); + const hasInnerContent = variant === "donut" && (innerMetricValue || innerMetricDescription && dimensions.size !== "small"); + const innerMetricId = useUniqueId("awsui-pie-chart__inner"); + const [isPopoverOpen, setPopoverOpen] = (0, import_react238.useState)(false); + const [popoverData, setPopoverData] = (0, import_react238.useState)(); + const highlightedSegmentIndex = (0, import_react238.useMemo)(() => { + for (let index = 0; index < pieData.length; index++) { + if (pieData[index].data.datum === highlightedSegment) { + return index; + } + } + return null; + }, [pieData, highlightedSegment]); + const detailPopoverFooterContent = (0, import_react238.useMemo)(() => detailPopoverFooter && highlightedSegment ? detailPopoverFooter(highlightedSegment) : null, [detailPopoverFooter, highlightedSegment]); + const i18n = useInternalI18n("pie-chart"); + const detailFunction = detailPopoverContent || defaultDetails(i18n, i18nStrings); + const details = popoverData ? detailFunction(popoverData.datum, dataSum) : []; + const popoverContentRef = (0, import_react238.useRef)(null); + const popoverContent = popoverData && import_react238.default.createElement(chart_series_details_default, { details, compactList: true, ref: popoverContentRef }); + const popoverDismissedRecently = (0, import_react238.useRef)(false); + const escapePressed = (0, import_react238.useRef)(false); + const highlightSegment = (0, import_react238.useCallback)((internalDatum) => { + const segment = internalDatum.datum; + if (segment !== highlightedSegment) { + onHighlightChange(segment); + } + if (popoverTrackRef.current) { + setPopoverData({ + datum: internalDatum.datum, + series: { + color: internalDatum.color, + index: internalDatum.index, + label: internalDatum.datum.title, + markerType: "rectangle" + }, + trackRef: popoverTrackRef + }); + setPopoverOpen(true); + } + }, [highlightedSegment, setPopoverOpen, onHighlightChange]); + const clearHighlightedSegment = (0, import_react238.useCallback)(() => { + setPopoverOpen(false); + onHighlightChange(null); + }, [onHighlightChange, setPopoverOpen]); + const checkMouseLeave = (event) => { + if (pinnedSegment !== null) { + return; + } + if (nodeContains(popoverRef.current, event.relatedTarget) || nodeContains(focusedSegmentRef.current, event.relatedTarget)) { + return; + } + clearHighlightedSegment(); + }; + (0, import_react238.useEffect)(() => { + const onKeyDown2 = (event) => { + if (event.key === "Escape") { + clearHighlightedSegment(); + escapePressed.current = true; + } + }; + document.addEventListener("keydown", onKeyDown2); + return () => document.removeEventListener("keydown", onKeyDown2); + }, [clearHighlightedSegment]); + const onMouseDown = (0, import_react238.useCallback)((internalDatum) => { + if (pinnedSegment === internalDatum.datum) { + setPinnedSegment(null); + clearHighlightedSegment(); + } else { + setPinnedSegment(internalDatum.datum); + highlightSegment(internalDatum); + } + }, [pinnedSegment, clearHighlightedSegment, setPinnedSegment, highlightSegment]); + const onMouseOver = (0, import_react238.useCallback)((internalDatum) => { + if (escapePressed.current) { + escapePressed.current = false; + return; + } + if (pinnedSegment !== null) { + return; + } + highlightSegment(internalDatum); + }, [pinnedSegment, highlightSegment]); + const onKeyDown = (0, import_react238.useCallback)((event) => { + const keyCode = event.keyCode; + if (keyCode !== KeyCode.right && keyCode !== KeyCode.left && keyCode !== KeyCode.enter && keyCode !== KeyCode.space) { + return; + } + event.preventDefault(); + let nextIndex = highlightedSegmentIndex || 0; + const MAX = pieData.length - 1; + if (keyCode === KeyCode.right) { + nextIndex++; + if (nextIndex > MAX) { + nextIndex = 0; + } + } else if (keyCode === KeyCode.left) { + nextIndex--; + if (nextIndex < 0) { + nextIndex = MAX; + } + } + if (keyCode === KeyCode.enter || keyCode === KeyCode.space) { + setPinnedSegment(pieData[nextIndex].data.datum); + } + highlightSegment(pieData[nextIndex].data); + }, [setPinnedSegment, highlightSegment, pieData, highlightedSegmentIndex]); + const onApplicationFocus = (0, import_react238.useCallback)((_event, target) => { + if (pinnedSegment !== null || popoverDismissedRecently.current || target === "mouse") { + return; + } + const segment = highlightedSegment || legendSegment || pieData[0].data.datum; + const matched = pieData.filter((d) => d.data.datum === segment); + highlightSegment(matched[0].data); + }, [pinnedSegment, pieData, highlightSegment, highlightedSegment, legendSegment]); + const onApplicationBlur = (0, import_react238.useCallback)((event) => { + const blurTarget = event.relatedTarget || event.target; + if (blurTarget === null || !(blurTarget instanceof Element) || !nodeBelongs(containerRef.current, blurTarget)) { + setPopoverOpen(false); + setPinnedSegment(null); + } + }, [setPinnedSegment]); + const onPopoverDismiss = (outsideClick) => { + setPopoverOpen(false); + setPinnedSegment(null); + if (!outsideClick) { + setTimeout(() => { + popoverDismissedRecently.current = true; + plotRef.current.focusApplication(); + popoverDismissedRecently.current = false; + }, 0); + } else { + onHighlightChange(null); + } + }; + return import_react238.default.createElement( + "div", + { className: clsx_m_default(styles_css_default76["chart-container"], fitHeight && styles_css_default76["chart-container--fit-height"]), ref: containerRef }, + import_react238.default.createElement( + "div", + { className: clsx_m_default(styles_css_default76["chart-container-chart-plot"], fitHeight && styles_css_default76["chart-container-chart-plot--fit-height"]) }, + import_react238.default.createElement( + chart_plot_default, + { ref: plotRef, width: "100%", height: fitHeight ? "100%" : height, transform: `translate(${width / 2} ${height / 2})`, isPrecise: true, isClickable: !isPopoverOpen, ariaLabel, ariaLabelledby, ariaDescription, ariaDescribedby: hasInnerContent ? innerMetricId : void 0, ariaRoleDescription: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.chartAriaRoleDescription, activeElementRef: focusedSegmentRef, activeElementKey: highlightedSegmentIndex === null || highlightedSegmentIndex === void 0 ? void 0 : highlightedSegmentIndex.toString(), onApplicationFocus, onApplicationBlur, onKeyDown, onMouseOut: checkMouseLeave }, + import_react238.default.createElement(Segments, { pieData, dimensions, variant, focusedSegmentRef, popoverTrackRef, highlightedSegment, segmentAriaRoleDescription: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.segmentAriaRoleDescription, onMouseDown, onMouseOver }), + hasLabels && import_react238.default.createElement(labels_default, { pieData, dimensions, segmentDescription, visibleDataSum: dataSum, hideTitles, hideDescriptions, highlightedSegment, containerRef }) + ) + ), + hasInnerContent && import_react238.default.createElement( + "div", + { className: styles_css_default76["inner-content"], id: innerMetricId }, + innerMetricValue && import_react238.default.createElement(InternalBox, { variant: dimensions.size === "small" ? "h3" : "h1", tagOverride: "div", color: "inherit", padding: "n" }, innerMetricValue), + innerMetricDescription && dimensions.size !== "small" && import_react238.default.createElement(InternalBox, { variant: "h3", color: "text-body-secondary", tagOverride: "div", padding: "n" }, innerMetricDescription) + ), + isPopoverOpen && popoverData && import_react238.default.createElement( + chart_popover_default, + { ref: popoverRef, title: popoverData.series && import_react238.default.createElement( + InternalBox, + { className: styles_css_default76["popover-header"], variant: "strong" }, + import_react238.default.createElement(chart_series_marker_default, { color: popoverData.series.color, type: popoverData.series.markerType }), + " ", + popoverData.series.label + ), trackRef: popoverData.trackRef, trackKey: popoverData.series.index, dismissButton: pinnedSegment !== null, dismissAriaLabel: i18nStrings.detailPopoverDismissAriaLabel, onDismiss: onPopoverDismiss, container: ((_b = plotRef.current) === null || _b === void 0 ? void 0 : _b.svg) || null, size: detailPopoverSize, onMouseLeave: checkMouseLeave, onBlur: onApplicationBlur }, + popoverContent, + detailPopoverFooterContent && import_react238.default.createElement(ChartPopoverFooter, null, detailPopoverFooterContent) + ), + import_react238.default.createElement(live_region_default, { source: [popoverContentRef] }) + ); +}; + +// node_modules/@cloudscape-design/components/pie-chart/index.js +var PieChart = function PieChart2(_a) { + var { fitHeight, variant = "pie", size = "medium", hideTitles = false, hideDescriptions = false, hideLegend = false, hideFilter = false, statusType = "finished", data: externalData = [], i18nStrings = {}, highlightedSegment: controlledHighlightedSegment, visibleSegments: controlledVisibleSegments, onHighlightChange: controlledOnHighlightChange, onFilterChange, additionalFilters, legendTitle, detailPopoverSize = "medium" } = _a, props2 = __rest(_a, ["fitHeight", "variant", "size", "hideTitles", "hideDescriptions", "hideLegend", "hideFilter", "statusType", "data", "i18nStrings", "highlightedSegment", "visibleSegments", "onHighlightChange", "onFilterChange", "additionalFilters", "legendTitle", "detailPopoverSize"]); + const { __internalRootRef = null } = useBaseComponent("PieChart", { + props: { + fitHeight, + variant, + size, + hideTitles, + hideDescriptions, + hideLegend, + hideFilter, + detailPopoverSize + } + }); + const baseProps = getBaseProps(props2); + const containerRef = (0, import_react239.useRef)(null); + const [containerWidth, measureRef] = useContainerWidth(); + const data = (0, import_react239.useMemo)(() => { + const colors = createCategoryColorScale(externalData, void 0, (it) => it.color || null); + return externalData.map((datum, i) => ({ + index: i, + color: colors[i], + datum + })); + }, [externalData]); + const [highlightedSegment = null, setHighlightedSegment] = useControllable(controlledHighlightedSegment, controlledOnHighlightChange, null, { + componentName: "PieChart", + controlledProp: "highlightedSegment", + changeHandler: "onHighlightChange" + }); + const [legendSegment, setLegendSegment] = (0, import_react239.useState)(highlightedSegment); + (0, import_react239.useEffect)(() => { + setLegendSegment(controlledHighlightedSegment || null); + }, [controlledHighlightedSegment]); + const [visibleSegments, setVisibleSegments] = useControllable(controlledVisibleSegments, onFilterChange, externalData, { + componentName: "PieChart", + controlledProp: "visibleSegments", + changeHandler: "onFilterChange" + }); + const visibleData = (0, import_react239.useMemo)(() => data.filter((d) => (visibleSegments === null || visibleSegments === void 0 ? void 0 : visibleSegments.indexOf(d.datum)) !== -1), [data, visibleSegments]); + const filterItems = data === null || data === void 0 ? void 0 : data.map((data2) => ({ + label: data2.datum.title, + color: data2.color, + type: "rectangle", + datum: data2.datum + })); + const legendItems = filterItems.filter((d) => (visibleSegments === null || visibleSegments === void 0 ? void 0 : visibleSegments.indexOf(d.datum)) !== -1); + const filterChange = (0, import_react239.useCallback)((selectedSeries) => { + setVisibleSegments(selectedSeries); + fireNonCancelableEvent(onFilterChange, { + visibleSegments: selectedSeries + }); + }, [setVisibleSegments, onFilterChange]); + const onHighlightChange = (0, import_react239.useCallback)((segment) => { + setLegendSegment(segment); + setHighlightedSegment(segment); + fireNonCancelableEvent(controlledOnHighlightChange, { highlightedSegment: segment }); + }, [controlledOnHighlightChange, setHighlightedSegment]); + const onBlur = (event) => { + if (event.relatedTarget && !nodeBelongs(containerRef.current, event.relatedTarget)) { + highlightedSegment && onHighlightChange(null); + setLegendSegment(null); + } + }; + const mergedRef = useMergeRefs(containerRef, measureRef, __internalRootRef); + const { pieData, dataSum } = (0, import_react239.useMemo)(() => { + const dataSum2 = visibleData.reduce((sum2, d) => sum2 + d.datum.value, 0); + const pieFactory = pie_default().value((d) => d.datum.value < dataSum2 / 100 ? dataSum2 / 100 : d.datum.value).sort(null); + const pieData2 = pieFactory(visibleData.filter((d) => d.datum.value > 0)); + return { pieData: pieData2, dataSum: dataSum2 }; + }, [visibleData]); + const hasNoData = !externalData || externalData.length === 0; + const { isEmpty, showChart } = getChartStatus({ externalData: data, visibleData: pieData, statusType }); + const isNoMatch = isEmpty && visibleData.length !== data.length; + const showFilters = statusType === "finished" && !hasNoData && (additionalFilters || !hideFilter); + const reserveLegendSpace = !showChart && !hideLegend; + const reserveFilterSpace = statusType !== "finished" && !isNoMatch && (!hideFilter || additionalFilters); + const hasLabels = !(hideTitles && hideDescriptions); + const isRefresh = useVisualRefresh(); + const defaultDimensions = getDimensionsBySize({ size, hasLabels, visualRefresh: isRefresh }); + const radius = defaultDimensions.outerRadius; + const height = 2 * (radius + defaultDimensions.padding + (hasLabels ? defaultDimensions.paddingLabels : 0)); + return import_react239.default.createElement(ChartWrapper, Object.assign({ ref: mergedRef, fitHeight: !!fitHeight }, baseProps, { className: clsx_m_default(baseProps.className, styles_css_default76.root), contentClassName: clsx_m_default(styles_css_default76.content, styles_css_default76[`content--${defaultDimensions.size}`], { + [styles_css_default76["content--without-labels"]]: !hasLabels, + [styles_css_default76["content--fit-height"]]: fitHeight + }), defaultFilter: showFilters && !hideFilter ? import_react239.default.createElement(chart_filter_default, { series: filterItems, onChange: filterChange, selectedSeries: visibleSegments, i18nStrings }) : null, additionalFilters: showFilters ? additionalFilters : null, reserveFilterSpace: !!reserveFilterSpace, reserveLegendSpace: !!reserveLegendSpace, chartStatus: import_react239.default.createElement(ChartStatusContainer, { isEmpty, isNoMatch, showChart, statusType, empty: props2.empty, noMatch: props2.noMatch, loadingText: props2.loadingText, errorText: props2.errorText, recoveryText: props2.recoveryText, onRecoveryClick: props2.onRecoveryClick }), chart: showChart ? import_react239.default.createElement(pie_chart_default, Object.assign({}, props2, { variant, size, height, fitHeight, data: externalData, width: containerWidth, hideTitles, hideDescriptions, i18nStrings, onHighlightChange, highlightedSegment, legendSegment, detailPopoverSize, pieData, dataSum })) : null, legend: !hideLegend && !hasNoData && statusType === "finished" && import_react239.default.createElement(chart_legend_default, { series: legendItems, highlightedSeries: legendSegment, legendTitle, ariaLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.legendAriaLabel, onHighlightChange, plotContainerRef: containerRef }), onBlur })); +}; +applyDisplayName(PieChart, "PieChart"); +var pie_chart_default2 = PieChart; + +// node_modules/@cloudscape-design/components/popover/index.js +var import_react240 = __toESM(require_react()); +function Popover(_a) { + var { position = "right", size = "medium", fixedWidth = false, triggerType = "text", dismissButton: dismissButton2 = true, renderWithPortal = false, header } = _a, rest = __rest(_a, ["position", "size", "fixedWidth", "triggerType", "dismissButton", "renderWithPortal", "header"]); + if (isDevelopment) { + if (dismissButton2 && !header) { + warnOnce("Popover", `You should provide a \`header\` when \`dismissButton\` is true.`); + } + } + const baseComponentProps = useBaseComponent("Popover", { + props: { dismissButton: dismissButton2, fixedWidth, position, renderWithPortal, size, triggerType } + }); + const externalProps = getExternalProps(rest); + return import_react240.default.createElement(internal_default17, Object.assign({ header, position, size, fixedWidth, triggerType, dismissButton: dismissButton2, renderWithPortal }, externalProps, baseComponentProps)); +} +applyDisplayName(Popover, "Popover"); + +// node_modules/@cloudscape-design/components/progress-bar/index.js +var import_react242 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/progress-bar/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/progress-bar/styles.scoped.css"; +var styles_css_default77 = { + "progress": "awsui_progress_11huc_1ah81_197", + "result-state": "awsui_result-state_11huc_1ah81_211", + "awsui-motion-fade-in": "awsui_awsui-motion-fade-in_11huc_1ah81_1", + "root": "awsui_root_11huc_1ah81_233", + "with-result-button": "awsui_with-result-button_11huc_1ah81_268", + "result-text": "awsui_result-text_11huc_1ah81_272", + "result-container-error": "awsui_result-container-error_11huc_1ah81_276", + "result-container-success": "awsui_result-container-success_11huc_1ah81_276", + "result-button": "awsui_result-button_11huc_1ah81_280", + "word-wrap": "awsui_word-wrap_11huc_1ah81_286", + "label-flash": "awsui_label-flash_11huc_1ah81_291", + "label-key-value": "awsui_label-key-value_11huc_1ah81_295", + "flash": "awsui_flash_11huc_1ah81_303", + "progress-container": "awsui_progress-container_11huc_1ah81_307", + "percentage-container": "awsui_percentage-container_11huc_1ah81_314", + "percentage": "awsui_percentage_11huc_1ah81_314", + "complete": "awsui_complete_11huc_1ah81_360", + "progress-in-flash": "awsui_progress-in-flash_11huc_1ah81_388" +}; + +// node_modules/@cloudscape-design/components/progress-bar/internal.js +var import_react241 = __toESM(require_react()); +var MAX_VALUE = 100; +var clamp = (value, lowerLimit, upperLimit) => { + return Math.max(Math.min(value, upperLimit), lowerLimit); +}; +var Progress = ({ value, isInFlash, ariaLabel, ariaLabelledby }) => { + const roundedValue = Math.round(value); + const progressValue = clamp(roundedValue, 0, MAX_VALUE); + return import_react241.default.createElement( + "div", + { className: styles_css_default77["progress-container"] }, + import_react241.default.createElement("progress", { className: clsx_m_default(styles_css_default77.progress, progressValue >= MAX_VALUE && styles_css_default77.complete, isInFlash && styles_css_default77["progress-in-flash"]), max: MAX_VALUE, value: progressValue, "aria-label": ariaLabel, "aria-labelledby": !ariaLabel ? ariaLabelledby : void 0 }), + import_react241.default.createElement( + "span", + { "aria-hidden": "true", className: styles_css_default77["percentage-container"] }, + import_react241.default.createElement(InternalBox, { className: styles_css_default77.percentage, variant: "small", color: isInFlash ? "inherit" : void 0 }, `${progressValue}%`) + ) + ); +}; +var SmallText = ({ color: color2, children: children2 }) => { + return import_react241.default.createElement(InternalBox, { className: styles_css_default77["word-wrap"], variant: "small", display: "block", color: color2 }, children2); +}; +var ResultButton = ({ onClick, children: children2 }) => { + return import_react241.default.createElement( + "div", + { className: styles_css_default77["result-button"] }, + import_react241.default.createElement(InternalButton, { formAction: "none", onClick }, children2) + ); +}; +var ResultState = ({ isInFlash, resultText, resultButtonText, status, onClick }) => { + const hasResultButton = !!resultButtonText; + if (isInFlash) { + return import_react241.default.createElement( + "div", + { className: styles_css_default77[`result-container-${status}`], "aria-live": "polite", "aria-atomic": "true" }, + import_react241.default.createElement("span", { className: styles_css_default77["result-text"] }, resultText) + ); + } + return import_react241.default.createElement( + "div", + { className: styles_css_default77[`result-container-${status}`], "aria-live": "polite", "aria-atomic": "true" }, + import_react241.default.createElement( + "span", + { className: clsx_m_default(hasResultButton && styles_css_default77["with-result-button"]) }, + import_react241.default.createElement( + StatusIndicator, + { type: status === "success" ? "success" : "error" }, + import_react241.default.createElement("span", { className: styles_css_default77["result-text"] }, resultText) + ) + ), + hasResultButton && import_react241.default.createElement(ResultButton, { onClick }, resultButtonText) + ); +}; + +// node_modules/@cloudscape-design/components/progress-bar/index.js +var ASSERTION_FREQUENCY = 5e3; +function ProgressBar(_a) { + var { value = 0, status = "in-progress", variant = "standalone", resultButtonText, label, ariaLabel, ariaLabelledby, description, additionalInfo, resultText, onResultButtonClick } = _a, rest = __rest(_a, ["value", "status", "variant", "resultButtonText", "label", "ariaLabel", "ariaLabelledby", "description", "additionalInfo", "resultText", "onResultButtonClick"]); + const { __internalRootRef } = useBaseComponent("ProgressBar", { + props: { variant } + }); + const baseProps = getBaseProps(rest); + const generatedName = useUniqueId("awsui-progress-bar-"); + const labelId = `${generatedName}-label`; + const isInFlash = variant === "flash"; + const isInProgressState = status === "in-progress"; + const [announcedValue, setAnnouncedValue] = (0, import_react242.useState)(""); + const throttledAssertion = (0, import_react242.useMemo)(() => { + return throttle((value2) => { + setAnnouncedValue(`${value2}%`); + }, ASSERTION_FREQUENCY); + }, []); + (0, import_react242.useEffect)(() => { + throttledAssertion(value); + }, [throttledAssertion, value]); + if (isInFlash && resultButtonText) { + warnOnce("ProgressBar", 'The `resultButtonText` is ignored if you set `variant="flash"`, and the result button is not displayed. Use the `buttonText` property and the `onButtonClick` event listener of the flashbar item in which the progress bar component is embedded.'); + } + return import_react242.default.createElement( + "div", + Object.assign({}, baseProps, { className: clsx_m_default(baseProps.className, styles_css_default77.root, variant && styles_css_default77[variant]), ref: __internalRootRef }), + import_react242.default.createElement( + "div", + { className: isInFlash ? styles_css_default77["flash-container"] : void 0 }, + import_react242.default.createElement("div", { className: clsx_m_default(styles_css_default77["word-wrap"], styles_css_default77[`label-${variant}`]), id: labelId }, label), + description && import_react242.default.createElement(SmallText, { color: isInFlash ? "inherit" : void 0 }, description), + import_react242.default.createElement("div", null, isInProgressState ? import_react242.default.createElement( + import_react242.default.Fragment, + null, + import_react242.default.createElement(Progress, { value, ariaLabel, ariaLabelledby: joinStrings(labelId, ariaLabelledby), isInFlash }), + import_react242.default.createElement( + live_region_default, + { delay: 0 }, + label, + label ? ": " : null, + announcedValue + ) + ) : import_react242.default.createElement(ResultState, { resultText, isInFlash, resultButtonText, status, onClick: () => { + fireNonCancelableEvent(onResultButtonClick); + } })) + ), + additionalInfo && import_react242.default.createElement(SmallText, { color: isInFlash ? "inherit" : void 0 }, additionalInfo) + ); +} +applyDisplayName(ProgressBar, "ProgressBar"); + +// node_modules/@cloudscape-design/components/property-filter/index.js +var import_react249 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/property-filter/token.js +var import_react246 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/property-filter/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/property-filter/styles.scoped.css"; +var styles_css_default78 = { + "root": "awsui_root_1wzqe_d6xov_99", + "search-field": "awsui_search-field_1wzqe_d6xov_134", + "input-wrapper": "awsui_input-wrapper_1wzqe_d6xov_140", + "add-token": "awsui_add-token_1wzqe_d6xov_144", + "tokens": "awsui_tokens_1wzqe_d6xov_151", + "token-operator": "awsui_token-operator_1wzqe_d6xov_156", + "property-editor": "awsui_property-editor_1wzqe_d6xov_160", + "token-editor": "awsui_token-editor_1wzqe_d6xov_161", + "property-editor-form": "awsui_property-editor-form_1wzqe_d6xov_166", + "token-editor-form": "awsui_token-editor-form_1wzqe_d6xov_167", + "property-editor-field-property": "awsui_property-editor-field-property_1wzqe_d6xov_170", + "token-editor-field-property": "awsui_token-editor-field-property_1wzqe_d6xov_171", + "property-editor-field-operator": "awsui_property-editor-field-operator_1wzqe_d6xov_174", + "token-editor-field-operator": "awsui_token-editor-field-operator_1wzqe_d6xov_175", + "property-editor-field-value": "awsui_property-editor-field-value_1wzqe_d6xov_178", + "token-editor-field-value": "awsui_token-editor-field-value_1wzqe_d6xov_179", + "property-editor-cancel": "awsui_property-editor-cancel_1wzqe_d6xov_182", + "token-editor-cancel": "awsui_token-editor-cancel_1wzqe_d6xov_183", + "property-editor-submit": "awsui_property-editor-submit_1wzqe_d6xov_186", + "token-editor-submit": "awsui_token-editor-submit_1wzqe_d6xov_187", + "property-editor-actions": "awsui_property-editor-actions_1wzqe_d6xov_190", + "token-editor-actions": "awsui_token-editor-actions_1wzqe_d6xov_191", + "custom-content-wrapper": "awsui_custom-content-wrapper_1wzqe_d6xov_209", + "custom-control": "awsui_custom-control_1wzqe_d6xov_213", + "input": "awsui_input_1wzqe_d6xov_140", + "results": "awsui_results_1wzqe_d6xov_221", + "token-trigger": "awsui_token-trigger_1wzqe_d6xov_226", + "remove-all": "awsui_remove-all_1wzqe_d6xov_231", + "token-label": "awsui_token-label_1wzqe_d6xov_232", + "join-operation": "awsui_join-operation_1wzqe_d6xov_233", + "custom-filter-actions": "awsui_custom-filter-actions_1wzqe_d6xov_234" +}; + +// node_modules/@cloudscape-design/components/property-filter/token-editor.js +var import_react244 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/property-filter/use-load-items.js +var import_react243 = __toESM(require_react()); +var useLoadItems2 = (onLoadItems, focusFilteringText, currentFilteringProperty, currentFilteringText, currentFilteringOperator) => { + const focusIn = (0, import_react243.useRef)(false); + const handleBlur = () => { + focusIn.current = true; + }; + const fireLoadItems = (detail) => { + var _a; + fireNonCancelableEvent(onLoadItems, Object.assign(Object.assign({}, detail), { filteringText: (_a = currentFilteringText !== null && currentFilteringText !== void 0 ? currentFilteringText : detail.filteringText) !== null && _a !== void 0 ? _a : "", filteringProperty: currentFilteringProperty, filteringOperator: currentFilteringOperator })); + focusIn.current = false; + }; + const handleFocus = () => { + if (focusIn.current) { + fireLoadItems({ firstPage: true, samePage: false, filteringText: focusFilteringText }); + } + }; + const handleLoadItems = ({ detail }) => fireLoadItems(detail); + return { + onBlur: handleBlur, + onFocus: handleFocus, + onLoadItems: handleLoadItems + }; +}; + +// node_modules/@cloudscape-design/components/property-filter/utils.js +function matchFilteringProperty(filteringProperties, filteringText) { + let maxLength = 0; + let matchedProperty = null; + for (const property of filteringProperties) { + if (property.propertyLabel.length >= maxLength && startsWith(filteringText, property.propertyLabel) || property.propertyLabel.length > maxLength && startsWith(filteringText.toLowerCase(), property.propertyLabel.toLowerCase())) { + maxLength = property.propertyLabel.length; + matchedProperty = property; + } + } + return matchedProperty; +} +function matchOperator(allowedOperators, filteringText) { + filteringText = filteringText.toLowerCase(); + let maxLength = 0; + let matchedOperator = null; + for (const operator of allowedOperators) { + if (operator.length > maxLength && startsWith(filteringText, operator.toLowerCase())) { + maxLength = operator.length; + matchedOperator = operator; + } + } + return matchedOperator; +} +function matchOperatorPrefix(allowedOperators, filteringText) { + if (filteringText.trim().length === 0) { + return ""; + } + for (const operator of allowedOperators) { + if (startsWith(operator.toLowerCase(), filteringText.toLowerCase())) { + return filteringText; + } + } + return null; +} +function matchTokenValue({ property, operator, value }, filteringOptions) { + var _a, _b; + const propertyOptions = filteringOptions.filter((option) => option.property === property); + const bestMatch = { propertyKey: property === null || property === void 0 ? void 0 : property.propertyKey, operator, value }; + for (const option of propertyOptions) { + if (option.label && option.label === value || !option.label && option.value === value) { + return { propertyKey: property === null || property === void 0 ? void 0 : property.propertyKey, operator, value: option.value }; + } + if (typeof value === "string" && value.toLowerCase() === ((_b = (_a = option.label) !== null && _a !== void 0 ? _a : option.value) !== null && _b !== void 0 ? _b : "").toLowerCase()) { + bestMatch.value = option.value; + } + } + return bestMatch; +} +function getFormattedToken(token) { + var _a; + const valueFormatter = (_a = token.property) === null || _a === void 0 ? void 0 : _a.getValueFormatter(token.operator); + const propertyLabel = token.property && token.property.propertyLabel; + const tokenValue = valueFormatter ? valueFormatter(token.value) : token.value; + const label = `${propertyLabel !== null && propertyLabel !== void 0 ? propertyLabel : ""} ${token.operator} ${tokenValue}`; + return { property: propertyLabel !== null && propertyLabel !== void 0 ? propertyLabel : "", operator: token.operator, value: tokenValue, label }; +} +function trimStart(source) { + let spacesLength = 0; + for (let i = 0; i < source.length; i++) { + if (source[i] === " ") { + spacesLength++; + } else { + break; + } + } + return source.slice(spacesLength); +} +function trimFirstSpace(source) { + return source[0] === " " ? source.slice(1) : source; +} +function removeOperator(source, operator) { + const operatorLastIndex = source.indexOf(operator) + operator.length; + const textWithoutOperator = source.slice(operatorLastIndex); + return trimFirstSpace(textWithoutOperator); +} +function startsWith(source, target) { + return source.indexOf(target) === 0; +} + +// node_modules/@cloudscape-design/components/property-filter/controller.js +var getQueryActions = (query, onChange, inputRef) => { + const { tokens, operation } = query; + const fireOnChange = (tokens2, operation2) => fireNonCancelableEvent(onChange, { tokens: tokens2, operation: operation2 }); + const setToken = (index, newToken) => { + const newTokens = [...tokens]; + if (newTokens && index < newTokens.length) { + newTokens[index] = newToken; + } + fireOnChange(newTokens, operation); + }; + const removeToken = (index) => { + var _a; + const newTokens = tokens.filter((_, i) => i !== index); + fireOnChange(newTokens, operation); + (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus({ preventDropdown: true }); + }; + const removeAllTokens = () => { + var _a; + fireOnChange([], operation); + (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus({ preventDropdown: true }); + }; + const addToken = (newToken) => { + const newTokens = [...tokens]; + newTokens.push(newToken); + fireOnChange(newTokens, operation); + }; + const setOperation = (newOperation) => { + fireOnChange(tokens, newOperation); + }; + return { + setToken, + removeToken, + removeAllTokens, + addToken, + setOperation + }; +}; +var getAllowedOperators = (property) => { + const { operators = [], defaultOperator } = property; + const operatorOrder = ["=", "!=", ":", "!:", "^", "!^", ">=", "<=", "<", ">"]; + const operatorSet = /* @__PURE__ */ new Set([defaultOperator, ...operators]); + return operatorOrder.filter((op) => operatorSet.has(op)); +}; +var parseText = (filteringText, filteringProperties, freeTextFiltering) => { + const property = matchFilteringProperty(filteringProperties, filteringText); + if (!property) { + if (!freeTextFiltering.disabled) { + const freeTextOperators = freeTextFiltering.operators.indexOf("!:") >= 0 ? ["!", ...freeTextFiltering.operators] : freeTextFiltering.operators; + const operator2 = matchOperator(freeTextOperators, filteringText); + if (operator2) { + return { + step: "free-text", + operator: operator2 === "!" ? "!:" : operator2, + value: removeOperator(filteringText, operator2) + }; + } + } + return { + step: "free-text", + value: filteringText + }; + } + const allowedOps = getAllowedOperators(property); + const textWithoutProperty = filteringText.substring(property.propertyLabel.length); + const operator = matchOperator(allowedOps, trimStart(textWithoutProperty)); + if (operator) { + return { + step: "property", + property, + operator, + value: removeOperator(textWithoutProperty, operator) + }; + } + const operatorPrefix = matchOperatorPrefix(allowedOps, trimStart(textWithoutProperty)); + if (operatorPrefix !== null) { + return { step: "operator", property, operatorPrefix }; + } + return { + step: "free-text", + value: filteringText + }; +}; +var getAllValueSuggestions = (filteringOptions, operator = "=", i18nStrings, customGroupsText) => { + var _a; + const defaultGroup = { + label: (_a = i18nStrings.groupValuesText) !== null && _a !== void 0 ? _a : "", + options: [] + }; + const customGroups = {}; + filteringOptions.forEach((filteringOption) => { + const property = filteringOption.property; + if (!property) { + return; + } + if (getAllowedOperators(property).indexOf(operator) === -1) { + return; + } + if (property.propertyGroup && !customGroups[property.propertyGroup]) { + const label = customGroupsText.reduce((acc, customGroup) => customGroup.group === property.propertyGroup ? customGroup.values : acc, ""); + customGroups[property.propertyGroup] = { + label, + options: [] + }; + } + const propertyGroup = property.propertyGroup ? customGroups[property.propertyGroup] : defaultGroup; + propertyGroup.options.push({ + value: property.propertyLabel + " " + (operator || "=") + " " + filteringOption.value, + label: filteringOption.label, + __labelPrefix: property.propertyLabel + " " + (operator || "=") + }); + }); + return [defaultGroup, ...Object.keys(customGroups).map((group) => customGroups[group])]; +}; +function createPropertiesCompatibilityMap(filteringProperties) { + const lookup = {}; + for (const property of filteringProperties) { + lookup[property.propertyKey] = (property.operators || []).map((operator) => ({ operator, form: property.getValueFormRenderer(operator) })).sort((a2, b) => a2.operator.localeCompare(b.operator)); + } + return (propertyA, propertyB) => { + if (lookup[propertyA].length !== lookup[propertyB].length) { + return false; + } + for (let i = 0; i < lookup[propertyA].length; i++) { + if (lookup[propertyA][i].operator !== lookup[propertyB][i].operator) { + return false; + } + if (lookup[propertyA][i].form !== lookup[propertyB][i].form) { + return false; + } + } + return true; + }; +} +var filteringPropertyToAutosuggestOption = (filteringProperty) => ({ + value: filteringProperty.propertyLabel, + label: filteringProperty.propertyLabel, + keepOpenOnSelect: true +}); +function getPropertySuggestions(filteringProperties, customGroupsText, i18nStrings, filteringPropertyToOption) { + var _a; + const defaultGroup = { + label: (_a = i18nStrings.groupPropertiesText) !== null && _a !== void 0 ? _a : "", + options: [] + }; + const customGroups = {}; + filteringProperties.forEach((filteringProperty) => { + const { propertyGroup } = filteringProperty; + let optionsGroup = defaultGroup; + if (propertyGroup) { + if (!customGroups[propertyGroup]) { + const label = customGroupsText.reduce((acc, customGroup) => customGroup.group === propertyGroup ? customGroup.properties : acc, ""); + customGroups[propertyGroup] = { options: [], label }; + } + optionsGroup = customGroups[propertyGroup]; + } + optionsGroup.options.push(filteringPropertyToOption(filteringProperty)); + }); + const defaultGroupArray = defaultGroup.options.length ? [defaultGroup] : []; + const customGroupsArray = Object.keys(customGroups).map((groupKey) => customGroups[groupKey]); + return [...defaultGroupArray, ...customGroupsArray]; +} +var getAutosuggestOptions = (parsedText, filteringProperties, filteringOptions, customGroupsText, i18nStrings) => { + switch (parsedText.step) { + case "property": { + const { propertyLabel, groupValuesLabel } = parsedText.property; + const options = filteringOptions.filter((o) => o.property === parsedText.property); + return { + filterText: parsedText.value, + options: [ + { + options: options.map(({ label, value }) => ({ + value: propertyLabel + " " + parsedText.operator + " " + value, + label, + __labelPrefix: propertyLabel + " " + parsedText.operator + })), + label: groupValuesLabel + } + ] + }; + } + case "operator": { + return { + filterText: parsedText.property.propertyLabel + " " + parsedText.operatorPrefix, + options: [ + ...getPropertySuggestions(filteringProperties, customGroupsText, i18nStrings, filteringPropertyToAutosuggestOption), + { + options: getAllowedOperators(parsedText.property).map((value) => ({ + value: parsedText.property.propertyLabel + " " + value + " ", + label: parsedText.property.propertyLabel + " " + value, + description: operatorToDescription(value, i18nStrings), + keepOpenOnSelect: true + })), + label: i18nStrings.operatorsText + } + ] + }; + } + case "free-text": { + const needsValueSuggestions = !!parsedText.value; + const needsPropertySuggestions = !(parsedText.step === "free-text" && parsedText.operator === "!:"); + return { + filterText: parsedText.value, + options: [ + ...needsPropertySuggestions ? getPropertySuggestions(filteringProperties, customGroupsText, i18nStrings, filteringPropertyToAutosuggestOption) : [], + ...needsValueSuggestions ? getAllValueSuggestions(filteringOptions, parsedText.operator, i18nStrings, customGroupsText) : [] + ] + }; + } + } +}; +var operatorToDescription = (operator, i18nStrings) => { + switch (operator) { + case "<": + return i18nStrings.operatorLessText; + case "<=": + return i18nStrings.operatorLessOrEqualText; + case ">": + return i18nStrings.operatorGreaterText; + case ">=": + return i18nStrings.operatorGreaterOrEqualText; + case ":": + return i18nStrings.operatorContainsText; + case "!:": + return i18nStrings.operatorDoesNotContainText; + case "=": + return i18nStrings.operatorEqualsText; + case "!=": + return i18nStrings.operatorDoesNotEqualText; + case "^": + return i18nStrings.operatorStartsWithText; + case "!^": + return i18nStrings.operatorDoesNotStartWithText; + default: + return ""; + } +}; + +// node_modules/@cloudscape-design/components/property-filter/token-editor.js +function PropertyInput({ property, onChangePropertyKey, asyncProps, filteringProperties, onLoadItems, customGroupsText, i18nStrings, freeTextFiltering }) { + var _a; + const propertySelectHandlers = useLoadItems2(onLoadItems); + const asyncPropertySelectProps = asyncProps ? Object.assign(Object.assign({}, asyncProps), propertySelectHandlers) : {}; + const propertyOptions = getPropertySuggestions(filteringProperties, customGroupsText, i18nStrings, ({ propertyKey, propertyLabel }) => ({ + value: propertyKey, + label: propertyLabel, + dontCloseOnSelect: true + })); + const checkPropertiesCompatible = createPropertiesCompatibilityMap(filteringProperties); + propertyOptions.forEach((optionGroup) => { + if ("options" in optionGroup) { + optionGroup.options.forEach((option) => { + if ((property === null || property === void 0 ? void 0 : property.propertyKey) && option.value) { + option.disabled = !checkPropertiesCompatible(option.value, property.propertyKey); + } + }); + } + }); + const allPropertiesOption = { + label: i18nStrings.allPropertiesLabel, + value: void 0 + }; + if (!freeTextFiltering.disabled) { + propertyOptions.unshift(allPropertiesOption); + } + return import_react244.default.createElement(internal_default16, Object.assign({ options: propertyOptions, selectedOption: property ? { + value: (_a = property.propertyKey) !== null && _a !== void 0 ? _a : void 0, + label: property.propertyLabel + } : allPropertiesOption, onChange: (e) => onChangePropertyKey(e.detail.selectedOption.value) }, asyncPropertySelectProps)); +} +function OperatorInput({ property, operator, onChangeOperator, i18nStrings, freeTextFiltering }) { + const operatorOptions = (property ? getAllowedOperators(property) : freeTextFiltering.operators).map((operator2) => ({ + value: operator2, + label: operator2, + description: operatorToDescription(operator2, i18nStrings) + })); + return import_react244.default.createElement(internal_default16, { options: operatorOptions, triggerVariant: "option", selectedOption: operator ? { + value: operator, + label: operator, + description: operatorToDescription(operator, i18nStrings) + } : null, onChange: (e) => onChangeOperator(e.detail.selectedOption.value) }); +} +function ValueInput({ property, operator, value, onChangeValue, asyncProps, filteringOptions, onLoadItems, i18nStrings }) { + var _a, _b, _c; + const valueOptions = property ? filteringOptions.filter((option) => { + var _a2; + return ((_a2 = option.property) === null || _a2 === void 0 ? void 0 : _a2.propertyKey) === property.propertyKey; + }).map(({ label, value: value2 }) => ({ label, value: value2 })) : []; + const valueAutosuggestHandlers = useLoadItems2(onLoadItems, "", property === null || property === void 0 ? void 0 : property.externalProperty); + const asyncValueAutosuggestProps = (property === null || property === void 0 ? void 0 : property.propertyKey) ? Object.assign(Object.assign({}, valueAutosuggestHandlers), asyncProps) : { empty: asyncProps.empty }; + const [matchedOption] = valueOptions.filter((option) => option.value === value); + const OperatorForm = (property === null || property === void 0 ? void 0 : property.propertyKey) && operator && (property === null || property === void 0 ? void 0 : property.getValueFormRenderer(operator)); + return OperatorForm ? import_react244.default.createElement(OperatorForm, { value, onChange: onChangeValue, operator }) : import_react244.default.createElement(internal_default15, Object.assign({ enteredTextLabel: (_a = i18nStrings.enteredTextLabel) !== null && _a !== void 0 ? _a : (value2) => value2, value: (_c = (_b = matchedOption === null || matchedOption === void 0 ? void 0 : matchedOption.label) !== null && _b !== void 0 ? _b : value) !== null && _c !== void 0 ? _c : "", clearAriaLabel: i18nStrings.clearAriaLabel, onChange: (e) => onChangeValue(e.detail.value), disabled: !operator, options: valueOptions }, asyncValueAutosuggestProps, { virtualScroll: true })); +} +function TokenEditor({ asyncProperties, asyncProps, customGroupsText, freeTextFiltering, expandToViewport, filteringProperties, filteringOptions, i18nStrings, onLoadItems, setToken, token, triggerComponent }) { + const [temporaryToken, setTemporaryToken] = (0, import_react244.useState)(token); + const popoverRef = (0, import_react244.useRef)(null); + const closePopover = () => { + popoverRef.current && popoverRef.current.dismissPopover(); + }; + const property = temporaryToken.property; + const onChangePropertyKey = (newPropertyKey) => { + var _a; + const filteringProperty = filteringProperties.reduce((acc, property2) => property2.propertyKey === newPropertyKey ? property2 : acc, void 0); + const allowedOperators = filteringProperty ? getAllowedOperators(filteringProperty) : freeTextFiltering.operators; + const operator2 = temporaryToken.operator && allowedOperators.indexOf(temporaryToken.operator) !== -1 ? temporaryToken.operator : allowedOperators[0]; + const matchedProperty = (_a = filteringProperties.find((property2) => property2.propertyKey === newPropertyKey)) !== null && _a !== void 0 ? _a : null; + setTemporaryToken(Object.assign(Object.assign({}, temporaryToken), { property: matchedProperty, operator: operator2 })); + }; + const operator = temporaryToken.operator; + const onChangeOperator = (newOperator) => { + setTemporaryToken(Object.assign(Object.assign({}, temporaryToken), { operator: newOperator })); + }; + const value = temporaryToken.value; + const onChangeValue = (newValue) => { + setTemporaryToken(Object.assign(Object.assign({}, temporaryToken), { value: newValue })); + }; + return import_react244.default.createElement(internal_default17, { ref: popoverRef, className: styles_css_default78["token-label"], triggerType: "text", header: i18nStrings.editTokenHeader, size: "large", position: "right", dismissAriaLabel: i18nStrings.dismissAriaLabel, __onOpen: () => setTemporaryToken(token), renderWithPortal: expandToViewport, content: import_react244.default.createElement( + "div", + { className: styles_css_default78["token-editor"] }, + import_react244.default.createElement( + "div", + { className: styles_css_default78["token-editor-form"] }, + import_react244.default.createElement( + InternalFormField, + { label: i18nStrings.propertyText, className: styles_css_default78["token-editor-field-property"] }, + import_react244.default.createElement(PropertyInput, { property, onChangePropertyKey, asyncProps: asyncProperties ? asyncProps : null, filteringProperties, onLoadItems, customGroupsText, i18nStrings, freeTextFiltering }) + ), + import_react244.default.createElement( + InternalFormField, + { label: i18nStrings.operatorText, className: styles_css_default78["token-editor-field-operator"] }, + import_react244.default.createElement(OperatorInput, { property, operator, onChangeOperator, i18nStrings, freeTextFiltering }) + ), + import_react244.default.createElement( + InternalFormField, + { label: i18nStrings.valueText, className: styles_css_default78["token-editor-field-value"] }, + import_react244.default.createElement(ValueInput, { property, operator, value, onChangeValue, asyncProps, filteringOptions, onLoadItems, i18nStrings }) + ) + ), + import_react244.default.createElement( + "div", + { className: styles_css_default78["token-editor-actions"] }, + import_react244.default.createElement(internal_default2, { formAction: "none", variant: "link", className: styles_css_default78["token-editor-cancel"], onClick: closePopover }, i18nStrings.cancelActionText), + import_react244.default.createElement(internal_default2, { className: styles_css_default78["token-editor-submit"], formAction: "none", onClick: () => { + setToken(matchTokenValue(temporaryToken, filteringOptions)); + closePopover(); + } }, i18nStrings.applyActionText) + ) + ) }, triggerComponent); +} + +// node_modules/@cloudscape-design/components/internal/components/filtering-token/index.js +var import_react245 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/internal/components/filtering-token/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/internal/components/filtering-token/styles.scoped.css"; +var styles_css_default79 = { + "root": "awsui_root_10m3l_ilcbp_103", + "token": "awsui_token_10m3l_ilcbp_108", + "show-operation": "awsui_show-operation_10m3l_ilcbp_123", + "select": "awsui_select_10m3l_ilcbp_129", + "token-content": "awsui_token-content_10m3l_ilcbp_133", + "dismiss-button": "awsui_dismiss-button_10m3l_ilcbp_138", + "token-disabled": "awsui_token-disabled_10m3l_ilcbp_180" +}; + +// node_modules/@cloudscape-design/components/internal/components/filtering-token/index.js +function FilteringToken({ ariaLabel, showOperation, operation, andText, orText, dismissAriaLabel, operatorAriaLabel, disabled, children: children2, onChange, onDismiss }) { + return import_react245.default.createElement( + "div", + { className: styles_css_default79.root, role: "group", "aria-label": ariaLabel }, + showOperation && import_react245.default.createElement(internal_default16, { __inFilteringToken: true, className: styles_css_default79.select, options: [ + { value: "and", label: andText }, + { value: "or", label: orText } + ], selectedOption: { value: operation, label: operation === "and" ? andText : orText }, onChange: (e) => onChange(e.detail.selectedOption.value), disabled, ariaLabel: operatorAriaLabel }), + import_react245.default.createElement( + "div", + { className: clsx_m_default(styles_css_default79.token, showOperation && styles_css_default79["show-operation"], disabled && styles_css_default79["token-disabled"]), "aria-disabled": disabled }, + import_react245.default.createElement("div", { className: styles_css_default79["token-content"] }, children2), + import_react245.default.createElement( + "button", + { type: "button", className: styles_css_default79["dismiss-button"], "aria-label": dismissAriaLabel, onClick: onDismiss, disabled }, + import_react245.default.createElement(internal_default, { name: "close" }) + ) + ) + ); +} + +// node_modules/@cloudscape-design/components/property-filter/token.js +var TokenButton = ({ token, operation = "and", first, removeToken, setToken, setOperation, filteringProperties, filteringOptions, asyncProps, onLoadItems, i18nStrings, asyncProperties, hideOperations, customGroupsText, disabled, freeTextFiltering, expandToViewport }) => { + var _a, _b, _c, _d; + const externalToken = Object.assign(Object.assign({}, token), { propertyKey: (_a = token.property) === null || _a === void 0 ? void 0 : _a.propertyKey }); + const formattedToken = getFormattedToken(token); + return import_react246.default.createElement( + FilteringToken, + { ariaLabel: formattedToken.label, showOperation: !first && !hideOperations, operation, andText: (_b = i18nStrings.operationAndText) !== null && _b !== void 0 ? _b : "", orText: (_c = i18nStrings.operationOrText) !== null && _c !== void 0 ? _c : "", dismissAriaLabel: (_d = i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.removeTokenButtonAriaLabel) === null || _d === void 0 ? void 0 : _d.call(i18nStrings, externalToken), operatorAriaLabel: i18nStrings.tokenOperatorAriaLabel, onChange: setOperation, onDismiss: removeToken, disabled }, + import_react246.default.createElement(TokenEditor, { setToken, triggerComponent: import_react246.default.createElement( + "span", + { className: styles_css_default78["token-trigger"] }, + import_react246.default.createElement(TokenTrigger, { property: formattedToken.property, operator: token.operator, value: formattedToken.value }) + ), filteringProperties, filteringOptions, token, asyncProps, onLoadItems, i18nStrings, asyncProperties, customGroupsText, freeTextFiltering, expandToViewport }) + ); +}; +var TokenTrigger = ({ property, operator, value }) => { + if (property) { + property += " "; + } + const freeTextContainsToken = operator === ":" && !property; + const operatorText = freeTextContainsToken ? "" : operator + " "; + return import_react246.default.createElement( + import_react246.default.Fragment, + null, + property, + import_react246.default.createElement("span", { className: styles_css_default78["token-operator"] }, operatorText), + value + ); +}; + +// node_modules/@cloudscape-design/components/property-filter/property-filter-autosuggest.js +var import_react247 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/property-filter/filter-options.js +function filterOptions3(options, searchText = "") { + if (!searchText) { + return options; + } + const filtered = []; + for (const option of options) { + if (isGroup4(option)) { + const childOptions = filterOptions3(option.options, searchText); + if (childOptions.length > 0) { + filtered.push(Object.assign(Object.assign({}, option), { options: childOptions })); + } + } else if (matchSingleOption2(option, searchText)) { + filtered.push(option); + } + } + return filtered; +} +function isGroup4(optionOrGroup) { + return "options" in optionOrGroup; +} +function matchSingleOption2(option, searchText) { + var _a, _b; + searchText = searchText.toLowerCase(); + const label = ((_a = option.label) !== null && _a !== void 0 ? _a : "").toLowerCase(); + const labelPrefix = (_b = option.__labelPrefix) !== null && _b !== void 0 ? _b : ""; + const value = (option.value ? option.value.slice(labelPrefix.length) : "").toLowerCase(); + return label.indexOf(searchText) !== -1 || value.indexOf(searchText) !== -1; +} + +// node_modules/@cloudscape-design/components/property-filter/property-filter-autosuggest.js +var DROPDOWN_WIDTH_OPTIONS_LIST = 300; +var DROPDOWN_WIDTH_CUSTOM_FORM = 200; +var PropertyFilterAutosuggest = import_react247.default.forwardRef((props2, ref) => { + var _a; + const { value, onChange, onFocus, onBlur, onLoadItems, options, statusType = "finished", placeholder, disabled, ariaLabel, enteredTextLabel, onKeyDown, virtualScroll, expandToViewport, customForm, filterText, onOptionClick, hideEnteredTextOption, searchResultsId } = props2, rest = __rest(props2, ["value", "onChange", "onFocus", "onBlur", "onLoadItems", "options", "statusType", "placeholder", "disabled", "ariaLabel", "enteredTextLabel", "onKeyDown", "virtualScroll", "expandToViewport", "customForm", "filterText", "onOptionClick", "hideEnteredTextOption", "searchResultsId"]); + const highlightText = filterText === void 0 ? value : filterText; + const customFormRef = (0, import_react247.useRef)(null); + const autosuggestInputRef = (0, import_react247.useRef)(null); + const mergedRef = useMergeRefs(autosuggestInputRef, ref); + const filteredOptions = (0, import_react247.useMemo)(() => filterOptions3(options || [], highlightText), [options, highlightText]); + const [autosuggestItemsState, autosuggestItemsHandlers] = useAutosuggestItems({ + options: filteredOptions, + filterValue: value, + filterText: highlightText, + filteringType: "manual", + enteredTextLabel, + hideEnteredTextLabel: hideEnteredTextOption, + onSelectItem: (option) => { + var _a2; + const value2 = option.value || ""; + fireNonCancelableEvent(onChange, { value: value2 }); + const selectedCancelled = fireCancelableEvent(onOptionClick, option); + if (!selectedCancelled) { + (_a2 = autosuggestInputRef.current) === null || _a2 === void 0 ? void 0 : _a2.close(); + } else { + autosuggestItemsHandlers.resetHighlightWithKeyboard(); + } + } + }); + const autosuggestLoadMoreHandlers = useAutosuggestLoadMore({ + options, + statusType, + onLoadItems: (detail) => fireNonCancelableEvent(onLoadItems, detail) + }); + const handleChange = (event) => { + autosuggestItemsHandlers.resetHighlightWithKeyboard(); + fireNonCancelableEvent(onChange, event.detail); + }; + const handleDelayedInput = (event) => { + autosuggestLoadMoreHandlers.fireLoadMoreOnInputChange(event.detail.value); + }; + const handleFocus = () => { + autosuggestLoadMoreHandlers.fireLoadMoreOnInputFocus(); + fireCancelableEvent(onFocus, null); + }; + const handleBlur = () => { + fireCancelableEvent(onBlur, null); + }; + const handleKeyDown = (e) => { + fireCancelableEvent(onKeyDown, e.detail); + }; + const handlePressArrowDown = () => { + var _a2; + autosuggestItemsHandlers.moveHighlightWithKeyboard(1); + if (customFormRef.current) { + (_a2 = getFirstFocusable(customFormRef.current)) === null || _a2 === void 0 ? void 0 : _a2.focus(); + } + }; + const handlePressArrowUp = () => { + autosuggestItemsHandlers.moveHighlightWithKeyboard(-1); + }; + const handlePressEnter = () => { + return autosuggestItemsHandlers.selectHighlightedOptionWithKeyboard(); + }; + const handleCloseDropdown = () => { + autosuggestItemsHandlers.resetHighlightWithKeyboard(); + }; + const handleRecoveryClick = () => { + var _a2; + autosuggestLoadMoreHandlers.fireLoadMoreOnRecoveryClick(); + (_a2 = autosuggestInputRef.current) === null || _a2 === void 0 ? void 0 : _a2.focus(); + }; + const selfControlId = useUniqueId("input"); + const controlId = (_a = rest.controlId) !== null && _a !== void 0 ? _a : selfControlId; + const listId = useUniqueId("list"); + const footerId = useUniqueId("footer"); + const highlightedOptionIdSource = useUniqueId(); + const highlightedOptionId = autosuggestItemsState.highlightedOption ? highlightedOptionIdSource : void 0; + const isEmpty = !value && !autosuggestItemsState.items.length; + const dropdownStatus = useDropdownStatus(Object.assign(Object.assign({}, props2), { isEmpty, onRecoveryClick: handleRecoveryClick, hasRecoveryCallback: !!onLoadItems })); + let content = null; + if (customForm) { + content = import_react247.default.createElement("div", { ref: customFormRef, className: styles_css_default78["custom-content-wrapper"] }, customForm); + } else if (autosuggestItemsState.items.length > 0) { + content = import_react247.default.createElement(AutosuggestOptionsList, { statusType, autosuggestItemsState, autosuggestItemsHandlers, highlightedOptionId, highlightText, listId, controlId, handleLoadMore: autosuggestLoadMoreHandlers.fireLoadMoreOnScroll, hasDropdownStatus: dropdownStatus.content !== null, virtualScroll, listBottom: !dropdownStatus.isSticky ? import_react247.default.createElement(dropdown_footer_default, { content: dropdownStatus.content, id: footerId }) : null, ariaDescribedby: dropdownStatus.content ? footerId : void 0 }); + } + return import_react247.default.createElement(autosuggest_input_default, Object.assign({ ref: mergedRef }, rest, { className: clsx_m_default(styles_css_default47.root, styles_css_default78.input), value, onChange: handleChange, onFocus: handleFocus, onBlur: handleBlur, onKeyDown: handleKeyDown, controlId, placeholder, disabled, ariaLabel, expandToViewport, ariaControls: listId, ariaActivedescendant: highlightedOptionId, ariaDescribedby: joinStrings(searchResultsId, rest.ariaDescribedby), dropdownExpanded: autosuggestItemsState.items.length > 1 || dropdownStatus.content !== null || !!customForm, dropdownContentKey: customForm ? "custom" : "options", dropdownContent: content, dropdownFooter: dropdownStatus.isSticky && dropdownStatus.content ? import_react247.default.createElement(dropdown_footer_default, { content: dropdownStatus.content, hasItems: autosuggestItemsState.items.length >= 1, id: footerId }) : null, dropdownWidth: customForm ? DROPDOWN_WIDTH_CUSTOM_FORM : DROPDOWN_WIDTH_OPTIONS_LIST, dropdownContentFocusable: !!customForm, onCloseDropdown: handleCloseDropdown, onDelayedInput: handleDelayedInput, onPressArrowDown: handlePressArrowDown, onPressArrowUp: handlePressArrowUp, onPressEnter: handlePressEnter })); +}); +var property_filter_autosuggest_default = PropertyFilterAutosuggest; + +// node_modules/@cloudscape-design/components/property-filter/property-editor.js +var import_react248 = __toESM(require_react()); +function PropertyEditor({ property, operator, filter, operatorForm, onCancel, onSubmit, i18nStrings }) { + const [value, onChange] = (0, import_react248.useState)(null); + const submitToken = () => onSubmit({ propertyKey: property.propertyKey, operator, value }); + return import_react248.default.createElement( + "div", + { className: styles_css_default78["property-editor"] }, + import_react248.default.createElement( + "div", + { className: styles_css_default78["property-editor-form"] }, + import_react248.default.createElement(InternalFormField, { label: property.groupValuesLabel }, operatorForm({ value, onChange, operator, filter })) + ), + import_react248.default.createElement( + "div", + { className: styles_css_default78["property-editor-actions"] }, + import_react248.default.createElement(internal_default2, { variant: "link", className: styles_css_default78["property-editor-cancel"], onClick: onCancel }, i18nStrings.cancelActionText), + import_react248.default.createElement(internal_default2, { className: styles_css_default78["property-editor-submit"], onClick: submitToken }, i18nStrings.applyActionText) + ) + ); +} + +// node_modules/@cloudscape-design/components/property-filter/index.js +function getOperatorI18nString(operator) { + switch (operator) { + case "=": + return "equals"; + case "!=": + return "not_equals"; + case ">": + return "greater_than"; + case ">=": + return "greater_than_equal"; + case "<": + return "less_than"; + case "<=": + return "less_than_equal"; + case ":": + return "contains"; + case "!:": + return "not_contains"; + case "^": + return "starts_with"; + case "!^": + return "not_starts_with"; + default: + return operator; + } +} +var PropertyFilter = import_react249.default.forwardRef((_a, ref) => { + var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3; + var { disabled, countText, query, hideOperations, onChange, filteringProperties, filteringOptions = [], customGroupsText = [], disableFreeTextFiltering = false, freeTextFiltering, onLoadItems, virtualScroll, customControl, customFilterActions, filteringPlaceholder, filteringAriaLabel, filteringEmpty, filteringLoadingText, filteringFinishedText, filteringErrorText, filteringRecoveryText, filteringStatusType, asyncProperties, tokenLimit, expandToViewport, tokenLimitShowFewerAriaLabel, tokenLimitShowMoreAriaLabel } = _a, rest = __rest(_a, ["disabled", "countText", "query", "hideOperations", "onChange", "filteringProperties", "filteringOptions", "customGroupsText", "disableFreeTextFiltering", "freeTextFiltering", "onLoadItems", "virtualScroll", "customControl", "customFilterActions", "filteringPlaceholder", "filteringAriaLabel", "filteringEmpty", "filteringLoadingText", "filteringFinishedText", "filteringErrorText", "filteringRecoveryText", "filteringStatusType", "asyncProperties", "tokenLimit", "expandToViewport", "tokenLimitShowFewerAriaLabel", "tokenLimitShowMoreAriaLabel"]); + const { __internalRootRef } = useBaseComponent("PropertyFilter", { + props: { asyncProperties, disableFreeTextFiltering, expandToViewport, hideOperations, tokenLimit, virtualScroll } + }); + const [removedTokenIndex, setRemovedTokenIndex] = (0, import_react249.useState)(null); + const inputRef = (0, import_react249.useRef)(null); + const baseProps = getBaseProps(rest); + const i18n = useInternalI18n("property-filter"); + const i18nStrings = Object.assign(Object.assign({}, rest.i18nStrings), { allPropertiesLabel: i18n("i18nStrings.allPropertiesLabel", (_b = rest.i18nStrings) === null || _b === void 0 ? void 0 : _b.allPropertiesLabel), applyActionText: i18n("i18nStrings.applyActionText", (_c = rest.i18nStrings) === null || _c === void 0 ? void 0 : _c.applyActionText), cancelActionText: i18n("i18nStrings.cancelActionText", (_d = rest.i18nStrings) === null || _d === void 0 ? void 0 : _d.cancelActionText), clearFiltersText: i18n("i18nStrings.clearFiltersText", (_e = rest.i18nStrings) === null || _e === void 0 ? void 0 : _e.clearFiltersText), editTokenHeader: i18n("i18nStrings.editTokenHeader", (_f = rest.i18nStrings) === null || _f === void 0 ? void 0 : _f.editTokenHeader), groupPropertiesText: i18n("i18nStrings.groupPropertiesText", (_g = rest.i18nStrings) === null || _g === void 0 ? void 0 : _g.groupPropertiesText), groupValuesText: i18n("i18nStrings.groupValuesText", (_h = rest.i18nStrings) === null || _h === void 0 ? void 0 : _h.groupValuesText), operationAndText: i18n("i18nStrings.operationAndText", (_j = rest.i18nStrings) === null || _j === void 0 ? void 0 : _j.operationAndText), operationOrText: i18n("i18nStrings.operationOrText", (_k = rest.i18nStrings) === null || _k === void 0 ? void 0 : _k.operationOrText), operatorContainsText: i18n("i18nStrings.operatorContainsText", (_l = rest.i18nStrings) === null || _l === void 0 ? void 0 : _l.operatorContainsText), operatorDoesNotContainText: i18n("i18nStrings.operatorDoesNotContainText", (_m = rest.i18nStrings) === null || _m === void 0 ? void 0 : _m.operatorDoesNotContainText), operatorDoesNotEqualText: i18n("i18nStrings.operatorDoesNotEqualText", (_o = rest.i18nStrings) === null || _o === void 0 ? void 0 : _o.operatorDoesNotEqualText), operatorEqualsText: i18n("i18nStrings.operatorEqualsText", (_p = rest.i18nStrings) === null || _p === void 0 ? void 0 : _p.operatorEqualsText), operatorGreaterOrEqualText: i18n("i18nStrings.operatorGreaterOrEqualText", (_q = rest.i18nStrings) === null || _q === void 0 ? void 0 : _q.operatorGreaterOrEqualText), operatorGreaterText: i18n("i18nStrings.operatorGreaterText", (_r = rest.i18nStrings) === null || _r === void 0 ? void 0 : _r.operatorGreaterText), operatorLessOrEqualText: i18n("i18nStrings.operatorLessOrEqualText", (_s = rest.i18nStrings) === null || _s === void 0 ? void 0 : _s.operatorLessOrEqualText), operatorLessText: i18n("i18nStrings.operatorLessText", (_t = rest.i18nStrings) === null || _t === void 0 ? void 0 : _t.operatorLessText), operatorStartsWithText: i18n("i18nStrings.operatorStartsWithText", (_u = rest.i18nStrings) === null || _u === void 0 ? void 0 : _u.operatorStartsWithText), operatorDoesNotStartWithText: i18n("i18nStrings.operatorDoesNotStartWithText", (_v = rest.i18nStrings) === null || _v === void 0 ? void 0 : _v.operatorDoesNotStartWithText), operatorText: i18n("i18nStrings.operatorText", (_w = rest.i18nStrings) === null || _w === void 0 ? void 0 : _w.operatorText), operatorsText: i18n("i18nStrings.operatorsText", (_x = rest.i18nStrings) === null || _x === void 0 ? void 0 : _x.operatorsText), propertyText: i18n("i18nStrings.propertyText", (_y = rest.i18nStrings) === null || _y === void 0 ? void 0 : _y.propertyText), tokenLimitShowFewer: i18n("i18nStrings.tokenLimitShowFewer", (_z = rest.i18nStrings) === null || _z === void 0 ? void 0 : _z.tokenLimitShowFewer), tokenLimitShowMore: i18n("i18nStrings.tokenLimitShowMore", (_0 = rest.i18nStrings) === null || _0 === void 0 ? void 0 : _0.tokenLimitShowMore), valueText: i18n("i18nStrings.valueText", (_1 = rest.i18nStrings) === null || _1 === void 0 ? void 0 : _1.valueText), removeTokenButtonAriaLabel: i18n("i18nStrings.removeTokenButtonAriaLabel", (_2 = rest.i18nStrings) === null || _2 === void 0 ? void 0 : _2.removeTokenButtonAriaLabel, (format2) => (token) => { + var _a2; + return format2({ + token__operator: getOperatorI18nString(token.operator), + token__propertyKey: (_a2 = token.propertyKey) !== null && _a2 !== void 0 ? _a2 : "", + token__value: token.value + }); + }) }); + (0, import_react249.useImperativeHandle)(ref, () => ({ focus: () => { + var _a2; + return (_a2 = inputRef.current) === null || _a2 === void 0 ? void 0 : _a2.focus(); + } }), []); + const showResults = !!((_3 = query.tokens) === null || _3 === void 0 ? void 0 : _3.length) && !disabled && !!countText; + const { addToken, removeToken, setToken, setOperation, removeAllTokens } = getQueryActions(query, onChange, inputRef); + const [filteringText, setFilteringText] = (0, import_react249.useState)(""); + const { internalProperties, internalOptions, internalQuery, internalFreeText } = (() => { + var _a2, _b2; + const propertyByKey = filteringProperties.reduce((acc, property) => { + var _a3, _b3, _c2, _d2, _e2; + const extendedOperators = ((_a3 = property === null || property === void 0 ? void 0 : property.operators) !== null && _a3 !== void 0 ? _a3 : []).reduce((acc2, operator) => typeof operator === "object" ? acc2.set(operator.operator, operator) : acc2, /* @__PURE__ */ new Map()); + acc.set(property.key, { + propertyKey: property.key, + propertyLabel: (_b3 = property === null || property === void 0 ? void 0 : property.propertyLabel) !== null && _b3 !== void 0 ? _b3 : "", + groupValuesLabel: (_c2 = property === null || property === void 0 ? void 0 : property.groupValuesLabel) !== null && _c2 !== void 0 ? _c2 : "", + propertyGroup: property === null || property === void 0 ? void 0 : property.group, + operators: ((_d2 = property === null || property === void 0 ? void 0 : property.operators) !== null && _d2 !== void 0 ? _d2 : []).map((op) => typeof op === "string" ? op : op.operator), + defaultOperator: (_e2 = property === null || property === void 0 ? void 0 : property.defaultOperator) !== null && _e2 !== void 0 ? _e2 : "=", + getValueFormatter: (operator) => { + var _a4, _b4; + return operator ? (_b4 = (_a4 = extendedOperators.get(operator)) === null || _a4 === void 0 ? void 0 : _a4.format) !== null && _b4 !== void 0 ? _b4 : null : null; + }, + getValueFormRenderer: (operator) => { + var _a4, _b4; + return operator ? (_b4 = (_a4 = extendedOperators.get(operator)) === null || _a4 === void 0 ? void 0 : _a4.form) !== null && _b4 !== void 0 ? _b4 : null : null; + }, + externalProperty: property + }); + return acc; + }, /* @__PURE__ */ new Map()); + const getProperty = (propertyKey) => { + var _a3; + return (_a3 = propertyByKey.get(propertyKey)) !== null && _a3 !== void 0 ? _a3 : null; + }; + const internalOptions2 = filteringOptions.map((option) => { + var _a3, _b3; + return { + property: getProperty(option.propertyKey), + value: option.value, + label: (_b3 = (_a3 = option.label) !== null && _a3 !== void 0 ? _a3 : option.value) !== null && _b3 !== void 0 ? _b3 : "" + }; + }); + const internalQuery2 = { + operation: query.operation, + tokens: query.tokens.map((token) => ({ + property: token.propertyKey ? getProperty(token.propertyKey) : null, + operator: token.operator, + value: token.value + })) + }; + const internalFreeText2 = { + disabled: disableFreeTextFiltering, + operators: (_a2 = freeTextFiltering === null || freeTextFiltering === void 0 ? void 0 : freeTextFiltering.operators) !== null && _a2 !== void 0 ? _a2 : [":", "!:"], + defaultOperator: (_b2 = freeTextFiltering === null || freeTextFiltering === void 0 ? void 0 : freeTextFiltering.defaultOperator) !== null && _b2 !== void 0 ? _b2 : ":" + }; + return { internalProperties: [...propertyByKey.values()], internalOptions: internalOptions2, internalQuery: internalQuery2, internalFreeText: internalFreeText2 }; + })(); + const parsedText = parseText(filteringText, internalProperties, internalFreeText); + const autosuggestOptions = getAutosuggestOptions(parsedText, internalProperties, internalOptions, customGroupsText, i18nStrings); + const createToken = (currentText) => { + const parsedText2 = parseText(currentText, internalProperties, internalFreeText); + let newToken; + switch (parsedText2.step) { + case "property": { + newToken = matchTokenValue({ + property: parsedText2.property, + operator: parsedText2.operator, + value: parsedText2.value + }, internalOptions); + break; + } + case "free-text": { + newToken = { + operator: parsedText2.operator || internalFreeText.defaultOperator, + value: parsedText2.value + }; + break; + } + case "operator": { + newToken = { + operator: internalFreeText.defaultOperator, + value: currentText + }; + break; + } + } + if (internalFreeText.disabled && !("propertyKey" in newToken)) { + return; + } + addToken(newToken); + setFilteringText(""); + }; + const ignoreKeyDown = (0, import_react249.useRef)(false); + const handleKeyDown = (event) => { + if (filteringText && !ignoreKeyDown.current && event.detail.keyCode === KeyCode.enter) { + createToken(filteringText); + } + }; + const getLoadMoreDetail = (parsedText2, filteringText2) => { + const loadMoreDetail2 = { + filteringProperty: void 0, + filteringText: filteringText2, + filteringOperator: void 0 + }; + if (parsedText2.step === "property") { + loadMoreDetail2.filteringProperty = parsedText2.property.externalProperty; + loadMoreDetail2.filteringText = parsedText2.value; + loadMoreDetail2.filteringOperator = parsedText2.operator; + } + return loadMoreDetail2; + }; + const loadMoreDetail = getLoadMoreDetail(parsedText, filteringText); + const inputLoadItemsHandlers = useLoadItems2(onLoadItems, loadMoreDetail.filteringText, loadMoreDetail.filteringProperty, loadMoreDetail.filteringText, loadMoreDetail.filteringOperator); + const asyncProps = { + empty: filteringEmpty, + loadingText: filteringLoadingText, + finishedText: filteringFinishedText, + errorText: filteringErrorText, + recoveryText: filteringRecoveryText, + statusType: filteringStatusType + }; + const asyncAutosuggestProps = !!filteringText.length || asyncProperties ? Object.assign(Object.assign({}, inputLoadItemsHandlers), asyncProps) : {}; + const handleSelected = (event) => { + var _a2; + ignoreKeyDown.current = true; + setTimeout(() => { + ignoreKeyDown.current = false; + }, 0); + const { detail: option } = event; + const value = option.value || ""; + if (!("keepOpenOnSelect" in option)) { + createToken(value); + return; + } + event.preventDefault(); + const parsedText2 = parseText(value, internalProperties, internalFreeText); + const loadMoreDetail2 = getLoadMoreDetail(parsedText2, value); + if (parsedText2.step === "operator") { + const operators = getAllowedOperators(parsedText2.property); + if (value.trim() === parsedText2.property.propertyLabel && operators.length === 1) { + loadMoreDetail2.filteringProperty = (_a2 = parsedText2.property.externalProperty) !== null && _a2 !== void 0 ? _a2 : void 0; + loadMoreDetail2.filteringOperator = operators[0]; + loadMoreDetail2.filteringText = ""; + setFilteringText(parsedText2.property.propertyLabel + " " + operators[0] + " "); + } + } + fireNonCancelableEvent(onLoadItems, Object.assign(Object.assign({}, loadMoreDetail2), { firstPage: true, samePage: false })); + }; + const operatorForm = parsedText.step === "property" && parsedText.property.getValueFormRenderer(parsedText.operator); + const searchResultsId = useUniqueId("property-filter-search-results"); + return import_react249.default.createElement( + "div", + Object.assign({}, baseProps, { className: clsx_m_default(baseProps.className, styles_css_default78.root), ref: __internalRootRef }), + import_react249.default.createElement( + "div", + { className: styles_css_default78["search-field"] }, + customControl && import_react249.default.createElement("div", { className: styles_css_default78["custom-control"] }, customControl), + import_react249.default.createElement(property_filter_autosuggest_default, Object.assign({ ref: inputRef, virtualScroll, enteredTextLabel: i18nStrings.enteredTextLabel, ariaLabel: filteringAriaLabel !== null && filteringAriaLabel !== void 0 ? filteringAriaLabel : i18nStrings.filteringAriaLabel, placeholder: filteringPlaceholder !== null && filteringPlaceholder !== void 0 ? filteringPlaceholder : i18nStrings.filteringPlaceholder, ariaLabelledby: rest.ariaLabelledby, ariaDescribedby: rest.ariaDescribedby, controlId: rest.controlId, value: filteringText, disabled, onKeyDown: handleKeyDown }, autosuggestOptions, { onChange: (event) => setFilteringText(event.detail.value), empty: filteringEmpty }, asyncAutosuggestProps, { expandToViewport, onOptionClick: handleSelected, customForm: operatorForm && import_react249.default.createElement(PropertyEditor, { property: parsedText.property, operator: parsedText.operator, filter: parsedText.value, operatorForm, i18nStrings, onCancel: () => { + var _a2, _b2; + setFilteringText(""); + (_a2 = inputRef.current) === null || _a2 === void 0 ? void 0 : _a2.close(); + (_b2 = inputRef.current) === null || _b2 === void 0 ? void 0 : _b2.focus({ preventDropdown: true }); + }, onSubmit: (token) => { + var _a2, _b2; + addToken(token); + setFilteringText(""); + (_a2 = inputRef.current) === null || _a2 === void 0 ? void 0 : _a2.focus({ preventDropdown: true }); + (_b2 = inputRef.current) === null || _b2 === void 0 ? void 0 : _b2.close(); + } }), hideEnteredTextOption: internalFreeText.disabled && parsedText.step !== "property", clearAriaLabel: i18nStrings.clearAriaLabel, searchResultsId: showResults ? searchResultsId : void 0 })), + showResults ? import_react249.default.createElement( + "div", + { className: styles_css_default78.results }, + import_react249.default.createElement(SearchResults, { id: searchResultsId }, countText) + ) : null + ), + internalQuery.tokens && internalQuery.tokens.length > 0 && import_react249.default.createElement( + "div", + { className: styles_css_default78.tokens }, + import_react249.default.createElement( + InternalSpaceBetween, + { size: "xs", direction: "horizontal" }, + import_react249.default.createElement(TokenList, { alignment: "inline", limit: tokenLimit, items: internalQuery.tokens, limitShowFewerAriaLabel: tokenLimitShowFewerAriaLabel, limitShowMoreAriaLabel: tokenLimitShowMoreAriaLabel, renderItem: (token, tokenIndex) => import_react249.default.createElement(TokenButton, { token, first: tokenIndex === 0, operation: internalQuery.operation, removeToken: () => { + removeToken(tokenIndex); + setRemovedTokenIndex(tokenIndex); + }, setToken: (newToken) => setToken(tokenIndex, newToken), setOperation, filteringProperties: internalProperties, filteringOptions: internalOptions, asyncProps, onLoadItems, i18nStrings, asyncProperties, hideOperations, customGroupsText, freeTextFiltering: internalFreeText, disabled, expandToViewport }), i18nStrings: { + limitShowFewer: i18nStrings.tokenLimitShowFewer, + limitShowMore: i18nStrings.tokenLimitShowMore + }, after: customFilterActions ? import_react249.default.createElement("div", { className: styles_css_default78["custom-filter-actions"] }, customFilterActions) : import_react249.default.createElement(InternalButton, { formAction: "none", onClick: removeAllTokens, className: styles_css_default78["remove-all"], disabled }, i18nStrings.clearFiltersText), moveFocusNextToIndex: removedTokenIndex }) + ) + ) + ); +}); +applyDisplayName(PropertyFilter, "PropertyFilter"); +var property_filter_default = PropertyFilter; + +// node_modules/@cloudscape-design/components/radio-group/index.js +var import_react250 = __toESM(require_react()); +var RadioGroup = import_react250.default.forwardRef((props2, ref) => { + const baseComponentProps = useBaseComponent("RadioGroup"); + return import_react250.default.createElement(internal_default6, Object.assign({ ref }, props2, baseComponentProps)); +}); +applyDisplayName(RadioGroup, "RadioGroup"); +var radio_group_default = RadioGroup; + +// node_modules/@cloudscape-design/components/s3-resource-selector/index.js +var import_react260 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/s3-resource-selector/s3-in-context/index.js +var import_react253 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/s3-resource-selector/s3-in-context/use-versions-fetch.js +var import_react251 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/internal/utils/promises.js +var PromiseCancelledSignal = class { +}; +function makeCancellable(promise) { + let cancelled = false; + const wrapped = promise.then((value) => { + if (cancelled) { + throw new PromiseCancelledSignal(); + } + return value; + }, (err) => { + if (cancelled) { + throw new PromiseCancelledSignal(); + } + throw err; + }); + return { + promise: wrapped, + cancel: () => { + cancelled = true; + }, + isCancelled: () => cancelled + }; +} + +// node_modules/@cloudscape-design/components/s3-resource-selector/s3-in-context/validation.js +var SCHEME = "s3://"; +var BUCKET_FIRST_CHAR = /^[a-z0-9]{1}/; +var CAPITAL_LETTER = /[A-Z]/; +var DNS_NAME = /^(([a-z0-9]|[a-z0-9][a-z0-9-]*[a-z0-9])\.)*([a-z0-9]|[a-z0-9][a-z0-9-]*[a-z0-9])$/; +function checkBucketNameLength(bucketName) { + return 3 <= bucketName.length && bucketName.length <= 63; +} +function extractBucketName(uri) { + const [bucketName, ...rest] = uri.replace(SCHEME, "").split("/"); + return [bucketName, rest.join("/")]; +} +function validate(uri) { + if (uri === "") { + return void 0; + } + if (uri.slice(0, SCHEME.length) !== SCHEME) { + return "validationPathMustBegin"; + } + const [bucketName] = extractBucketName(uri); + if (!BUCKET_FIRST_CHAR.test(bucketName)) { + return "validationBucketLowerCase"; + } + if (CAPITAL_LETTER.test(bucketName)) { + return "validationBucketMustNotContain"; + } + if (!checkBucketNameLength(bucketName)) { + return "validationBucketLength"; + } + if (!DNS_NAME.test(bucketName)) { + return "validationBucketMustComplyDns"; + } + return void 0; +} +function getErrorText(i18n, i18nStrings, errorCode) { + return errorCode ? i18n(`i18nStrings.${errorCode}`, i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings[errorCode]) : void 0; +} + +// node_modules/@cloudscape-design/components/s3-resource-selector/s3-in-context/use-versions-fetch.js +function useVersionsFetch(fetchVersions) { + const [loading, setLoading] = (0, import_react251.useState)(false); + const [lastFetchedValue, setLastFetched] = (0, import_react251.useState)(""); + const [versions, setVersions] = (0, import_react251.useState)([]); + const loadVersions = (uri) => { + if (uri === lastFetchedValue) { + return; + } + setLastFetched(uri); + const errorCode = validate(uri); + const [bucketName, prefix] = extractBucketName(uri); + if (errorCode || !bucketName || !prefix || prefix.slice(-1) === "/") { + return; + } + setLoading(true); + const result = makeCancellable(fetchVersions(bucketName, prefix)); + result.promise.then((versions2) => { + setLoading(false); + setVersions(versions2.map((version) => ({ + value: version.VersionId, + label: version.LastModified + }))); + }, (err) => { + if (!(err instanceof PromiseCancelledSignal)) { + setLoading(false); + } + }); + return result; + }; + return { + loading, + versions, + resetVersions: () => setVersions([]), + // this function is a dependency of useEffect + loadVersions: useStableCallback(loadVersions) + }; +} + +// node_modules/@cloudscape-design/components/s3-resource-selector/s3-in-context/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/s3-resource-selector/s3-in-context/styles.scoped.css"; +var styles_css_default80 = { + "root": "awsui_root_1vtzr_19vlz_9", + "view-button": "awsui_view-button_1vtzr_19vlz_13", + "browse-button": "awsui_browse-button_1vtzr_19vlz_17", + "layout": "awsui_layout_1vtzr_19vlz_21", + "layout-uri": "awsui_layout-uri_1vtzr_19vlz_33", + "layout-version": "awsui_layout-version_1vtzr_19vlz_37", + "layout-divider": "awsui_layout-divider_1vtzr_19vlz_42" +}; + +// node_modules/@cloudscape-design/components/s3-resource-selector/s3-in-context/search-input.js +var import_react252 = __toESM(require_react()); +var SearchInput = import_react252.default.forwardRef((props2, ref) => { + const formFieldContext = useFormFieldContext(props2); + return import_react252.default.createElement(internal_default4, Object.assign({ type: "search" }, props2, formFieldContext, { ref })); +}); + +// node_modules/@cloudscape-design/components/s3-resource-selector/s3-in-context/index.js +var S3InContext = import_react253.default.forwardRef(({ i18nStrings, inputPlaceholder, resource, viewHref, invalid, inputAriaDescribedby, selectableItemsTypes, fetchVersions, onChange, onBrowse }, ref) => { + const i18n = useInternalI18n("s3-resource-selector"); + const isInputBlurredRef = (0, import_react253.useRef)(true); + const [isInputTouched, setInputTouched] = (0, import_react253.useState)(false); + const { versions, loading, loadVersions, resetVersions } = useVersionsFetch(fetchVersions); + const inputRef = (0, import_react253.useRef)(null); + useForwardFocus(ref, inputRef); + const uri = resource.uri; + const supportsVersions = selectableItemsTypes && selectableItemsTypes.indexOf("versions") > -1; + const selectedVersion = versions.filter((version) => version.value === resource.versionId)[0] || null; + function handleUriChange(event) { + const uri2 = event.detail.value; + const errorCode = isInputTouched ? validate(uri2) : void 0; + resetVersions(); + onChange({ uri: uri2 }, getErrorText(i18n, i18nStrings, errorCode)); + } + function handleUriBlur() { + isInputBlurredRef.current = true; + setInputTouched(true); + const errorCode = validate(resource.uri); + onChange(resource, getErrorText(i18n, i18nStrings, errorCode)); + if (supportsVersions) { + loadVersions(resource.uri); + } + } + (0, import_react253.useEffect)(() => { + var _a; + if (!isInputBlurredRef.current || !supportsVersions) { + return; + } + const { cancel } = (_a = loadVersions(uri)) !== null && _a !== void 0 ? _a : {}; + return cancel; + }, [uri, supportsVersions, loadVersions]); + return import_react253.default.createElement( + "div", + { className: styles_css_default80.root }, + import_react253.default.createElement( + "div", + { className: styles_css_default80.layout }, + import_react253.default.createElement( + InternalFormField, + { className: styles_css_default80["layout-uri"], label: i18n("i18nStrings.inContextUriLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.inContextUriLabel), stretch: true }, + import_react253.default.createElement(SearchInput, { ref: inputRef, value: uri, ariaDescribedby: inputAriaDescribedby, clearAriaLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.inContextInputClearAriaLabel, placeholder: inputPlaceholder !== null && inputPlaceholder !== void 0 ? inputPlaceholder : i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.inContextInputPlaceholder, onChange: handleUriChange, invalid, onFocus: () => isInputBlurredRef.current = false, onBlur: handleUriBlur }) + ), + supportsVersions && import_react253.default.createElement( + InternalFormField, + { className: styles_css_default80["layout-version"], label: i18n("i18nStrings.inContextVersionSelectLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.inContextVersionSelectLabel), stretch: true }, + import_react253.default.createElement(internal_default16, { selectedOption: selectedVersion, placeholder: i18n("i18nStrings.inContextSelectPlaceholder", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.inContextSelectPlaceholder), disabled: versions.length === 0, options: versions, onChange: (event) => onChange(Object.assign(Object.assign({}, resource), { versionId: event.detail.selectedOption.value }), void 0), invalid: false }) + ), + import_react253.default.createElement( + "div", + null, + import_react253.default.createElement(InternalButton, { className: styles_css_default80["view-button"], disabled: !viewHref, href: viewHref, target: "_blank", iconName: "external", iconAlign: "right", formAction: "none", ariaLabel: i18n("i18nStrings.inContextViewButtonAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.inContextViewButtonAriaLabel) }, i18n("i18nStrings.inContextViewButton", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.inContextViewButton)) + ), + import_react253.default.createElement("div", { className: styles_css_default80["layout-divider"] }), + import_react253.default.createElement( + "div", + null, + import_react253.default.createElement(InternalButton, { className: styles_css_default80["browse-button"], disabled: loading, formAction: "none", onClick: onBrowse }, i18n("i18nStrings.inContextBrowseButton", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.inContextBrowseButton)) + ) + ), + import_react253.default.createElement("div", { role: "alert", "aria-live": "assertive", "aria-atomic": "true" }, loading && import_react253.default.createElement( + InternalBox, + { margin: { top: "s" } }, + import_react253.default.createElement( + StatusIndicator, + { type: "loading" }, + import_react253.default.createElement(live_region_default, { visible: true }, i18n("i18nStrings.inContextLoadingText", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.inContextLoadingText)) + ) + )) + ); +}); + +// node_modules/@cloudscape-design/components/s3-resource-selector/s3-modal/index.js +var import_react259 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/s3-resource-selector/s3-modal/buckets-table.js +var import_react256 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/s3-resource-selector/s3-modal/table-utils.js +function includes(array, item) { + return !!array && array.indexOf(item) > -1; +} +var compareDates = (itemA, itemB) => { + const timeA = itemA ? new Date(itemA).getTime() : 0; + const timeB = itemB ? new Date(itemB).getTime() : 0; + return timeA - timeB; +}; +function getColumnAriaLabel(i18n, i18nStrings, columnName = "") { + return ({ sorted, descending: descending2 }) => { + var _a, _b, _c, _d, _e, _f; + if (!sorted) { + return (_b = i18n("i18nStrings.labelNotSorted", (_a = i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.labelNotSorted) === null || _a === void 0 ? void 0 : _a.call(i18nStrings, columnName), (format2) => format2({ columnName }))) !== null && _b !== void 0 ? _b : ""; + } + if (descending2) { + return (_d = i18n("i18nStrings.labelSortedDescending", (_c = i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.labelSortedDescending) === null || _c === void 0 ? void 0 : _c.call(i18nStrings, columnName), (format2) => format2({ columnName }))) !== null && _d !== void 0 ? _d : ""; + } + return (_f = i18n("i18nStrings.labelSortedAscending", (_e = i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.labelSortedAscending) === null || _e === void 0 ? void 0 : _e.call(i18nStrings, columnName), (format2) => format2({ columnName }))) !== null && _f !== void 0 ? _f : ""; + }; +} + +// node_modules/@cloudscape-design/components/s3-resource-selector/s3-modal/column-formats.js +var BYTES_BASE = 1024; +var BYTES_DECIMALS = 2; +var BYTES_SIZES = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"]; +function formatDefault(value) { + return value ? value : "-"; +} +function formatSize(bytes) { + if (bytes === void 0) { + return "-"; + } + if (bytes === 0) { + return `0 ${BYTES_SIZES[0]}`; + } + const i = Math.floor(Math.log(bytes) / Math.log(BYTES_BASE)); + return parseFloat((bytes / Math.pow(BYTES_BASE, i)).toFixed(BYTES_DECIMALS)) + " " + BYTES_SIZES[i]; +} + +// node_modules/@cloudscape-design/components/s3-resource-selector/s3-modal/basic-table.js +var import_react255 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/s3-resource-selector/s3-modal/empty-state.js +var import_react254 = __toESM(require_react()); +function EmptyState({ title, subtitle, action }) { + return import_react254.default.createElement( + InternalBox, + { textAlign: "center", color: "inherit" }, + import_react254.default.createElement(InternalBox, { variant: "strong", textAlign: "center", color: "inherit" }, title), + import_react254.default.createElement(InternalBox, { variant: "p", padding: { bottom: "s" }, color: "inherit" }, subtitle), + action + ); +} + +// node_modules/@cloudscape-design/components/s3-resource-selector/s3-modal/basic-table.js +function getSharedI18Strings(i18n, i18nStrings) { + return { + filteringCounterText: i18n("i18nStrings.filteringCounterText", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.filteringCounterText, (format2) => (count) => format2({ count })), + labelRefresh: i18n("i18nStrings.labelRefresh", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.labelRefresh), + labelsPagination: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.labelsPagination, + noMatchTitle: i18n("i18nStrings.filteringNoMatches", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.filteringNoMatches), + noMatchSubtitle: i18n("i18nStrings.filteringCantFindMatch", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.filteringCantFindMatch), + clearFilterButtonText: i18n("i18nStrings.clearFilterButtonText", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.clearFilterButtonText), + filteringClearAriaLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.labelClearFilter + }; +} +function BasicS3Table({ forwardFocusRef, columnDefinitions, fetchData, trackBy, i18nStrings = {}, isVisualRefresh, visibleColumns, isItemDisabled, onSelect }) { + var _a; + const [loading, setLoading] = (0, import_react255.useState)(false); + const [allItems, setAllItems] = (0, import_react255.useState)([]); + const textFilterRef = (0, import_react255.useRef)(null); + const onSelectLatest = useStableCallback(onSelect); + function loadData() { + setLoading(true); + fetchData().then((items2) => { + setAllItems(items2); + setLoading(false); + }).catch(() => { + setLoading(false); + }); + } + (0, import_react255.useEffect)(() => { + loadData(); + }, []); + useForwardFocus(forwardFocusRef, textFilterRef); + const { items, filteredItemsCount, collectionProps, filterProps, paginationProps, actions } = useCollection(allItems, { + selection: { trackBy }, + filtering: { + empty: i18nStrings.emptyText, + noMatch: import_react255.default.createElement(EmptyState, { title: i18nStrings.noMatchTitle, subtitle: i18nStrings.noMatchSubtitle, action: import_react255.default.createElement(InternalButton, { onClick: () => actions.setFiltering("") }, i18nStrings.clearFilterButtonText) }) + }, + pagination: {}, + sorting: {} + }); + const selectedItem = (_a = collectionProps.selectedItems) === null || _a === void 0 ? void 0 : _a[0]; + (0, import_react255.useEffect)(() => { + onSelectLatest(selectedItem); + }, [selectedItem, onSelectLatest]); + return import_react255.default.createElement(internal_default8, Object.assign({ variant: isVisualRefresh ? "borderless" : "container" }, collectionProps, { header: import_react255.default.createElement(InternalHeader, { variant: isVisualRefresh ? "h3" : "h2", headingTagOverride: "h3", actions: import_react255.default.createElement(InternalButton, { iconName: "refresh", ariaLabel: i18nStrings.labelRefresh, onClick: loadData }), counter: selectedItem ? `(1/${allItems.length})` : `(${allItems.length})` }, i18nStrings.header), trackBy, filter: import_react255.default.createElement(internal_default9, Object.assign({}, filterProps, { ref: textFilterRef, filteringAriaLabel: i18nStrings.filteringAriaLabel, filteringClearAriaLabel: i18nStrings.filteringClearAriaLabel, filteringPlaceholder: i18nStrings.filteringPlaceholder, countText: i18nStrings.filteringCounterText ? i18nStrings.filteringCounterText(filteredItemsCount) : "" })), pagination: import_react255.default.createElement(InternalPagination, Object.assign({}, paginationProps, { ariaLabels: i18nStrings.labelsPagination })), selectionType: "single", ariaLabels: i18nStrings.selectionLabels, loading, loadingText: i18nStrings.loadingText, items, visibleColumns, isItemDisabled, columnDefinitions, enableKeyboardNavigation: true })); +} + +// node_modules/@cloudscape-design/components/s3-resource-selector/s3-modal/buckets-table.js +function BucketsTable({ forwardFocusRef, i18nStrings, isVisualRefresh, isItemDisabled, selectableItemsTypes, fetchData, visibleColumns, onDrilldown, onSelect }) { + var _a, _b, _c, _d; + const i18n = useInternalI18n("s3-resource-selector"); + return import_react256.default.createElement(BasicS3Table, { forwardFocusRef, trackBy: "Name", fetchData, visibleColumns, isItemDisabled: isItemDisabled || (() => !includes(selectableItemsTypes, "buckets")), i18nStrings: Object.assign(Object.assign({}, getSharedI18Strings(i18n, i18nStrings)), { header: i18n("i18nStrings.selectionBuckets", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.selectionBuckets), loadingText: i18n("i18nStrings.selectionBucketsLoading", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.selectionBucketsLoading), filteringAriaLabel: (_a = i18n("i18nStrings.labelFiltering", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.labelFiltering, (format2) => (itemsType) => format2({ itemsType }))) === null || _a === void 0 ? void 0 : _a((_b = i18n("i18nStrings.selectionBuckets", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.selectionBuckets)) !== null && _b !== void 0 ? _b : ""), filteringPlaceholder: i18n("i18nStrings.selectionBucketsSearchPlaceholder", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.selectionBucketsSearchPlaceholder), emptyText: i18n("i18nStrings.selectionBucketsNoItems", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.selectionBucketsNoItems), selectionLabels: Object.assign(Object.assign({}, i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.labelsBucketsSelection), { selectionGroupLabel: i18n("i18nStrings.labelsBucketsSelection.selectionGroupLabel", (_c = i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.labelsBucketsSelection) === null || _c === void 0 ? void 0 : _c.selectionGroupLabel), itemSelectionLabel: i18n("i18nStrings.labelsBucketsSelection.itemSelectionLabel", (_d = i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.labelsBucketsSelection) === null || _d === void 0 ? void 0 : _d.itemSelectionLabel, (format2) => (data, item) => { + var _a2; + return format2({ item__Name: (_a2 = item.Name) !== null && _a2 !== void 0 ? _a2 : "" }); + }) }) }), isVisualRefresh, columnDefinitions: [ + { + id: "Name", + header: i18n("i18nStrings.columnBucketName", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.columnBucketName), + ariaLabel: getColumnAriaLabel(i18n, i18nStrings, i18n("i18nStrings.columnBucketName", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.columnBucketName)), + sortingField: "Name", + cell: (item) => { + const isClickable = includes(selectableItemsTypes, "objects") || includes(selectableItemsTypes, "versions"); + return isClickable ? import_react256.default.createElement(internal_default12, { onFollow: () => item.Name && onDrilldown(item.Name), variant: "link" }, item.Name) : item.Name; + }, + minWidth: "250px" + }, + { + id: "CreationDate", + header: i18n("i18nStrings.columnBucketCreationDate", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.columnBucketCreationDate), + ariaLabel: getColumnAriaLabel(i18n, i18nStrings, i18n("i18nStrings.columnBucketCreationDate", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.columnBucketCreationDate)), + sortingComparator: (a2, b) => compareDates(a2.CreationDate, b.CreationDate), + cell: (item) => formatDefault(item.CreationDate) + }, + { + id: "Region", + header: i18n("i18nStrings.columnBucketRegion", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.columnBucketRegion), + ariaLabel: getColumnAriaLabel(i18n, i18nStrings, i18n("i18nStrings.columnBucketRegion", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.columnBucketRegion)), + sortingField: "Region", + cell: (item) => formatDefault(item.Region), + minWidth: "150px" + } + ], onSelect: (item) => { + var _a2; + return onSelect((_a2 = item === null || item === void 0 ? void 0 : item.Name) !== null && _a2 !== void 0 ? _a2 : ""); + } }); +} + +// node_modules/@cloudscape-design/components/s3-resource-selector/s3-modal/objects-table.js +var import_react257 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/s3-resource-selector/utils.js +function joinObjectPath(segments) { + return segments.reduce((prev, next) => { + if (prev && prev[prev.length - 1] !== "/") { + prev = prev + "/"; + } + return prev + next; + }, ""); +} + +// node_modules/@cloudscape-design/components/s3-resource-selector/s3-modal/objects-table.js +function ObjectsTable({ forwardFocusRef, pathSegments, i18nStrings, isVisualRefresh, isItemDisabled, selectableItemsTypes, fetchData, visibleColumns, onDrilldown, onSelect }) { + var _a, _b, _c, _d; + const i18n = useInternalI18n("s3-resource-selector"); + return import_react257.default.createElement(BasicS3Table, { + // remount fresh component every we change the path to reset the inner state (e.g. selection/filtering) + key: pathSegments.join("/"), + forwardFocusRef, + trackBy: "Key", + fetchData: () => { + const [bucketName, ...rest] = pathSegments; + return fetchData(bucketName, joinObjectPath(rest)); + }, + i18nStrings: Object.assign(Object.assign({}, getSharedI18Strings(i18n, i18nStrings)), { header: i18n("i18nStrings.selectionObjects", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.selectionObjects), loadingText: i18n("i18nStrings.selectionObjectsLoading", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.selectionObjectsLoading), filteringAriaLabel: (_a = i18n("i18nStrings.labelFiltering", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.labelFiltering, (format2) => (itemsType) => format2({ itemsType }))) === null || _a === void 0 ? void 0 : _a((_b = i18n("i18nStrings.selectionObjects", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.selectionObjects)) !== null && _b !== void 0 ? _b : ""), filteringPlaceholder: i18n("i18nStrings.selectionObjectsSearchPlaceholder", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.selectionObjectsSearchPlaceholder), emptyText: i18n("i18nStrings.selectionObjectsNoItems", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.selectionObjectsNoItems), selectionLabels: Object.assign(Object.assign({}, i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.labelsObjectsSelection), { selectionGroupLabel: i18n("i18nStrings.labelsObjectsSelection.selectionGroupLabel", (_c = i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.labelsObjectsSelection) === null || _c === void 0 ? void 0 : _c.selectionGroupLabel), itemSelectionLabel: i18n("i18nStrings.labelsObjectsSelection.itemSelectionLabel", (_d = i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.labelsObjectsSelection) === null || _d === void 0 ? void 0 : _d.itemSelectionLabel, (format2) => (data, item) => { + var _a2; + return format2({ item__Key: (_a2 = item.Key) !== null && _a2 !== void 0 ? _a2 : "" }); + }) }) }), + isVisualRefresh, + visibleColumns, + isItemDisabled: isItemDisabled || (() => !includes(selectableItemsTypes, "objects")), + columnDefinitions: [ + { + id: "Key", + header: i18n("i18nStrings.columnObjectKey", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.columnObjectKey), + ariaLabel: getColumnAriaLabel(i18n, i18nStrings, i18n("i18nStrings.columnObjectKey", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.columnObjectKey)), + sortingField: "Key", + cell: (item) => { + const isClickable = item.IsFolder || includes(selectableItemsTypes, "versions"); + return import_react257.default.createElement( + import_react257.default.Fragment, + null, + import_react257.default.createElement(internal_default, { name: item.IsFolder ? "folder" : "file" }), + " ", + isClickable ? import_react257.default.createElement(internal_default12, { onFollow: () => item.Key && onDrilldown(item), variant: "link" }, item.Key) : item.Key + ); + }, + minWidth: "250px" + }, + { + id: "LastModified", + header: i18n("i18nStrings.columnObjectLastModified", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.columnObjectLastModified), + ariaLabel: getColumnAriaLabel(i18n, i18nStrings, i18n("i18nStrings.columnObjectLastModified", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.columnObjectLastModified)), + sortingComparator: (a2, b) => compareDates(a2.LastModified, b.LastModified), + cell: (item) => formatDefault(item.LastModified) + }, + { + id: "Size", + header: i18n("i18nStrings.columnObjectSize", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.columnObjectSize), + ariaLabel: getColumnAriaLabel(i18n, i18nStrings, i18n("i18nStrings.columnObjectSize", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.columnObjectSize)), + sortingField: "Size", + cell: (item) => formatSize(item.Size) + } + ], + onSelect: (item) => { + var _a2; + return onSelect((_a2 = item === null || item === void 0 ? void 0 : item.Key) !== null && _a2 !== void 0 ? _a2 : ""); + } + }); +} + +// node_modules/@cloudscape-design/components/s3-resource-selector/s3-modal/versions-table.js +var import_react258 = __toESM(require_react()); +function VersionsTable({ forwardFocusRef, pathSegments, i18nStrings, isVisualRefresh, isItemDisabled, fetchData, visibleColumns, onSelect }) { + var _a, _b, _c, _d; + const i18n = useInternalI18n("s3-resource-selector"); + return import_react258.default.createElement(BasicS3Table, { forwardFocusRef, trackBy: "VersionId", fetchData: () => { + const [bucketName, ...rest] = pathSegments; + return fetchData(bucketName, joinObjectPath(rest)); + }, i18nStrings: Object.assign(Object.assign({}, getSharedI18Strings(i18n, i18nStrings)), { header: i18n("i18nStrings.selectionVersions", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.selectionVersions), loadingText: i18n("i18nStrings.selectionVersionsLoading", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.selectionVersionsLoading), filteringAriaLabel: (_a = i18n("i18nStrings.labelFiltering", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.labelFiltering, (format2) => (itemsType) => format2({ itemsType }))) === null || _a === void 0 ? void 0 : _a((_b = i18n("i18nStrings.selectionVersions", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.selectionVersions)) !== null && _b !== void 0 ? _b : ""), filteringPlaceholder: i18n("i18nStrings.selectionVersionsSearchPlaceholder", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.selectionVersionsSearchPlaceholder), emptyText: i18n("i18nStrings.selectionVersionsNoItems", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.selectionVersionsNoItems), selectionLabels: Object.assign(Object.assign({}, i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.labelsVersionsSelection), { selectionGroupLabel: i18n("i18nStrings.labelsVersionsSelection.selectionGroupLabel", (_c = i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.labelsVersionsSelection) === null || _c === void 0 ? void 0 : _c.selectionGroupLabel), itemSelectionLabel: i18n("i18nStrings.labelsVersionsSelection.itemSelectionLabel", (_d = i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.labelsVersionsSelection) === null || _d === void 0 ? void 0 : _d.itemSelectionLabel, (format2) => (data, item) => { + var _a2; + return format2({ item__VersionId: (_a2 = item.VersionId) !== null && _a2 !== void 0 ? _a2 : "" }); + }) }) }), isVisualRefresh, visibleColumns, isItemDisabled, columnDefinitions: [ + { + id: "ID", + header: i18n("i18nStrings.columnVersionID", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.columnVersionID), + ariaLabel: getColumnAriaLabel(i18n, i18nStrings, i18n("i18nStrings.columnVersionID", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.columnVersionID)), + sortingField: "VersionId", + cell: (item) => item.VersionId, + minWidth: "250px" + }, + { + id: "LastModified", + header: i18n("i18nStrings.columnVersionLastModified", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.columnVersionLastModified), + ariaLabel: getColumnAriaLabel(i18n, i18nStrings, i18n("i18nStrings.columnVersionLastModified", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.columnVersionLastModified)), + sortingComparator: (a2, b) => compareDates(a2.LastModified, b.LastModified), + cell: (item) => formatDefault(item.LastModified) + }, + { + id: "Size", + header: i18n("i18nStrings.columnVersionSize", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.columnVersionSize), + ariaLabel: getColumnAriaLabel(i18n, i18nStrings, i18n("i18nStrings.columnVersionSize", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.columnVersionSize)), + sortingField: "Size", + cell: (item) => formatSize(item.Size) + } + ], onSelect: (item) => { + var _a2; + return onSelect((_a2 = item === null || item === void 0 ? void 0 : item.VersionId) !== null && _a2 !== void 0 ? _a2 : ""); + } }); +} + +// node_modules/@cloudscape-design/components/s3-resource-selector/s3-modal/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/s3-resource-selector/s3-modal/styles.scoped.css"; +var styles_css_default81 = { + "modal-actions": "awsui_modal-actions_12hyz_1p88p_5", + "submit-button": "awsui_submit-button_12hyz_1p88p_9" +}; + +// node_modules/@cloudscape-design/components/s3-resource-selector/s3-modal/index.js +function assertNever(_value) { + return null; +} +var initialBrowseState = { + selectedItem: null, + currentView: "buckets", + breadcrumbs: [] +}; +function s3BrowseReducer(state, action) { + switch (action.type) { + case "browse-buckets": + return initialBrowseState; + case "browse-objects": + return { + selectedItem: null, + currentView: "objects", + breadcrumbs: action.breadcrumbs + }; + case "browse-versions": + return { + selectedItem: null, + currentView: "versions", + breadcrumbs: action.breadcrumbs + }; + case "select-item": + return Object.assign(Object.assign({}, state), { selectedItem: action.item }); + default: + assertNever(action); + } + return state; +} +function createResourceInfo({ currentView, breadcrumbs, selectedItem }) { + const prefix = "s3://"; + if (currentView === "versions") { + return { uri: prefix + joinObjectPath(breadcrumbs), versionId: selectedItem !== null && selectedItem !== void 0 ? selectedItem : void 0 }; + } + return { uri: prefix + joinObjectPath([...breadcrumbs, selectedItem]) }; +} +function S3Modal({ i18nStrings, alert, selectableItemsTypes, fetchBuckets, bucketsVisibleColumns, bucketsIsItemDisabled, fetchObjects, objectsVisibleColumns, objectsIsItemDisabled, fetchVersions, versionsVisibleColumns, versionsIsItemDisabled, getModalRoot, removeModalRoot, onSubmit, onDismiss }) { + var _a; + const [{ currentView, breadcrumbs, selectedItem }, dispatch] = (0, import_react259.useReducer)(s3BrowseReducer, initialBrowseState); + const forwardFocusRef = (0, import_react259.useRef)(null); + const i18n = useInternalI18n("s3-resource-selector"); + const isVisualRefresh = useVisualRefresh(); + useEffectOnUpdate(() => { + var _a2; + (_a2 = forwardFocusRef.current) === null || _a2 === void 0 ? void 0 : _a2.focus(); + }, [breadcrumbs]); + return import_react259.default.createElement( + "div", + null, + import_react259.default.createElement( + InternalModal, + { visible: true, size: "max", getModalRoot, removeModalRoot, closeAriaLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.labelModalDismiss, onDismiss, header: i18n("i18nStrings.modalTitle", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.modalTitle), footer: import_react259.default.createElement( + InternalSpaceBetween, + { className: styles_css_default81["modal-actions"], size: "xs", direction: "horizontal" }, + import_react259.default.createElement(InternalButton, { variant: "link", formAction: "none", onClick: onDismiss }, i18n("i18nStrings.modalCancelButton", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.modalCancelButton)), + import_react259.default.createElement(InternalButton, { variant: "primary", className: styles_css_default81["submit-button"], disabled: !selectedItem, formAction: "none", onClick: () => onSubmit(createResourceInfo({ currentView, breadcrumbs, selectedItem })) }, i18n("i18nStrings.modalSubmitButton", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.modalSubmitButton)) + ) }, + import_react259.default.createElement( + InternalSpaceBetween, + { size: isVisualRefresh ? "xxs" : "xs" }, + import_react259.default.createElement(InternalBreadcrumbGroup, { ariaLabel: i18n("i18nStrings.labelBreadcrumbs", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.labelBreadcrumbs), expandAriaLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.labelExpandBreadcrumbs, onFollow: (event) => { + event.preventDefault(); + event.detail.item.meta.onClick(); + }, items: [ + { + text: (_a = i18n("i18nStrings.modalBreadcrumbRootItem", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.modalBreadcrumbRootItem)) !== null && _a !== void 0 ? _a : "", + href: "", + meta: { onClick: () => dispatch({ type: "browse-buckets" }) } + }, + ...breadcrumbs.map((segment, index) => ({ + text: segment, + href: "", + meta: { + onClick: () => dispatch({ + type: "browse-objects", + breadcrumbs: breadcrumbs.slice(0, index + 1) + }) + } + })) + ] }), + alert, + currentView === "buckets" ? import_react259.default.createElement(BucketsTable, { forwardFocusRef, fetchData: fetchBuckets, visibleColumns: bucketsVisibleColumns, isItemDisabled: bucketsIsItemDisabled, selectableItemsTypes, i18nStrings, isVisualRefresh, onDrilldown: (path2) => dispatch({ + type: "browse-objects", + breadcrumbs: [path2] + }), onSelect: (item) => dispatch({ type: "select-item", item }) }) : currentView === "objects" ? import_react259.default.createElement(ObjectsTable, { forwardFocusRef, pathSegments: breadcrumbs, fetchData: fetchObjects, visibleColumns: objectsVisibleColumns, isItemDisabled: objectsIsItemDisabled, selectableItemsTypes, i18nStrings, isVisualRefresh, onDrilldown: (item) => { + dispatch({ + type: item.IsFolder ? "browse-objects" : "browse-versions", + breadcrumbs: [...breadcrumbs, item.Key] + }); + }, onSelect: (item) => dispatch({ type: "select-item", item }) }) : currentView === "versions" ? import_react259.default.createElement(VersionsTable, { forwardFocusRef, pathSegments: breadcrumbs, fetchData: fetchVersions, visibleColumns: versionsVisibleColumns, isItemDisabled: versionsIsItemDisabled, i18nStrings, isVisualRefresh, onSelect: (item) => dispatch({ type: "select-item", item }) }) : assertNever(currentView) + ) + ) + ); +} + +// node_modules/@cloudscape-design/components/s3-resource-selector/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/s3-resource-selector/styles.scoped.css"; +var styles_css_default82 = { + "root": "awsui_root_1u0yw_rfo7y_5", + "alert": "awsui_alert_1u0yw_rfo7y_9" +}; + +// node_modules/@cloudscape-design/components/s3-resource-selector/index.js +var S3ResourceSelector = import_react260.default.forwardRef((_a, ref) => { + var { i18nStrings, inputPlaceholder, alert, resource, viewHref, invalid, selectableItemsTypes = [], inputAriaDescribedby, bucketsVisibleColumns = ["Name", "CreationDate"], bucketsIsItemDisabled, fetchBuckets, fetchObjects, objectsVisibleColumns = ["Key", "LastModified", "Size"], objectsIsItemDisabled, fetchVersions, versionsVisibleColumns = ["ID", "LastModified", "Size"], versionsIsItemDisabled, onChange, ariaLabel, getModalRoot, removeModalRoot } = _a, rest = __rest(_a, ["i18nStrings", "inputPlaceholder", "alert", "resource", "viewHref", "invalid", "selectableItemsTypes", "inputAriaDescribedby", "bucketsVisibleColumns", "bucketsIsItemDisabled", "fetchBuckets", "fetchObjects", "objectsVisibleColumns", "objectsIsItemDisabled", "fetchVersions", "versionsVisibleColumns", "versionsIsItemDisabled", "onChange", "ariaLabel", "getModalRoot", "removeModalRoot"]); + checkSafeUrl("S3ResourceSelector", viewHref); + const { __internalRootRef } = useBaseComponent("S3ResourceSelector"); + const [modalOpen, setModalOpen] = (0, import_react260.useState)(false); + const inContextRef = (0, import_react260.useRef)(null); + const modalWasSubmitted = (0, import_react260.useRef)(false); + useForwardFocus(ref, inContextRef); + const { ariaLabelledby, ariaDescribedby } = useFormFieldContext(rest); + (0, import_react260.useEffect)(() => { + var _a2; + if (!modalOpen && modalWasSubmitted.current) { + modalWasSubmitted.current = false; + (_a2 = inContextRef.current) === null || _a2 === void 0 ? void 0 : _a2.focus(); + } + }, [modalOpen]); + const baseProps = getBaseProps(rest); + const modalProps = { + alert, + i18nStrings, + fetchBuckets, + selectableItemsTypes, + bucketsVisibleColumns, + bucketsIsItemDisabled, + fetchObjects, + objectsVisibleColumns, + objectsIsItemDisabled, + fetchVersions, + versionsVisibleColumns, + versionsIsItemDisabled, + getModalRoot, + removeModalRoot, + onSubmit: (resource2) => { + fireNonCancelableEvent(onChange, { resource: resource2 }); + setModalOpen(false); + modalWasSubmitted.current = true; + }, + onDismiss: () => setModalOpen(false) + }; + return import_react260.default.createElement( + "div", + Object.assign({}, baseProps, { className: clsx_m_default(styles_css_default82.root, baseProps.className), ref: __internalRootRef, role: "group", "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, "aria-label": ariaLabel }), + import_react260.default.createElement(S3InContext, { ref: inContextRef, selectableItemsTypes, i18nStrings, inputPlaceholder, resource, viewHref, invalid, inputAriaDescribedby, fetchVersions, onBrowse: () => setModalOpen(true), onChange: (resource2, errorText) => fireNonCancelableEvent(onChange, { resource: resource2, errorText }) }), + !modalOpen && alert && import_react260.default.createElement(InternalBox, { className: styles_css_default82.alert, margin: { top: "s" } }, alert), + modalOpen && import_react260.default.createElement(S3Modal, Object.assign({}, modalProps)) + ); +}); +applyDisplayName(S3ResourceSelector, "S3ResourceSelector"); +var s3_resource_selector_default = S3ResourceSelector; + +// node_modules/@cloudscape-design/components/segmented-control/index.js +var import_react261 = __toESM(require_react()); +function SegmentedControl(props2) { + const baseComponentProps = useBaseComponent("SegmentedControl"); + return import_react261.default.createElement(InternalSegmentedControl2, Object.assign({}, props2, baseComponentProps)); +} +applyDisplayName(SegmentedControl, "SegmentedControl"); + +// node_modules/@cloudscape-design/components/select/index.js +var import_react262 = __toESM(require_react()); +var Select = import_react262.default.forwardRef((_a, ref) => { + var { options = [], filteringType = "none", statusType = "finished", triggerVariant = "label" } = _a, restProps = __rest(_a, ["options", "filteringType", "statusType", "triggerVariant"]); + const baseComponentProps = useBaseComponent("Select", { + props: { + autoFocus: restProps.autoFocus, + expandToViewport: restProps.expandToViewport, + filteringType, + triggerVariant, + virtualScroll: restProps.virtualScroll + } + }); + const externalProps = getExternalProps(restProps); + return import_react262.default.createElement(internal_default16, Object.assign({ options, filteringType, statusType, triggerVariant }, externalProps, baseComponentProps, { ref })); +}); +applyDisplayName(Select, "Select"); +var select_default = Select; + +// node_modules/@cloudscape-design/components/side-navigation/index.js +var import_react264 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/side-navigation/internal.js +var import_react263 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/side-navigation/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/side-navigation/styles.scoped.css"; +var styles_css_default83 = { + "root": "awsui_root_l0dv0_s3klw_99", + "header": "awsui_header_l0dv0_s3klw_136", + "header-link": "awsui_header-link_l0dv0_s3klw_149", + "header-link--has-logo": "awsui_header-link--has-logo_l0dv0_s3klw_159", + "header-link-text": "awsui_header-link-text_l0dv0_s3klw_159", + "header-logo": "awsui_header-logo_l0dv0_s3klw_164", + "header-logo--stretched": "awsui_header-logo--stretched_l0dv0_s3klw_170", + "list-container": "awsui_list-container_l0dv0_s3klw_175", + "list": "awsui_list_l0dv0_s3klw_175", + "list-variant-root": "awsui_list-variant-root_l0dv0_s3klw_187", + "list-variant-root--last": "awsui_list-variant-root--last_l0dv0_s3klw_194", + "list-variant-expandable-link-group": "awsui_list-variant-expandable-link-group_l0dv0_s3klw_198", + "list-item": "awsui_list-item_l0dv0_s3klw_202", + "section": "awsui_section_l0dv0_s3klw_210", + "expandable-link-group": "awsui_expandable-link-group_l0dv0_s3klw_211", + "section--no-ident": "awsui_section--no-ident_l0dv0_s3klw_214", + "expandable-link-group--no-ident": "awsui_expandable-link-group--no-ident_l0dv0_s3klw_215", + "refresh": "awsui_refresh_l0dv0_s3klw_223", + "list-variant-section-group": "awsui_list-variant-section-group_l0dv0_s3klw_231", + "section-group": "awsui_section-group_l0dv0_s3klw_238", + "section-group-title": "awsui_section-group-title_l0dv0_s3klw_249", + "link": "awsui_link_l0dv0_s3klw_253", + "link-active": "awsui_link-active_l0dv0_s3klw_262", + "info": "awsui_info_l0dv0_s3klw_299", + "external-icon": "awsui_external-icon_l0dv0_s3klw_303", + "divider": "awsui_divider_l0dv0_s3klw_307", + "divider-default": "awsui_divider-default_l0dv0_s3klw_313", + "divider-header": "awsui_divider-header_l0dv0_s3klw_318" +}; + +// node_modules/@cloudscape-design/components/side-navigation/util.js +function hasActiveLink(items, activeHref) { + for (const item of items) { + if ((item.type === "link" || item.type === "link-group" || item.type === "expandable-link-group") && item.href === activeHref) { + return true; + } + if ((item.type === "section" || item.type === "link-group" || item.type === "expandable-link-group") && hasActiveLink(item.items, activeHref)) { + return true; + } + } + return false; +} +function generateExpandableItemsMapping(items, mapping = /* @__PURE__ */ new WeakMap(), expandableParents = []) { + items.forEach((item) => { + const nextLevelParents = expandableParents.slice(); + if (item.type === "section" || item.type === "expandable-link-group") { + mapping.set(item, expandableParents); + nextLevelParents.unshift(item); + } + if (item.type === "section" || item.type === "link-group" || item.type === "expandable-link-group") { + generateExpandableItemsMapping(item.items, mapping, nextLevelParents); + } + }); + return mapping; +} +function checkDuplicateHrefs(items) { + const hrefs = /* @__PURE__ */ new Set(); + const queue = items.slice(); + while (queue.length > 0) { + const item = queue.shift(); + if ("href" in item) { + if (hrefs.has(item.href)) { + warnOnce("SideNavigation", `duplicate href in "${item.text}": ${item.href}`); + } + hrefs.add(item.href); + } + if ("items" in item) { + queue.push(...item.items); + } + } +} + +// node_modules/@cloudscape-design/components/side-navigation/internal.js +function Header3({ definition, activeHref, fireFollow }) { + checkSafeUrl("SideNavigation", definition.href); + const onClick = (0, import_react263.useCallback)((event) => { + if (isPlainLeftClick(event)) { + fireFollow(definition, event); + } + }, [fireFollow, definition]); + return import_react263.default.createElement( + import_react263.default.Fragment, + null, + import_react263.default.createElement( + "h2", + { className: styles_css_default83.header }, + import_react263.default.createElement( + "a", + { href: definition.href, className: clsx_m_default(styles_css_default83["header-link"], { [styles_css_default83["header-link--has-logo"]]: !!definition.logo }), "aria-current": definition.href === activeHref ? "page" : void 0, onClick }, + definition.logo && import_react263.default.createElement("img", Object.assign({ className: clsx_m_default(styles_css_default83["header-logo"], { + [styles_css_default83["header-logo--stretched"]]: !definition.text + }) }, definition.logo)), + import_react263.default.createElement("span", { className: styles_css_default83["header-link-text"] }, definition.text) + ) + ), + import_react263.default.createElement(Divider2, { isPresentational: true, variant: "header" }) + ); +} +function NavigationItemsList({ items, variant, activeHref, fireChange, fireFollow }) { + const lists = []; + let currentListIndex = 0; + lists[currentListIndex] = { + listVariant: variant, + items: [] + }; + items.forEach((item, index) => { + var _a, _b, _c, _d, _e; + const itemid = index + 1; + switch (item.type) { + case "divider": { + const dividerIndex = lists.length; + lists[dividerIndex] = { + element: import_react263.default.createElement( + "div", + { "data-itemid": `item-${itemid}` }, + import_react263.default.createElement(Divider2, { variant: "default" }) + ) + }; + currentListIndex = lists.length; + lists[currentListIndex] = { + listVariant: variant, + items: [] + }; + return; + } + case "link": { + (_a = lists[currentListIndex].items) === null || _a === void 0 ? void 0 : _a.push({ + element: import_react263.default.createElement( + "li", + { key: index, "data-itemid": `item-${itemid}`, className: styles_css_default83["list-item"] }, + import_react263.default.createElement(Link2, { definition: item, activeHref, fireChange, fireFollow }) + ) + }); + return; + } + case "section": { + (_b = lists[currentListIndex].items) === null || _b === void 0 ? void 0 : _b.push({ + element: import_react263.default.createElement( + "li", + { key: index, "data-itemid": `item-${itemid}`, className: styles_css_default83["list-item"] }, + import_react263.default.createElement(Section, { definition: item, activeHref, variant, fireChange, fireFollow }) + ) + }); + return; + } + case "section-group": { + (_c = lists[currentListIndex].items) === null || _c === void 0 ? void 0 : _c.push({ + element: import_react263.default.createElement( + "li", + { key: index, "data-itemid": `item-${itemid}`, className: styles_css_default83["list-item"] }, + import_react263.default.createElement(SectionGroup, { definition: item, activeHref, fireChange, fireFollow }) + ) + }); + return; + } + case "link-group": { + (_d = lists[currentListIndex].items) === null || _d === void 0 ? void 0 : _d.push({ + element: import_react263.default.createElement( + "li", + { key: index, "data-itemid": `item-${itemid}`, className: styles_css_default83["list-item"] }, + import_react263.default.createElement(LinkGroup, { definition: item, activeHref, fireChange, fireFollow }) + ) + }); + return; + } + case "expandable-link-group": { + (_e = lists[currentListIndex].items) === null || _e === void 0 ? void 0 : _e.push({ + element: import_react263.default.createElement( + "li", + { key: index, "data-itemid": `item-${itemid}`, className: styles_css_default83["list-item"] }, + import_react263.default.createElement(ExpandableLinkGroup, { definition: item, activeHref, fireChange, fireFollow, variant }) + ) + }); + return; + } + } + }); + const lastListIndex = lists.length - 1; + return import_react263.default.createElement(import_react263.default.Fragment, null, lists.map((list, index) => { + if (!list.items || list.items.length === 0) { + return import_react263.default.createElement("div", { key: `hr-${index}`, className: clsx_m_default(styles_css_default83.list, styles_css_default83[`list-variant-${variant}`], { + [styles_css_default83["list-variant-root--last"]]: list.listVariant === "root" && index === lastListIndex + }) }, list.element); + } else { + return import_react263.default.createElement("ul", { key: `list-${index}`, className: clsx_m_default(styles_css_default83.list, styles_css_default83[`list-variant-${list.listVariant}`], { + [styles_css_default83["list-variant-root--last"]]: list.listVariant === "root" && index === lastListIndex + }) }, list.items.map((item) => item.element)); + } + })); +} +function Divider2({ variant = "default", isPresentational = false }) { + return import_react263.default.createElement("hr", { className: clsx_m_default(styles_css_default83.divider, styles_css_default83[`divider-${variant}`]), role: isPresentational ? "presentation" : void 0 }); +} +function Link2({ definition, expanded, activeHref, fireFollow }) { + checkSafeUrl("SideNavigation", definition.href); + const isActive = definition.href === activeHref; + const onClick = (0, import_react263.useCallback)((event) => { + if (isPlainLeftClick(event)) { + fireFollow(definition, event); + } + }, [fireFollow, definition]); + return import_react263.default.createElement( + import_react263.default.Fragment, + null, + import_react263.default.createElement( + "a", + { href: definition.href, className: clsx_m_default(styles_css_default83.link, { [styles_css_default83["link-active"]]: isActive }), target: definition.external ? "_blank" : void 0, rel: definition.external ? "noopener noreferrer" : void 0, "aria-expanded": expanded, "aria-current": definition.href === activeHref ? "page" : void 0, onClick }, + definition.text, + definition.external && import_react263.default.createElement( + "span", + { "aria-label": definition.externalIconAriaLabel, role: definition.externalIconAriaLabel ? "img" : void 0 }, + import_react263.default.createElement(internal_default, { name: "external", className: styles_css_default83["external-icon"] }) + ) + ), + definition.info && import_react263.default.createElement("span", { className: styles_css_default83.info }, definition.info) + ); +} +function Section({ definition, activeHref, fireFollow, fireChange, variant }) { + var _a; + const [expanded, setExpanded] = (0, import_react263.useState)((_a = definition.defaultExpanded) !== null && _a !== void 0 ? _a : true); + const isVisualRefresh = useVisualRefresh(); + const onExpandedChange = (0, import_react263.useCallback)((e) => { + fireChange(definition, e.detail.expanded); + setExpanded(e.detail.expanded); + }, [definition, fireChange]); + (0, import_react263.useEffect)(() => { + var _a2; + setExpanded((_a2 = definition.defaultExpanded) !== null && _a2 !== void 0 ? _a2 : true); + }, [definition]); + return import_react263.default.createElement( + InternalExpandableSection, + { variant: "footer", expanded, onChange: onExpandedChange, className: clsx_m_default(styles_css_default83.section, variant === "section-group" && styles_css_default83["section--no-ident"], isVisualRefresh && styles_css_default83.refresh), headerText: definition.text }, + import_react263.default.createElement(NavigationItemsList, { variant: "section", items: definition.items, fireFollow, fireChange, activeHref }) + ); +} +function SectionGroup({ definition, activeHref, fireFollow, fireChange }) { + return import_react263.default.createElement( + "div", + { className: styles_css_default83["section-group"] }, + import_react263.default.createElement(InternalBox, { className: styles_css_default83["section-group-title"], variant: "h3" }, definition.title), + import_react263.default.createElement(NavigationItemsList, { variant: "section-group", items: definition.items, fireFollow, fireChange, activeHref }) + ); +} +function LinkGroup({ definition, activeHref, fireFollow, fireChange }) { + checkSafeUrl("SideNavigation", definition.href); + return import_react263.default.createElement( + import_react263.default.Fragment, + null, + import_react263.default.createElement(Link2, { definition: { type: "link", href: definition.href, text: definition.text, info: definition.info }, fireFollow: (_, event) => fireFollow(definition, event), fireChange, activeHref }), + import_react263.default.createElement(NavigationItemsList, { variant: "link-group", items: definition.items, fireFollow, fireChange, activeHref }) + ); +} +function ExpandableLinkGroup({ definition, fireFollow, fireChange, activeHref, variant }) { + const containsActiveLink = (0, import_react263.useMemo)(() => { + return activeHref ? hasActiveLink(definition.items, activeHref) : false; + }, [activeHref, definition.items]); + const [expanded, setExpanded] = (0, import_react263.useState)(() => { + var _a; + return (_a = definition.defaultExpanded) !== null && _a !== void 0 ? _a : definition.href === activeHref || containsActiveLink; + }); + const [userExpanded, setUserExpanded] = (0, import_react263.useState)(); + (0, import_react263.useEffect)(() => setUserExpanded(void 0), [definition]); + (0, import_react263.useEffect)(() => { + setExpanded(definition.href === activeHref || containsActiveLink); + }, [definition.href, containsActiveLink, activeHref]); + (0, import_react263.useEffect)(() => { + if (definition.defaultExpanded !== void 0) { + setExpanded(definition.defaultExpanded); + } + }, [definition]); + const onExpandedChange = (0, import_react263.useCallback)((e) => { + fireChange(definition, e.detail.expanded); + setUserExpanded(e.detail.expanded); + }, [definition, fireChange]); + const onHeaderFollow = (_, event) => { + fireFollow(definition, event); + setUserExpanded(true); + if (!expanded) { + fireChange(definition, true); + } + }; + return import_react263.default.createElement( + InternalExpandableSection, + { className: clsx_m_default(styles_css_default83["expandable-link-group"], variant === "section-group" && styles_css_default83["expandable-link-group--no-ident"]), variant: "navigation", expanded: userExpanded !== null && userExpanded !== void 0 ? userExpanded : expanded, onChange: onExpandedChange, headerText: import_react263.default.createElement(Link2, { definition: { type: "link", href: definition.href, text: definition.text }, expanded: userExpanded !== null && userExpanded !== void 0 ? userExpanded : expanded, fireFollow: onHeaderFollow, fireChange, activeHref }) }, + import_react263.default.createElement(NavigationItemsList, { variant: "expandable-link-group", items: definition.items, fireFollow, fireChange, activeHref }) + ); +} + +// node_modules/@cloudscape-design/components/side-navigation/index.js +function SideNavigation(_a) { + var { header, activeHref, items = [], onFollow, onChange } = _a, props2 = __rest(_a, ["header", "activeHref", "items", "onFollow", "onChange"]); + const { __internalRootRef } = useBaseComponent("SideNavigation"); + const baseProps = getBaseProps(props2); + const parentMap = (0, import_react264.useMemo)(() => generateExpandableItemsMapping(items), [items]); + if (isDevelopment) { + (0, import_react264.useEffect)(() => checkDuplicateHrefs(items), [items]); + } + const onChangeHandler = (0, import_react264.useCallback)((item, expanded) => { + fireNonCancelableEvent(onChange, { item, expanded, expandableParents: parentMap.get(item) }); + }, [onChange, parentMap]); + const onFollowHandler = (0, import_react264.useCallback)((item, sourceEvent) => { + fireCancelableEvent(onFollow, item, sourceEvent); + }, [onFollow]); + return import_react264.default.createElement( + "div", + Object.assign({}, baseProps, { className: clsx_m_default(styles_css_default83.root, baseProps.className), ref: __internalRootRef }), + header && import_react264.default.createElement(Header3, { definition: header, activeHref, fireChange: onChangeHandler, fireFollow: onFollowHandler }), + items && import_react264.default.createElement( + "div", + { className: styles_css_default83["list-container"] }, + import_react264.default.createElement(NavigationItemsList, { variant: "root", items, fireFollow: onFollowHandler, fireChange: onChangeHandler, activeHref }) + ) + ); +} +applyDisplayName(SideNavigation, "SideNavigation"); + +// node_modules/@cloudscape-design/components/spinner/index.js +var import_react265 = __toESM(require_react()); +function Spinner(_a) { + var { size = "normal", variant = "normal" } = _a, props2 = __rest(_a, ["size", "variant"]); + const baseComponentProps = useBaseComponent("Spinner", { + props: { size, variant } + }); + return import_react265.default.createElement(InternalSpinner, Object.assign({ size, variant }, props2, baseComponentProps)); +} +applyDisplayName(Spinner, "Spinner"); + +// node_modules/@cloudscape-design/components/split-panel/index.js +var import_react277 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/split-panel/widget.js +var import_react276 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/split-panel/implementation.js +var import_react275 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/split-panel/preferences-modal.js +var import_react272 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/tiles/internal.js +var import_react267 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/tiles/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/tiles/styles.scoped.css"; +var styles_css_default84 = { + "column-layout": "awsui_column-layout_vj6p7_147sx_99", + "grid": "awsui_grid_vj6p7_147sx_134", + "grid-no-gutters": "awsui_grid-no-gutters_vj6p7_147sx_140", + "grid-variant-text-grid": "awsui_grid-variant-text-grid_vj6p7_147sx_144", + "grid-breakpoint-default": "awsui_grid-breakpoint-default_vj6p7_147sx_152", + "grid-columns-1": "awsui_grid-columns-1_vj6p7_147sx_155", + "grid-breakpoint-xxs": "awsui_grid-breakpoint-xxs_vj6p7_147sx_155", + "grid-breakpoint-xs": "awsui_grid-breakpoint-xs_vj6p7_147sx_158", + "grid-columns-2": "awsui_grid-columns-2_vj6p7_147sx_161", + "grid-columns-3": "awsui_grid-columns-3_vj6p7_147sx_167", + "grid-columns-4": "awsui_grid-columns-4_vj6p7_147sx_173", + "grid-vertical-borders": "awsui_grid-vertical-borders_vj6p7_147sx_189", + "grid-horizontal-borders": "awsui_grid-horizontal-borders_vj6p7_147sx_222", + "root": "awsui_root_vj6p7_147sx_276", + "tile-container": "awsui_tile-container_vj6p7_147sx_314", + "refresh": "awsui_refresh_vj6p7_147sx_329", + "has-metadata": "awsui_has-metadata_vj6p7_147sx_333", + "selected": "awsui_selected_vj6p7_147sx_339", + "disabled": "awsui_disabled_vj6p7_147sx_344", + "columns": "awsui_columns_vj6p7_147sx_360", + "column-1": "awsui_column-1_vj6p7_147sx_366", + "breakpoint-xs": "awsui_breakpoint-xs_vj6p7_147sx_374", + "breakpoint-xxs": "awsui_breakpoint-xxs_vj6p7_147sx_379", + "column-2": "awsui_column-2_vj6p7_147sx_384", + "column-3": "awsui_column-3_vj6p7_147sx_402", + "column-4": "awsui_column-4_vj6p7_147sx_420", + "control": "awsui_control_vj6p7_147sx_439", + "no-image": "awsui_no-image_vj6p7_147sx_443", + "image": "awsui_image_vj6p7_147sx_447" +}; + +// node_modules/@cloudscape-design/components/tiles/tile.js +var import_react266 = __toESM(require_react()); +var Tile = import_react266.default.forwardRef(({ item, selected, name, breakpoint, onChange }, forwardedRef) => { + const internalRef = (0, import_react266.useRef)(null); + const isVisualRefresh = useVisualRefresh(); + const mergedRef = useMergeRefs(internalRef, forwardedRef); + return import_react266.default.createElement( + "div", + { className: clsx_m_default(styles_css_default84["tile-container"], { [styles_css_default84["has-metadata"]]: item.description || item.image }, { [styles_css_default84.selected]: selected }, { [styles_css_default84.disabled]: !!item.disabled }, { [styles_css_default84.refresh]: isVisualRefresh }, styles_css_default84[`breakpoint-${breakpoint}`]), "data-value": item.value, onClick: () => { + var _a; + if (item.disabled) { + return; + } + (_a = internalRef.current) === null || _a === void 0 ? void 0 : _a.focus(); + if (!selected) { + fireNonCancelableEvent(onChange, { value: item.value }); + } + } }, + import_react266.default.createElement( + "div", + { className: clsx_m_default(styles_css_default84.control, { [styles_css_default84["no-image"]]: !item.image }) }, + import_react266.default.createElement(radio_button_default, { checked: selected, ref: mergedRef, name, value: item.value, label: item.label, description: item.description, disabled: item.disabled, controlId: item.controlId }) + ), + item.image && import_react266.default.createElement("div", { className: clsx_m_default(styles_css_default84.image, { [styles_css_default84.disabled]: !!item.disabled }) }, item.image) + ); +}); + +// node_modules/@cloudscape-design/components/tiles/internal.js +var COLUMN_TRIGGERS = ["default", "xxs", "xs"]; +var InternalTiles = import_react267.default.forwardRef((_a, ref) => { + var { name, value, items, ariaLabel, ariaRequired, ariaControls, columns, onChange, __internalRootRef = null } = _a, rest = __rest(_a, ["name", "value", "items", "ariaLabel", "ariaRequired", "ariaControls", "columns", "onChange", "__internalRootRef"]); + const baseProps = getBaseProps(rest); + const { ariaDescribedby, ariaLabelledby } = useFormFieldContext(rest); + const generatedName = useUniqueId("awsui-tiles-"); + const [tileRef, tileRefIndex] = useRadioGroupForwardFocus(ref, items, value); + const [breakpoint, breakpointRef] = useContainerBreakpoints(COLUMN_TRIGGERS); + const mergedRef = useMergeRefs(breakpointRef, __internalRootRef); + const columnCount = getColumnCount(items, columns); + return import_react267.default.createElement( + "div", + Object.assign({ role: "radiogroup", "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, "aria-required": ariaRequired, "aria-controls": ariaControls }, baseProps, { className: clsx_m_default(baseProps.className, styles_css_default84.root), ref: mergedRef }), + import_react267.default.createElement("div", { className: clsx_m_default(styles_css_default84.columns, styles_css_default84[`column-${columnCount}`]) }, items && items.map((item, index) => import_react267.default.createElement(Tile, { ref: index === tileRefIndex ? tileRef : void 0, key: item.value, item, selected: item.value === value, name: name || generatedName, breakpoint, onChange }))) + ); +}); +function getColumnCount(items, columns) { + if (columns) { + return columns; + } + const nItems = items ? items.length : 0; + const columnsLookup = { + 0: 1, + 1: 1, + 2: 2, + 4: 2, + 8: 2 + }; + return columnsLookup[nItems] || 3; +} +var internal_default20 = InternalTiles; + +// node_modules/@cloudscape-design/components/split-panel/icons/side-position.js +var import_react268 = __toESM(require_react()); +var sidePositionIcon = import_react268.default.createElement( + "svg", + { focusable: false, viewBox: "0 0 239 134", version: "1.1", xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", "aria-hidden": "true" }, + import_react268.default.createElement( + "g", + { stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd" }, + import_react268.default.createElement( + "g", + null, + import_react268.default.createElement("rect", { className: styles_css_default23["preference-icon--layout-border"], strokeWidth: "2", x: "1", y: "1", width: "223", height: "125", rx: "2" }), + import_react268.default.createElement("rect", { className: styles_css_default23["preference-icon--layout-background"], x: "11.25", y: "0", width: "203.4375", height: "125" }), + import_react268.default.createElement("path", { className: styles_css_default23["preference-icon--layout-header"], d: "M2,0 L223,0 C224.104569,-2.02906125e-16 225,0.8954305 225,2 L225,10 L225,10 L0,10 L0,2 C-1.3527075e-16,0.8954305 0.8954305,2.02906125e-16 2,0 Z" }) + ), + import_react268.default.createElement( + "g", + { transform: "translate(20.000000, 22.000000)" }, + import_react268.default.createElement("rect", { className: styles_css_default23["preference-icon--border"], strokeWidth: "2", x: "1", y: "1", width: "182", height: "110", rx: "2" }), + import_react268.default.createElement("rect", { className: styles_css_default23["preference-icon--primary-button"], x: "152", y: "6", width: "26", height: "10" }), + import_react268.default.createElement("rect", { className: styles_css_default23["preference-icon--disabled-element"], x: "122", y: "6", width: "26", height: "10" }), + import_react268.default.createElement("rect", { className: styles_css_default23["preference-icon--disabled-element"], x: "92", y: "6", width: "26", height: "10" }), + import_react268.default.createElement("rect", { className: styles_css_default23["preference-icon--disabled-element"], x: "122", y: "29", width: "55", height: "3" }), + import_react268.default.createElement("rect", { className: styles_css_default23["preference-icon--disabled-element"], x: "92", y: "29", width: "26", height: "3" }), + import_react268.default.createElement("polygon", { className: styles_css_default23["preference-icon--focus-text"], points: "19 29 49 29 49 32 19 32" }), + import_react268.default.createElement("polygon", { className: styles_css_default23["preference-icon--focus-text"], points: "10 10 40 10 40 13 10 13" }), + import_react268.default.createElement("polygon", { className: styles_css_default23["preference-icon--disabled-element"], points: "10 29 13 29 13 32 10 32" }), + import_react268.default.createElement("line", { className: styles_css_default23["preference-icon--separator"], x1: "3", y1: "22.7619048", x2: "181", y2: "22.7619048", strokeWidth: "2", strokeLinecap: "square" }), + import_react268.default.createElement( + "g", + { transform: "translate(3.000000, 37.285714)" }, + import_react268.default.createElement("rect", { className: styles_css_default23["preference-icon--disabled-element"], x: "119", y: "6", width: "55", height: "3" }), + import_react268.default.createElement("rect", { className: styles_css_default23["preference-icon--disabled-element"], x: "89", y: "6", width: "26", height: "3" }), + import_react268.default.createElement("polygon", { className: styles_css_default23["preference-icon--focus-text"], points: "16 6 46 6 46 9 16 9" }), + import_react268.default.createElement("polygon", { className: styles_css_default23["preference-icon--disabled-element"], points: "7 6 10 6 10 9 7 9" }), + import_react268.default.createElement("line", { className: styles_css_default23["preference-icon--separator"], x1: "0", y1: "0.666666667", x2: "178", y2: "0.666666667", strokeLinecap: "square" }) + ), + import_react268.default.createElement( + "g", + { transform: "translate(3.000000, 51.714286)" }, + import_react268.default.createElement("rect", { className: styles_css_default23["preference-icon--disabled-element"], x: "119", y: "6", width: "55", height: "3" }), + import_react268.default.createElement("rect", { className: styles_css_default23["preference-icon--disabled-element"], x: "89", y: "6", width: "26", height: "3" }), + import_react268.default.createElement("polygon", { className: styles_css_default23["preference-icon--focus-text"], points: "16 6 46 6 46 9 16 9" }), + import_react268.default.createElement("polygon", { className: styles_css_default23["preference-icon--disabled-element"], points: "7 6 10 6 10 9 7 9" }), + import_react268.default.createElement("line", { className: styles_css_default23["preference-icon--separator"], x1: "0", y1: "0.666666667", x2: "178", y2: "0.666666667", strokeLinecap: "square" }) + ), + import_react268.default.createElement( + "g", + { transform: "translate(3.000000, 80.571429)" }, + import_react268.default.createElement("rect", { className: styles_css_default23["preference-icon--disabled-element"], x: "119", y: "6", width: "55", height: "3" }), + import_react268.default.createElement("rect", { className: styles_css_default23["preference-icon--disabled-element"], x: "89", y: "6", width: "26", height: "3" }), + import_react268.default.createElement("polygon", { className: styles_css_default23["preference-icon--focus-text"], points: "16 6 46 6 46 9 16 9" }), + import_react268.default.createElement("polygon", { className: styles_css_default23["preference-icon--disabled-element"], points: "7 6 10 6 10 9 7 9" }), + import_react268.default.createElement("line", { className: styles_css_default23["preference-icon--separator"], x1: "0", y1: "0.666666667", x2: "178", y2: "0.666666667", strokeLinecap: "square" }) + ), + import_react268.default.createElement( + "g", + { transform: "translate(3.000000, 66.142857)" }, + import_react268.default.createElement("rect", { className: styles_css_default23["preference-icon--disabled-element"], x: "119", y: "6", width: "55", height: "3" }), + import_react268.default.createElement("rect", { className: styles_css_default23["preference-icon--disabled-element"], x: "89", y: "6", width: "26", height: "3" }), + import_react268.default.createElement("polygon", { className: styles_css_default23["preference-icon--focus-text"], points: "16 6 46 6 46 9 16 9" }), + import_react268.default.createElement("polygon", { className: styles_css_default23["preference-icon--disabled-element"], points: "7 6 10 6 10 9 7 9" }), + import_react268.default.createElement("line", { className: styles_css_default23["preference-icon--separator"], x1: "0", y1: "0.666666667", x2: "178", y2: "0.666666667", strokeLinecap: "square" }) + ), + import_react268.default.createElement( + "g", + { transform: "translate(3.000000, 95.000000)" }, + import_react268.default.createElement("rect", { className: styles_css_default23["preference-icon--disabled-element"], x: "119", y: "6", width: "55", height: "3" }), + import_react268.default.createElement("rect", { className: styles_css_default23["preference-icon--disabled-element"], x: "89", y: "6", width: "26", height: "3" }), + import_react268.default.createElement("polygon", { className: styles_css_default23["preference-icon--focus-text"], points: "16 6 46 6 46 9 16 9" }), + import_react268.default.createElement("polygon", { className: styles_css_default23["preference-icon--disabled-element"], points: "7 6 10 6 10 9 7 9" }), + import_react268.default.createElement("line", { className: styles_css_default23["preference-icon--separator"], x1: "0", y1: "0.666666667", x2: "178", y2: "0.666666667", strokeLinecap: "square" }) + ) + ), + import_react268.default.createElement( + "g", + { transform: "translate(182.000000, 28.000000)" }, + import_react268.default.createElement( + "g", + null, + import_react268.default.createElement("rect", { className: styles_css_default23["preference-icon--border"], strokeWidth: "2", x: "1", y: "1", width: "55", height: "97", rx: "2" }), + import_react268.default.createElement("rect", { className: styles_css_default23["preference-icon--secondary"], x: "39.5474354", y: "5.86666667", width: "14", height: "6.41666667" }), + import_react268.default.createElement("polygon", { className: styles_css_default23["preference-icon--focus-text"], points: "3.62672811 7.88333333 24.6267281 7.88333333 24.6267281 10.6333333 3.62672811 10.6333333" }) + ), + import_react268.default.createElement( + "g", + { transform: "translate(4.000000, 22.000000)", className: styles_css_default23["preference-icon--secondary"] }, + import_react268.default.createElement("polygon", { points: "0 0 23 0 23 2 0 2" }), + import_react268.default.createElement("polygon", { points: "26 0 49 0 49 2 26 2" }) + ), + import_react268.default.createElement( + "g", + { transform: "translate(4.000000, 32.000000)", className: styles_css_default23["preference-icon--secondary"] }, + import_react268.default.createElement("polygon", { points: "0 0 23 0 23 2 0 2" }), + import_react268.default.createElement("polygon", { points: "26 0 49 0 49 2 26 2" }) + ), + import_react268.default.createElement( + "g", + { transform: "translate(4.000000, 43.000000)", className: styles_css_default23["preference-icon--secondary"] }, + import_react268.default.createElement("polygon", { points: "0 0 23 0 23 2 0 2" }), + import_react268.default.createElement("polygon", { points: "26 0 49 0 49 2 26 2" }) + ), + import_react268.default.createElement( + "g", + { transform: "translate(4.000000, 51.000000)", className: styles_css_default23["preference-icon--secondary"] }, + import_react268.default.createElement("polygon", { points: "0 0 23 0 23 2 0 2" }), + import_react268.default.createElement("polygon", { points: "26 0 49 0 49 2 26 2" }) + ) + ) + ) +); +var side_position_default = sidePositionIcon; + +// node_modules/@cloudscape-design/components/split-panel/icons/bottom-icon.js +var import_react269 = __toESM(require_react()); +var bottomPositionIcon = import_react269.default.createElement( + "svg", + { focusable: false, viewBox: "0 0 240 134", version: "1.1", xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", "aria-hidden": "true" }, + import_react269.default.createElement( + "g", + { stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd" }, + import_react269.default.createElement( + "g", + null, + import_react269.default.createElement( + "g", + null, + import_react269.default.createElement("rect", { className: styles_css_default23["preference-icon--layout-border"], strokeWidth: "2", x: "1", y: "1", width: "238", height: "125", rx: "2" }), + import_react269.default.createElement("rect", { className: styles_css_default23["preference-icon--layout-background"], x: "12", y: "0", width: "217", height: "126" }), + import_react269.default.createElement("path", { className: styles_css_default23["preference-icon--layout-header"], d: "M2,0 L238,0 C239.104569,-1.58997828e-14 240,0.8954305 240,2 L240,10 L240,10 L0,10 L0,2 C-1.3527075e-16,0.8954305 0.8954305,2.02906125e-16 2,0 Z" }) + ), + import_react269.default.createElement( + "g", + { transform: "translate(28.000000, 22.000000)" }, + import_react269.default.createElement("rect", { className: styles_css_default23["preference-icon--border"], strokeWidth: "2", x: "1", y: "1", width: "182", height: "110", rx: "2" }), + import_react269.default.createElement("rect", { className: styles_css_default23["preference-icon--primary-button"], x: "152", y: "6", width: "26", height: "10" }), + import_react269.default.createElement("rect", { className: styles_css_default23["preference-icon--disabled-element"], x: "122", y: "6", width: "26", height: "10" }), + import_react269.default.createElement("rect", { className: styles_css_default23["preference-icon--disabled-element"], x: "92", y: "6", width: "26", height: "10" }), + import_react269.default.createElement("rect", { className: styles_css_default23["preference-icon--disabled-element"], x: "122", y: "29", width: "55", height: "3" }), + import_react269.default.createElement("rect", { className: styles_css_default23["preference-icon--disabled-element"], x: "92", y: "29", width: "26", height: "3" }), + import_react269.default.createElement("polygon", { className: styles_css_default23["preference-icon--focus-text"], points: "19 29 49 29 49 32 19 32" }), + import_react269.default.createElement("polygon", { className: styles_css_default23["preference-icon--focus-text"], points: "10 10 40 10 40 13 10 13" }), + import_react269.default.createElement("polygon", { className: styles_css_default23["preference-icon--disabled-element"], points: "10 29 13 29 13 32 10 32" }), + import_react269.default.createElement("line", { className: styles_css_default23["preference-icon--separator"], x1: "3", y1: "22.7619048", x2: "181", y2: "22.7619048", strokeWidth: "2", strokeLinecap: "square" }), + import_react269.default.createElement( + "g", + { transform: "translate(3.000000, 37.285714)" }, + import_react269.default.createElement("rect", { className: styles_css_default23["preference-icon--disabled-element"], x: "119", y: "6", width: "55", height: "3" }), + import_react269.default.createElement("rect", { className: styles_css_default23["preference-icon--disabled-element"], x: "89", y: "6", width: "26", height: "3" }), + import_react269.default.createElement("polygon", { className: styles_css_default23["preference-icon--focus-text"], points: "16 6 46 6 46 9 16 9" }), + import_react269.default.createElement("polygon", { className: styles_css_default23["preference-icon--disabled-element"], points: "7 6 10 6 10 9 7 9" }), + import_react269.default.createElement("line", { className: styles_css_default23["preference-icon--separator"], x1: "0", y1: "0.666666667", x2: "178", y2: "0.666666667", strokeLinecap: "square" }) + ) + ), + import_react269.default.createElement( + "g", + { transform: "translate(12.000000, 74.000000)" }, + import_react269.default.createElement( + "g", + null, + import_react269.default.createElement("rect", { className: styles_css_default23["preference-icon--border"], strokeWidth: "2", x: "1", y: "1", width: "215", height: "58", rx: "2" }), + import_react269.default.createElement("rect", { className: styles_css_default23["preference-icon--secondary"], x: "177", y: "8", width: "30.6630435", height: "10" }), + import_react269.default.createElement("polygon", { className: styles_css_default23["preference-icon--focus-text"], points: "10 12 45.3804348 12 45.3804348 15 10 15" }) + ), + import_react269.default.createElement( + "g", + { className: styles_css_default23["preference-icon--secondary"], transform: "translate(9.000000, 40.000000)" }, + import_react269.default.createElement("polygon", { points: "-3.55271368e-15 0 39 0 39 3 -3.55271368e-15 3" }), + import_react269.default.createElement("polygon", { points: "53 0 92 0 92 3 53 3" }), + import_react269.default.createElement("polygon", { points: "107 0 146 0 146 3 107 3" }), + import_react269.default.createElement("polygon", { points: "160 0 199 0 199 3 160 3" }), + import_react269.default.createElement("polygon", { points: "-3.55271368e-15 9 39 9 39 12 -3.55271368e-15 12" }), + import_react269.default.createElement("polygon", { points: "53 9 92 9 92 12 53 12" }), + import_react269.default.createElement("polygon", { points: "107 9 146 9 146 12 107 12" }), + import_react269.default.createElement("polygon", { points: "160 9 199 9 199 12 160 12" }) + ), + import_react269.default.createElement("polygon", { className: styles_css_default23["preference-icon--focus-text"], points: "10 23 32 23 32 26 10 26" }), + import_react269.default.createElement("polygon", { className: styles_css_default23["preference-icon--secondary"], points: "40 23 62 23 62 26 40 26" }) + ) + ) + ) +); +var bottom_icon_default = bottomPositionIcon; + +// node_modules/@cloudscape-design/components/split-panel/icons/side-position-refresh.js +var import_react270 = __toESM(require_react()); +var getClassName = (suffix) => styles_css_default23[`preference-icon-refresh--${suffix}`]; +var TableRow = ({ offset, separator = true, isHeader }) => { + const offsetTop = 0.4482; + const offsetBottom = 3.4482; + return import_react270.default.createElement( + "g", + { transform: `translate(0, ${offset})`, className: getClassName(isHeader ? "column-header" : "disabled") }, + import_react270.default.createElement("path", { d: `M19 ${offsetTop}2H22V${offsetBottom}H19V${offsetTop}Z` }), + import_react270.default.createElement("path", { d: `M27 ${offsetTop}H51V${offsetBottom}H27V${offsetTop}Z`, className: !isHeader ? getClassName("secondary") : void 0 }), + import_react270.default.createElement("path", { d: `M90 ${offsetTop}H110V${offsetBottom}H90V${offsetTop}Z` }), + import_react270.default.createElement("path", { d: `M113 ${offsetTop}H157V${offsetBottom}H113V${offsetTop}Z` }), + separator && import_react270.default.createElement("path", { d: "M14 8H159.387", className: getClassName("separator"), strokeLinecap: "square" }) + ); +}; +var SidePanelRow = ({ offset }) => { + return import_react270.default.createElement( + "g", + { transform: `translate(0, ${offset})`, className: getClassName("secondary") }, + import_react270.default.createElement("path", { d: "M177 0H190V3H177V0Z" }), + import_react270.default.createElement("path", { d: "M195 0H208V3H195V0Z" }) + ); +}; +var bottomPositionIcon2 = import_react270.default.createElement( + "svg", + { focusable: false, viewBox: "0 0 230 128", version: "1.1", xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", "aria-hidden": "true" }, + import_react270.default.createElement("path", { d: "M2 1H214C214.552 1 215 1.44772 215 2V126C215 126.552 214.552 127 214 127H2.00001C1.44772 127 1 126.552 1 126V2C1 1.44772 1.44772 1 2 1Z", className: getClassName("window"), strokeWidth: "2" }), + import_react270.default.createElement( + "g", + { className: "awsui-context-top-navigation" }, + import_react270.default.createElement("rect", { x: "2", y: "2", width: "212", height: "6", className: getClassName("layout-top") }) + ), + import_react270.default.createElement( + "g", + { className: getContentHeaderClassName() }, + import_react270.default.createElement("path", { d: "M2 8H214V23H2V8Z", className: getClassName("layout-main") }), + import_react270.default.createElement( + "g", + { className: getClassName("default") }, + import_react270.default.createElement("path", { d: "M9 15.5C9 16.8807 7.88071 18 6.5 18C5.11929 18 4 16.8807 4 15.5C4 14.1193 5.11929 13 6.5 13C7.88071 13 9 14.1193 9 15.5Z", className: getClassName("disabled") }), + import_react270.default.createElement("path", { d: "M16 14H46.1484V17H16V14Z" }), + import_react270.default.createElement("path", { d: "M92 15.5C92 13.567 93.567 12 95.5 12H108.86C110.793 12 112.36 13.567 112.36 15.5C112.36 17.433 110.793 19 108.86 19H95.5C93.567 19 92 17.433 92 15.5Z" }), + import_react270.default.createElement("path", { d: "M116 15.5C116 13.567 117.567 12 119.5 12H132.86C134.793 12 136.36 13.567 136.36 15.5C136.36 17.433 134.793 19 132.86 19H119.5C117.567 19 116 17.433 116 15.5Z" }), + import_react270.default.createElement("path", { d: "M139 15.5C139 13.567 140.567 12 142.5 12H155.86C157.793 12 159.36 13.567 159.36 15.5C159.36 17.433 157.793 19 155.86 19H142.5C140.567 19 139 17.433 139 15.5Z", className: getClassName("primary") }) + ) + ), + import_react270.default.createElement(TableRow, { offset: 27, isHeader: true }), + import_react270.default.createElement(TableRow, { offset: 39 }), + import_react270.default.createElement(TableRow, { offset: 51 }), + import_react270.default.createElement(TableRow, { offset: 63 }), + import_react270.default.createElement(TableRow, { offset: 75 }), + import_react270.default.createElement(TableRow, { offset: 87 }), + import_react270.default.createElement(TableRow, { offset: 99 }), + import_react270.default.createElement(TableRow, { offset: 111, separator: false }), + import_react270.default.createElement("rect", { x: "166", y: "13", width: "62", height: "108", rx: "5", className: getClassName("window"), strokeWidth: "2" }), + import_react270.default.createElement("rect", { x: "169", y: "62", width: "3", height: "8", rx: "1.5", className: getClassName("input-default") }), + import_react270.default.createElement("path", { d: "M216 14V120", className: getClassName("separator") }), + import_react270.default.createElement( + "g", + { className: getClassName("disabled") }, + import_react270.default.createElement("path", { d: "M224 19.5C224 20.8807 222.881 22 221.5 22C220.119 22 219 20.8807 219 19.5C219 18.1193 220.119 17 221.5 17C222.881 17 224 18.1193 224 19.5Z" }), + import_react270.default.createElement("path", { d: "M224 27.5C224 28.8807 222.881 30 221.5 30C220.119 30 219 28.8807 219 27.5C219 26.1193 220.119 25 221.5 25C222.881 25 224 26.1193 224 27.5Z" }) + ), + import_react270.default.createElement("path", { d: "M177 23H191V28H177V23Z", className: getClassName("heading") }), + import_react270.default.createElement( + "g", + { className: getClassName("secondary") }, + import_react270.default.createElement("path", { d: "M207 23H212V28H207V23Z" }), + import_react270.default.createElement("path", { d: "M199 23H204V28H199V23Z" }) + ), + import_react270.default.createElement(SidePanelRow, { offset: 36 }), + import_react270.default.createElement(SidePanelRow, { offset: 48 }), + import_react270.default.createElement(SidePanelRow, { offset: 60 }), + import_react270.default.createElement(SidePanelRow, { offset: 72 }) +); +var side_position_refresh_default = bottomPositionIcon2; + +// node_modules/@cloudscape-design/components/split-panel/icons/bottom-icon-refresh.js +var import_react271 = __toESM(require_react()); +var TableRow2 = ({ offset, isHeader }) => { + const offsetTop = 0.4482; + const offsetBottom = 3.4482; + return import_react271.default.createElement( + "g", + { transform: `translate(0, ${offset})`, className: getClassName(isHeader ? "column-header" : "disabled") }, + import_react271.default.createElement("path", { d: `M31 ${offsetTop}H34V${offsetBottom}H31V${offsetTop}Z` }), + import_react271.default.createElement("path", { d: `M39 ${offsetTop}H63V${offsetBottom}H39V${offsetTop}Z`, className: !isHeader ? getClassName("secondary") : void 0 }), + import_react271.default.createElement("path", { d: `M135 ${offsetTop}H155V${offsetBottom}H135V${offsetTop}Z` }), + import_react271.default.createElement("path", { d: `M158 ${offsetTop}H202V${offsetBottom}H158V${offsetTop}Z` }), + import_react271.default.createElement("path", { d: "M26 8H204.388", className: getClassName("separator"), strokeLinecap: "square" }) + ); +}; +var SidePanelRow2 = ({ offset }) => { + return import_react271.default.createElement( + "g", + { transform: `translate(0, ${offset})`, className: getClassName("secondary") }, + import_react271.default.createElement("path", { d: "M27 0H59V3H27V0Z" }), + import_react271.default.createElement("path", { d: "M75 0H107V3H75V0Z" }), + import_react271.default.createElement("path", { d: "M123 0H155V3H123V0Z" }), + import_react271.default.createElement("path", { d: "M171 0H203V3H171V0Z" }) + ); +}; +var bottomPositionIcon3 = import_react271.default.createElement( + "svg", + { focusable: false, viewBox: "0 0 230 128", version: "1.1", xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", "aria-hidden": "true" }, + import_react271.default.createElement("path", { d: "M2 1H228C228.552 1 229 1.44772 229 2V117C229 117.552 228.552 118 228 118H2C1.44772 118 1 117.552 1 117V2C1 1.44772 1.44772 1 2 1Z", className: getClassName("window"), strokeWidth: "2" }), + import_react271.default.createElement( + "g", + { className: "awsui-context-top-navigation" }, + import_react271.default.createElement("rect", { x: "2", y: "2", width: "226", height: "6", className: getClassName("layout-top") }) + ), + import_react271.default.createElement( + "g", + { className: getContentHeaderClassName() }, + import_react271.default.createElement("path", { d: "M2 8H228V23H2V8Z", className: getClassName("layout-main") }), + import_react271.default.createElement( + "g", + { className: getClassName("default") }, + import_react271.default.createElement("path", { d: "M9 15.5C9 16.8807 7.88071 18 6.5 18C5.11929 18 4 16.8807 4 15.5C4 14.1193 5.11929 13 6.5 13C7.88071 13 9 14.1193 9 15.5Z", className: getClassName("disabled") }), + import_react271.default.createElement("path", { d: "M26 14H56.1484V17H26V14Z" }), + import_react271.default.createElement("path", { d: "M139 15.5C139 13.567 140.567 12 142.5 12H155.86C157.793 12 159.36 13.567 159.36 15.5C159.36 17.433 157.793 19 155.86 19H142.5C140.567 19 139 17.433 139 15.5Z" }), + import_react271.default.createElement("path", { d: "M163 15.5C163 13.567 164.567 12 166.5 12H179.86C181.793 12 183.36 13.567 183.36 15.5C183.36 17.433 181.793 19 179.86 19H166.5C164.567 19 163 17.433 163 15.5Z" }), + import_react271.default.createElement("path", { d: "M186 15.5C186 13.567 187.567 12 189.5 12H202.86C204.793 12 206.36 13.567 206.36 15.5C206.36 17.433 204.793 19 202.86 19H189.5C187.567 19 186 17.433 186 15.5Z", className: getClassName("primary") }), + import_react271.default.createElement("circle", { cx: "223.5", cy: "15.5", r: "2.5", className: getClassName("disabled") }) + ) + ), + import_react271.default.createElement(TableRow2, { offset: 27, isHeader: true }), + import_react271.default.createElement(TableRow2, { offset: 39 }), + import_react271.default.createElement(TableRow2, { offset: 51 }), + import_react271.default.createElement(TableRow2, { offset: 63 }), + import_react271.default.createElement("rect", { x: "8", y: "75", width: "214", height: "52", rx: "5", className: getClassName("window"), strokeWidth: "2" }), + import_react271.default.createElement("rect", { x: "111", y: "79", width: "8", height: "3", rx: "1.5", className: getClassName("input-default") }), + import_react271.default.createElement("path", { d: "M27 87H57V92H27V87Z", className: getClassName("heading") }), + import_react271.default.createElement( + "g", + { className: getClassName("secondary") }, + import_react271.default.createElement("path", { d: "M198 87H203V92H198V87Z" }), + import_react271.default.createElement("path", { d: "M190 87H195V92H190V87Z" }) + ), + import_react271.default.createElement(SidePanelRow2, { offset: 99 }), + import_react271.default.createElement(SidePanelRow2, { offset: 106 }), + import_react271.default.createElement(SidePanelRow2, { offset: 113 }) +); +var bottom_icon_refresh_default = bottomPositionIcon3; + +// node_modules/@cloudscape-design/components/split-panel/preferences-modal.js +var preferences_modal_default2 = (props2) => { + const [position, setPosition] = (0, import_react272.useState)(props2.preferences.position); + const onCancel = () => { + setPosition(props2.preferences.position); + props2.onDismiss(); + }; + const onConfirm = () => { + props2.onConfirm({ position }); + }; + return import_react272.default.createElement( + InternalModal, + { size: "medium", visible: props2.visible, onDismiss: props2.onDismiss, header: props2.i18nStrings.header, closeAriaLabel: props2.i18nStrings.cancel, footer: import_react272.default.createElement( + InternalBox, + { float: "right" }, + import_react272.default.createElement( + InternalSpaceBetween, + { direction: "horizontal", size: "xs" }, + import_react272.default.createElement(InternalButton, { onClick: onCancel, formAction: "none", variant: "link" }, props2.i18nStrings.cancel), + import_react272.default.createElement(InternalButton, { onClick: onConfirm, variant: "primary" }, props2.i18nStrings.confirm) + ) + ), __internalRootRef: props2.__internalRootRef }, + import_react272.default.createElement( + InternalFormField, + { label: props2.i18nStrings.positionLabel, description: props2.i18nStrings.positionDescription }, + import_react272.default.createElement(internal_default20, { onChange: (e) => setPosition(e.detail.value), value: position, columns: 2, items: [ + { + label: props2.i18nStrings.positionBottom, + image: props2.isRefresh ? bottom_icon_refresh_default : bottom_icon_default, + value: "bottom" + }, + { + label: props2.i18nStrings.positionSide, + image: props2.isRefresh ? side_position_refresh_default : side_position_default, + value: "side", + disabled: props2.disabledSidePosition + } + ] }) + ) + ); +}; + +// node_modules/@cloudscape-design/components/split-panel/side.js +var import_react273 = __toESM(require_react()); +function SplitPanelContentSide({ baseProps, splitPanelRef, toggleRef, header, children: children2, resizeHandle, isOpen, cappedSize, openButtonAriaLabel, panelHeaderId, onToggle }) { + const { topOffset, bottomOffset } = useSplitPanelContext(); + const isRefresh = useVisualRefresh(); + return import_react273.default.createElement( + "div", + Object.assign({}, baseProps, { className: clsx_m_default(baseProps.className, styles_css_default23.drawer, styles_css_default23.root, styles_css_default23["position-side"], { + [styles_css_default23["drawer-closed"]]: !isOpen + }), style: { + width: isOpen && isRefresh ? cappedSize : void 0, + maxWidth: isRefresh ? "100%" : void 0 + }, ref: splitPanelRef }), + import_react273.default.createElement( + "div", + { className: clsx_m_default(styles_css_default23["drawer-content-side"]), style: { + top: topOffset, + bottom: bottomOffset + }, onClick: () => !isOpen && onToggle(), "aria-labelledby": panelHeaderId, role: "region" }, + isOpen ? import_react273.default.createElement("div", { className: styles_css_default23["slider-wrapper-side"] }, resizeHandle) : import_react273.default.createElement(internal_default2, { className: clsx_m_default(styles_css_default23["open-button"], styles_css_default23["open-button-side"]), iconName: "angle-left", variant: "icon", formAction: "none", ariaLabel: openButtonAriaLabel, ariaExpanded: isOpen, ref: isRefresh ? null : toggleRef }), + import_react273.default.createElement( + "div", + { className: styles_css_default23["content-side"], "aria-hidden": !isOpen }, + import_react273.default.createElement("div", { className: clsx_m_default(styles_css_default23["pane-header-wrapper-side"]) }, header), + import_react273.default.createElement("div", { className: clsx_m_default(styles_css_default23["pane-content-wrapper-side"]) }, children2) + ) + ) + ); +} + +// node_modules/@cloudscape-design/components/split-panel/bottom.js +var import_react274 = __toESM(require_react()); +function SplitPanelContentBottom({ baseProps, isOpen, state, transitioningElementRef, splitPanelRef, cappedSize, header, resizeHandle, children: children2, appLayoutMaxWidth, panelHeaderId, onToggle }) { + const isRefresh = useVisualRefresh(); + const { bottomOffset, leftOffset, rightOffset, disableContentPaddings, contentWrapperPaddings, reportHeaderHeight } = useSplitPanelContext(); + const transitionContentBottomRef = useMergeRefs(splitPanelRef || null, transitioningElementRef); + const isMobile = useMobile(); + const headerRef = (0, import_react274.useRef)(null); + useResizeObserver(headerRef, (entry) => reportHeaderHeight(entry.borderBoxHeight)); + (0, import_react274.useEffect)(() => { + return () => reportHeaderHeight(0); + }, []); + const centeredMaxWidthClasses = clsx_m_default({ + [styles_css_default23["pane-bottom-center-align"]]: isRefresh, + [styles_css_default23["pane-bottom-content-nav-padding"]]: contentWrapperPaddings === null || contentWrapperPaddings === void 0 ? void 0 : contentWrapperPaddings.closedNav, + [styles_css_default23["pane-bottom-content-tools-padding"]]: contentWrapperPaddings === null || contentWrapperPaddings === void 0 ? void 0 : contentWrapperPaddings.closedTools + }); + return import_react274.default.createElement( + "div", + Object.assign({}, baseProps, { className: clsx_m_default(baseProps.className, styles_css_default23.root, styles_css_default23.drawer, styles_css_default23["position-bottom"], { + [styles_css_default23["drawer-closed"]]: !isOpen, + [styles_css_default23["drawer-mobile"]]: isMobile, + [styles_css_default23["drawer-disable-content-paddings"]]: disableContentPaddings, + [styles_css_default23.animating]: isRefresh && (state === "entering" || state === "exiting"), + [styles_css_default23.refresh]: isRefresh + }), onClick: () => !isOpen && onToggle(), style: { + bottom: bottomOffset, + left: leftOffset, + right: rightOffset, + height: isOpen ? cappedSize : void 0 + }, ref: transitionContentBottomRef }), + isOpen && import_react274.default.createElement("div", { className: styles_css_default23["slider-wrapper-bottom"] }, resizeHandle), + import_react274.default.createElement( + "div", + { className: styles_css_default23["drawer-content-bottom"], "aria-labelledby": panelHeaderId, role: "region" }, + import_react274.default.createElement("div", { className: clsx_m_default(styles_css_default23["pane-header-wrapper-bottom"], centeredMaxWidthClasses), ref: headerRef }, header), + import_react274.default.createElement( + "div", + { className: clsx_m_default(styles_css_default23["content-bottom"], centeredMaxWidthClasses), "aria-hidden": !isOpen }, + import_react274.default.createElement("div", { className: clsx_m_default({ [styles_css_default23["content-bottom-max-width"]]: isRefresh }), style: appLayoutMaxWidth }, children2) + ) + ) + ); +} + +// node_modules/@cloudscape-design/components/split-panel/implementation.js +var SplitPanelImplementation = import_react275.default.forwardRef((_a, __internalRootRef) => { + var { header, children: children2, hidePreferencesButton = false, closeBehavior = "collapse", i18nStrings } = _a, restProps = __rest(_a, ["header", "children", "hidePreferencesButton", "closeBehavior", "i18nStrings"]); + const isRefresh = useVisualRefresh(); + const { position, topOffset, bottomOffset, rightOffset, contentWidthStyles, isOpen, isForcedPosition, onPreferencesChange, onResize, onToggle, size, relativeSize, setSplitPanelToggle, refs } = useSplitPanelContext(); + const baseProps = getBaseProps(restProps); + const i18n = useInternalI18n("split-panel"); + const [isPreferencesOpen, setPreferencesOpen] = (0, import_react275.useState)(false); + const appLayoutMaxWidth = isRefresh && position === "bottom" ? contentWidthStyles : void 0; + const openButtonAriaLabel = i18n("i18nStrings.openButtonAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.openButtonAriaLabel); + (0, import_react275.useEffect)(() => { + setSplitPanelToggle({ displayed: closeBehavior === "collapse", ariaLabel: openButtonAriaLabel }); + }, [setSplitPanelToggle, openButtonAriaLabel, closeBehavior]); + const splitPanelRefObject = (0, import_react275.useRef)(null); + const sizeControlProps = { + position, + panelRef: splitPanelRefObject, + handleRef: refs.slider, + onResize + }; + const onSliderPointerDown = usePointerEvents(sizeControlProps); + const onKeyDown = useKeyboardEvents(sizeControlProps); + const wrappedChildren = import_react275.default.createElement(AppLayoutContext.Provider, { value: { + stickyOffsetTop: topOffset, + stickyOffsetBottom: bottomOffset + } }, children2); + const panelHeaderId = useUniqueId("split-panel-header"); + const wrappedHeader = import_react275.default.createElement( + "div", + { className: styles_css_default23.header, style: appLayoutMaxWidth }, + import_react275.default.createElement("h2", { className: styles_css_default23["header-text"], id: panelHeaderId }, header), + import_react275.default.createElement( + "div", + { className: styles_css_default23["header-actions"] }, + !hidePreferencesButton && isOpen && import_react275.default.createElement( + import_react275.default.Fragment, + null, + import_react275.default.createElement(InternalButton, { className: styles_css_default23["preferences-button"], iconName: "settings", variant: "icon", onClick: () => setPreferencesOpen(true), formAction: "none", ariaLabel: i18n("i18nStrings.preferencesTitle", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.preferencesTitle), ref: refs.preferences }), + import_react275.default.createElement("span", { className: styles_css_default23.divider }) + ), + isOpen ? import_react275.default.createElement(InternalButton, { className: styles_css_default23["close-button"], iconName: isRefresh && closeBehavior === "collapse" ? position === "side" ? "angle-right" : "angle-down" : "close", variant: "icon", onClick: onToggle, formAction: "none", ariaLabel: i18n("i18nStrings.closeButtonAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.closeButtonAriaLabel), ariaExpanded: isOpen }) : position === "side" ? null : import_react275.default.createElement(InternalButton, { className: styles_css_default23["open-button"], iconName: "angle-up", variant: "icon", formAction: "none", ariaLabel: i18n("i18nStrings.openButtonAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.openButtonAriaLabel), ref: refs.toggle, ariaExpanded: isOpen }) + ) + ); + const resizeHandle = import_react275.default.createElement( + "div", + { ref: refs.slider, role: "slider", tabIndex: 0, "aria-label": i18n("i18nStrings.resizeHandleAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.resizeHandleAriaLabel), "aria-valuemax": 100, "aria-valuemin": 0, "aria-valuenow": position === "bottom" ? relativeSize : 100 - relativeSize, className: clsx_m_default(styles_css_default23.slider, styles_css_default23[`slider-${position}`]), onKeyDown, onPointerDown: onSliderPointerDown }, + import_react275.default.createElement(resize_handler_default, { className: clsx_m_default(styles_css_default23["slider-icon"], styles_css_default23[`slider-icon-${position}`]) }) + ); + (0, import_react275.useLayoutEffect)(() => { + const root = splitPanelRefObject.current; + if (root) { + const property = "transform"; + const temporaryValue = "translateZ(0)"; + const valueBefore = root.style[property]; + root.style[property] = temporaryValue; + void root.offsetHeight; + root.style[property] = valueBefore; + } + }, [rightOffset, __internalRootRef]); + const mergedRef = useMergeRefs(splitPanelRefObject, __internalRootRef); + if (closeBehavior === "hide" && !isOpen) { + return import_react275.default.createElement(import_react275.default.Fragment, null); + } + if (isRefresh && !isOpen && position === "side") { + return import_react275.default.createElement(import_react275.default.Fragment, null); + } + return import_react275.default.createElement(Transition2, { in: isOpen !== null && isOpen !== void 0 ? isOpen : false }, (state, transitioningElementRef) => import_react275.default.createElement( + import_react275.default.Fragment, + null, + position === "side" && import_react275.default.createElement(SplitPanelContentSide, { resizeHandle, baseProps, isOpen, splitPanelRef: mergedRef, cappedSize: size, onToggle, openButtonAriaLabel: i18n("i18nStrings.openButtonAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.openButtonAriaLabel), toggleRef: refs.toggle, header: wrappedHeader, panelHeaderId }, wrappedChildren), + position === "bottom" && import_react275.default.createElement(SplitPanelContentBottom, { resizeHandle, baseProps, isOpen, splitPanelRef: mergedRef, cappedSize: size, onToggle, header: wrappedHeader, panelHeaderId, state, transitioningElementRef, appLayoutMaxWidth }, wrappedChildren), + isPreferencesOpen && import_react275.default.createElement(preferences_modal_default2, { visible: true, preferences: { position }, disabledSidePosition: position === "bottom" && isForcedPosition, isRefresh, i18nStrings: { + header: i18n("i18nStrings.preferencesTitle", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.preferencesTitle), + confirm: i18n("i18nStrings.preferencesConfirm", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.preferencesConfirm), + cancel: i18n("i18nStrings.preferencesCancel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.preferencesCancel), + positionLabel: i18n("i18nStrings.preferencesPositionLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.preferencesPositionLabel), + positionDescription: i18n("i18nStrings.preferencesPositionDescription", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.preferencesPositionDescription), + positionBottom: i18n("i18nStrings.preferencesPositionBottom", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.preferencesPositionBottom), + positionSide: i18n("i18nStrings.preferencesPositionSide", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.preferencesPositionSide) + }, onConfirm: (preferences) => { + onPreferencesChange(Object.assign({}, preferences)); + setPreferencesOpen(false); + }, onDismiss: () => { + setPreferencesOpen(false); + } }) + )); +}); + +// node_modules/@cloudscape-design/components/split-panel/widget.js +function createWidgetizedSplitPanel(SplitPanelLoader) { + return import_react276.default.forwardRef((props2, ref) => { + const isRefresh = useVisualRefresh(); + if (isRefresh && getGlobalFlag("appLayoutWidget") && SplitPanelLoader) { + return import_react276.default.createElement(SplitPanelLoader, Object.assign({ ref }, props2)); + } + return import_react276.default.createElement(SplitPanelImplementation, Object.assign({ ref }, props2)); + }); +} + +// node_modules/@cloudscape-design/components/split-panel/internal.js +var SplitPanelInternal = createWidgetizedSplitPanel(); + +// node_modules/@cloudscape-design/components/split-panel/index.js +function SplitPanel2(_a) { + var { hidePreferencesButton = false, closeBehavior = "collapse" } = _a, restProps = __rest(_a, ["hidePreferencesButton", "closeBehavior"]); + const { __internalRootRef } = useBaseComponent("SplitPanel", { + props: { closeBehavior, hidePreferencesButton } + }); + return import_react277.default.createElement(SplitPanelInternal, Object.assign({}, restProps, { ref: __internalRootRef, hidePreferencesButton, closeBehavior })); +} +applyDisplayName(SplitPanel2, "SplitPanel"); + +// node_modules/@cloudscape-design/components/status-indicator/index.js +var import_react278 = __toESM(require_react()); +function StatusIndicator2(_a) { + var { type = "success", wrapText = true } = _a, props2 = __rest(_a, ["type", "wrapText"]); + const baseComponentProps = useBaseComponent("StatusIndicator", { + props: { colorOverride: props2.colorOverride, type, wrapText } + }); + return import_react278.default.createElement(StatusIndicator, Object.assign({ type, wrapText }, props2, baseComponentProps)); +} +applyDisplayName(StatusIndicator2, "StatusIndicator"); + +// node_modules/@cloudscape-design/components/tabs/index.js +var import_react280 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/tabs/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/tabs/styles.scoped.css"; +var styles_css_default85 = { + "tabs-header": "awsui_tabs-header_14rmt_n8497_198", + "tabs-header-list": "awsui_tabs-header-list_14rmt_n8497_206", + "pagination-button": "awsui_pagination-button_14rmt_n8497_223", + "pagination-button-left": "awsui_pagination-button-left_14rmt_n8497_230", + "pagination-button-left-scrollable": "awsui_pagination-button-left-scrollable_14rmt_n8497_233", + "pagination-button-right": "awsui_pagination-button-right_14rmt_n8497_237", + "pagination-button-right-scrollable": "awsui_pagination-button-right-scrollable_14rmt_n8497_240", + "tabs-tab": "awsui_tabs-tab_14rmt_n8497_245", + "tabs-tab-label": "awsui_tabs-tab-label_14rmt_n8497_257", + "tabs-tab-link": "awsui_tabs-tab-link_14rmt_n8497_273", + "refresh": "awsui_refresh_14rmt_n8497_292", + "tabs-tab-disabled": "awsui_tabs-tab-disabled_14rmt_n8497_343", + "tabs-tab-active": "awsui_tabs-tab-active_14rmt_n8497_378", + "tabs-header-with-divider": "awsui_tabs-header-with-divider_14rmt_n8497_385", + "root": "awsui_root_14rmt_n8497_389", + "tabs": "awsui_tabs_14rmt_n8497_198", + "tabs-content": "awsui_tabs-content_14rmt_n8497_430", + "fit-height": "awsui_fit-height_14rmt_n8497_434", + "tabs-content-active": "awsui_tabs-content-active_14rmt_n8497_440", + "tabs-content-wrapper": "awsui_tabs-content-wrapper_14rmt_n8497_454", + "with-paddings": "awsui_with-paddings_14rmt_n8497_454", + "tabs-container-content-wrapper": "awsui_tabs-container-content-wrapper_14rmt_n8497_465" +}; + +// node_modules/@cloudscape-design/components/tabs/tab-header-bar.js +var import_react279 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/tabs/native-smooth-scroll-supported.js +function native_smooth_scroll_supported_default() { + return "scrollBehavior" in document.documentElement.style; +} + +// node_modules/@cloudscape-design/components/tabs/smooth-scroll.js +var getScrollSpeed = (pixels) => 15e-4 * Math.abs(pixels) + 0.558; +var getScrollTime = (pixels) => Math.round(Math.abs(pixels) / getScrollSpeed(pixels)); +var now = () => window.performance ? window.performance.now() : Date.now(); +var ease = (k2) => { + return 0.5 * (1 - Math.cos(Math.PI * k2)); +}; +var step = (context) => { + const time2 = now(); + const elapsed = Math.min((time2 - context.startTime) / context.scrollTime, 1); + const value = ease(elapsed); + const currentX = context.startX + (context.endX - context.startX) * value; + context.scrollable.scrollLeft = currentX; + if (currentX !== context.endX) { + requestAnimationFrame(() => step(context)); + } +}; +var simulateSmoothScroll = (element, endX) => { + const startX = element.scrollLeft; + step({ + scrollable: element, + startX, + endX, + startTime: now(), + scrollTime: getScrollTime(endX - startX) + }); +}; +var smoothScroll = (element, to) => { + if (isMotionDisabled(element)) { + element.scrollLeft = to; + return; + } + if (native_smooth_scroll_supported_default() && element.scrollTo) { + element.scrollTo({ + left: to, + behavior: "smooth" + }); + return; + } + simulateSmoothScroll(element, to); +}; +var smooth_scroll_default = smoothScroll; + +// node_modules/@cloudscape-design/components/tabs/scroll-utils.js +var onPaginationClick = (headerBarRef, direction) => { + if (!(headerBarRef === null || headerBarRef === void 0 ? void 0 : headerBarRef.current)) { + return; + } + const element = headerBarRef.current; + const { scrollLeft, scrollWidth, offsetWidth } = element; + const paginatedSectionSize = Math.ceil(element.clientWidth * 0.75); + const scrollDistance = direction === "forward" ? Math.min(Math.abs(scrollLeft) + paginatedSectionSize, scrollWidth - offsetWidth) : Math.max(Math.abs(scrollLeft) - paginatedSectionSize, 0); + const scrollTo = isRtl(element) ? scrollDistance * -1 : scrollDistance; + smooth_scroll_default(element, scrollTo); +}; +var hasHorizontalOverflow = (headerBar, inlineStartOverflowButton) => { + const { offsetWidth, scrollWidth } = headerBar; + const paginationButtonsWidth = inlineStartOverflowButton.current && 2 * inlineStartOverflowButton.current.offsetWidth; + return paginationButtonsWidth ? scrollWidth > offsetWidth + paginationButtonsWidth : scrollWidth > offsetWidth; +}; +var hasInlineStartOverflow = (headerBar) => { + return getScrollInlineStart(headerBar) > 0; +}; +var hasInlineEndOverflow = (headerBar) => { + return Math.ceil(getScrollInlineStart(headerBar)) < headerBar.scrollWidth - headerBar.offsetWidth; +}; +var scrollIntoView = (tabHeader, headerBar, smooth = true) => { + if (!tabHeader || !headerBar) { + return; + } + const margin = 2; + let updatedLeftScroll = headerBar.scrollLeft; + updatedLeftScroll = Math.min(updatedLeftScroll, tabHeader.offsetLeft - margin); + updatedLeftScroll = Math.max(updatedLeftScroll, tabHeader.offsetLeft + tabHeader.offsetWidth - headerBar.offsetWidth + margin); + if (smooth) { + smooth_scroll_default(headerBar, updatedLeftScroll); + } else { + headerBar.scrollLeft = updatedLeftScroll; + } +}; + +// node_modules/@cloudscape-design/components/tabs/tab-header-bar.js +function TabHeaderBar({ onChange, activeTabId, tabs, variant, idNamespace, ariaLabel, ariaLabelledby, i18nStrings }) { + const headerBarRef = (0, import_react279.useRef)(null); + const activeTabHeaderRef = (0, import_react279.useRef)(null); + const inlineStartOverflowButton = (0, import_react279.useRef)(null); + const i18n = useInternalI18n("tabs"); + const isVisualRefresh = useVisualRefresh(); + const [widthChange, containerRef] = useContainerQuery((rect) => rect.contentBoxWidth); + const tabRefs = (0, import_react279.useRef)(/* @__PURE__ */ new Map()); + const [horizontalOverflow, setHorizontalOverflow] = (0, import_react279.useState)(false); + const [inlineStartOverflow, setInlineStartOverflow] = (0, import_react279.useState)(false); + const [inlineEndOverflow, setInlineEndOverflow] = (0, import_react279.useState)(false); + (0, import_react279.useEffect)(() => { + if (headerBarRef.current) { + setHorizontalOverflow(hasHorizontalOverflow(headerBarRef.current, inlineStartOverflowButton)); + setInlineStartOverflow(hasInlineStartOverflow(headerBarRef.current)); + setInlineEndOverflow(hasInlineEndOverflow(headerBarRef.current)); + } + }, [widthChange, tabs]); + const scrollIntoViewIfPossible = (smooth) => { + if (!activeTabId) { + return; + } + const activeTabRef = tabRefs.current.get(activeTabId); + if (activeTabRef && headerBarRef.current) { + scrollIntoView(activeTabRef, headerBarRef.current, smooth); + } + }; + (0, import_react279.useEffect)(() => { + requestAnimationFrame(() => { + scrollIntoViewIfPossible(false); + }); + }, [horizontalOverflow, widthChange, tabs.length]); + (0, import_react279.useEffect)(() => { + scrollIntoViewIfPossible(true); + }, [activeTabId]); + (0, import_react279.useEffect)(() => { + var _a, _b; + if ((_a = headerBarRef.current) === null || _a === void 0 ? void 0 : _a.contains(document.activeElement)) { + if (document.activeElement !== activeTabHeaderRef.current) { + (_b = activeTabHeaderRef.current) === null || _b === void 0 ? void 0 : _b.focus({ preventScroll: true }); + } + } + }, [activeTabId]); + const onScroll = () => { + if (headerBarRef.current) { + setInlineStartOverflow(hasInlineStartOverflow(headerBarRef.current)); + setInlineEndOverflow(hasInlineEndOverflow(headerBarRef.current)); + } + }; + const classes = clsx_m_default({ + [styles_css_default85["tabs-header"]]: true, + [styles_css_default85["tabs-header-with-divider"]]: variant === "default" || isVisualRefresh + }); + const leftButtonClasses = clsx_m_default({ + [styles_css_default85["pagination-button"]]: true, + [styles_css_default85["pagination-button-left"]]: true, + [styles_css_default85["pagination-button-left-scrollable"]]: inlineStartOverflow + }); + const rightButtonClasses = clsx_m_default({ + [styles_css_default85["pagination-button"]]: true, + [styles_css_default85["pagination-button-right"]]: true, + [styles_css_default85["pagination-button-right-scrollable"]]: inlineEndOverflow + }); + return ( + //converted span to div as list should not be a child of span for HTML validation + import_react279.default.createElement( + "div", + { className: classes, ref: containerRef }, + horizontalOverflow && import_react279.default.createElement( + "span", + { ref: inlineStartOverflowButton, className: leftButtonClasses }, + import_react279.default.createElement(InternalButton, { formAction: "none", variant: "icon", iconName: "angle-left", disabled: !inlineStartOverflow, __focusable: true, onClick: () => onPaginationClick(headerBarRef, "backward"), ariaLabel: i18n("i18nStrings.scrollLeftAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.scrollLeftAriaLabel) }) + ), + import_react279.default.createElement("ul", { role: "tablist", className: styles_css_default85["tabs-header-list"], "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, ref: headerBarRef, onScroll }, tabs.map(renderTabHeader)), + horizontalOverflow && import_react279.default.createElement( + "span", + { className: rightButtonClasses }, + import_react279.default.createElement(InternalButton, { formAction: "none", variant: "icon", iconName: "angle-right", disabled: !inlineEndOverflow, __focusable: true, onClick: () => onPaginationClick(headerBarRef, "forward"), ariaLabel: i18n("i18nStrings.scrollRightAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.scrollRightAriaLabel) }) + ) + ) + ); + function renderTabHeader(tab) { + const enabledTabsWithCurrentTab = tabs.filter((tab2) => !tab2.disabled || tab2.id === activeTabId); + const highlightTab = function(enabledTabIndex) { + const tab2 = enabledTabsWithCurrentTab[enabledTabIndex]; + if (tab2.id === activeTabId) { + return; + } + onChange({ activeTabId: tab2.id, activeTabHref: tab2.href }); + }; + const onKeyDown = function(event) { + const { keyCode } = event; + const specialKeys = [KeyCode.right, KeyCode.left, KeyCode.end, KeyCode.home, KeyCode.pageUp, KeyCode.pageDown]; + if (hasModifierKeys(event) || specialKeys.indexOf(keyCode) === -1) { + return; + } + event.preventDefault(); + const activeIndex = enabledTabsWithCurrentTab.indexOf(tab); + handleKey(event, { + onEnd: () => highlightTab(enabledTabsWithCurrentTab.length - 1), + onHome: () => highlightTab(0), + onInlineEnd: () => activeIndex + 1 === enabledTabsWithCurrentTab.length ? highlightTab(0) : highlightTab(activeIndex + 1), + onInlineStart: () => activeIndex === 0 ? highlightTab(enabledTabsWithCurrentTab.length - 1) : highlightTab(activeIndex - 1), + onPageDown: () => inlineEndOverflow && onPaginationClick(headerBarRef, "forward"), + onPageUp: () => inlineStartOverflow && onPaginationClick(headerBarRef, "backward") + }); + }; + const clickTab = (event) => { + if (tab.disabled) { + event.preventDefault(); + return; + } + const specialKey = !isPlainLeftClick(event); + if (specialKey && tab.href) { + return; + } + event.preventDefault(); + if (!tab.href) { + const clickedTabRef = tabRefs.current.get(tab.id); + if (clickedTabRef) { + const childElement = clickedTabRef.firstChild; + if (childElement && childElement !== document.activeElement) { + childElement.focus({ preventScroll: true }); + } + } + } + if (tab.id === activeTabId) { + return; + } + onChange({ activeTabId: tab.id, activeTabHref: tab.href }); + }; + const classes2 = clsx_m_default({ + [styles_css_default85["tabs-tab-link"]]: true, + [styles_css_default85.refresh]: isVisualRefresh, + [styles_css_default85["tabs-tab-active"]]: activeTabId === tab.id && !tab.disabled, + [styles_css_default85["tabs-tab-disabled"]]: tab.disabled + }); + const commonProps = { + className: classes2, + role: "tab", + "aria-selected": tab.id === activeTabId, + "aria-controls": `${idNamespace}-${tab.id}-panel`, + "data-testid": tab.id, + id: getTabElementId({ namespace: idNamespace, tabId: tab.id }), + children: import_react279.default.createElement("span", { className: styles_css_default85["tabs-tab-label"] }, tab.label) + }; + if (tab.disabled) { + commonProps["aria-disabled"] = "true"; + } else { + commonProps.onClick = clickTab; + } + if (tab.id === activeTabId) { + commonProps.ref = activeTabHeaderRef; + commonProps.tabIndex = 0; + commonProps.onKeyDown = (event) => onKeyDown(event); + } else { + commonProps.tabIndex = -1; + } + let trigger = null; + if (tab.href) { + const anchorProps = commonProps; + anchorProps.href = tab.href; + trigger = import_react279.default.createElement("a", Object.assign({}, anchorProps)); + } else { + const buttonProps = commonProps; + buttonProps.type = "button"; + if (tab.disabled) { + buttonProps.disabled = true; + } + trigger = import_react279.default.createElement("button", Object.assign({}, buttonProps)); + } + return import_react279.default.createElement("li", { ref: (element) => tabRefs.current.set(tab.id, element), className: styles_css_default85["tabs-tab"], role: "presentation", key: tab.id }, trigger); + } +} +function getTabElementId({ namespace, tabId }) { + return namespace + "-" + tabId; +} + +// node_modules/@cloudscape-design/components/tabs/index.js +function firstEnabledTab(tabs) { + const enabledTabs = tabs.filter((tab) => !tab.disabled); + if (enabledTabs.length > 0) { + return enabledTabs[0]; + } + return null; +} +function Tabs(_a) { + var _b, _c; + var { tabs, variant = "default", onChange, activeTabId: controlledTabId, ariaLabel, ariaLabelledby, disableContentPaddings = false, i18nStrings, fitHeight } = _a, rest = __rest(_a, ["tabs", "variant", "onChange", "activeTabId", "ariaLabel", "ariaLabelledby", "disableContentPaddings", "i18nStrings", "fitHeight"]); + for (const tab of tabs) { + checkSafeUrl("Tabs", tab.href); + } + const { __internalRootRef } = useBaseComponent("Tabs", { + props: { disableContentPaddings, variant } + }); + const idNamespace = useUniqueId("awsui-tabs-"); + const [activeTabId, setActiveTabId] = useControllable(controlledTabId, onChange, (_c = (_b = firstEnabledTab(tabs)) === null || _b === void 0 ? void 0 : _b.id) !== null && _c !== void 0 ? _c : "", { + componentName: "Tabs", + controlledProp: "activeTabId", + changeHandler: "onChange" + }); + const baseProps = getBaseProps(rest); + const content = () => { + const selectedTab = tabs.filter((tab) => tab.id === activeTabId)[0]; + const renderContent = (tab) => { + const isTabSelected = tab === selectedTab; + const classes = clsx_m_default({ + [styles_css_default85["tabs-content"]]: true, + [styles_css_default85["tabs-content-active"]]: isTabSelected + }); + const contentAttributes = { + className: classes, + role: "tabpanel", + id: `${idNamespace}-${tab.id}-panel`, + key: `${idNamespace}-${tab.id}-panel`, + tabIndex: 0, + "aria-labelledby": getTabElementId({ namespace: idNamespace, tabId: tab.id }) + }; + const isContentShown = isTabSelected && !selectedTab.disabled; + return import_react280.default.createElement("div", Object.assign({}, contentAttributes), isContentShown && selectedTab.content); + }; + return import_react280.default.createElement("div", { className: clsx_m_default(variant === "container" || variant === "stacked" ? styles_css_default85["tabs-container-content-wrapper"] : styles_css_default85["tabs-content-wrapper"], { + [styles_css_default85["with-paddings"]]: !disableContentPaddings + }) }, tabs.map(renderContent)); + }; + const header = import_react280.default.createElement(TabHeaderBar, { activeTabId, variant, idNamespace, ariaLabel, ariaLabelledby, tabs, onChange: (changeDetail) => { + setActiveTabId(changeDetail.activeTabId); + fireNonCancelableEvent(onChange, changeDetail); + }, i18nStrings }); + if (variant === "container" || variant === "stacked") { + return import_react280.default.createElement(InternalContainer, Object.assign({ header, disableHeaderPaddings: true }, baseProps, { className: clsx_m_default(baseProps.className, styles_css_default85.root), __internalRootRef, disableContentPaddings: true, variant: variant === "stacked" ? "stacked" : "default", fitHeight }), content()); + } + return import_react280.default.createElement( + "div", + Object.assign({}, baseProps, { className: clsx_m_default(baseProps.className, styles_css_default85.root, styles_css_default85.tabs, { [styles_css_default85["fit-height"]]: fitHeight }), ref: __internalRootRef }), + header, + content() + ); +} +applyDisplayName(Tabs, "Tabs"); + +// node_modules/@cloudscape-design/components/tag-editor/index.js +var import_react283 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/tag-editor/internal.js +var import_react281 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/tag-editor/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/tag-editor/styles.scoped.css"; +var styles_css_default86 = { + "root": "awsui_root_brdst_1yvx7_99", + "loading": "awsui_loading_brdst_1yvx7_103", + "undo-button": "awsui_undo-button_brdst_1yvx7_107" +}; + +// node_modules/@cloudscape-design/components/tag-editor/internal.js +var TagControl = import_react281.default.forwardRef(({ row, value, readOnly, defaultOptions, placeholder, errorText, loadingText, suggestionText, tooManySuggestionText, limit, filteringKey, enteredTextLabel, clearAriaLabel, onChange, onBlur, onRequest, initialOptionsRef }, ref) => { + const [options, setOptions] = (0, import_react281.useState)(defaultOptions); + const [statusType, setStatusType] = (0, import_react281.useState)(); + const requestCancelFnRef = (0, import_react281.useRef)({ + cancel: () => { + }, + isCancelled: () => false + }); + const latestFilteringQuery = (0, import_react281.useRef)({ key: void 0, value: void 0 }); + const isSameQuery = (key, value2) => latestFilteringQuery.current.key === key && latestFilteringQuery.current.value === value2; + const onLoadItems = (filteringText) => { + if (!onRequest || isSameQuery(filteringKey, filteringText) || requestCancelFnRef.current.isCancelled()) { + return; + } + requestCancelFnRef.current.cancel(); + if (latestFilteringQuery.current.key !== filteringKey) { + setOptions([]); + } else if (filteringText === "" && (initialOptionsRef === null || initialOptionsRef === void 0 ? void 0 : initialOptionsRef.current) && initialOptionsRef.current.length > 0) { + setOptions(initialOptionsRef.current); + } + setStatusType("loading"); + latestFilteringQuery.current = { key: filteringKey, value: filteringText }; + const { promise, cancel, isCancelled } = makeCancellable(onRequest(filteringText)); + promise.then((newValues) => { + const newOptions = newValues.map((value2) => ({ value: value2 })); + setStatusType(void 0); + setOptions(newOptions); + if (initialOptionsRef) { + initialOptionsRef.current = newOptions; + } + }).catch((err) => { + if (!(err instanceof PromiseCancelledSignal)) { + setStatusType("error"); + } + }); + requestCancelFnRef.current = { cancel, isCancelled }; + }; + return import_react281.default.createElement(internal_default15, { ref, value, readOnly, statusType, options: options.length < limit ? options : [], empty: options.length < limit ? suggestionText : tooManySuggestionText, placeholder, errorText, loadingText, enteredTextLabel, clearAriaLabel, onChange: ({ detail }) => onChange(detail.value, row), onBlur: () => onBlur === null || onBlur === void 0 ? void 0 : onBlur(row), onFocus: () => { + onLoadItems(""); + }, onLoadItems: ({ detail }) => { + onLoadItems(detail.filteringText); + } }); +}); +var UndoButton = import_react281.default.forwardRef(({ children: children2, onClick }, ref) => { + return import_react281.default.createElement("a", { ref, role: "button", tabIndex: 0, className: styles_css_default86["undo-button"], onClick, onKeyDown: (event) => { + if (event.keyCode === KeyCode.space || event.keyCode === KeyCode.enter) { + event.preventDefault(); + } + if (event.keyCode === KeyCode.enter) { + onClick(); + } + }, onKeyUp: (event) => { + if (event.keyCode === KeyCode.space) { + onClick(); + } + } }, children2); +}); + +// node_modules/@cloudscape-design/components/tag-editor/validation.js +var DEFAULT_CHAR_REGEX = /^([\p{L}\p{Z}\p{N}_.:/=+\\@-]*)$/u; +var SYSTEM_TAG_PREFIX = "aws:"; +var MAX_KEY_LENGTH = 128; +var MAX_VALUE_LENGTH = 256; +function validate2(tags, keyDirtyState, i18n, i18nStrings, charRegex = DEFAULT_CHAR_REGEX) { + const tagKeysCache = {}; + tags.forEach((tag) => { + var _a; + if (tag.key && !tag.markedForRemoval) { + tagKeysCache[tag.key] = ((_a = tagKeysCache[tag.key]) !== null && _a !== void 0 ? _a : 0) + 1; + } + }); + return tags.map((tag, i) => { + let keyError, valueError; + if (keyDirtyState[i] && emptyKeyCheck(tag.key)) { + keyError = i18n("i18nStrings.emptyKeyError", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.emptyKeyError); + } else if (awsPrefixCheck(tag.key)) { + keyError = i18n("i18nStrings.awsPrefixError", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.awsPrefixError); + } else if (invalidCharCheck(tag.key, charRegex)) { + keyError = i18n("i18nStrings.invalidKeyError", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.invalidKeyError); + } else if (maxKeyLengthCheck(tag.key)) { + keyError = i18n("i18nStrings.maxKeyCharLengthError", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.maxKeyCharLengthError); + } else if (duplicateKeyCheck(tag.key, tagKeysCache)) { + keyError = i18n("i18nStrings.duplicateKeyError", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.duplicateKeyError); + } + if (!tag.markedForRemoval) { + if (invalidCharCheck(tag.value, charRegex)) { + valueError = i18n("i18nStrings.invalidValueError", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.invalidValueError); + } else if (maxValueLengthCheck(tag.value)) { + valueError = i18n("i18nStrings.maxValueCharLengthError", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.maxValueCharLengthError); + } + } + if (keyError || valueError) { + return { key: keyError, value: valueError }; + } + }); +} +var awsPrefixCheck = (value) => { + return value.toLowerCase().indexOf(SYSTEM_TAG_PREFIX) === 0; +}; +var emptyKeyCheck = (value) => { + return !value || value.trim().length === 0; +}; +var maxKeyLengthCheck = (value) => { + return value && value.length > MAX_KEY_LENGTH; +}; +var duplicateKeyCheck = (value, keyCache) => { + var _a; + return ((_a = keyCache === null || keyCache === void 0 ? void 0 : keyCache[value]) !== null && _a !== void 0 ? _a : 0) > 1; +}; +var maxValueLengthCheck = (value) => { + return value && value.length > MAX_VALUE_LENGTH; +}; +var invalidCharCheck = (value, validCharRegex = DEFAULT_CHAR_REGEX) => { + if (!value || !validCharRegex) { + return false; + } + return !validCharRegex.test(value); +}; + +// node_modules/@cloudscape-design/components/tag-editor/utils.js +var import_react282 = __toESM(require_react()); +function findIndex(array, condition) { + for (let i = 0; i < array.length; i++) { + if (condition(array[i])) { + return i; + } + } + return -1; +} +function makeMemoizedArray(prev, next, isEqual) { + for (let i = 0; i < Math.max(prev.length, next.length); i++) { + if (i === next.length) { + return prev.slice(0, i); + } + if (i === prev.length) { + return [...prev.slice(0, i), ...next.slice(i)]; + } + if (!isEqual(prev[i], next[i])) { + return [...prev.slice(0, i), next[i], ...makeMemoizedArray(prev.slice(i + 1), next.slice(i + 1), isEqual)]; + } + } + return prev; +} +function useMemoizedArray(array, isEqual) { + const ref = (0, import_react282.useRef)(array); + const updated = makeMemoizedArray(ref.current, array, isEqual); + (0, import_react282.useEffect)(() => { + ref.current = updated; + }, [updated]); + return updated; +} + +// node_modules/@cloudscape-design/components/tag-editor/index.js +var isItemRemovable = ({ tag }) => !tag.markedForRemoval; +var TagEditor = import_react283.default.forwardRef((_a, ref) => { + var _b, _c, _d, _e, _f, _g; + var { tags = [], i18nStrings, loading = false, tagLimit = 50, allowedCharacterPattern, keysRequest, valuesRequest, onChange } = _a, restProps = __rest(_a, ["tags", "i18nStrings", "loading", "tagLimit", "allowedCharacterPattern", "keysRequest", "valuesRequest", "onChange"]); + const baseComponentProps = useBaseComponent("TagEditor", { + props: { tagLimit, allowedCharacterPattern } + }); + const i18n = useInternalI18n("tag-editor"); + const remainingTags = tagLimit - tags.filter((tag) => !tag.markedForRemoval).length; + const attributeEditorRef = (0, import_react283.useRef)(null); + const keyInputRefs = (0, import_react283.useRef)([]); + const valueInputRefs = (0, import_react283.useRef)([]); + const undoButtonRefs = (0, import_react283.useRef)([]); + const initialKeyOptionsRef = (0, import_react283.useRef)([]); + const keyDirtyStateRef = (0, import_react283.useRef)([]); + const focusEventRef = (0, import_react283.useRef)(); + (0, import_react283.useLayoutEffect)(() => { + var _a2; + (_a2 = focusEventRef.current) === null || _a2 === void 0 ? void 0 : _a2.apply(void 0); + focusEventRef.current = void 0; + }); + const errors = validate2(tags, keyDirtyStateRef.current, i18n, i18nStrings, allowedCharacterPattern ? new RegExp(allowedCharacterPattern) : void 0); + const internalTags = useMemoizedArray(tags.map((tag, i) => ({ tag, error: errors[i] })), (prev, next) => { + var _a2, _b2, _c2, _d2; + return prev.tag === next.tag && ((_a2 = prev.error) === null || _a2 === void 0 ? void 0 : _a2.key) === ((_b2 = next.error) === null || _b2 === void 0 ? void 0 : _b2.key) && ((_c2 = prev.error) === null || _c2 === void 0 ? void 0 : _c2.value) === ((_d2 = next.error) === null || _d2 === void 0 ? void 0 : _d2.value); + }); + (0, import_react283.useImperativeHandle)(ref, () => ({ + focus() { + var _a2, _b2; + const errorIndex = findIndex(internalTags, ({ error }) => (error === null || error === void 0 ? void 0 : error.key) || (error === null || error === void 0 ? void 0 : error.value)); + if (errorIndex !== -1) { + const refArray = ((_a2 = internalTags[errorIndex].error) === null || _a2 === void 0 ? void 0 : _a2.key) ? keyInputRefs : valueInputRefs; + (_b2 = refArray.current[errorIndex]) === null || _b2 === void 0 ? void 0 : _b2.focus(); + } + } + }), [internalTags]); + const validateAndFire = (0, import_react283.useCallback)((newTags) => { + fireNonCancelableEvent(onChange, { + tags: newTags, + valid: !validate2(newTags, keyDirtyStateRef.current, i18n, i18nStrings, allowedCharacterPattern ? new RegExp(allowedCharacterPattern) : void 0).some((error) => error) + }); + }, [onChange, i18n, i18nStrings, allowedCharacterPattern]); + const onAddButtonClick = () => { + validateAndFire([...tags, { key: "", value: "", existing: false }]); + focusEventRef.current = () => { + var _a2; + (_a2 = keyInputRefs.current[tags.length]) === null || _a2 === void 0 ? void 0 : _a2.focus(); + }; + }; + const onRemoveButtonClick = useStableCallback(({ detail }) => { + var _a2, _b2, _c2, _d2, _e2; + const existing = tags[detail.itemIndex].existing; + validateAndFire([ + ...tags.slice(0, detail.itemIndex), + ...existing ? [Object.assign(Object.assign({}, tags[detail.itemIndex]), { markedForRemoval: true })] : [], + ...tags.slice(detail.itemIndex + 1) + ]); + if (existing) { + focusEventRef.current = () => { + var _a3; + (_a3 = undoButtonRefs.current[detail.itemIndex]) === null || _a3 === void 0 ? void 0 : _a3.focus(); + }; + } else { + keyDirtyStateRef.current.splice(detail.itemIndex, 1); + const nextKey = keyInputRefs.current[detail.itemIndex + 1]; + if (nextKey) { + (_a2 = keyInputRefs.current[detail.itemIndex]) === null || _a2 === void 0 ? void 0 : _a2.focus(); + } else if (detail.itemIndex > 0) { + const previousIsExisting = tags[detail.itemIndex - 1].existing; + if (previousIsExisting) { + if (tags[detail.itemIndex - 1].markedForRemoval) { + (_b2 = undoButtonRefs.current[detail.itemIndex - 1]) === null || _b2 === void 0 ? void 0 : _b2.focus(); + } else { + (_c2 = valueInputRefs.current[detail.itemIndex - 1]) === null || _c2 === void 0 ? void 0 : _c2.focus(); + } + } else { + (_d2 = keyInputRefs.current[detail.itemIndex - 1]) === null || _d2 === void 0 ? void 0 : _d2.focus(); + } + } else { + (_e2 = attributeEditorRef.current) === null || _e2 === void 0 ? void 0 : _e2.focusAddButton(); + } + } + }); + const onKeyChange = useStableCallback((value, row) => { + keyDirtyStateRef.current[row] = true; + validateAndFire([...tags.slice(0, row), Object.assign(Object.assign({}, tags[row]), { key: value }), ...tags.slice(row + 1)]); + }); + const onKeyBlur = useStableCallback((row) => { + keyDirtyStateRef.current[row] = true; + validateAndFire([...tags]); + }); + const onValueChange = useStableCallback((value, row) => { + validateAndFire([...tags.slice(0, row), Object.assign(Object.assign({}, tags[row]), { value }), ...tags.slice(row + 1)]); + }); + const onUndoRemoval = useStableCallback((row) => { + validateAndFire([...tags.slice(0, row), Object.assign(Object.assign({}, tags[row]), { markedForRemoval: false }), ...tags.slice(row + 1)]); + focusEventRef.current = () => { + var _a2; + (_a2 = attributeEditorRef.current) === null || _a2 === void 0 ? void 0 : _a2.focusRemoveButton(row); + }; + }); + const definition = (0, import_react283.useMemo)(() => [ + { + label: i18n("i18nStrings.keyHeader", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.keyHeader), + control: ({ tag }, row) => import_react283.default.createElement(TagControl, { row, value: tag.key, readOnly: tag.existing, limit: 200, defaultOptions: [], placeholder: i18n("i18nStrings.keyPlaceholder", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.keyPlaceholder), errorText: i18n("i18nStrings.keysSuggestionError", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.keysSuggestionError), loadingText: i18n("i18nStrings.keysSuggestionLoading", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.keysSuggestionLoading), suggestionText: i18n("i18nStrings.keySuggestion", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.keySuggestion), tooManySuggestionText: i18n("i18nStrings.tooManyKeysSuggestion", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.tooManyKeysSuggestion), enteredTextLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.enteredKeyLabel, clearAriaLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.clearAriaLabel, onRequest: keysRequest, onChange: onKeyChange, onBlur: onKeyBlur, initialOptionsRef: initialKeyOptionsRef, ref: (ref2) => { + keyInputRefs.current[row] = ref2; + } }), + errorText: ({ error }) => error === null || error === void 0 ? void 0 : error.key + }, + { + label: import_react283.default.createElement( + import_react283.default.Fragment, + null, + i18n("i18nStrings.valueHeader", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.valueHeader), + " -", + " ", + import_react283.default.createElement("i", null, i18n("i18nStrings.optional", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.optional)) + ), + control: ({ tag }, row) => { + var _a2; + return tag.markedForRemoval ? import_react283.default.createElement( + "div", + { role: "alert" }, + import_react283.default.createElement( + InternalBox, + { margin: { top: "xxs" } }, + i18n("i18nStrings.undoPrompt", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.undoPrompt), + " ", + import_react283.default.createElement(UndoButton, { onClick: () => onUndoRemoval(row), ref: (elem) => { + undoButtonRefs.current[row] = elem; + } }, i18n("i18nStrings.undoButton", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.undoButton)) + ) + ) : import_react283.default.createElement(TagControl, { row, value: tag.value, readOnly: false, limit: 200, defaultOptions: (_a2 = tag.valueSuggestionOptions) !== null && _a2 !== void 0 ? _a2 : [], placeholder: i18n("i18nStrings.valuePlaceholder", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.valuePlaceholder), errorText: i18n("i18nStrings.valuesSuggestionError", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.valuesSuggestionError), loadingText: i18n("i18nStrings.valuesSuggestionLoading", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.valuesSuggestionLoading), suggestionText: i18n("i18nStrings.valueSuggestion", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.valueSuggestion), tooManySuggestionText: i18n("i18nStrings.tooManyValuesSuggestion", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.tooManyValuesSuggestion), enteredTextLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.enteredValueLabel, clearAriaLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.clearAriaLabel, filteringKey: tag.key, onRequest: valuesRequest && ((value) => valuesRequest(tag.key, value)), onChange: onValueChange, ref: (ref2) => { + valueInputRefs.current[row] = ref2; + } }); + }, + errorText: ({ error }) => error === null || error === void 0 ? void 0 : error.value + } + ], [i18n, i18nStrings, keysRequest, onKeyChange, onKeyBlur, valuesRequest, onValueChange, onUndoRemoval]); + const forwardedI18nStrings = (0, import_react283.useMemo)(() => ({ + errorIconAriaLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.errorIconAriaLabel, + itemRemovedAriaLive: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.itemRemovedAriaLive, + removeButtonAriaLabel: i18n("i18nStrings.removeButtonAriaLabel", (i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.removeButtonAriaLabel) && (({ tag }) => i18nStrings.removeButtonAriaLabel(tag)), (format2) => ({ tag }) => format2({ tag__key: tag.key })) + }), [i18nStrings, i18n]); + if (loading) { + return import_react283.default.createElement( + "div", + { className: styles_css_default86.root, ref: baseComponentProps.__internalRootRef }, + import_react283.default.createElement( + StatusIndicator, + { className: styles_css_default86.loading, type: "loading" }, + import_react283.default.createElement(live_region_default, { visible: true }, i18n("i18nStrings.loading", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.loading)) + ) + ); + } + const baseProps = getBaseProps(restProps); + return import_react283.default.createElement(internal_default14, Object.assign({}, baseProps, baseComponentProps, { ref: attributeEditorRef, className: clsx_m_default(styles_css_default86.root, baseProps.className), items: internalTags, isItemRemovable, onAddButtonClick, onRemoveButtonClick, addButtonText: (_b = i18n("i18nStrings.addButton", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.addButton)) !== null && _b !== void 0 ? _b : "", removeButtonText: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.removeButton, disableAddButton: remainingTags <= 0, empty: i18n("i18nStrings.emptyTags", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.emptyTags), additionalInfo: remainingTags < 0 ? import_react283.default.createElement(FormFieldError, { errorIconAriaLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.errorIconAriaLabel }, (_d = i18n("i18nStrings.tagLimitExceeded", (_c = i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.tagLimitExceeded) === null || _c === void 0 ? void 0 : _c.call(i18nStrings, tagLimit), (format2) => format2({ tagLimit }))) !== null && _d !== void 0 ? _d : "") : remainingTags === 0 ? (_f = i18n("i18nStrings.tagLimitReached", (_e = i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.tagLimitReached) === null || _e === void 0 ? void 0 : _e.call(i18nStrings, tagLimit), (format2) => format2({ tagLimit }))) !== null && _f !== void 0 ? _f : "" : i18n("i18nStrings.tagLimit", (_g = i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.tagLimit) === null || _g === void 0 ? void 0 : _g.call(i18nStrings, remainingTags, tagLimit), (format2) => format2({ tagLimitAvailable: `${remainingTags === tagLimit}`, availableTags: remainingTags, tagLimit })), definition, i18nStrings: forwardedI18nStrings })); +}); +applyDisplayName(TagEditor, "TagEditor"); +var tag_editor_default = TagEditor; + +// node_modules/@cloudscape-design/components/text-content/index.js +var import_react284 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/text-content/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/text-content/styles.scoped.css"; +var styles_css_default87 = { + "text-content": "awsui_text-content_6absk_1rcdq_100" +}; + +// node_modules/@cloudscape-design/components/text-content/index.js +function TextContent(_a) { + var { children: children2 } = _a, props2 = __rest(_a, ["children"]); + const { __internalRootRef } = useBaseComponent("TextContent"); + const baseProps = getBaseProps(props2); + const className = clsx_m_default(baseProps.className, styles_css_default87["text-content"]); + return import_react284.default.createElement("div", Object.assign({}, baseProps, { className, ref: __internalRootRef }), children2); +} +applyDisplayName(TextContent, "TextContent"); + +// node_modules/@cloudscape-design/components/textarea/index.js +var import_react285 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/textarea/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/textarea/styles.scoped.css"; +var styles_css_default88 = { + "root": "awsui_root_qk1j1_w6j53_99", + "textarea": "awsui_textarea_qk1j1_w6j53_103", + "textarea-readonly": "awsui_textarea-readonly_qk1j1_w6j53_156", + "textarea-invalid": "awsui_textarea-invalid_qk1j1_w6j53_198" +}; + +// node_modules/@cloudscape-design/components/textarea/index.js +var Textarea = import_react285.default.forwardRef((_a, ref) => { + var { value, autoComplete = true, disabled, readOnly, disableBrowserAutocorrect, disableBrowserSpellcheck, spellcheck, onKeyDown, onKeyUp, onChange, onBlur, onFocus, ariaRequired, name, rows, placeholder, autoFocus, ariaLabel } = _a, rest = __rest(_a, ["value", "autoComplete", "disabled", "readOnly", "disableBrowserAutocorrect", "disableBrowserSpellcheck", "spellcheck", "onKeyDown", "onKeyUp", "onChange", "onBlur", "onFocus", "ariaRequired", "name", "rows", "placeholder", "autoFocus", "ariaLabel"]); + const { __internalRootRef } = useBaseComponent("Textarea", { + props: { autoComplete, autoFocus, disableBrowserAutocorrect, disableBrowserSpellcheck, readOnly, spellcheck } + }); + const { ariaLabelledby, ariaDescribedby, controlId, invalid } = useFormFieldContext(rest); + const baseProps = getBaseProps(rest); + const textareaRef = (0, import_react285.useRef)(null); + useForwardFocus(ref, textareaRef); + const attributes = { + "aria-label": ariaLabel, + "aria-labelledby": ariaLabelledby, + "aria-describedby": ariaDescribedby, + "aria-required": ariaRequired ? "true" : void 0, + "aria-invalid": invalid ? "true" : void 0, + name, + placeholder, + autoFocus, + className: clsx_m_default(styles_css_default88.textarea, { + [styles_css_default88["textarea-readonly"]]: readOnly, + [styles_css_default88["textarea-invalid"]]: invalid + }), + autoComplete: convertAutoComplete(autoComplete), + spellCheck: spellcheck, + disabled, + readOnly: readOnly ? true : void 0, + rows: rows || 3, + onKeyDown: onKeyDown && ((event) => fireKeyboardEvent(onKeyDown, event)), + onKeyUp: onKeyUp && ((event) => fireKeyboardEvent(onKeyUp, event)), + // We set a default value on the component in order to force it into the controlled mode. + value: value || "", + onChange: onChange && ((event) => fireNonCancelableEvent(onChange, { value: event.target.value })), + onBlur: onBlur && (() => fireNonCancelableEvent(onBlur)), + onFocus: onFocus && (() => fireNonCancelableEvent(onFocus)) + }; + if (disableBrowserAutocorrect) { + attributes.autoCorrect = "off"; + attributes.autoCapitalize = "off"; + } + if (disableBrowserSpellcheck) { + attributes.spellCheck = "false"; + } + return import_react285.default.createElement( + "span", + Object.assign({}, baseProps, { className: clsx_m_default(styles_css_default88.root, baseProps.className), ref: __internalRootRef }), + import_react285.default.createElement("textarea", Object.assign({ ref: textareaRef, id: controlId }, attributes)) + ); +}); +applyDisplayName(Textarea, "Textarea"); +var textarea_default = Textarea; + +// node_modules/@cloudscape-design/components/tiles/index.js +var import_react286 = __toESM(require_react()); +var Tiles = import_react286.default.forwardRef((props2, ref) => { + const baseComponentProps = useBaseComponent("Tiles", { + props: { columns: props2.columns } + }); + return import_react286.default.createElement(internal_default20, Object.assign({ ref }, props2, baseComponentProps)); +}); +applyDisplayName(Tiles, "Tiles"); +var tiles_default = Tiles; + +// node_modules/@cloudscape-design/components/time-input/index.js +var import_react287 = __toESM(require_react()); +var TimeInput = import_react287.default.forwardRef((_a, ref) => { + var { format: format2 = "hh:mm:ss", use24Hour = true, autoComplete = true } = _a, props2 = __rest(_a, ["format", "use24Hour", "autoComplete"]); + const baseComponentProps = useBaseComponent("TimeInput", { + props: { + autoFocus: props2.autoFocus, + disableBrowserAutocorrect: props2.disableBrowserAutocorrect, + format: format2, + readOnly: props2.readOnly, + use24Hour + } + }); + return import_react287.default.createElement(internal_default19, Object.assign({ format: format2, use24Hour, autoComplete }, props2, baseComponentProps, { ref })); +}); +applyDisplayName(TimeInput, "TimeInput"); +var time_input_default = TimeInput; + +// node_modules/@cloudscape-design/components/toggle/index.js +var import_react288 = __toESM(require_react()); +var Toggle = import_react288.default.forwardRef((props2, ref) => { + const baseComponentProps = useBaseComponent("Toggle"); + return import_react288.default.createElement(internal_default7, Object.assign({}, props2, baseComponentProps, { ref })); +}); +applyDisplayName(Toggle, "Toggle"); +var toggle_default = Toggle; + +// node_modules/@cloudscape-design/components/token-group/index.js +var import_react289 = __toESM(require_react()); +function TokenGroup(_a) { + var { items = [], alignment = "horizontal" } = _a, props2 = __rest(_a, ["items", "alignment"]); + const baseComponentProps = useBaseComponent("TokenGroup", { + props: { alignment, disableOuterPadding: props2.disableOuterPadding, limit: props2.limit } + }); + return import_react289.default.createElement(InternalTokenGroup, Object.assign({ items, alignment }, props2, baseComponentProps)); +} +applyDisplayName(TokenGroup, "TokenGroup"); + +// node_modules/@cloudscape-design/components/top-navigation/index.js +var import_react300 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/top-navigation/internal.js +var import_react299 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/top-navigation/use-top-navigation.js +var import_react290 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/top-navigation/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/top-navigation/styles.scoped.css"; +var styles_css_default89 = { + "icon": "awsui_icon_k5dlb_d6w6r_99", + "top-navigation": "awsui_top-navigation_k5dlb_d6w6r_117", + "padding-box": "awsui_padding-box_k5dlb_d6w6r_152", + "medium": "awsui_medium_k5dlb_d6w6r_162", + "narrow": "awsui_narrow_k5dlb_d6w6r_162", + "virtual": "awsui_virtual_k5dlb_d6w6r_173", + "hidden": "awsui_hidden_k5dlb_d6w6r_177", + " ": "awsui_ _k5dlb_d6w6r_1", + "identity": "awsui_identity_k5dlb_d6w6r_189", + "identity-link": "awsui_identity-link_k5dlb_d6w6r_192", + "no-logo": "awsui_no-logo_k5dlb_d6w6r_212", + "logo": "awsui_logo_k5dlb_d6w6r_216", + "title": "awsui_title_k5dlb_d6w6r_228", + "inputs": "awsui_inputs_k5dlb_d6w6r_243", + "search": "awsui_search_k5dlb_d6w6r_251", + "search-expanded": "awsui_search-expanded_k5dlb_d6w6r_255", + "utilities": "awsui_utilities_k5dlb_d6w6r_259", + "utility-wrapper": "awsui_utility-wrapper_k5dlb_d6w6r_270", + "utility-type-button-link": "awsui_utility-type-button-link_k5dlb_d6w6r_291", + "utility-type-menu-dropdown": "awsui_utility-type-menu-dropdown_k5dlb_d6w6r_296", + "utility-type-button-primary-button": "awsui_utility-type-button-primary-button_k5dlb_d6w6r_305", + "utility-link-icon": "awsui_utility-link-icon_k5dlb_d6w6r_313", + "utility-button-external-icon": "awsui_utility-button-external-icon_k5dlb_d6w6r_317", + "offset-right-none": "awsui_offset-right-none_k5dlb_d6w6r_321", + "offset-right-l": "awsui_offset-right-l_k5dlb_d6w6r_325", + "offset-right-xxl": "awsui_offset-right-xxl_k5dlb_d6w6r_329", + "overflow-menu-drawer": "awsui_overflow-menu-drawer_k5dlb_d6w6r_334", + "overflow-menu": "awsui_overflow-menu_k5dlb_d6w6r_334", + "overflow-menu-header": "awsui_overflow-menu-header_k5dlb_d6w6r_378", + "overflow-menu-header-text": "awsui_overflow-menu-header-text_k5dlb_d6w6r_386", + "overflow-menu-header-text--secondary": "awsui_overflow-menu-header-text--secondary_k5dlb_d6w6r_398", + "overflow-menu-header-text--title": "awsui_overflow-menu-header-text--title_k5dlb_d6w6r_404", + "overflow-menu-back-button": "awsui_overflow-menu-back-button_k5dlb_d6w6r_408", + "overflow-menu-dismiss-button": "awsui_overflow-menu-dismiss-button_k5dlb_d6w6r_412", + "overflow-menu-control": "awsui_overflow-menu-control_k5dlb_d6w6r_416", + "overflow-menu-list-item-utility": "awsui_overflow-menu-list-item-utility_k5dlb_d6w6r_457", + "overflow-menu-control-link": "awsui_overflow-menu-control-link_k5dlb_d6w6r_465", + "overflow-menu-control-expandable-menu-trigger": "awsui_overflow-menu-control-expandable-menu-trigger_k5dlb_d6w6r_468", + "overflow-menu-list": "awsui_overflow-menu-list_k5dlb_d6w6r_457", + "overflow-menu-list-submenu": "awsui_overflow-menu-list-submenu_k5dlb_d6w6r_504", + "overflow-menu-list-item": "awsui_overflow-menu-list-item_k5dlb_d6w6r_457", + "overflow-menu-list-item-icon": "awsui_overflow-menu-list-item-icon_k5dlb_d6w6r_513", + "overflow-menu-list-item-text": "awsui_overflow-menu-list-item-text_k5dlb_d6w6r_516", + "overflow-menu-list-item-submenu": "awsui_overflow-menu-list-item-submenu_k5dlb_d6w6r_525", + "overflow-menu-list-item-dropdown-menu": "awsui_overflow-menu-list-item-dropdown-menu_k5dlb_d6w6r_531", + "overflow-menu-list-item-expandable": "awsui_overflow-menu-list-item-expandable_k5dlb_d6w6r_535", + "expanded": "awsui_expanded_k5dlb_d6w6r_543" +}; + +// node_modules/@cloudscape-design/components/top-navigation/use-top-navigation.js +var RESPONSIVENESS_BUFFER = 20; +function useTopNavigation({ identity: identity2, search, utilities }) { + const mainRef = (0, import_react290.useRef)(null); + const virtualRef = (0, import_react290.useRef)(null); + const [breakpoint, breakpointRef] = useContainerBreakpoints(["xxs", "s"]); + const hasSearch = !!search; + const hasTitleWithLogo = identity2 && !!identity2.logo && !!identity2.title; + const responsiveStates = (0, import_react290.useMemo)(() => { + return generateResponsiveStateKeys(utilities, hasSearch, hasTitleWithLogo); + }, [utilities, hasSearch, hasTitleWithLogo]); + const [responsiveState, setResponsiveState] = (0, import_react290.useState)(); + const recalculateFit = (0, import_react290.useCallback)(() => { + var _a, _b, _c, _d; + if (!(mainRef === null || mainRef === void 0 ? void 0 : mainRef.current) || !virtualRef.current) { + setResponsiveState(responsiveStates[0]); + return; + } + const availableWidth = getContentBoxWidth(mainRef.current.querySelector(`.${styles_css_default89["padding-box"]}`)); + if (availableWidth === 0) { + setResponsiveState(responsiveStates[0]); + return; + } + const sizeConfiguration = { + hasSearch, + availableWidth, + // Get widths from the hidden top navigation + fullIdentityWidth: virtualRef.current.querySelector(`.${styles_css_default89.identity}`).getBoundingClientRect().width, + titleWidth: (_b = (_a = virtualRef.current.querySelector(`.${styles_css_default89.title}`)) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().width) !== null && _b !== void 0 ? _b : 0, + searchSlotWidth: (_d = (_c = virtualRef.current.querySelector(`.${styles_css_default89.search}`)) === null || _c === void 0 ? void 0 : _c.getBoundingClientRect().width) !== null && _d !== void 0 ? _d : 0, + searchUtilityWidth: virtualRef.current.querySelector('[data-utility-special="search"]').getBoundingClientRect().width, + utilitiesLeftPadding: parseFloat(getComputedStyle(virtualRef.current.querySelector(`.${styles_css_default89.utilities}`)).paddingLeft || "0px"), + utilityWithLabelWidths: Array.prototype.slice.call(virtualRef.current.querySelectorAll(`[data-utility-hide="false"]`)).map((element) => element.getBoundingClientRect().width), + utilityWithoutLabelWidths: Array.prototype.slice.call(virtualRef.current.querySelectorAll(`[data-utility-hide="true"]`)).map((element) => element.getBoundingClientRect().width), + menuTriggerUtilityWidth: virtualRef.current.querySelector('[data-utility-special="menu-trigger"]').getBoundingClientRect().width + }; + setResponsiveState(determineBestResponsiveState(responsiveStates, sizeConfiguration)); + }, [responsiveStates, hasSearch]); + const [, containerQueryRef] = useContainerQuery(() => { + recalculateFit(); + }, [recalculateFit]); + const onVirtualMount = (0, import_react290.useCallback)((element) => { + virtualRef.current = element; + recalculateFit(); + }, [recalculateFit]); + const [isSearchMinimized, setSearchMinimized] = (0, import_react290.useState)(true); + const isSearchExpanded = !isSearchMinimized && hasSearch && (responsiveState === null || responsiveState === void 0 ? void 0 : responsiveState.hideSearch); + (0, import_react290.useEffect)(() => { + if (!(responsiveState === null || responsiveState === void 0 ? void 0 : responsiveState.hideSearch)) { + setSearchMinimized(true); + } + }, [responsiveState]); + (0, import_react290.useEffect)(() => { + var _a, _b; + if (isSearchExpanded) { + (_b = (_a = mainRef === null || mainRef === void 0 ? void 0 : mainRef.current) === null || _a === void 0 ? void 0 : _a.querySelector(`.${styles_css_default89.search} input`)) === null || _b === void 0 ? void 0 : _b.focus(); + } + }, [isSearchExpanded, mainRef]); + const mergedMainRef = useMergeRefs(mainRef, containerQueryRef, breakpointRef); + return { + mainRef: mergedMainRef, + virtualRef: onVirtualMount, + responsiveState: responsiveState !== null && responsiveState !== void 0 ? responsiveState : responsiveStates[0], + breakpoint: breakpoint !== null && breakpoint !== void 0 ? breakpoint : "default", + isSearchExpanded: !!isSearchExpanded, + onSearchUtilityClick: () => setSearchMinimized((isSearchMinimized2) => !isSearchMinimized2) + }; +} +function getContentBoxWidth(element) { + const style = getComputedStyle(element); + return parseFloat(style.width || "0px") - parseFloat(style.paddingLeft || "0px") - parseFloat(style.paddingRight || "0px"); +} +function generateResponsiveStateKeys(utilities, canHideSearch, canHideTitle) { + const states = [{}]; + if (utilities.some((utility) => utility.text)) { + states.push({ hideUtilityText: true }); + } + if (canHideSearch) { + states.push({ + hideUtilityText: true, + hideSearch: true + }); + } + const hiddenUtilties = []; + for (let i = 0; i < utilities.length; i++) { + if (!utilities[i].disableUtilityCollapse) { + hiddenUtilties.push(i); + states.push({ + hideUtilityText: true, + hideSearch: canHideSearch || void 0, + hideUtilities: hiddenUtilties.length > 0 ? hiddenUtilties.slice() : void 0 + }); + } + } + if (canHideTitle) { + states.push({ + hideUtilityText: true, + hideSearch: canHideSearch || void 0, + hideUtilities: hiddenUtilties.length > 0 ? hiddenUtilties.slice() : void 0, + hideTitle: true + }); + } + return states; +} +function determineBestResponsiveState(possibleStates, sizes) { + const { hasSearch, availableWidth, utilitiesLeftPadding, fullIdentityWidth, titleWidth, searchSlotWidth, searchUtilityWidth, utilityWithLabelWidths, utilityWithoutLabelWidths, menuTriggerUtilityWidth } = sizes; + for (const state of possibleStates) { + const searchWidth = hasSearch ? state.hideSearch ? searchUtilityWidth : searchSlotWidth : 0; + const utilitiesWidth = (state.hideUtilityText ? utilityWithoutLabelWidths : utilityWithLabelWidths).filter((_width, i) => !state.hideUtilities || state.hideUtilities.indexOf(i) === -1).reduce((sum2, width) => sum2 + width, 0); + const menuTriggerWidth = state.hideUtilities ? menuTriggerUtilityWidth : 0; + const identityWidth = state.hideTitle ? fullIdentityWidth - titleWidth : fullIdentityWidth; + const expectedInnerWidth = identityWidth + searchWidth + utilitiesLeftPadding + utilitiesWidth + menuTriggerWidth; + if (expectedInnerWidth <= availableWidth - RESPONSIVENESS_BUFFER) { + return state; + } + } + return possibleStates[possibleStates.length - 1]; +} + +// node_modules/@cloudscape-design/components/top-navigation/parts/utility.js +var import_react292 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/internal/components/menu-dropdown/index.js +var import_react291 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/internal/components/menu-dropdown/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/internal/components/menu-dropdown/styles.scoped.css"; +var styles_css_default90 = { + "button": "awsui_button_m5h9f_1s7lt_99", + "expanded": "awsui_expanded_m5h9f_1s7lt_154", + "offset-right-none": "awsui_offset-right-none_m5h9f_1s7lt_165", + "offset-right-l": "awsui_offset-right-l_m5h9f_1s7lt_168", + "offset-right-xxl": "awsui_offset-right-xxl_m5h9f_1s7lt_171", + "text": "awsui_text_m5h9f_1s7lt_196", + "icon": "awsui_icon_m5h9f_1s7lt_200" +}; + +// node_modules/@cloudscape-design/components/internal/components/menu-dropdown/index.js +var ButtonTrigger2 = import_react291.default.forwardRef(({ testUtilsClass, iconName, iconUrl, iconAlt, iconSvg, badge, ariaLabel, offsetRight, disabled, expanded, children: children2, onClick }, ref) => { + const hasIcon = iconName || iconUrl || iconSvg; + return import_react291.default.createElement( + "button", + { ref, type: "button", className: clsx_m_default(styles_css_default90.button, styles_css_default90[`offset-right-${offsetRight}`], testUtilsClass, { + [styles_css_default90.expanded]: expanded + }), "aria-label": ariaLabel, "aria-expanded": !!expanded, "aria-haspopup": true, disabled, onClick: (event) => { + event.preventDefault(); + onClick && onClick(); + } }, + hasIcon && import_react291.default.createElement(internal_default, { className: styles_css_default90.icon, name: iconName, url: iconUrl, alt: iconAlt, svg: iconSvg, badge }), + children2 && import_react291.default.createElement("span", { className: styles_css_default90.text }, children2), + children2 && import_react291.default.createElement(internal_default, { name: "caret-down-filled", className: expanded ? styles_css_default12["rotate-up"] : styles_css_default12["rotate-down"] }) + ); +}); +var MenuDropdown = (_a) => { + var { iconName, iconUrl, iconAlt, iconSvg, badge, offsetRight, children: children2 } = _a, props2 = __rest(_a, ["iconName", "iconUrl", "iconAlt", "iconSvg", "badge", "offsetRight", "children"]); + const baseProps = getBaseProps(props2); + const dropdownTrigger = ({ triggerRef, ariaLabel, isOpen, testUtilsClass, disabled, onClick }) => { + return import_react291.default.createElement(ButtonTrigger2, { testUtilsClass, ref: triggerRef, disabled, expanded: isOpen, iconName, iconUrl, iconAlt, iconSvg, badge, ariaLabel, offsetRight, onClick }, children2); + }; + return import_react291.default.createElement(internal_default11, Object.assign({}, baseProps, props2, { variant: "navigation", customTriggerBuilder: dropdownTrigger, preferCenter: true })); +}; +applyDisplayName(MenuDropdown, "MenuDropdown"); +var menu_dropdown_default = MenuDropdown; + +// node_modules/@cloudscape-design/components/top-navigation/parts/utility.js +function Utility({ hideText, definition, offsetRight }) { + var _a; + const hasIcon = !!definition.iconName || !!definition.iconUrl || !!definition.iconAlt || !!definition.iconSvg; + const shouldHideText = hideText && !definition.disableTextCollapse && hasIcon; + let ariaLabel = (_a = definition.ariaLabel) !== null && _a !== void 0 ? _a : definition.text; + if (definition.type === "button") { + ariaLabel = definition.ariaLabel ? definition.ariaLabel : joinStrings(definition.text, definition.externalIconAriaLabel); + checkSafeUrl("TopNavigation", definition.href); + if (definition.variant === "primary-button") { + return import_react292.default.createElement( + "span", + { className: styles_css_default89[`offset-right-${offsetRight}`] }, + import_react292.default.createElement(InternalButton, { variant: "primary", href: definition.href, target: definition.external ? "_blank" : void 0, onClick: definition.onClick, onFollow: definition.onFollow, ariaLabel, iconName: definition.iconName, iconUrl: definition.iconUrl, iconAlt: definition.iconAlt, iconSvg: definition.iconSvg }, shouldHideText ? null : import_react292.default.createElement( + import_react292.default.Fragment, + null, + definition.text, + definition.external && import_react292.default.createElement( + import_react292.default.Fragment, + null, + " ", + import_react292.default.createElement( + "span", + { className: clsx_m_default(styles_css_default89["utility-button-external-icon"], styles_css_default89[`offset-right-${offsetRight}`]), "aria-label": definition.externalIconAriaLabel, role: definition.externalIconAriaLabel ? "img" : void 0 }, + import_react292.default.createElement(internal_default, { name: "external" }) + ) + ) + )) + ); + } else { + return import_react292.default.createElement( + "span", + { className: styles_css_default89[`offset-right-${offsetRight}`] }, + import_react292.default.createElement( + internal_default12, + { variant: "top-navigation", href: definition.href, target: definition.target, rel: definition.rel, external: definition.external, onFollow: (evt) => { + fireCancelableEvent(definition.onFollow, { href: definition.href, target: definition.target, external: definition.external }, evt); + fireCancelableEvent(definition.onClick, { href: definition.href, target: definition.target, external: definition.external }, evt); + }, ariaLabel }, + hasIcon && import_react292.default.createElement(internal_default, { name: definition.iconName, url: definition.iconUrl, alt: definition.iconAlt, svg: definition.iconSvg, badge: definition.badge }), + !shouldHideText && definition.text && import_react292.default.createElement("span", { className: hasIcon ? styles_css_default89["utility-link-icon"] : void 0 }, definition.text) + ) + ); + } + } else if (definition.type === "menu-dropdown") { + const title = definition.title || definition.text; + const shouldShowTitle = shouldHideText || !definition.text; + checkSafeUrlRecursively(definition.items); + return import_react292.default.createElement(menu_dropdown_default, Object.assign({}, definition, { title: shouldShowTitle ? title : "", ariaLabel, offsetRight }), !shouldHideText && definition.text); + } + return null; +} +function checkSafeUrlRecursively(itemOrGroup) { + for (const item of itemOrGroup) { + checkSafeUrl("TopNavigation", item.href); + if ("items" in item) { + checkSafeUrlRecursively(item.items); + } + } +} + +// node_modules/@cloudscape-design/components/top-navigation/parts/overflow-menu/index.js +var import_react298 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/top-navigation/parts/overflow-menu/router.js +var import_react293 = __toESM(require_react()); +var defaultCtx = { state: { view: "utilities", data: null }, setState: () => { +} }; +var ViewContext = (0, import_react293.createContext)(defaultCtx); +var useNavigate = () => { + const { setState } = (0, import_react293.useContext)(ViewContext); + const navigate = (view, data) => { + setState({ view, data }); + }; + return navigate; +}; +var Route = ({ view, element }) => { + const { state } = (0, import_react293.useContext)(ViewContext); + if (view === state.view) { + if (typeof element === "function") { + return element(state.data); + } + return import_react293.default.createElement(import_react293.default.Fragment, null, element); + } + return null; +}; +var Router = ({ children: children2 }) => { + const [state, setState] = (0, import_react293.useState)({ view: "utilities", data: null }); + return import_react293.default.createElement(ViewContext.Provider, { value: { state, setState } }, children2); +}; +var router_default = Router; + +// node_modules/@cloudscape-design/components/top-navigation/parts/overflow-menu/views/utilities.js +var import_react296 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/top-navigation/parts/overflow-menu/header.js +var import_react294 = __toESM(require_react()); +var Header4 = ({ children: children2, secondaryText, backIconAriaLabel, dismissIconAriaLabel, onBack, onClose }) => { + return import_react294.default.createElement( + "div", + { className: styles_css_default89["overflow-menu-header"] }, + onBack && import_react294.default.createElement( + internal_default2, + { + // Used for test-utils, which require the selectable element to have a classname. + // eslint-disable-next-line react/forbid-component-props + className: styles_css_default89["overflow-menu-back-button"], + ariaLabel: backIconAriaLabel, + iconName: "angle-left", + variant: "icon", + onClick: () => onBack() + } + ), + import_react294.default.createElement( + "h2", + { className: styles_css_default89["overflow-menu-header-text"] }, + import_react294.default.createElement("div", { className: styles_css_default89["overflow-menu-header-text--title"] }, children2), + secondaryText && import_react294.default.createElement("div", { className: styles_css_default89["overflow-menu-header-text--secondary"] }, secondaryText) + ), + import_react294.default.createElement( + internal_default2, + { + // eslint-disable-next-line react/forbid-component-props + className: styles_css_default89["overflow-menu-dismiss-button"], + ariaLabel: dismissIconAriaLabel, + iconName: "close", + variant: "icon", + onClick: () => onClose && onClose() + } + ) + ); +}; +var header_default2 = Header4; + +// node_modules/@cloudscape-design/components/top-navigation/parts/overflow-menu/menu-item.js +var import_react295 = __toESM(require_react()); +var ListItem = ({ children: children2, startIcon, endIcon }) => { + return import_react295.default.createElement( + import_react295.default.Fragment, + null, + startIcon && import_react295.default.createElement("span", { className: styles_css_default89["overflow-menu-list-item-icon"] }, startIcon), + import_react295.default.createElement("span", { className: styles_css_default89["overflow-menu-list-item-text"] }, children2), + endIcon && endIcon + ); +}; +var LinkItem = (0, import_react295.forwardRef)(({ children: children2, external, href, target, rel, startIcon, endIcon, onClick, context, testId }, ref) => { + const anchorTarget = target !== null && target !== void 0 ? target : external ? "_blank" : void 0; + const anchorRel = rel !== null && rel !== void 0 ? rel : anchorTarget === "_blank" ? "noopener noreferrer" : void 0; + const role = !href ? "button" : void 0; + return import_react295.default.createElement( + "a", + Object.assign({ ref, onClick, className: clsx_m_default(styles_css_default89["overflow-menu-control"], styles_css_default89["overflow-menu-control-link"], context && styles_css_default89[`overflow-menu-control-${context}`]), role, tabIndex: 0, href, target: anchorTarget, rel: anchorRel }, testId ? { "data-testid": testId } : {}), + import_react295.default.createElement(ListItem, { startIcon, endIcon }, children2) + ); +}); +var ButtonItem = (0, import_react295.forwardRef)(({ children: children2, startIcon, endIcon, onClick, testId }, ref) => { + return import_react295.default.createElement( + "button", + Object.assign({ ref, className: styles_css_default89["overflow-menu-control"], onClick }, typeof testId === "string" ? { "data-testid": testId } : {}), + import_react295.default.createElement(ListItem, { startIcon, endIcon }, children2) + ); +}); +var NavigationItem = (0, import_react295.forwardRef)((_a, ref) => { + var { startIcon, children: children2, index, testId } = _a, definition = __rest(_a, ["startIcon", "children", "index", "testId"]); + const navigate = useNavigate(); + return import_react295.default.createElement(ButtonItem, { ref, startIcon, endIcon: import_react295.default.createElement(internal_default, { name: "angle-right" }), testId, onClick: () => navigate("dropdown-menu", { + definition, + headerText: definition.text || definition.title, + headerSecondaryText: definition.description, + utilityIndex: index + }) }, children2); +}); +var ExpandableItem = (_a) => { + var { children: children2, onItemClick } = _a, definition = __rest(_a, ["children", "onItemClick"]); + const [expanded, setExpanded] = (0, import_react295.useState)(false); + const headerId = useUniqueId("overflow-menu-item"); + return import_react295.default.createElement( + import_react295.default.Fragment, + null, + import_react295.default.createElement( + "button", + { className: clsx_m_default(styles_css_default89["overflow-menu-control"], styles_css_default89["overflow-menu-control-expandable-menu-trigger"]), onClick: () => setExpanded((value) => !value), "aria-expanded": expanded }, + import_react295.default.createElement( + ListItem, + { endIcon: import_react295.default.createElement( + "span", + { className: clsx_m_default(styles_css_default89.icon, expanded && styles_css_default89.expanded) }, + import_react295.default.createElement(internal_default, { name: "caret-up-filled" }) + ) }, + import_react295.default.createElement("span", { id: headerId }, children2) + ) + ), + expanded && import_react295.default.createElement("ul", { className: clsx_m_default(styles_css_default89["overflow-menu-list"], styles_css_default89["overflow-menu-list-submenu"]), "aria-labelledby": headerId }, definition.items.map((item, index) => { + const isGroup5 = typeof item.items !== "undefined"; + return import_react295.default.createElement("li", { key: index, className: clsx_m_default(styles_css_default89[`overflow-menu-list-item`], styles_css_default89[`overflow-menu-list-item-dropdown-menu`]) }, dropdownComponentFactory(item, isGroup5, onItemClick)); + })) + ); +}; +function utilityComponentFactory(utility, index, ref) { + const label = utility.text || utility.title; + const hasIcon = !!utility.iconName || !!utility.iconUrl || !!utility.iconAlt || !!utility.iconSvg; + const startIcon = hasIcon && import_react295.default.createElement(internal_default, { name: utility.iconName, url: utility.iconUrl, alt: utility.iconAlt, svg: utility.iconSvg }); + switch (utility.type) { + case "button": { + const handleClick = (event) => { + var _a; + if (Boolean(utility.href) && isPlainLeftClick(event)) { + fireCancelableEvent(utility.onFollow, { href: utility.href, target: utility.target }, event); + } + fireCancelableEvent(utility.onClick, {}, event); + (_a = utility.onClose) === null || _a === void 0 ? void 0 : _a.call(utility); + }; + const content = import_react295.default.createElement( + import_react295.default.Fragment, + null, + label, + utility.external && import_react295.default.createElement( + import_react295.default.Fragment, + null, + " ", + import_react295.default.createElement( + "span", + { "aria-label": utility.externalIconAriaLabel, role: utility.externalIconAriaLabel ? "img" : void 0 }, + import_react295.default.createElement(internal_default, { name: "external", size: "normal" }) + ) + ) + ); + if (!utility.href) { + return import_react295.default.createElement(ButtonItem, { ref, startIcon, onClick: handleClick, testId: `__${index}` }, content); + } + return import_react295.default.createElement(LinkItem, { ref, startIcon, href: utility.href, external: utility.external, target: utility.target, rel: utility.rel, testId: `__${index}`, onClick: handleClick }, content); + } + case "menu-dropdown": { + return import_react295.default.createElement(NavigationItem, Object.assign({ ref, startIcon, index }, utility, { testId: `__${index}` }), label); + } + } +} +function dropdownComponentFactory(item, expandable, onItemClick) { + const label = item.text; + const hasIcon = !!item.iconName || !!item.iconUrl || !!item.iconAlt || !!item.iconSvg; + const startIcon = hasIcon && import_react295.default.createElement(internal_default, { name: item.iconName, url: item.iconUrl, alt: item.iconAlt, svg: item.iconSvg }); + if (expandable) { + return import_react295.default.createElement(ExpandableItem, Object.assign({}, item, { onItemClick }), label); + } + return import_react295.default.createElement( + LinkItem, + { startIcon, href: item.href, external: item.external, context: "dropdown-menu", testId: item.id, onClick: (event) => onItemClick(event, item) }, + label, + item.external && import_react295.default.createElement( + import_react295.default.Fragment, + null, + " ", + import_react295.default.createElement( + "span", + { "aria-label": item.externalIconAriaLabel, role: item.externalIconAriaLabel ? "img" : void 0 }, + import_react295.default.createElement(internal_default, { name: "external", size: "normal" }) + ) + ) + ); +} +var UtilityMenuItem = (0, import_react295.forwardRef)((_a, ref) => { + var { index } = _a, props2 = __rest(_a, ["index"]); + return import_react295.default.createElement("li", { className: clsx_m_default(styles_css_default89[`overflow-menu-list-item`], styles_css_default89[`overflow-menu-list-item-utility`]) }, utilityComponentFactory(props2, index, ref)); +}); +var SubmenuItem = (props2) => { + const expandable = typeof props2.items !== "undefined"; + return import_react295.default.createElement("li", { className: clsx_m_default(styles_css_default89[`overflow-menu-list-item`], styles_css_default89[`overflow-menu-list-item-submenu`], expandable && styles_css_default89[`overflow-menu-list-item-expandable`]) }, dropdownComponentFactory(props2, expandable, props2.onClick)); +}; + +// node_modules/@cloudscape-design/components/top-navigation/parts/overflow-menu/views/utilities.js +var UtilitiesView = ({ headerText, dismissIconAriaLabel, onClose, items = [], focusIndex }) => { + const headerId = useUniqueId("overflow-menu-header"); + const ref = (0, import_react296.useRef)(null); + (0, import_react296.useEffect)(() => { + var _a; + if (typeof focusIndex === "number") { + (_a = ref.current) === null || _a === void 0 ? void 0 : _a.focus(); + } + }, [focusIndex]); + return import_react296.default.createElement( + focus_lock_default, + { autoFocus: true }, + import_react296.default.createElement( + header_default2, + { dismissIconAriaLabel, onClose }, + import_react296.default.createElement("span", { id: headerId }, headerText) + ), + import_react296.default.createElement("ul", { className: styles_css_default89["overflow-menu-list"], "aria-labelledby": headerId }, items.map((utility, index) => import_react296.default.createElement(UtilityMenuItem, Object.assign({ key: index, index, ref: index === focusIndex ? ref : void 0, onClose }, utility)))) + ); +}; +var utilities_default = UtilitiesView; + +// node_modules/@cloudscape-design/components/top-navigation/parts/overflow-menu/views/submenu.js +var import_react297 = __toESM(require_react()); +var SubmenuView = ({ onClose, utilityIndex, headerText, headerSecondaryText, dismissIconAriaLabel, backIconAriaLabel, definition }) => { + const navigate = useNavigate(); + const headerId = useUniqueId("overflow-menu-header"); + return import_react297.default.createElement( + focus_lock_default, + { autoFocus: true }, + import_react297.default.createElement( + header_default2, + { secondaryText: headerSecondaryText, dismissIconAriaLabel, backIconAriaLabel, onClose, onBack: () => navigate("utilities", { utilityIndex }) }, + import_react297.default.createElement("span", { id: headerId }, headerText) + ), + import_react297.default.createElement("ul", { className: clsx_m_default(styles_css_default89["overflow-menu-list"], styles_css_default89["overflow-menu-list-submenu"]), "aria-labelledby": headerId }, definition.items.map((item, index) => import_react297.default.createElement(SubmenuItem, Object.assign({ key: index }, item, { onClick: (event, item2) => { + if (item2.href && isPlainLeftClick(event)) { + fireCancelableEvent(definition.onItemFollow, { id: item2.id, href: item2.href, external: item2.external }, event); + } + fireCancelableEvent(definition.onItemClick, { id: item2.id, href: item2.href, external: item2.external }, event); + onClose === null || onClose === void 0 ? void 0 : onClose(); + } })))) + ); +}; +var submenu_default = SubmenuView; + +// node_modules/@cloudscape-design/components/top-navigation/parts/overflow-menu/index.js +var OverflowMenu2 = ({ headerText, dismissIconAriaLabel, backIconAriaLabel, items = [], onClose }) => { + const i18n = useInternalI18n("top-navigation"); + const renderedDismissIconAriaLabel = i18n("i18nStrings.overflowMenuDismissIconAriaLabel", dismissIconAriaLabel); + const renderedBackIconAriaLabel = i18n("i18nStrings.overflowMenuBackIconAriaLabel", backIconAriaLabel); + return import_react298.default.createElement( + "div", + { className: styles_css_default89["overflow-menu"], onKeyUp: (event) => { + if (event.key === "Escape") { + onClose === null || onClose === void 0 ? void 0 : onClose(); + } + } }, + import_react298.default.createElement( + router_default, + null, + import_react298.default.createElement(Route, { view: "utilities", element: (data) => import_react298.default.createElement(utilities_default, { headerText: i18n("i18nStrings.overflowMenuTitleText", headerText), items, focusIndex: data === null || data === void 0 ? void 0 : data.utilityIndex, dismissIconAriaLabel: renderedDismissIconAriaLabel, backIconAriaLabel: renderedBackIconAriaLabel, onClose }) }), + import_react298.default.createElement(Route, { view: "dropdown-menu", element: (data) => import_react298.default.createElement(submenu_default, { headerText: data === null || data === void 0 ? void 0 : data.headerText, headerSecondaryText: data === null || data === void 0 ? void 0 : data.headerSecondaryText, dismissIconAriaLabel: renderedDismissIconAriaLabel, backIconAriaLabel: renderedBackIconAriaLabel, definition: data === null || data === void 0 ? void 0 : data.definition, utilityIndex: data === null || data === void 0 ? void 0 : data.utilityIndex, onClose }) }) + ) + ); +}; +var overflow_menu_default = OverflowMenu2; + +// node_modules/@cloudscape-design/components/top-navigation/internal.js +function InternalTopNavigation(_a) { + var { __internalRootRef, identity: identity2, i18nStrings, utilities, search } = _a, restProps = __rest(_a, ["__internalRootRef", "identity", "i18nStrings", "utilities", "search"]); + checkSafeUrl("TopNavigation", identity2.href); + const baseProps = getBaseProps(restProps); + const { mainRef, virtualRef, breakpoint, responsiveState, isSearchExpanded, onSearchUtilityClick } = useTopNavigation({ identity: identity2, search, utilities }); + const [overflowMenuOpen, setOverflowMenuOpen] = (0, import_react299.useState)(false); + const overflowMenuTriggerRef = (0, import_react299.useRef)(null); + const isNarrowViewport = breakpoint === "default"; + const isMediumViewport = breakpoint === "xxs"; + const isLargeViewport = breakpoint === "s"; + const i18n = useInternalI18n("top-navigation"); + const onIdentityClick = (event) => { + if (isPlainLeftClick(event)) { + fireCancelableEvent(identity2.onFollow, {}, event); + } + }; + const toggleOverflowMenu = () => { + setOverflowMenuOpen((overflowMenuOpen2) => !overflowMenuOpen2); + }; + const menuTriggerVisible = !isSearchExpanded && responsiveState.hideUtilities; + (0, import_react299.useEffect)(() => { + setOverflowMenuOpen(false); + }, [menuTriggerVisible]); + useEffectOnUpdate(() => { + var _a2; + if (!overflowMenuOpen) { + (_a2 = overflowMenuTriggerRef.current) === null || _a2 === void 0 ? void 0 : _a2.focus(); + } + }, [overflowMenuOpen]); + const content = (isVirtual) => { + var _a2, _b; + const Wrapper = isVirtual ? "div" : "header"; + const showIdentity = isVirtual || !isSearchExpanded; + const showTitle = isVirtual || !responsiveState.hideTitle; + const showSearchSlot = search && (isVirtual || !responsiveState.hideSearch || isSearchExpanded); + const showSearchUtility = isVirtual || search && responsiveState.hideSearch; + const showUtilities = isVirtual || !isSearchExpanded; + const showMenuTrigger = isVirtual || menuTriggerVisible; + return import_react299.default.createElement( + Wrapper, + { + ref: isVirtual ? virtualRef : mainRef, + "aria-hidden": isVirtual ? true : void 0, + // Wrapper is an alias for "div" or "header". + // eslint-disable-next-line react/forbid-component-props + className: clsx_m_default(styles_css_default89["top-navigation"], { + [styles_css_default89.virtual]: isVirtual, + [styles_css_default89.hidden]: isVirtual, + [styles_css_default89.narrow]: isNarrowViewport, + [styles_css_default89.medium]: isMediumViewport + }) + }, + import_react299.default.createElement( + "div", + { className: styles_css_default89["padding-box"] }, + showIdentity && import_react299.default.createElement( + "div", + { className: clsx_m_default(styles_css_default89.identity, !identity2.logo && styles_css_default89["no-logo"]) }, + import_react299.default.createElement( + "a", + { className: styles_css_default89["identity-link"], href: identity2.href, onClick: onIdentityClick }, + identity2.logo && import_react299.default.createElement("img", { role: "img", src: (_a2 = identity2.logo) === null || _a2 === void 0 ? void 0 : _a2.src, alt: (_b = identity2.logo) === null || _b === void 0 ? void 0 : _b.alt, className: clsx_m_default(styles_css_default89.logo, { + [styles_css_default89.narrow]: isNarrowViewport + }) }), + showTitle && import_react299.default.createElement("span", { className: styles_css_default89.title }, identity2.title) + ) + ), + showSearchSlot && import_react299.default.createElement( + "div", + { className: styles_css_default89.inputs }, + import_react299.default.createElement("div", { className: clsx_m_default(styles_css_default89.search, !isVirtual && isSearchExpanded && styles_css_default89["search-expanded"]) }, search) + ), + import_react299.default.createElement( + "div", + { className: styles_css_default89.utilities }, + showSearchUtility && import_react299.default.createElement( + "div", + { className: clsx_m_default(styles_css_default89["utility-wrapper"], styles_css_default89["utility-type-button"], styles_css_default89["utility-type-button-link"], { + [styles_css_default89.narrow]: isNarrowViewport, + [styles_css_default89.medium]: isMediumViewport + }), "data-utility-special": "search" }, + import_react299.default.createElement(Utility, { hideText: true, definition: { + type: "button", + iconName: isSearchExpanded ? "close" : "search", + ariaLabel: isSearchExpanded ? i18n("i18nStrings.searchDismissIconAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.searchDismissIconAriaLabel) : i18n("i18nStrings.searchIconAriaLabel", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.searchIconAriaLabel), + onClick: onSearchUtilityClick + } }) + ), + showUtilities && utilities.filter((_utility, i) => isVirtual || !responsiveState.hideUtilities || responsiveState.hideUtilities.indexOf(i) === -1).map((utility, i) => { + var _a3; + const hideText = !!responsiveState.hideUtilityText; + const isLast = (isVirtual || !showMenuTrigger) && i === utilities.length - 1; + const offsetRight = isLast && isLargeViewport ? "xxl" : isLast ? "l" : void 0; + return import_react299.default.createElement( + "div", + { key: i, className: clsx_m_default(styles_css_default89["utility-wrapper"], styles_css_default89[`utility-type-${utility.type}`], utility.type === "button" && styles_css_default89[`utility-type-button-${(_a3 = utility.variant) !== null && _a3 !== void 0 ? _a3 : "link"}`], { + [styles_css_default89.narrow]: isNarrowViewport, + [styles_css_default89.medium]: isMediumViewport + }), "data-utility-index": i, "data-utility-hide": `${hideText}` }, + import_react299.default.createElement(Utility, { hideText, definition: utility, offsetRight }) + ); + }), + isVirtual && utilities.map((utility, i) => { + var _a3; + const hideText = !responsiveState.hideUtilityText; + const isLast = !showMenuTrigger && i === utilities.length - 1; + const offsetRight = isLast && isLargeViewport ? "xxl" : isLast ? "l" : void 0; + return import_react299.default.createElement( + "div", + { key: i, className: clsx_m_default(styles_css_default89["utility-wrapper"], styles_css_default89[`utility-type-${utility.type}`], utility.type === "button" && styles_css_default89[`utility-type-button-${(_a3 = utility.variant) !== null && _a3 !== void 0 ? _a3 : "link"}`], { + [styles_css_default89.narrow]: isNarrowViewport, + [styles_css_default89.medium]: isMediumViewport + }), "data-utility-index": i, "data-utility-hide": `${hideText}` }, + import_react299.default.createElement(Utility, { hideText, definition: utility, offsetRight }) + ); + }), + showMenuTrigger && import_react299.default.createElement( + "div", + { className: clsx_m_default(styles_css_default89["utility-wrapper"], styles_css_default89["utility-type-menu-dropdown"], { + [styles_css_default89.narrow]: isNarrowViewport, + [styles_css_default89.medium]: isMediumViewport + }), "data-utility-special": "menu-trigger" }, + import_react299.default.createElement(ButtonTrigger2, { expanded: overflowMenuOpen, onClick: toggleOverflowMenu, offsetRight: "l", ref: !isVirtual ? overflowMenuTriggerRef : void 0 }, i18n("i18nStrings.overflowMenuTriggerText", i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.overflowMenuTriggerText)) + ) + ) + ) + ); + }; + return import_react299.default.createElement( + "div", + Object.assign({}, baseProps, { ref: __internalRootRef }), + import_react299.default.createElement( + VisualContext, + { contextName: "top-navigation" }, + content(false), + import_react299.default.createElement(Portal, null, content(true)), + menuTriggerVisible && overflowMenuOpen && import_react299.default.createElement( + "div", + { className: styles_css_default89["overflow-menu-drawer"] }, + import_react299.default.createElement(overflow_menu_default, { headerText: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.overflowMenuTitleText, dismissIconAriaLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.overflowMenuDismissIconAriaLabel, backIconAriaLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.overflowMenuBackIconAriaLabel, items: utilities.filter((utility, i) => (!responsiveState.hideUtilities || responsiveState.hideUtilities.indexOf(i) !== -1) && !utility.disableUtilityCollapse), onClose: toggleOverflowMenu }) + ) + ) + ); +} + +// node_modules/@cloudscape-design/components/top-navigation/index.js +function TopNavigation(_a) { + var { utilities = [] } = _a, restProps = __rest(_a, ["utilities"]); + const baseComponentProps = useBaseComponent("TopNavigation"); + return import_react300.default.createElement(InternalTopNavigation, Object.assign({}, baseComponentProps, { utilities }, restProps)); +} +applyDisplayName(TopNavigation, "TopNavigation"); + +// node_modules/@cloudscape-design/components/tutorial-panel/index.js +var import_react306 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/tutorial-panel/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/tutorial-panel/styles.scoped.css"; +var styles_css_default91 = { + "tutorial-panel": "awsui_tutorial-panel_1oin5_a21xr_99" +}; + +// node_modules/@cloudscape-design/components/tutorial-panel/components/tutorial-list/index.js +var import_react301 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/tutorial-panel/components/tutorial-list/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/tutorial-panel/components/tutorial-list/styles.scoped.css"; +var styles_css_default92 = { + "content-enter": "awsui_content-enter_ig8mp_dp1p1_99", + "awsui-motion-fade-in": "awsui_awsui-motion-fade-in_ig8mp_dp1p1_1", + "tutorial-list": "awsui_tutorial-list_ig8mp_dp1p1_125", + "tutorial-box": "awsui_tutorial-box_ig8mp_dp1p1_164", + "tutorial-box-title": "awsui_tutorial-box-title_ig8mp_dp1p1_211", + "tutorial-description-plaintext": "awsui_tutorial-description-plaintext_ig8mp_dp1p1_217", + "tutorial-description": "awsui_tutorial-description_ig8mp_dp1p1_217", + "expandable-section": "awsui_expandable-section_ig8mp_dp1p1_229", + "expanded": "awsui_expanded_ig8mp_dp1p1_233", + "button-wrapper": "awsui_button-wrapper_ig8mp_dp1p1_237", + "start": "awsui_start_ig8mp_dp1p1_242", + "expand-button": "awsui_expand-button_ig8mp_dp1p1_246", + "collapse-button": "awsui_collapse-button_ig8mp_dp1p1_250", + "learn-more-link": "awsui_learn-more-link_ig8mp_dp1p1_254", + "title": "awsui_title_ig8mp_dp1p1_258", + "prerequisites-alert": "awsui_prerequisites-alert_ig8mp_dp1p1_262", + "completed": "awsui_completed_ig8mp_dp1p1_266", + "download-link": "awsui_download-link_ig8mp_dp1p1_270" +}; + +// node_modules/@cloudscape-design/components/tutorial-panel/components/tutorial-list/index.js +function TutorialList({ i18nStrings, tutorials, loading = false, onStartTutorial, downloadUrl }) { + checkSafeUrl("TutorialPanel", downloadUrl); + const isRefresh = useVisualRefresh(); + return import_react301.default.createElement( + import_react301.default.Fragment, + null, + import_react301.default.createElement( + InternalSpaceBetween, + { size: "s" }, + import_react301.default.createElement( + InternalSpaceBetween, + { size: "m" }, + import_react301.default.createElement(InternalBox, { variant: "h2", fontSize: isRefresh ? "heading-m" : "heading-l", padding: { bottom: "n" } }, i18nStrings.tutorialListTitle), + import_react301.default.createElement(InternalBox, { variant: "p", color: "text-body-secondary", padding: "n" }, i18nStrings.tutorialListDescription) + ), + import_react301.default.createElement( + InternalSpaceBetween, + { size: "l" }, + downloadUrl && import_react301.default.createElement( + "a", + { href: downloadUrl, target: "_blank", rel: "noopener noreferrer", className: styles_css_default92["download-link"], "aria-label": i18nStrings.labelTutorialListDownloadLink }, + import_react301.default.createElement(internal_default, { name: "download" }), + import_react301.default.createElement(InternalBox, { padding: { left: "xs" }, color: "inherit", fontWeight: "bold", display: "inline" }, i18nStrings.tutorialListDownloadLinkText) + ), + loading ? import_react301.default.createElement( + StatusIndicator, + { type: "loading" }, + import_react301.default.createElement(live_region_default, { visible: true }, i18nStrings.loadingText) + ) : import_react301.default.createElement("ul", { className: styles_css_default92["tutorial-list"], role: "list" }, tutorials.map((tutorial, index) => import_react301.default.createElement(Tutorial, { tutorial, key: index, onStartTutorial, i18nStrings }))) + ) + ) + ); +} +function Tutorial({ tutorial, onStartTutorial: onStartTutorialEventHandler, i18nStrings }) { + var _a; + checkSafeUrl("TutorialPanel", tutorial.learnMoreUrl); + const controlId = useUniqueId(); + const triggerControldId = useUniqueId(); + const headerId = useUniqueId(); + const isRefresh = useVisualRefresh(); + const onStartTutorial = (0, import_react301.useCallback)(() => { + fireNonCancelableEvent(onStartTutorialEventHandler, { tutorial }); + }, [onStartTutorialEventHandler, tutorial]); + const [expanded, setExpanded] = (0, import_react301.useState)(!tutorial.prerequisitesNeeded && !tutorial.completed); + const onClick = (0, import_react301.useCallback)(() => { + setExpanded((expanded2) => !expanded2); + }, []); + return import_react301.default.createElement( + "li", + { className: styles_css_default92["tutorial-box"], role: "listitem" }, + import_react301.default.createElement( + InternalSpaceBetween, + { size: "xs" }, + import_react301.default.createElement( + "div", + { className: styles_css_default92["tutorial-box-title"] }, + import_react301.default.createElement(InternalBox, { variant: "h3", fontSize: isRefresh ? "heading-s" : "heading-m", id: headerId, margin: { right: "xs" }, padding: "n", className: styles_css_default92.title }, tutorial.title), + import_react301.default.createElement( + "div", + { className: styles_css_default92["button-wrapper"] }, + import_react301.default.createElement(InternalButton, { id: triggerControldId, variant: "icon", ariaExpanded: expanded, __nativeAttributes: { + "aria-controls": controlId, + "aria-labelledby": headerId + }, formAction: "none", onClick, className: expanded ? styles_css_default92["collapse-button"] : styles_css_default92["expand-button"], iconName: expanded ? "angle-up" : "angle-down" }) + ) + ), + tutorial.completed ? import_react301.default.createElement(StatusIndicator, { __size: "inherit", type: "success", className: styles_css_default92.completed, wrapText: true }, i18nStrings.tutorialCompletedText) : null + ), + import_react301.default.createElement( + "div", + { "aria-live": "polite" }, + import_react301.default.createElement( + CSSTransition_default, + { in: expanded, timeout: 30, classNames: { enter: styles_css_default92["content-enter"] } }, + import_react301.default.createElement( + "div", + { className: clsx_m_default(styles_css_default92["expandable-section"], expanded && styles_css_default92.expanded), id: controlId }, + import_react301.default.createElement( + InternalSpaceBetween, + { size: "l" }, + import_react301.default.createElement( + InternalSpaceBetween, + { size: "m" }, + tutorial.prerequisitesNeeded && tutorial.prerequisitesAlert && import_react301.default.createElement(internal_default10, { type: "info", className: styles_css_default92["prerequisites-alert"] }, tutorial.prerequisitesAlert), + import_react301.default.createElement( + InternalSpaceBetween, + { size: "s" }, + import_react301.default.createElement( + InternalBox, + { color: "text-body-secondary" }, + import_react301.default.createElement("div", { className: clsx_m_default(styles_css_default92["tutorial-description"], typeof tutorial.description === "string" && styles_css_default92["tutorial-description-plaintext"]) }, tutorial.description) + ), + tutorial.learnMoreUrl && import_react301.default.createElement(internal_default12, { href: tutorial.learnMoreUrl, className: styles_css_default92["learn-more-link"], externalIconAriaLabel: i18nStrings.labelLearnMoreExternalIcon, ariaLabel: i18nStrings.labelLearnMoreLink, external: true, variant: "primary" }, i18nStrings.learnMoreLinkText) + ) + ), + import_react301.default.createElement( + InternalBox, + { margin: { bottom: "xxs" } }, + import_react301.default.createElement(InternalButton, { onClick: onStartTutorial, disabled: (_a = tutorial.prerequisitesNeeded) !== null && _a !== void 0 ? _a : false, formAction: "none", className: styles_css_default92.start }, tutorial.completed ? i18nStrings.restartTutorialButtonText : i18nStrings.startTutorialButtonText) + ) + ) + ) + ) + ) + ); +} + +// node_modules/@cloudscape-design/components/tutorial-panel/components/tutorial-detail-view/index.js +var import_react305 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/tutorial-panel/components/tutorial-detail-view/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/tutorial-panel/components/tutorial-detail-view/styles.scoped.css"; +var styles_css_default93 = { + "tutorial-list": "awsui_tutorial-list_1u70p_8w58y_99", + "tutorial-title": "awsui_tutorial-title_1u70p_8w58y_138", + "task": "awsui_task_1u70p_8w58y_145", + "task-title": "awsui_task-title_1u70p_8w58y_153", + "task-title--status": "awsui_task-title--status_1u70p_8w58y_161", + "current-task": "awsui_current-task_1u70p_8w58y_165", + "successful-task": "awsui_successful-task_1u70p_8w58y_169", + "congratulation-message": "awsui_congratulation-message_1u70p_8w58y_173", + "congratulation-message--status": "awsui_congratulation-message--status_1u70p_8w58y_181", + "plaintext-congratulation-description": "awsui_plaintext-congratulation-description_1u70p_8w58y_185", + "divider": "awsui_divider_1u70p_8w58y_189", + "step-list": "awsui_step-list_1u70p_8w58y_193", + "step": "awsui_step_1u70p_8w58y_193", + "expandable-section-wrapper": "awsui_expandable-section-wrapper_1u70p_8w58y_204", + "expandable-section-header": "awsui_expandable-section-header_1u70p_8w58y_208", + "step-title": "awsui_step-title_1u70p_8w58y_213", + "feedback-link": "awsui_feedback-link_1u70p_8w58y_214", + "dismiss-button": "awsui_dismiss-button_1u70p_8w58y_215", + "completion-screen-title": "awsui_completion-screen-title_1u70p_8w58y_216", + "completion-screen-description": "awsui_completion-screen-description_1u70p_8w58y_217" +}; + +// node_modules/@cloudscape-design/components/tutorial-panel/components/tutorial-detail-view/congratulation-screen.js +var import_react302 = __toESM(require_react()); +function CongratulationScreen({ children: children2, onFeedbackClick, i18nStrings }) { + return import_react302.default.createElement( + InternalSpaceBetween, + { size: "xxl" }, + import_react302.default.createElement( + InternalSpaceBetween, + { size: "xl" }, + import_react302.default.createElement( + "div", + { className: styles_css_default93["congratulation-message"] }, + import_react302.default.createElement(StatusIndicator, { __size: "inherit", type: "success", className: styles_css_default93["congratulation-message--status"] }), + import_react302.default.createElement("div", { className: styles_css_default93["completion-screen-title"] }, i18nStrings.completionScreenTitle) + ), + import_react302.default.createElement( + InternalBox, + { color: "text-body-secondary" }, + import_react302.default.createElement("div", { className: clsx_m_default({ + [styles_css_default93["completion-screen-description"]]: true, + [styles_css_default93["plaintext-congratulation-description"]]: typeof children2 === "string" + }) }, children2) + ) + ), + import_react302.default.createElement("div", { className: styles_css_default93.divider }), + onFeedbackClick && import_react302.default.createElement(internal_default12, { onFollow: onFeedbackClick, className: styles_css_default93["feedback-link"], variant: "primary" }, i18nStrings.feedbackLinkText) + ); +} + +// node_modules/@cloudscape-design/components/tutorial-panel/components/tutorial-detail-view/task-list.js +var import_react304 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/tutorial-panel/components/tutorial-detail-view/task.js +var import_react303 = __toESM(require_react()); +function getStatusIndicatorType(taskIndex, currentTaskIndex) { + if (taskIndex < currentTaskIndex) { + return "success"; + } + if (taskIndex === currentTaskIndex) { + return "in-progress"; + } + return "pending"; +} +function Task({ task, taskIndex, currentTaskIndex, expanded, onToggleExpand, i18nStrings }) { + const statusIndicatorType = getStatusIndicatorType(taskIndex, currentTaskIndex); + const onExpandChange = (0, import_react303.useCallback)(() => { + onToggleExpand(taskIndex); + }, [onToggleExpand, taskIndex]); + return import_react303.default.createElement( + "li", + { className: styles_css_default93.task }, + import_react303.default.createElement( + InternalSpaceBetween, + { size: "xxs" }, + import_react303.default.createElement( + "div", + { className: styles_css_default93["task-title"] }, + import_react303.default.createElement(StatusIndicator, { __size: "inherit", type: statusIndicatorType, iconAriaLabel: i18nStrings.labelsTaskStatus[statusIndicatorType], className: styles_css_default93["task-title--status"] }), + import_react303.default.createElement(InternalBox, { variant: "h3", padding: { left: "xxxs", vertical: "n" }, fontSize: "heading-s", color: taskIndex < currentTaskIndex ? "text-status-success" : "text-status-inactive" }, i18nStrings.taskTitle(taskIndex, task.title)) + ), + import_react303.default.createElement( + "div", + { className: styles_css_default93["expandable-section-wrapper"] }, + import_react303.default.createElement( + InternalExpandableSection, + { header: import_react303.default.createElement("span", { className: styles_css_default93["expandable-section-header"] }, i18nStrings.labelTotalSteps(task.steps.length)), expanded, onChange: onExpandChange, headerAriaLabel: joinStrings(i18nStrings.taskTitle(taskIndex, task.title), i18nStrings.labelTotalSteps(task.steps.length)) }, + import_react303.default.createElement("ol", { className: styles_css_default93["step-list"] }, task.steps.map((step2, stepIndex) => import_react303.default.createElement( + "li", + { key: stepIndex, className: styles_css_default93.step }, + import_react303.default.createElement(InternalBox, { color: "text-body-secondary", fontSize: "body-m", padding: { left: "l" }, className: styles_css_default93["step-title"] }, i18nStrings.stepTitle(stepIndex, step2.title)) + ))) + ) + ) + ) + ); +} + +// node_modules/@cloudscape-design/components/tutorial-panel/components/tutorial-detail-view/task-list.js +function TaskList({ tasks, onExitTutorial, currentGlobalStepIndex, i18nStrings }) { + const currentTaskIndex = getStepInfo(tasks, currentGlobalStepIndex !== null && currentGlobalStepIndex !== void 0 ? currentGlobalStepIndex : 0).taskIndex; + const [expandedTasks, setExpandedTasks] = (0, import_react304.useState)({ [currentTaskIndex]: true }); + const onToggleExpand = (0, import_react304.useCallback)((stepIndex) => { + setExpandedTasks((prevTasks) => Object.assign(Object.assign({}, prevTasks), { [stepIndex]: !prevTasks[stepIndex] })); + }, []); + (0, import_react304.useEffect)(() => { + setExpandedTasks({ [currentTaskIndex]: true }); + }, [currentTaskIndex]); + return import_react304.default.createElement( + InternalSpaceBetween, + { size: "xxl" }, + import_react304.default.createElement("ol", { className: styles_css_default93["tutorial-list"] }, tasks.map((task, index) => { + var _a; + return import_react304.default.createElement(Task, { task, key: index, taskIndex: index, currentTaskIndex, expanded: (_a = expandedTasks[index]) !== null && _a !== void 0 ? _a : false, onToggleExpand, i18nStrings }); + })), + import_react304.default.createElement( + InternalBox, + { margin: { top: "xxxs" } }, + import_react304.default.createElement(InternalButton, { onClick: onExitTutorial, formAction: "none", className: styles_css_default93["dismiss-button"] }, i18nStrings.dismissTutorialButtonText) + ) + ); +} + +// node_modules/@cloudscape-design/components/tutorial-panel/components/tutorial-detail-view/index.js +function TutorialDetailView({ tutorial, onExitTutorial: onExitTutorialHandler, currentStepIndex = 0, onFeedbackClick: onFeedbackClickHandler, i18nStrings }) { + const isRefresh = useVisualRefresh(); + const onExitTutorial = (0, import_react305.useCallback)(() => { + fireNonCancelableEvent(onExitTutorialHandler, { tutorial }); + }, [onExitTutorialHandler, tutorial]); + const onFeedbackClick = (0, import_react305.useMemo)(() => onFeedbackClickHandler && (() => fireNonCancelableEvent(onFeedbackClickHandler, { tutorial })), [onFeedbackClickHandler, tutorial]); + return import_react305.default.createElement( + import_react305.default.Fragment, + null, + import_react305.default.createElement( + InternalSpaceBetween, + { size: "xl" }, + import_react305.default.createElement( + "div", + { className: styles_css_default93["tutorial-title"] }, + import_react305.default.createElement(InternalButton, { variant: "icon", onClick: onExitTutorial, ariaLabel: i18nStrings.labelExitTutorial, formAction: "none", iconName: "arrow-left" }), + import_react305.default.createElement(InternalBox, { variant: "h2", fontSize: isRefresh ? "heading-m" : "heading-l", padding: { top: "xxs" }, margin: { left: "s" } }, tutorial.title) + ), + import_react305.default.createElement( + "div", + null, + import_react305.default.createElement("div", { role: "status" }, tutorial.completed && import_react305.default.createElement(CongratulationScreen, { onFeedbackClick, i18nStrings }, tutorial.completedScreenDescription)), + !tutorial.completed && import_react305.default.createElement(TaskList, { tasks: tutorial.tasks, onExitTutorial, currentGlobalStepIndex: currentStepIndex, i18nStrings }) + ) + ) + ); +} + +// node_modules/@cloudscape-design/components/tutorial-panel/index.js +function TutorialPanel(_a) { + var { i18nStrings, loading, tutorials, onFeedbackClick, downloadUrl } = _a, restProps = __rest(_a, ["i18nStrings", "loading", "tutorials", "onFeedbackClick", "downloadUrl"]); + const { __internalRootRef } = useBaseComponent("TutorialPanel"); + const baseProps = getBaseProps(restProps); + const context = (0, import_react306.useContext)(hotspotContext); + return import_react306.default.createElement( + import_react306.default.Fragment, + null, + import_react306.default.createElement("div", Object.assign({}, baseProps, { className: clsx_m_default(baseProps.className, styles_css_default91["tutorial-panel"]), ref: __internalRootRef }), context.currentTutorial ? import_react306.default.createElement(TutorialDetailView, { i18nStrings, tutorial: context.currentTutorial, onExitTutorial: context.onExitTutorial, currentStepIndex: context.currentStepIndex, onFeedbackClick }) : import_react306.default.createElement(TutorialList, { i18nStrings, tutorials, loading, onStartTutorial: context.onStartTutorial, downloadUrl })) + ); +} +applyDisplayName(TutorialPanel, "TutorialPanel"); + +// node_modules/@cloudscape-design/components/wizard/index.js +var import_react314 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/wizard/internal.js +var import_react313 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/wizard/wizard-form.js +var import_react310 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/wizard/wizard-actions.js +var import_react308 = __toESM(require_react()); + +// node_modules/@cloudscape-design/components/wizard/styles.css.js +import "/home/a171157/personal-repos/deep-racer/community-contributions/deepracer-custom-console/new/node_modules/@cloudscape-design/components/wizard/styles.scoped.css"; +var styles_css_default94 = { + "root": "awsui_root_1xupv_e5t6y_100", + "wizard": "awsui_wizard_1xupv_e5t6y_135", + "refresh": "awsui_refresh_1xupv_e5t6y_135", + "small-container": "awsui_small-container_1xupv_e5t6y_142", + "remove-high-contrast-header": "awsui_remove-high-contrast-header_1xupv_e5t6y_146", + "navigation": "awsui_navigation_1xupv_e5t6y_154", + "number": "awsui_number_1xupv_e5t6y_236", + "circle": "awsui_circle_1xupv_e5t6y_252", + "title": "awsui_title_1xupv_e5t6y_263", + "active": "awsui_active_1xupv_e5t6y_294", + "disabled": "awsui_disabled_1xupv_e5t6y_305", + "enabled": "awsui_enabled_1xupv_e5t6y_315", + "form": "awsui_form_1xupv_e5t6y_357", + "form-header": "awsui_form-header_1xupv_e5t6y_362", + "background": "awsui_background_1xupv_e5t6y_372", + "form-header-content": "awsui_form-header-content_1xupv_e5t6y_384", + "form-component": "awsui_form-component_1xupv_e5t6y_392", + "hidden": "awsui_hidden_1xupv_e5t6y_406", + "collapsed-steps": "awsui_collapsed-steps_1xupv_e5t6y_410", + "collapsed-steps-hidden": "awsui_collapsed-steps-hidden_1xupv_e5t6y_415", + "form-header-component-wrapper": "awsui_form-header-component-wrapper_1xupv_e5t6y_419", + "form-header-component": "awsui_form-header-component_1xupv_e5t6y_419", + "navigation-link": "awsui_navigation-link_1xupv_e5t6y_435", + "navigation-link-item": "awsui_navigation-link-item_1xupv_e5t6y_436", + "navigation-link-label": "awsui_navigation-link-label_1xupv_e5t6y_437", + "navigation-link-active": "awsui_navigation-link-active_1xupv_e5t6y_441", + "navigation-link-disabled": "awsui_navigation-link-disabled_1xupv_e5t6y_446", + "cancel-button": "awsui_cancel-button_1xupv_e5t6y_450", + "previous-button": "awsui_previous-button_1xupv_e5t6y_451", + "primary-button": "awsui_primary-button_1xupv_e5t6y_452", + "skip-to-button": "awsui_skip-to-button_1xupv_e5t6y_453", + "action-buttons": "awsui_action-buttons_1xupv_e5t6y_457" +}; + +// node_modules/@cloudscape-design/components/wizard/unmount.js +var import_react307 = __toESM(require_react()); +var Unmount = class extends import_react307.default.Component { + componentWillUnmount() { + this.props.onUnmount(); + } + render() { + return this.props.children; + } +}; + +// node_modules/@cloudscape-design/components/wizard/wizard-actions.js +function WizardActions({ cancelButtonText, onCancelClick, isPrimaryLoading, primaryButtonText, primaryButtonLoadingText, onPrimaryClick, showPrevious, previousButtonText, onPreviousClick, showSkipTo, skipToButtonText, onSkipToClick }) { + const containerRef = (0, import_react308.useRef)(null); + const primaryButtonRef = (0, import_react308.useRef)(null); + const onPreviousUnmount = () => { + var _a, _b; + if (((_a = containerRef.current) === null || _a === void 0 ? void 0 : _a.querySelector(`.${styles_css_default94["previous-button"]}`)) === document.activeElement) { + (_b = primaryButtonRef.current) === null || _b === void 0 ? void 0 : _b.focus(); + } + }; + const onSkipUnmount = () => { + var _a, _b; + if (((_a = containerRef.current) === null || _a === void 0 ? void 0 : _a.querySelector(`.${styles_css_default94["skip-to-button"]}`)) === document.activeElement) { + (_b = primaryButtonRef.current) === null || _b === void 0 ? void 0 : _b.focus(); + } + }; + return import_react308.default.createElement( + "div", + { ref: containerRef }, + import_react308.default.createElement( + InternalSpaceBetween, + { direction: "horizontal", size: "xs", className: styles_css_default94["action-buttons"] }, + import_react308.default.createElement(InternalButton, { className: styles_css_default94["cancel-button"], variant: "link", formAction: "none", onClick: onCancelClick }, cancelButtonText), + showSkipTo && skipToButtonText && import_react308.default.createElement( + Unmount, + { onUnmount: onSkipUnmount }, + import_react308.default.createElement(InternalButton, { className: styles_css_default94["skip-to-button"], onClick: onSkipToClick, formAction: "none", disabled: isPrimaryLoading }, skipToButtonText) + ), + showPrevious && import_react308.default.createElement( + Unmount, + { onUnmount: onPreviousUnmount }, + import_react308.default.createElement(InternalButton, { className: styles_css_default94["previous-button"], onClick: onPreviousClick, formAction: "none", disabled: isPrimaryLoading }, previousButtonText) + ), + import_react308.default.createElement(InternalButton, { ref: primaryButtonRef, className: styles_css_default94["primary-button"], variant: "primary", formAction: "none", onClick: onPrimaryClick, loading: isPrimaryLoading, loadingText: primaryButtonLoadingText }, primaryButtonText) + ) + ); +} + +// node_modules/@cloudscape-design/components/wizard/wizard-form-header.js +var import_react309 = __toESM(require_react()); +function WizardFormHeader({ children: children2, isVisualRefresh }) { + const overlapElement = useDynamicOverlap(); + return import_react309.default.createElement( + "div", + { className: clsx_m_default(styles_css_default94["form-header"], isVisualRefresh && styles_css_default94["form-header-refresh"], isVisualRefresh && getContentHeaderClassName()), ref: overlapElement }, + import_react309.default.createElement("div", { className: clsx_m_default(styles_css_default94["form-header-content"], shouldRemoveHighContrastHeader() && styles_css_default94["remove-high-contrast-header"]) }, children2) + ); +} + +// node_modules/@cloudscape-design/components/wizard/wizard-form.js +var STEP_NAME_SELECTOR = `[${DATA_ATTR_FUNNEL_KEY}=${FUNNEL_KEY_STEP_NAME}]`; +function WizardForm({ steps, activeStepIndex, isVisualRefresh, showCollapsedSteps, i18nStrings, submitButtonText, isPrimaryLoading, allowSkipTo, secondaryActions, onCancelClick, onPreviousClick, onPrimaryClick, onSkipToClick }) { + const _a = steps[activeStepIndex] || {}, { title, info, description, content, errorText, isOptional } = _a, rest = __rest(_a, ["title", "info", "description", "content", "errorText", "isOptional"]); + const isLastStep = activeStepIndex >= steps.length - 1; + const skipToTargetIndex = findSkipToTargetIndex(steps, activeStepIndex); + const isMobile = useMobile(); + const stepHeaderRef = (0, import_react310.useRef)(null); + const analyticsMetadata = getAnalyticsMetadataProps(rest); + const elementRef = useComponentMetadata("WizardForm", PACKAGE_VERSION, Object.assign({}, analyticsMetadata)); + useEffectOnUpdate(() => { + var _a2; + if (stepHeaderRef && stepHeaderRef.current) { + (_a2 = stepHeaderRef.current) === null || _a2 === void 0 ? void 0 : _a2.focus(); + } + }, [activeStepIndex]); + const showSkipTo = allowSkipTo && skipToTargetIndex !== -1; + const skipToButtonText = skipToTargetIndex !== -1 && i18nStrings.skipToButtonLabel ? i18nStrings.skipToButtonLabel(steps[skipToTargetIndex], skipToTargetIndex + 1) : void 0; + return import_react310.default.createElement( + import_react310.default.Fragment, + null, + import_react310.default.createElement(AnalyticsFunnelStep, { instanceIdentifier: analyticsMetadata === null || analyticsMetadata === void 0 ? void 0 : analyticsMetadata.instanceIdentifier, errorContext: analyticsMetadata === null || analyticsMetadata === void 0 ? void 0 : analyticsMetadata.errorContext, stepNameSelector: STEP_NAME_SELECTOR, stepNumber: activeStepIndex + 1 }, ({ funnelStepProps }) => { + var _a2; + return import_react310.default.createElement( + import_react310.default.Fragment, + null, + import_react310.default.createElement( + WizardFormHeader, + { isMobile: isMobile || showCollapsedSteps, isVisualRefresh }, + import_react310.default.createElement("div", { className: clsx_m_default(styles_css_default94["collapsed-steps"], !showCollapsedSteps && styles_css_default94["collapsed-steps-hidden"]) }, (_a2 = i18nStrings.collapsedStepsLabel) === null || _a2 === void 0 ? void 0 : _a2.call(i18nStrings, activeStepIndex + 1, steps.length)), + import_react310.default.createElement( + InternalHeader, + { className: styles_css_default94["form-header-component"], variant: "h1", description, info }, + import_react310.default.createElement( + "span", + { className: styles_css_default94["form-header-component-wrapper"], tabIndex: -1, ref: stepHeaderRef }, + import_react310.default.createElement("span", Object.assign({}, { [DATA_ATTR_FUNNEL_KEY]: FUNNEL_KEY_STEP_NAME }), title), + isOptional && import_react310.default.createElement("i", null, ` - ${i18nStrings.optional}`) + ) + ) + ), + import_react310.default.createElement(InternalForm, Object.assign({ __internalRootRef: elementRef, className: clsx_m_default(styles_css_default94["form-component"]), actions: import_react310.default.createElement(WizardActions, { cancelButtonText: i18nStrings.cancelButton, primaryButtonText: isLastStep ? submitButtonText !== null && submitButtonText !== void 0 ? submitButtonText : i18nStrings.submitButton : i18nStrings.nextButton, primaryButtonLoadingText: isLastStep ? i18nStrings.submitButtonLoadingAnnouncement : i18nStrings.nextButtonLoadingAnnouncement, previousButtonText: i18nStrings.previousButton, onCancelClick, onPreviousClick, onPrimaryClick, onSkipToClick: () => onSkipToClick(skipToTargetIndex), showPrevious: activeStepIndex !== 0, isPrimaryLoading, showSkipTo, skipToButtonText }), secondaryActions, errorText, errorIconAriaLabel: i18nStrings.errorIconAriaLabel }, funnelStepProps), content) + ); + }) + ); +} +function findSkipToTargetIndex(steps, activeStepIndex) { + let nextRequiredStepIndex = activeStepIndex; + do { + nextRequiredStepIndex++; + } while (nextRequiredStepIndex < steps.length - 1 && steps[nextRequiredStepIndex].isOptional); + return nextRequiredStepIndex > activeStepIndex + 1 ? nextRequiredStepIndex : -1; +} + +// node_modules/@cloudscape-design/components/wizard/wizard-navigation.js +var import_react311 = __toESM(require_react()); +var Statuses; +(function(Statuses2) { + Statuses2["Active"] = "active"; + Statuses2["Unvisited"] = "unvisited"; + Statuses2["Visited"] = "visited"; + Statuses2["Next"] = "next"; +})(Statuses || (Statuses = {})); +function Navigation2({ activeStepIndex, farthestStepIndex, allowSkipTo, hidden, i18nStrings, isVisualRefresh, isLoadingNextStep, onStepClick, onSkipToClick, steps }) { + return import_react311.default.createElement( + "nav", + { className: clsx_m_default(styles_css_default94.navigation, hidden && styles_css_default94.hidden, isVisualRefresh && styles_css_default94.refresh, shouldRemoveHighContrastHeader() && styles_css_default94["remove-high-contrast-header"]), "aria-label": i18nStrings.navigationAriaLabel }, + import_react311.default.createElement("ul", { className: clsx_m_default(isVisualRefresh && styles_css_default94.refresh, shouldRemoveHighContrastHeader() && styles_css_default94["remove-high-contrast-header"]) }, steps.map((step2, index) => isVisualRefresh ? import_react311.default.createElement(NavigationStepVisualRefresh, { i18nStrings, index, key: index, onStepClick, onSkipToClick, status: getStatus(index), step: step2 }) : import_react311.default.createElement(NavigationStepClassic, { i18nStrings, index, key: index, onStepClick, onSkipToClick, status: getStatus(index), step: step2 }))) + ); + function getStatus(index) { + if (activeStepIndex === index) { + return Statuses.Active; + } + if (isLoadingNextStep) { + return Statuses.Unvisited; + } + if (farthestStepIndex >= index) { + return Statuses.Visited; + } + if (allowSkipTo && canSkip(activeStepIndex + 1, index)) { + return Statuses.Next; + } + return Statuses.Unvisited; + } + function canSkip(fromIndex, toIndex) { + let index = fromIndex; + do { + if (!steps[index].isOptional) { + return false; + } + index++; + } while (index < toIndex); + return true; + } +} +function NavigationStepVisualRefresh({ i18nStrings, index, onStepClick, onSkipToClick, status, step: step2 }) { + function handleStepInteraction() { + if (status === Statuses.Visited) { + onStepClick(index); + } + if (status === Statuses.Next) { + onSkipToClick(index); + } + } + const state = { + active: "active", + unvisited: "disabled", + visited: "enabled", + next: "enabled" + }[status]; + const linkClassName = clsx_m_default(styles_css_default94["navigation-link"], { + [styles_css_default94["navigation-link-active"]]: status === Statuses.Active, + [styles_css_default94["navigation-link-disabled"]]: status === Statuses.Unvisited + }); + return import_react311.default.createElement( + "li", + { className: clsx_m_default(styles_css_default94[`${state}`], styles_css_default94["navigation-link-item"]) }, + import_react311.default.createElement("hr", null), + import_react311.default.createElement( + "span", + { className: clsx_m_default(styles_css_default94.number, styles_css_default94["navigation-link-label"]) }, + i18nStrings.stepNumberLabel && i18nStrings.stepNumberLabel(index + 1), + step2.isOptional && import_react311.default.createElement("i", null, ` - ${i18nStrings.optional}`) + ), + import_react311.default.createElement( + "a", + { className: linkClassName, "aria-current": status === Statuses.Active ? "step" : void 0, "aria-disabled": status === Statuses.Unvisited ? "true" : void 0, onClick: (event) => { + event.preventDefault(); + handleStepInteraction(); + }, onKeyDown: (event) => { + if (event.key === " " || event.key === "Enter") { + event.preventDefault(); + } + if (event.key === "Enter") { + handleStepInteraction(); + } + }, onKeyUp: (event) => { + if (event.key === " ") { + handleStepInteraction(); + } + }, role: "button", tabIndex: status === Statuses.Visited || status === Statuses.Next ? 0 : void 0 }, + import_react311.default.createElement("div", { className: clsx_m_default(styles_css_default94.circle) }), + import_react311.default.createElement("span", { className: clsx_m_default(styles_css_default94.title) }, step2.title) + ) + ); +} +function NavigationStepClassic({ i18nStrings, index, onStepClick, onSkipToClick, status, step: step2 }) { + const spanClassName = clsx_m_default(styles_css_default94["navigation-link"], status === Statuses.Active ? styles_css_default94["navigation-link-active"] : styles_css_default94["navigation-link-disabled"]); + return import_react311.default.createElement( + "li", + { className: styles_css_default94["navigation-link-item"] }, + import_react311.default.createElement( + InternalBox, + { variant: "small", className: styles_css_default94["navigation-link-label"], display: "block", margin: { bottom: "xxs" } }, + i18nStrings.stepNumberLabel && i18nStrings.stepNumberLabel(index + 1), + step2.isOptional && import_react311.default.createElement("i", null, ` - ${i18nStrings.optional}`) + ), + import_react311.default.createElement("div", null, status === Statuses.Visited || status === Statuses.Next ? import_react311.default.createElement(internal_default12, { className: clsx_m_default(styles_css_default94["navigation-link"]), onFollow: (evt) => { + evt.preventDefault(); + status === Statuses.Visited ? onStepClick(index) : onSkipToClick(index); + }, variant: "primary" }, step2.title) : import_react311.default.createElement("span", { className: spanClassName, "aria-current": status === Statuses.Active ? "step" : void 0, "aria-disabled": status === Statuses.Active ? void 0 : "true" }, step2.title)) + ); +} + +// node_modules/@cloudscape-design/components/wizard/analytics.js +var import_react312 = __toESM(require_react()); +function useFunnelChangeEvent(funnelInteractionId, steps) { + const listenForStepChanges = (0, import_react312.useRef)(false); + (0, import_react312.useEffect)(() => { + const handle = setTimeout(() => listenForStepChanges.current = true, 0); + return () => { + clearTimeout(handle); + listenForStepChanges.current = false; + }; + }, [funnelInteractionId]); + const stepTitles = steps.map((step2) => step2.title).join(); + (0, import_react312.useEffect)(() => { + if (!funnelInteractionId || !listenForStepChanges.current) { + return; + } + FunnelMetrics.funnelChange({ + funnelInteractionId, + stepConfiguration: getStepConfiguration(steps) + }); + }, [funnelInteractionId, stepTitles]); +} +function getStepConfiguration(steps) { + return steps.map((step2, index) => { + var _a; + return { + name: step2.title, + number: index + 1, + isOptional: (_a = step2.isOptional) !== null && _a !== void 0 ? _a : false + }; + }); +} + +// node_modules/@cloudscape-design/components/wizard/internal.js +function InternalWizard(_a) { + var _b, _c, _d, _e, _f, _g, _h, _j; + var { steps, activeStepIndex: controlledActiveStepIndex, submitButtonText, isLoadingNextStep = false, allowSkipTo = false, secondaryActions, onCancel, onSubmit, onNavigate, __internalRootRef } = _a, rest = __rest(_a, ["steps", "activeStepIndex", "submitButtonText", "isLoadingNextStep", "allowSkipTo", "secondaryActions", "onCancel", "onSubmit", "onNavigate", "__internalRootRef"]); + const baseProps = getBaseProps(rest); + const [breakpoint, breakpointsRef] = useContainerBreakpoints(["xs"]); + const ref = useMergeRefs(breakpointsRef, __internalRootRef); + const smallContainer = breakpoint === "default"; + const [activeStepIndex, setActiveStepIndex] = useControllable(controlledActiveStepIndex, onNavigate, 0, { + componentName: "Wizard", + controlledProp: "activeStepIndex", + changeHandler: "onNavigate" + }); + const { funnelInteractionId, funnelSubmit, funnelCancel, funnelProps, funnelNextOrSubmitAttempt } = useFunnel(); + const actualActiveStepIndex = activeStepIndex ? Math.min(activeStepIndex, steps.length - 1) : 0; + const farthestStepIndex = (0, import_react313.useRef)(actualActiveStepIndex); + farthestStepIndex.current = Math.max(farthestStepIndex.current, actualActiveStepIndex); + const isVisualRefresh = useVisualRefresh(); + const isLastStep = actualActiveStepIndex >= steps.length - 1; + const navigationEvent = (requestedStepIndex, reason) => { + if (funnelInteractionId) { + const stepName = getNameFromSelector(STEP_NAME_SELECTOR); + FunnelMetrics.funnelStepNavigation({ + navigationType: reason, + funnelInteractionId, + stepNumber: actualActiveStepIndex + 1, + stepName, + stepNameSelector: STEP_NAME_SELECTOR, + destinationStepNumber: requestedStepIndex + 1, + subStepAllSelector: getSubStepAllSelector() + }); + } + setActiveStepIndex(requestedStepIndex); + fireNonCancelableEvent(onNavigate, { requestedStepIndex, reason }); + }; + const onStepClick = (stepIndex) => navigationEvent(stepIndex, "step"); + const onSkipToClick = (stepIndex) => navigationEvent(stepIndex, "skip"); + const onCancelClick = () => { + funnelCancel(); + fireNonCancelableEvent(onCancel); + }; + const onPreviousClick = () => navigationEvent(actualActiveStepIndex - 1, "previous"); + const onPrimaryClick = () => { + funnelNextOrSubmitAttempt(); + if (isLastStep) { + funnelSubmit(); + fireNonCancelableEvent(onSubmit); + } else { + navigationEvent(actualActiveStepIndex + 1, "next"); + } + }; + useFunnelChangeEvent(funnelInteractionId, steps); + const i18n = useInternalI18n("wizard"); + const skipToButtonLabel = i18n("i18nStrings.skipToButtonLabel", (_b = rest.i18nStrings) === null || _b === void 0 ? void 0 : _b.skipToButtonLabel, (format2) => (task) => format2({ task__title: task.title })); + const i18nStrings = Object.assign(Object.assign({}, rest.i18nStrings), { skipToButtonLabel, stepNumberLabel: i18n("i18nStrings.stepNumberLabel", (_c = rest.i18nStrings) === null || _c === void 0 ? void 0 : _c.stepNumberLabel, (format2) => (stepNumber) => format2({ stepNumber })), collapsedStepsLabel: i18n("i18nStrings.collapsedStepsLabel", (_d = rest.i18nStrings) === null || _d === void 0 ? void 0 : _d.collapsedStepsLabel, (format2) => (stepNumber, stepsCount) => format2({ stepNumber, stepsCount })), navigationAriaLabel: i18n("i18nStrings.navigationAriaLabel", (_e = rest.i18nStrings) === null || _e === void 0 ? void 0 : _e.navigationAriaLabel), cancelButton: i18n("i18nStrings.cancelButton", (_f = rest.i18nStrings) === null || _f === void 0 ? void 0 : _f.cancelButton), previousButton: i18n("i18nStrings.previousButton", (_g = rest.i18nStrings) === null || _g === void 0 ? void 0 : _g.previousButton), nextButton: i18n("i18nStrings.nextButton", (_h = rest.i18nStrings) === null || _h === void 0 ? void 0 : _h.nextButton), optional: i18n("i18nStrings.optional", (_j = rest.i18nStrings) === null || _j === void 0 ? void 0 : _j.optional) }); + if (activeStepIndex && activeStepIndex >= steps.length) { + warnOnce("Wizard", `You have set \`activeStepIndex\` to ${activeStepIndex} but you have provided only ${steps.length} steps. Its value is ignored and the component uses ${steps.length - 1} instead.`); + } + if (allowSkipTo && !skipToButtonLabel) { + warnOnce("Wizard", `You have set \`allowSkipTo\` but you have not provided \`i18nStrings.skipToButtonLabel\`. The skip-to button will not be rendered.`); + } + return import_react313.default.createElement( + "div", + Object.assign({}, baseProps, funnelProps, { ref, className: clsx_m_default(styles_css_default94.root, baseProps.className) }), + import_react313.default.createElement( + "div", + { className: clsx_m_default(styles_css_default94.wizard, isVisualRefresh && styles_css_default94.refresh, smallContainer && styles_css_default94["small-container"], shouldRemoveHighContrastHeader() && styles_css_default94["remove-high-contrast-header"]) }, + import_react313.default.createElement(Navigation2, { activeStepIndex: actualActiveStepIndex, farthestStepIndex: farthestStepIndex.current, allowSkipTo, hidden: smallContainer, i18nStrings, isVisualRefresh, isLoadingNextStep, onStepClick, onSkipToClick, steps }), + import_react313.default.createElement( + "div", + { className: clsx_m_default(styles_css_default94.form, isVisualRefresh && styles_css_default94.refresh, smallContainer && styles_css_default94["small-container"], shouldRemoveHighContrastHeader() && styles_css_default94["remove-high-contrast-header"]) }, + isVisualRefresh && import_react313.default.createElement("div", { className: clsx_m_default(styles_css_default94.background, getContentHeaderClassName()) }), + import_react313.default.createElement(WizardForm, { steps, isVisualRefresh, showCollapsedSteps: smallContainer, i18nStrings, submitButtonText, activeStepIndex: actualActiveStepIndex, isPrimaryLoading: isLoadingNextStep, allowSkipTo, secondaryActions, onCancelClick, onPreviousClick, onSkipToClick, onPrimaryClick }) + ) + ) + ); +} + +// node_modules/@cloudscape-design/components/wizard/index.js +function Wizard(_a) { + var { isLoadingNextStep = false, allowSkipTo = false } = _a, props2 = __rest(_a, ["isLoadingNextStep", "allowSkipTo"]); + const analyticsMetadata = getAnalyticsMetadataProps(props2); + const baseComponentProps = useBaseComponent("Wizard", { props: { allowSkipTo } }, analyticsMetadata); + const { wizardCount } = useFunnel(); + const externalProps = getExternalProps(props2); + (0, import_react314.useEffect)(() => { + wizardCount.current++; + return () => void wizardCount.current--; + }, [wizardCount]); + return import_react314.default.createElement( + AnalyticsFunnel, + { instanceIdentifier: analyticsMetadata === null || analyticsMetadata === void 0 ? void 0 : analyticsMetadata.instanceIdentifier, flowType: analyticsMetadata === null || analyticsMetadata === void 0 ? void 0 : analyticsMetadata.flowType, errorContext: analyticsMetadata === null || analyticsMetadata === void 0 ? void 0 : analyticsMetadata.errorContext, funnelType: "multi-page", optionalStepNumbers: props2.steps.map((step2, index) => step2.isOptional ? index + 1 : -1).filter((step2) => step2 !== -1), totalFunnelSteps: props2.steps.length, stepConfiguration: getStepConfiguration(props2.steps) }, + import_react314.default.createElement(InternalWizard, Object.assign({ isLoadingNextStep, allowSkipTo }, externalProps, baseComponentProps)) + ); +} +applyDisplayName(Wizard, "Wizard"); +var wizard_default = Wizard; +export { + alert_default as Alert, + AnchorNavigation, + AnnotationContext, + app_layout_default as AppLayout, + area_chart_default as AreaChart, + attribute_editor_default as AttributeEditor, + autosuggest_default as Autosuggest, + Badge, + bar_chart_default as BarChart, + Box, + BreadcrumbGroup, + button_default as Button, + button_dropdown_default as ButtonDropdown, + Calendar2 as Calendar, + cards_default as Cards, + checkbox_default as Checkbox, + code_editor_default as CodeEditor, + CollectionPreferences, + ColumnLayout2 as ColumnLayout, + Container, + ContentLayout, + CopyToClipboard, + date_input_default as DateInput, + date_picker_default as DatePicker, + date_range_picker_default as DateRangePicker, + Drawer2 as Drawer, + ExpandableSection, + file_upload_default as FileUpload, + Flashbar, + Form, + FormField, + Grid3 as Grid, + Header, + HelpPanel, + Hotspot, + Icon, + input_default as Input, + line_chart_default as LineChart, + link_default as Link, + mixed_line_bar_chart_default as MixedLineBarChart, + Modal, + multiselect_default as Multiselect, + Pagination, + pie_chart_default2 as PieChart, + Popover, + ProgressBar, + property_filter_default as PropertyFilter, + radio_group_default as RadioGroup, + s3_resource_selector_default as S3ResourceSelector, + SegmentedControl, + select_default as Select, + SideNavigation, + SpaceBetween, + Spinner, + SplitPanel2 as SplitPanel, + StatusIndicator2 as StatusIndicator, + table_default as Table, + Tabs, + tag_editor_default as TagEditor, + TextContent, + text_filter_default as TextFilter, + textarea_default as Textarea, + tiles_default as Tiles, + time_input_default as TimeInput, + toggle_default as Toggle, + TokenGroup, + TopNavigation, + TutorialPanel, + wizard_default as Wizard +}; +/*! Bundled license information: + +object-assign/index.js: + (* + object-assign + (c) Sindre Sorhus + @license MIT + *) +*/ +//# sourceMappingURL=@cloudscape-design_components.js.map diff --git a/new/node_modules/.vite/deps/@cloudscape-design_components.js.map b/new/node_modules/.vite/deps/@cloudscape-design_components.js.map new file mode 100644 index 00000000..be744266 --- /dev/null +++ b/new/node_modules/.vite/deps/@cloudscape-design_components.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../../object-assign/index.js", "../../prop-types/lib/ReactPropTypesSecret.js", "../../prop-types/lib/has.js", "../../prop-types/checkPropTypes.js", "../../prop-types/factoryWithTypeCheckers.js", "../../prop-types/index.js", "../../src/alert/index.tsx", "../../src/alert/internal.tsx", "../../@cloudscape-design/components/alert/styles.css.js", "../../src/internal/plugins/helpers/runtime-content-wrapper.tsx", "../../src/internal/plugins/helpers/use-discovered-action.tsx", "../../src/internal/plugins/controllers/drawers.ts", "../../src/internal/plugins/helpers/utils.ts", "../../src/internal/plugins/controllers/action-buttons.ts", "../../src/internal/plugins/api.ts", "../../src/alert/actions-wrapper/index.tsx", "../../@cloudscape-design/components/alert/actions-wrapper/styles.css.js", "../../src/anchor-navigation/index.tsx", "../../src/anchor-navigation/internal.tsx", "../../@cloudscape-design/components/anchor-navigation/styles.css.js", "../../@cloudscape-design/components/anchor-navigation/test-classes/styles.css.js", "../../src/anchor-navigation/use-scroll-spy.tsx", "../../src/annotation-context/index.tsx", "../../src/annotation-context/annotation/open-annotation.tsx", "../../src/annotation-context/annotation/annotation-trigger.tsx", "../../@cloudscape-design/components/annotation-context/annotation/styles.css.js", "../../src/annotation-context/annotation/annotation-icon.tsx", "../../src/annotation-context/annotation/annotation-popover.tsx", "../../src/annotation-context/annotation/closed-annotation.tsx", "../../src/annotation-context/context.ts", "../../src/annotation-context/utils.ts", "../../src/app-layout/index.tsx", "../../src/app-layout/widget.tsx", "../../src/app-layout/implementation.tsx", "../../src/app-layout/classic.tsx", "../../src/internal/hooks/use-controllable/index.ts", "../../src/app-layout/notifications/index.tsx", "../../@cloudscape-design/components/app-layout/notifications/styles.css.js", "../../src/app-layout/mobile-toolbar/index.tsx", "../../src/app-layout/toggles/index.tsx", "../../@cloudscape-design/components/app-layout/toggles/styles.css.js", "../../src/app-layout/drawer/overflow-menu.tsx", "../../src/button-dropdown/internal.tsx", "../../@cloudscape-design/components/button-dropdown/styles.css.js", "../../@cloudscape-design/components/internal/components/dropdown/styles.css.js", "../../src/internal/components/dropdown/index.tsx", "../../src/internal/components/dropdown/dropdown-fit-handler.ts", "../../src/internal/components/transition/index.tsx", "../../@babel/runtime/helpers/esm/extends.js", "../../@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js", "../../@babel/runtime/helpers/esm/inheritsLoose.js", "../../react-transition-group/esm/CSSTransition.js", "../../dom-helpers/esm/hasClass.js", "../../dom-helpers/esm/addClass.js", "../../dom-helpers/esm/removeClass.js", "../../react-transition-group/esm/Transition.js", "../../react-transition-group/esm/config.js", "../../react-transition-group/esm/utils/PropTypes.js", "../../react-transition-group/esm/TransitionGroupContext.js", "../../react-transition-group/esm/utils/reflow.js", "../../react-transition-group/esm/ReplaceTransition.js", "../../react-transition-group/esm/TransitionGroup.js", "../../react-transition-group/esm/utils/ChildMapping.js", "../../react-transition-group/esm/SwitchTransition.js", "../../src/internal/components/dropdown/context.tsx", "../../src/button-dropdown/items-list.tsx", "../../src/button-dropdown/item-element/index.tsx", "../../src/button-dropdown/utils/utils.ts", "../../@cloudscape-design/components/button-dropdown/item-element/styles.css.js", "../../src/button-dropdown/tooltip.tsx", "../../src/button-dropdown/utils/menu-item.ts", "../../src/button-dropdown/category-elements/expandable-category-element.tsx", "../../@cloudscape-design/components/button-dropdown/category-elements/styles.css.js", "../../src/button-dropdown/category-elements/category-element.tsx", "../../src/button-dropdown/category-elements/mobile-expandable-category-element.tsx", "../../src/button-dropdown/mobile-expandable-group/mobile-expandable-group.tsx", "../../@cloudscape-design/components/button-dropdown/mobile-expandable-group/styles.css.js", "../../src/internal/components/options-list/utils/use-open-state.ts", "../../src/button-dropdown/utils/use-highlighted-menu.ts", "../../src/button-dropdown/utils/create-items-tree.ts", "../../src/button-dropdown/utils/move-highlight.ts", "../../src/button-dropdown/utils/use-button-dropdown.ts", "../../src/internal/components/options-list/index.tsx", "../../@cloudscape-design/components/internal/components/options-list/styles.css.js", "../../@cloudscape-design/components/app-layout/test-classes/styles.css.js", "../../@cloudscape-design/components/app-layout/mobile-toolbar/styles.css.js", "../../@cloudscape-design/components/app-layout/styles.css.js", "../../src/app-layout/drawer/drawers-helpers.ts", "../../src/app-layout/utils/use-drawers.ts", "../../src/app-layout/runtime-api.tsx", "../../src/app-layout/utils/use-focus-control.ts", "../../src/split-panel/utils/size-utils.ts", "../../src/app-layout/content-wrapper/index.tsx", "../../@cloudscape-design/components/app-layout/content-wrapper/styles.css.js", "../../src/app-layout/drawer/index.tsx", "../../@cloudscape-design/components/app-layout/drawer/styles.css.js", "../../src/app-layout/drawer/resizable-drawer.tsx", "../../src/app-layout/utils/use-pointer-events.ts", "../../src/app-layout/utils/use-keyboard-events.ts", "../../src/split-panel/icons/resize-handler.tsx", "../../@cloudscape-design/components/split-panel/styles.css.js", "../../src/app-layout/split-panel/constants.ts", "../../src/app-layout/split-panel/drawer.tsx", "../../@cloudscape-design/components/app-layout/split-panel/styles.css.js", "../../src/internal/context/split-panel-context.ts", "../../src/app-layout/split-panel/provider.tsx", "../../src/app-layout/utils/use-split-panel-focus-control.ts", "../../src/app-layout/visual-refresh/index.tsx", "../../src/app-layout/visual-refresh/context.tsx", "../../src/app-layout/visual-refresh/split-panel.tsx", "../../@cloudscape-design/components/app-layout/visual-refresh/styles.css.js", "../../src/app-layout/utils/use-resize.tsx", "../../src/app-layout/visual-refresh/use-background-overlap.tsx", "../../src/app-layout/visual-refresh/background.tsx", "../../src/app-layout/visual-refresh/breadcrumbs.tsx", "../../src/app-layout/visual-refresh/drawers.tsx", "../../src/app-layout/visual-refresh/trigger-button.tsx", "../../src/app-layout/visual-refresh/header.tsx", "../../src/app-layout/visual-refresh/layout.tsx", "../../src/app-layout/visual-refresh/main.tsx", "../../src/app-layout/visual-refresh/mobile-toolbar.tsx", "../../src/app-layout/visual-refresh/navigation.tsx", "../../src/app-layout/visual-refresh/notifications.tsx", "../../src/app-layout/visual-refresh/tools.tsx", "../../src/app-layout/internal.tsx", "../../src/app-layout/defaults.ts", "../../src/app-layout/utils/use-app-layout-placement.ts", "../../src/app-layout/utils/use-observed-element.ts", "../../src/area-chart/index.tsx", "../../src/area-chart/internal.tsx", "../../src/internal/components/chart-status-container/index.tsx", "../../src/link/internal.tsx", "../../@cloudscape-design/components/link/styles.css.js", "../../@cloudscape-design/components/internal/components/chart-status-container/styles.css.js", "../../src/area-chart/elements/area-chart-filter.tsx", "../../src/internal/components/chart-filter/index.tsx", "../../src/multiselect/internal.tsx", "../../src/internal/components/option/utils/filter-options.ts", "../../src/internal/components/dropdown-footer/index.tsx", "../../@cloudscape-design/components/internal/components/dropdown-footer/styles.css.js", "../../src/internal/components/dropdown-status/index.tsx", "../../@cloudscape-design/components/internal/components/dropdown-status/styles.css.js", "../../src/internal/components/option/utils/flatten-options.ts", "../../src/internal/components/options-list/utils/test-indexes.ts", "../../src/internal/components/option/utils/prepare-options.ts", "../../src/select/utils/use-select.ts", "../../src/internal/components/options-list/utils/use-highlight-option.ts", "../../src/internal/components/options-list/utils/use-keyboard.ts", "../../src/internal/components/options-list/utils/use-ids.ts", "../../src/select/utils/connect-options.ts", "../../src/select/utils/use-native-search.ts", "../../src/select/utils/use-load-items.ts", "../../src/select/utils/use-announcement.ts", "../../src/internal/components/option/option-announcer.ts", "../../src/select/parts/plain-list.tsx", "../../src/select/utils/render-options.tsx", "../../src/select/parts/item.tsx", "../../@cloudscape-design/components/select/parts/styles.css.js", "../../src/internal/components/option/index.tsx", "../../@cloudscape-design/components/internal/components/option/styles.css.js", "../../src/internal/components/option/option-parts.tsx", "../../src/internal/components/option/highlight-match.tsx", "../../src/internal/components/selectable-item/index.tsx", "../../@cloudscape-design/components/internal/components/selectable-item/styles.css.js", "../../src/select/parts/multiselect-item.tsx", "../../src/select/utils/get-item-props.ts", "../../src/select/parts/virtual-list.tsx", "../../src/internal/hooks/use-virtual/index.ts", "../../@cloudscape-design/components/internal/vendor/react-virtual.js", "../../src/select/utils/check-option-value-field.ts", "../../src/select/parts/filter.tsx", "../../src/select/parts/trigger.tsx", "../../src/internal/components/button-trigger/index.tsx", "../../@cloudscape-design/components/internal/components/button-trigger/styles.css.js", "../../src/token-group/internal.tsx", "../../@cloudscape-design/components/multiselect/styles.css.js", "../../src/internal/components/chart-series-marker/index.tsx", "../../@cloudscape-design/components/internal/components/chart-series-marker/styles.css.js", "../../@cloudscape-design/components/internal/components/chart-filter/styles.css.js", "../../src/area-chart/elements/area-chart-legend.tsx", "../../src/internal/components/chart-legend/index.tsx", "../../@cloudscape-design/components/internal/components/chart-legend/styles.css.js", "../../src/area-chart/chart-container.tsx", "../../src/internal/components/chart-plot/index.tsx", "../../@cloudscape-design/components/internal/components/chart-plot/styles.css.js", "../../src/internal/components/chart-plot/application-controller.tsx", "../../src/internal/components/chart-plot/focus-outline.tsx", "../../src/internal/components/cartesian-chart/axis-label.tsx", "../../@cloudscape-design/components/internal/components/cartesian-chart/styles.css.js", "../../src/internal/components/cartesian-chart/labels-measure.tsx", "../../src/internal/components/cartesian-chart/left-labels.tsx", "../../src/internal/components/cartesian-chart/constants.ts", "../../src/internal/components/cartesian-chart/label-utils.ts", "../../src/internal/components/responsive-text/index.tsx", "../../src/internal/components/responsive-text/responsive-text-utils.ts", "../../src/internal/components/cartesian-chart/bottom-labels.tsx", "../../src/internal/components/cartesian-chart/emphasized-baseline.tsx", "../../src/area-chart/elements/data-series.tsx", "../../src/area-chart/elements/area-series.tsx", "../../d3-path/src/path.js", "../../d3-shape/src/constant.js", "../../d3-shape/src/math.js", "../../d3-shape/src/arc.js", "../../d3-shape/src/curve/linear.js", "../../d3-shape/src/point.js", "../../d3-shape/src/line.js", "../../d3-shape/src/area.js", "../../d3-shape/src/descending.js", "../../d3-shape/src/identity.js", "../../d3-shape/src/pie.js", "../../d3-shape/src/curve/radial.js", "../../d3-shape/src/array.js", "../../d3-shape/src/symbol/diamond.js", "../../d3-shape/src/symbol/star.js", "../../d3-shape/src/symbol/triangle.js", "../../d3-shape/src/symbol/wye.js", "../../d3-shape/src/noop.js", "../../d3-shape/src/curve/basis.js", "../../d3-shape/src/curve/basisClosed.js", "../../d3-shape/src/curve/basisOpen.js", "../../d3-shape/src/curve/bundle.js", "../../d3-shape/src/curve/cardinal.js", "../../d3-shape/src/curve/cardinalClosed.js", "../../d3-shape/src/curve/cardinalOpen.js", "../../d3-shape/src/curve/catmullRom.js", "../../d3-shape/src/curve/catmullRomClosed.js", "../../d3-shape/src/curve/catmullRomOpen.js", "../../d3-shape/src/curve/linearClosed.js", "../../d3-shape/src/curve/monotone.js", "../../d3-shape/src/curve/natural.js", "../../d3-shape/src/curve/step.js", "../../src/area-chart/elements/threshold-series.tsx", "../../@cloudscape-design/components/area-chart/styles.css.js", "../../src/area-chart/elements/chart-popover.tsx", "../../src/internal/components/chart-popover/index.tsx", "../../@cloudscape-design/components/internal/components/chart-popover/styles.css.js", "../../src/internal/components/chart-series-details/index.tsx", "../../@cloudscape-design/components/internal/components/chart-series-details/styles.css.js", "../../src/expandable-section/internal.tsx", "../../@cloudscape-design/components/expandable-section/styles.css.js", "../../src/expandable-section/expandable-section-container.tsx", "../../src/expandable-section/expandable-section-header.tsx", "../../src/expandable-section/utils.ts", "../../src/internal/components/chart-series-details/series-details-text.ts", "../../src/internal/components/chart-popover-footer/index.tsx", "../../@cloudscape-design/components/internal/components/chart-popover-footer/styles.css.js", "../../src/area-chart/elements/highlighted-point.tsx", "../../src/internal/components/cartesian-chart/highlighted-point.tsx", "../../src/area-chart/elements/vertical-marker.tsx", "../../src/internal/components/cartesian-chart/vertical-marker.tsx", "../../src/area-chart/elements/use-highlight-details.ts", "../../src/internal/utils/use-container-width.ts", "../../src/internal/components/cartesian-chart/chart-container.tsx", "../../src/area-chart/model/use-chart-model.ts", "../../src/area-chart/model/utils.ts", "../../src/internal/components/cartesian-chart/ticks.ts", "../../@cloudscape-design/components/internal/vendor/d3-scale.js", "../../src/internal/components/cartesian-chart/scales.ts", "../../src/area-chart/model/compute-chart-props.ts", "../../@cloudscape-design/components/internal/generated/styles/tokens.js", "../../src/internal/styles/colors.ts", "../../src/internal/utils/create-category-color-scale.ts", "../../src/area-chart/model/create-series-decorator.ts", "../../src/area-chart/model/interactions-store.ts", "../../src/internal/utils/throttle.ts", "../../src/internal/hooks/container-queries/use-height-measure.ts", "../../src/area-chart/model/use-filter-props.ts", "../../src/area-chart/model/use-highlight-props.ts", "../../src/internal/components/chart-wrapper/index.tsx", "../../@cloudscape-design/components/internal/components/chart-wrapper/styles.css.js", "../../src/attribute-editor/index.tsx", "../../src/attribute-editor/internal.tsx", "../../src/attribute-editor/additional-info.tsx", "../../@cloudscape-design/components/attribute-editor/styles.css.js", "../../src/attribute-editor/row.tsx", "../../src/autosuggest/index.tsx", "../../src/autosuggest/internal.tsx", "../../src/autosuggest/options-controller.ts", "../../src/autosuggest/utils/utils.ts", "../../src/autosuggest/options-list.tsx", "../../src/autosuggest/virtual-list.tsx", "../../src/autosuggest/autosuggest-option.tsx", "../../@cloudscape-design/components/autosuggest/styles.css.js", "../../src/autosuggest/plain-list.tsx", "../../src/autosuggest/load-more-controller.ts", "../../src/internal/components/autosuggest-input/index.tsx", "../../@cloudscape-design/components/internal/components/autosuggest-input/styles.css.js", "../../src/badge/index.tsx", "../../@cloudscape-design/components/badge/styles.css.js", "../../src/bar-chart/index.tsx", "../../@cloudscape-design/components/bar-chart/styles.css.js", "../../src/mixed-line-bar-chart/internal.tsx", "../../src/mixed-line-bar-chart/chart-legend.tsx", "../../src/mixed-line-bar-chart/utils.ts", "../../src/mixed-line-bar-chart/chart-container.tsx", "../../src/internal/components/cartesian-chart/vertical-grid-lines.tsx", "../../src/mixed-line-bar-chart/chart-popover.tsx", "../../@cloudscape-design/components/mixed-line-bar-chart/styles.css.js", "../../src/mixed-line-bar-chart/domain.ts", "../../src/mixed-line-bar-chart/make-scaled-series.ts", "../../src/mixed-line-bar-chart/make-scaled-bar-groups.ts", "../../src/mixed-line-bar-chart/format-highlighted.ts", "../../src/mixed-line-bar-chart/data-series.tsx", "../../src/mixed-line-bar-chart/line-series.tsx", "../../src/mixed-line-bar-chart/bar-series.tsx", "../../src/mixed-line-bar-chart/bar-groups.tsx", "../../src/mixed-line-bar-chart/hooks/use-mouse-hover.ts", "../../src/mixed-line-bar-chart/hooks/use-navigation.ts", "../../src/mixed-line-bar-chart/hooks/use-popover.ts", "../../src/breadcrumb-group/index.tsx", "../../src/breadcrumb-group/internal.tsx", "../../@cloudscape-design/components/breadcrumb-group/styles.css.js", "../../src/breadcrumb-group/item/item.tsx", "../../@cloudscape-design/components/breadcrumb-group/item/styles.css.js", "../../src/internal/components/tooltip/index.tsx", "../../@cloudscape-design/components/internal/components/tooltip/styles.css.js", "../../src/button-dropdown/index.tsx", "../../src/calendar/index.tsx", "../../src/calendar/internal.tsx", "../../@cloudscape-design/components/calendar/styles.css.js", "../../src/calendar/header/index.tsx", "../../src/calendar/header/header-button.tsx", "../../src/calendar/grid/index.tsx", "../../src/internal/utils/locale/merge-locales.ts", "../../src/internal/utils/locale/normalize-locale.ts", "../../weekstart/src/api.js", "../../weekstart/src/langRegionMap.js", "../../weekstart/src/regionDayMap.js", "../../weekstart/src/main.js", "../../src/internal/utils/locale/normalize-start-of-week.ts", "../../src/calendar/utils/navigation.ts", "../../src/internal/hooks/use-date-cache/index.ts", "../../src/calendar/utils/intl.ts", "../../src/calendar/use-calendar-labels.ts", "../../src/calendar/grid/use-calendar-grid-rows.ts", "../../mnth/web/add-days.ts", "../../mnth/web/set-date.ts", "../../mnth/web/index.ts", "../../src/internal/utils/handle-key.ts", "../../src/calendar/grid/use-calendar-grid-keyboard-navigation.ts", "../../src/calendar/grid/calendar-grid-header.tsx", "../../src/cards/index.tsx", "../../@cloudscape-design/components/cards/styles.css.js", "../../src/cards/cards-layout-helper.ts", "../../src/checkbox/index.tsx", "../../src/code-editor/index.tsx", "../../src/code-editor/pane.tsx", "../../src/code-editor/resizable-box/index.tsx", "../../@cloudscape-design/components/code-editor/resizable-box/styles.css.js", "../../@cloudscape-design/components/code-editor/styles.css.js", "../../src/code-editor/ace-modes.ts", "../../src/code-editor/ace-themes.ts", "../../src/code-editor/util.ts", "../../src/code-editor/listeners.ts", "../../src/code-editor/setup-editor.ts", "../../src/code-editor/preferences-modal.tsx", "../../src/select/internal.tsx", "../../@cloudscape-design/components/select/styles.css.js", "../../src/code-editor/loading-screen.tsx", "../../src/code-editor/error-screen.tsx", "../../src/code-editor/status-bar.tsx", "../../src/code-editor/tab-button.tsx", "../../src/code-editor/use-editor.tsx", "../../src/column-layout/index.tsx", "../../src/container/index.tsx", "../../src/content-layout/index.tsx", "../../src/content-layout/internal.tsx", "../../@cloudscape-design/components/content-layout/styles.css.js", "../../src/copy-to-clipboard/index.tsx", "../../src/popover/internal.tsx", "../../@cloudscape-design/components/copy-to-clipboard/styles.css.js", "../../@cloudscape-design/components/copy-to-clipboard/test-classes/styles.css.js", "../../src/date-input/index.tsx", "../../src/date-input/internal.tsx", "../../src/internal/components/masked-input/index.tsx", "../../src/internal/components/masked-input/utils/keys.ts", "../../src/internal/components/masked-input/keyboard-handler.ts", "../../src/internal/components/masked-input/use-mask.ts", "../../src/internal/components/masked-input/utils/strings.ts", "../../src/internal/components/masked-input/utils/mask-format.ts", "../../@cloudscape-design/components/date-input/styles.css.js", "../../src/date-picker/index.tsx", "../../@cloudscape-design/components/date-picker/styles.css.js", "../../src/internal/hooks/use-focus-tracker.ts", "../../src/internal/focus-tracker.ts", "../../src/date-picker/utils.ts", "../../src/date-range-picker/index.tsx", "../../@cloudscape-design/components/date-range-picker/styles.css.js", "../../src/date-range-picker/dropdown.tsx", "../../src/date-range-picker/calendar/index.tsx", "../../src/date-range-picker/calendar/header/index.tsx", "../../src/date-range-picker/calendar/header/header-button.tsx", "../../src/date-range-picker/calendar/grids/index.tsx", "../../src/date-range-picker/calendar/grids/grid.tsx", "../../@cloudscape-design/components/date-range-picker/calendar/grids/styles.css.js", "../../src/internal/utils/has-value.ts", "../../src/date-range-picker/calendar/utils.ts", "../../src/date-range-picker/calendar/range-inputs.tsx", "../../src/time-input/internal.tsx", "../../@cloudscape-design/components/time-input/styles.css.js", "../../src/date-range-picker/relative-range/index.tsx", "../../@cloudscape-design/components/date-range-picker/relative-range/styles.css.js", "../../src/date-range-picker/mode-switcher.tsx", "../../src/segmented-control/internal.tsx", "../../src/segmented-control/internal-segmented-control.tsx", "../../src/segmented-control/segment.tsx", "../../@cloudscape-design/components/segmented-control/styles.css.js", "../../src/date-range-picker/time-offset.ts", "../../src/date-range-picker/utils.tsx", "../../src/drawer/index.tsx", "../../@cloudscape-design/components/drawer/styles.css.js", "../../src/expandable-section/index.tsx", "../../src/flashbar/index.tsx", "../../src/flashbar/collapsible-flashbar.tsx", "../../src/flashbar/flash.tsx", "../../@cloudscape-design/components/flashbar/styles.css.js", "../../src/flashbar/utils.ts", "../../src/flashbar/internal/analytics.ts", "../../src/internal/animate.ts", "../../src/flashbar/common.tsx", "../../src/flashbar/non-collapsible-flashbar.tsx", "../../src/flashbar/constant.ts", "../../src/form/index.tsx", "../../src/form/internal.tsx", "../../@cloudscape-design/components/form/styles.css.js", "../../src/grid/index.tsx", "../../src/help-panel/index.tsx", "../../@cloudscape-design/components/help-panel/styles.css.js", "../../src/hotspot/index.tsx", "../../@cloudscape-design/components/hotspot/styles.css.js", "../../src/icon/index.tsx", "../../src/input/index.tsx", "../../src/line-chart/index.tsx", "../../@cloudscape-design/components/line-chart/styles.css.js", "../../src/link/index.tsx", "../../src/mixed-line-bar-chart/index.tsx", "../../src/modal/index.tsx", "../../src/multiselect/index.tsx", "../../src/pie-chart/index.tsx", "../../src/pie-chart/pie-chart.tsx", "../../src/pie-chart/labels.tsx", "../../@cloudscape-design/components/pie-chart/styles.css.js", "../../src/pie-chart/utils.ts", "../../src/pie-chart/responsive-text.tsx", "../../src/pie-chart/segments.tsx", "../../src/popover/index.tsx", "../../src/progress-bar/index.tsx", "../../@cloudscape-design/components/progress-bar/styles.css.js", "../../src/progress-bar/internal.tsx", "../../src/property-filter/index.tsx", "../../src/property-filter/token.tsx", "../../@cloudscape-design/components/property-filter/styles.css.js", "../../src/property-filter/token-editor.tsx", "../../src/property-filter/use-load-items.ts", "../../src/property-filter/utils.ts", "../../src/property-filter/controller.ts", "../../src/internal/components/filtering-token/index.tsx", "../../@cloudscape-design/components/internal/components/filtering-token/styles.css.js", "../../src/property-filter/property-filter-autosuggest.tsx", "../../src/property-filter/filter-options.ts", "../../src/property-filter/property-editor.tsx", "../../src/radio-group/index.tsx", "../../src/s3-resource-selector/index.tsx", "../../src/s3-resource-selector/s3-in-context/index.tsx", "../../src/s3-resource-selector/s3-in-context/use-versions-fetch.ts", "../../src/internal/utils/promises.ts", "../../src/s3-resource-selector/s3-in-context/validation.ts", "../../@cloudscape-design/components/s3-resource-selector/s3-in-context/styles.css.js", "../../src/s3-resource-selector/s3-in-context/search-input.tsx", "../../src/s3-resource-selector/s3-modal/index.tsx", "../../src/s3-resource-selector/s3-modal/buckets-table.tsx", "../../src/s3-resource-selector/s3-modal/table-utils.ts", "../../src/s3-resource-selector/s3-modal/column-formats.ts", "../../src/s3-resource-selector/s3-modal/basic-table.tsx", "../../src/s3-resource-selector/s3-modal/empty-state.tsx", "../../src/s3-resource-selector/s3-modal/objects-table.tsx", "../../src/s3-resource-selector/utils.ts", "../../src/s3-resource-selector/s3-modal/versions-table.tsx", "../../@cloudscape-design/components/s3-resource-selector/s3-modal/styles.css.js", "../../@cloudscape-design/components/s3-resource-selector/styles.css.js", "../../src/segmented-control/index.tsx", "../../src/select/index.tsx", "../../src/side-navigation/index.tsx", "../../src/side-navigation/internal.tsx", "../../@cloudscape-design/components/side-navigation/styles.css.js", "../../src/side-navigation/util.tsx", "../../src/spinner/index.tsx", "../../src/split-panel/index.tsx", "../../src/split-panel/widget.tsx", "../../src/split-panel/implementation.tsx", "../../src/split-panel/preferences-modal.tsx", "../../src/tiles/internal.tsx", "../../@cloudscape-design/components/tiles/styles.css.js", "../../src/tiles/tile.tsx", "../../src/split-panel/icons/side-position.tsx", "../../src/split-panel/icons/bottom-icon.tsx", "../../src/split-panel/icons/side-position-refresh.tsx", "../../src/split-panel/icons/bottom-icon-refresh.tsx", "../../src/split-panel/side.tsx", "../../src/split-panel/bottom.tsx", "../../src/split-panel/internal.tsx", "../../src/status-indicator/index.tsx", "../../src/tabs/index.tsx", "../../@cloudscape-design/components/tabs/styles.css.js", "../../src/tabs/tab-header-bar.tsx", "../../src/tabs/native-smooth-scroll-supported.ts", "../../src/tabs/smooth-scroll.ts", "../../src/tabs/scroll-utils.ts", "../../src/tag-editor/index.tsx", "../../src/tag-editor/internal.tsx", "../../@cloudscape-design/components/tag-editor/styles.css.js", "../../src/tag-editor/validation.ts", "../../src/tag-editor/utils.ts", "../../src/text-content/index.tsx", "../../@cloudscape-design/components/text-content/styles.css.js", "../../src/textarea/index.tsx", "../../@cloudscape-design/components/textarea/styles.css.js", "../../src/tiles/index.tsx", "../../src/time-input/index.tsx", "../../src/toggle/index.tsx", "../../src/token-group/index.tsx", "../../src/top-navigation/index.tsx", "../../src/top-navigation/internal.tsx", "../../src/top-navigation/use-top-navigation.ts", "../../@cloudscape-design/components/top-navigation/styles.css.js", "../../src/top-navigation/parts/utility.tsx", "../../src/internal/components/menu-dropdown/index.tsx", "../../@cloudscape-design/components/internal/components/menu-dropdown/styles.css.js", "../../src/top-navigation/parts/overflow-menu/index.tsx", "../../src/top-navigation/parts/overflow-menu/router.tsx", "../../src/top-navigation/parts/overflow-menu/views/utilities.tsx", "../../src/top-navigation/parts/overflow-menu/header.tsx", "../../src/top-navigation/parts/overflow-menu/menu-item.tsx", "../../src/top-navigation/parts/overflow-menu/views/submenu.tsx", "../../src/tutorial-panel/index.tsx", "../../@cloudscape-design/components/tutorial-panel/styles.css.js", "../../src/tutorial-panel/components/tutorial-list/index.tsx", "../../@cloudscape-design/components/tutorial-panel/components/tutorial-list/styles.css.js", "../../src/tutorial-panel/components/tutorial-detail-view/index.tsx", "../../@cloudscape-design/components/tutorial-panel/components/tutorial-detail-view/styles.css.js", "../../src/tutorial-panel/components/tutorial-detail-view/congratulation-screen.tsx", "../../src/tutorial-panel/components/tutorial-detail-view/task-list.tsx", "../../src/tutorial-panel/components/tutorial-detail-view/task.tsx", "../../src/wizard/index.tsx", "../../src/wizard/internal.tsx", "../../src/wizard/wizard-form.tsx", "../../src/wizard/wizard-actions.tsx", "../../@cloudscape-design/components/wizard/styles.css.js", "../../src/wizard/unmount.ts", "../../src/wizard/wizard-form-header.tsx", "../../src/wizard/wizard-navigation.tsx", "../../src/wizard/analytics.ts"], + "sourcesContent": ["/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n\n'use strict';\n/* eslint-disable no-unused-vars */\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction shouldUseNative() {\n\ttry {\n\t\tif (!Object.assign) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Detect buggy property enumeration order in older V8 versions.\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\t\tvar test1 = new String('abc'); // eslint-disable-line no-new-wrappers\n\t\ttest1[5] = 'de';\n\t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test2 = {};\n\t\tfor (var i = 0; i < 10; i++) {\n\t\t\ttest2['_' + String.fromCharCode(i)] = i;\n\t\t}\n\t\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n\t\t\treturn test2[n];\n\t\t});\n\t\tif (order2.join('') !== '0123456789') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test3 = {};\n\t\t'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n\t\t\ttest3[letter] = letter;\n\t\t});\n\t\tif (Object.keys(Object.assign({}, test3)).join('') !==\n\t\t\t\t'abcdefghijklmnopqrst') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t} catch (err) {\n\t\t// We don't expect any of the above to throw, but better to be safe.\n\t\treturn false;\n\t}\n}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n\tvar from;\n\tvar to = toObject(target);\n\tvar symbols;\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = Object(arguments[s]);\n\n\t\tfor (var key in from) {\n\t\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\t\tto[key] = from[key];\n\t\t\t}\n\t\t}\n\n\t\tif (getOwnPropertySymbols) {\n\t\t\tsymbols = getOwnPropertySymbols(from);\n\t\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\t\tto[symbols[i]] = from[symbols[i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to;\n};\n", "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n", "module.exports = Function.call.bind(Object.prototype.hasOwnProperty);\n", "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar printWarning = function() {};\n\nif (process.env.NODE_ENV !== 'production') {\n var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n var loggedTypeFailures = {};\n var has = require('./lib/has');\n\n printWarning = function(text) {\n var message = 'Warning: ' + text;\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) { /**/ }\n };\n}\n\n/**\n * Assert that the values match with the type specs.\n * Error messages are memorized and will only be shown once.\n *\n * @param {object} typeSpecs Map of name to a ReactPropType\n * @param {object} values Runtime values that need to be type-checked\n * @param {string} location e.g. \"prop\", \"context\", \"child context\"\n * @param {string} componentName Name of the component for error messages.\n * @param {?Function} getStack Returns the component stack.\n * @private\n */\nfunction checkPropTypes(typeSpecs, values, location, componentName, getStack) {\n if (process.env.NODE_ENV !== 'production') {\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error;\n // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n var err = Error(\n (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +\n 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +\n 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'\n );\n err.name = 'Invariant Violation';\n throw err;\n }\n error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);\n } catch (ex) {\n error = ex;\n }\n if (error && !(error instanceof Error)) {\n printWarning(\n (componentName || 'React class') + ': type specification of ' +\n location + ' `' + typeSpecName + '` is invalid; the type checker ' +\n 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +\n 'You may have forgotten to pass an argument to the type checker ' +\n 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +\n 'shape all require an argument).'\n );\n }\n if (error instanceof Error && !(error.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error.message] = true;\n\n var stack = getStack ? getStack() : '';\n\n printWarning(\n 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')\n );\n }\n }\n }\n }\n}\n\n/**\n * Resets warning cache when testing.\n *\n * @private\n */\ncheckPropTypes.resetWarningCache = function() {\n if (process.env.NODE_ENV !== 'production') {\n loggedTypeFailures = {};\n }\n}\n\nmodule.exports = checkPropTypes;\n", "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactIs = require('react-is');\nvar assign = require('object-assign');\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\nvar has = require('./lib/has');\nvar checkPropTypes = require('./checkPropTypes');\n\nvar printWarning = function() {};\n\nif (process.env.NODE_ENV !== 'production') {\n printWarning = function(text) {\n var message = 'Warning: ' + text;\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n };\n}\n\nfunction emptyFunctionThatReturnsNull() {\n return null;\n}\n\nmodule.exports = function(isValidElement, throwOnDirectAccess) {\n /* global Symbol */\n var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;\n var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.\n\n /**\n * Returns the iterator method function contained on the iterable object.\n *\n * Be sure to invoke the function with the iterable as context:\n *\n * var iteratorFn = getIteratorFn(myIterable);\n * if (iteratorFn) {\n * var iterator = iteratorFn.call(myIterable);\n * ...\n * }\n *\n * @param {?object} maybeIterable\n * @return {?function}\n */\n function getIteratorFn(maybeIterable) {\n var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);\n if (typeof iteratorFn === 'function') {\n return iteratorFn;\n }\n }\n\n /**\n * Collection of methods that allow declaration and validation of props that are\n * supplied to React components. Example usage:\n *\n * var Props = require('ReactPropTypes');\n * var MyArticle = React.createClass({\n * propTypes: {\n * // An optional string prop named \"description\".\n * description: Props.string,\n *\n * // A required enum prop named \"category\".\n * category: Props.oneOf(['News','Photos']).isRequired,\n *\n * // A prop named \"dialog\" that requires an instance of Dialog.\n * dialog: Props.instanceOf(Dialog).isRequired\n * },\n * render: function() { ... }\n * });\n *\n * A more formal specification of how these methods are used:\n *\n * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)\n * decl := ReactPropTypes.{type}(.isRequired)?\n *\n * Each and every declaration produces a function with the same signature. This\n * allows the creation of custom validation functions. For example:\n *\n * var MyLink = React.createClass({\n * propTypes: {\n * // An optional string or URI prop named \"href\".\n * href: function(props, propName, componentName) {\n * var propValue = props[propName];\n * if (propValue != null && typeof propValue !== 'string' &&\n * !(propValue instanceof URI)) {\n * return new Error(\n * 'Expected a string or an URI for ' + propName + ' in ' +\n * componentName\n * );\n * }\n * }\n * },\n * render: function() {...}\n * });\n *\n * @internal\n */\n\n var ANONYMOUS = '<>';\n\n // Important!\n // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.\n var ReactPropTypes = {\n array: createPrimitiveTypeChecker('array'),\n bigint: createPrimitiveTypeChecker('bigint'),\n bool: createPrimitiveTypeChecker('boolean'),\n func: createPrimitiveTypeChecker('function'),\n number: createPrimitiveTypeChecker('number'),\n object: createPrimitiveTypeChecker('object'),\n string: createPrimitiveTypeChecker('string'),\n symbol: createPrimitiveTypeChecker('symbol'),\n\n any: createAnyTypeChecker(),\n arrayOf: createArrayOfTypeChecker,\n element: createElementTypeChecker(),\n elementType: createElementTypeTypeChecker(),\n instanceOf: createInstanceTypeChecker,\n node: createNodeChecker(),\n objectOf: createObjectOfTypeChecker,\n oneOf: createEnumTypeChecker,\n oneOfType: createUnionTypeChecker,\n shape: createShapeTypeChecker,\n exact: createStrictShapeTypeChecker,\n };\n\n /**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n */\n /*eslint-disable no-self-compare*/\n function is(x, y) {\n // SameValue algorithm\n if (x === y) {\n // Steps 1-5, 7-10\n // Steps 6.b-6.e: +0 != -0\n return x !== 0 || 1 / x === 1 / y;\n } else {\n // Step 6.a: NaN == NaN\n return x !== x && y !== y;\n }\n }\n /*eslint-enable no-self-compare*/\n\n /**\n * We use an Error-like object for backward compatibility as people may call\n * PropTypes directly and inspect their output. However, we don't use real\n * Errors anymore. We don't inspect their stack anyway, and creating them\n * is prohibitively expensive if they are created too often, such as what\n * happens in oneOfType() for any type before the one that matched.\n */\n function PropTypeError(message, data) {\n this.message = message;\n this.data = data && typeof data === 'object' ? data: {};\n this.stack = '';\n }\n // Make `instanceof Error` still work for returned errors.\n PropTypeError.prototype = Error.prototype;\n\n function createChainableTypeChecker(validate) {\n if (process.env.NODE_ENV !== 'production') {\n var manualPropTypeCallCache = {};\n var manualPropTypeWarningCount = 0;\n }\n function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {\n componentName = componentName || ANONYMOUS;\n propFullName = propFullName || propName;\n\n if (secret !== ReactPropTypesSecret) {\n if (throwOnDirectAccess) {\n // New behavior only for users of `prop-types` package\n var err = new Error(\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use `PropTypes.checkPropTypes()` to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n err.name = 'Invariant Violation';\n throw err;\n } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {\n // Old behavior for people using React.PropTypes\n var cacheKey = componentName + ':' + propName;\n if (\n !manualPropTypeCallCache[cacheKey] &&\n // Avoid spamming the console because they are often not actionable except for lib authors\n manualPropTypeWarningCount < 3\n ) {\n printWarning(\n 'You are manually calling a React.PropTypes validation ' +\n 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +\n 'and will throw in the standalone `prop-types` package. ' +\n 'You may be seeing this warning due to a third-party PropTypes ' +\n 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'\n );\n manualPropTypeCallCache[cacheKey] = true;\n manualPropTypeWarningCount++;\n }\n }\n }\n if (props[propName] == null) {\n if (isRequired) {\n if (props[propName] === null) {\n return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));\n }\n return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));\n }\n return null;\n } else {\n return validate(props, propName, componentName, location, propFullName);\n }\n }\n\n var chainedCheckType = checkType.bind(null, false);\n chainedCheckType.isRequired = checkType.bind(null, true);\n\n return chainedCheckType;\n }\n\n function createPrimitiveTypeChecker(expectedType) {\n function validate(props, propName, componentName, location, propFullName, secret) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== expectedType) {\n // `propValue` being instance of, say, date/regexp, pass the 'object'\n // check, but we can offer a more precise error message here rather than\n // 'of type `object`'.\n var preciseType = getPreciseType(propValue);\n\n return new PropTypeError(\n 'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),\n {expectedType: expectedType}\n );\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createAnyTypeChecker() {\n return createChainableTypeChecker(emptyFunctionThatReturnsNull);\n }\n\n function createArrayOfTypeChecker(typeChecker) {\n function validate(props, propName, componentName, location, propFullName) {\n if (typeof typeChecker !== 'function') {\n return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');\n }\n var propValue = props[propName];\n if (!Array.isArray(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));\n }\n for (var i = 0; i < propValue.length; i++) {\n var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);\n if (error instanceof Error) {\n return error;\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createElementTypeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n if (!isValidElement(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createElementTypeTypeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n if (!ReactIs.isValidElementType(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createInstanceTypeChecker(expectedClass) {\n function validate(props, propName, componentName, location, propFullName) {\n if (!(props[propName] instanceof expectedClass)) {\n var expectedClassName = expectedClass.name || ANONYMOUS;\n var actualClassName = getClassName(props[propName]);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createEnumTypeChecker(expectedValues) {\n if (!Array.isArray(expectedValues)) {\n if (process.env.NODE_ENV !== 'production') {\n if (arguments.length > 1) {\n printWarning(\n 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +\n 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'\n );\n } else {\n printWarning('Invalid argument supplied to oneOf, expected an array.');\n }\n }\n return emptyFunctionThatReturnsNull;\n }\n\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n for (var i = 0; i < expectedValues.length; i++) {\n if (is(propValue, expectedValues[i])) {\n return null;\n }\n }\n\n var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {\n var type = getPreciseType(value);\n if (type === 'symbol') {\n return String(value);\n }\n return value;\n });\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));\n }\n return createChainableTypeChecker(validate);\n }\n\n function createObjectOfTypeChecker(typeChecker) {\n function validate(props, propName, componentName, location, propFullName) {\n if (typeof typeChecker !== 'function') {\n return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');\n }\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));\n }\n for (var key in propValue) {\n if (has(propValue, key)) {\n var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error instanceof Error) {\n return error;\n }\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createUnionTypeChecker(arrayOfTypeCheckers) {\n if (!Array.isArray(arrayOfTypeCheckers)) {\n process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;\n return emptyFunctionThatReturnsNull;\n }\n\n for (var i = 0; i < arrayOfTypeCheckers.length; i++) {\n var checker = arrayOfTypeCheckers[i];\n if (typeof checker !== 'function') {\n printWarning(\n 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +\n 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'\n );\n return emptyFunctionThatReturnsNull;\n }\n }\n\n function validate(props, propName, componentName, location, propFullName) {\n var expectedTypes = [];\n for (var i = 0; i < arrayOfTypeCheckers.length; i++) {\n var checker = arrayOfTypeCheckers[i];\n var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret);\n if (checkerResult == null) {\n return null;\n }\n if (checkerResult.data && has(checkerResult.data, 'expectedType')) {\n expectedTypes.push(checkerResult.data.expectedType);\n }\n }\n var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));\n }\n return createChainableTypeChecker(validate);\n }\n\n function createNodeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n if (!isNode(props[propName])) {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function invalidValidatorError(componentName, location, propFullName, key, type) {\n return new PropTypeError(\n (componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +\n 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'\n );\n }\n\n function createShapeTypeChecker(shapeTypes) {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));\n }\n for (var key in shapeTypes) {\n var checker = shapeTypes[key];\n if (typeof checker !== 'function') {\n return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));\n }\n var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error) {\n return error;\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createStrictShapeTypeChecker(shapeTypes) {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));\n }\n // We need to check all keys in case some are required but missing from props.\n var allKeys = assign({}, props[propName], shapeTypes);\n for (var key in allKeys) {\n var checker = shapeTypes[key];\n if (has(shapeTypes, key) && typeof checker !== 'function') {\n return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));\n }\n if (!checker) {\n return new PropTypeError(\n 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +\n '\\nBad object: ' + JSON.stringify(props[propName], null, ' ') +\n '\\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')\n );\n }\n var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error) {\n return error;\n }\n }\n return null;\n }\n\n return createChainableTypeChecker(validate);\n }\n\n function isNode(propValue) {\n switch (typeof propValue) {\n case 'number':\n case 'string':\n case 'undefined':\n return true;\n case 'boolean':\n return !propValue;\n case 'object':\n if (Array.isArray(propValue)) {\n return propValue.every(isNode);\n }\n if (propValue === null || isValidElement(propValue)) {\n return true;\n }\n\n var iteratorFn = getIteratorFn(propValue);\n if (iteratorFn) {\n var iterator = iteratorFn.call(propValue);\n var step;\n if (iteratorFn !== propValue.entries) {\n while (!(step = iterator.next()).done) {\n if (!isNode(step.value)) {\n return false;\n }\n }\n } else {\n // Iterator will provide entry [k,v] tuples rather than values.\n while (!(step = iterator.next()).done) {\n var entry = step.value;\n if (entry) {\n if (!isNode(entry[1])) {\n return false;\n }\n }\n }\n }\n } else {\n return false;\n }\n\n return true;\n default:\n return false;\n }\n }\n\n function isSymbol(propType, propValue) {\n // Native Symbol.\n if (propType === 'symbol') {\n return true;\n }\n\n // falsy value can't be a Symbol\n if (!propValue) {\n return false;\n }\n\n // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'\n if (propValue['@@toStringTag'] === 'Symbol') {\n return true;\n }\n\n // Fallback for non-spec compliant Symbols which are polyfilled.\n if (typeof Symbol === 'function' && propValue instanceof Symbol) {\n return true;\n }\n\n return false;\n }\n\n // Equivalent of `typeof` but with special handling for array and regexp.\n function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }\n\n // This handles more types than `getPropType`. Only used for error messages.\n // See `createPrimitiveTypeChecker`.\n function getPreciseType(propValue) {\n if (typeof propValue === 'undefined' || propValue === null) {\n return '' + propValue;\n }\n var propType = getPropType(propValue);\n if (propType === 'object') {\n if (propValue instanceof Date) {\n return 'date';\n } else if (propValue instanceof RegExp) {\n return 'regexp';\n }\n }\n return propType;\n }\n\n // Returns a string that is postfixed to a warning about an invalid type.\n // For example, \"undefined\" or \"of type array\"\n function getPostfixForTypeWarning(value) {\n var type = getPreciseType(value);\n switch (type) {\n case 'array':\n case 'object':\n return 'an ' + type;\n case 'boolean':\n case 'date':\n case 'regexp':\n return 'a ' + type;\n default:\n return type;\n }\n }\n\n // Returns class name of the object, if any.\n function getClassName(propValue) {\n if (!propValue.constructor || !propValue.constructor.name) {\n return ANONYMOUS;\n }\n return propValue.constructor.name;\n }\n\n ReactPropTypes.checkPropTypes = checkPropTypes;\n ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n", "/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (process.env.NODE_ENV !== 'production') {\n var ReactIs = require('react-is');\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(ReactIs.isElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect } from 'react';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { AlertProps } from './interfaces';\nimport InternalAlert from './internal';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { FunnelMetrics } from '../internal/analytics';\nimport { useFunnel, useFunnelStep, useFunnelSubStep } from '../internal/analytics/hooks/use-funnel';\nimport { getNameFromSelector, getSubStepAllSelector } from '../internal/analytics/selectors';\nimport { BasePropsWithAnalyticsMetadata, getAnalyticsMetadataProps } from '../internal/base-component';\n\nexport { AlertProps };\n\nconst Alert = React.forwardRef(\n ({ type = 'info', visible = true, ...props }: AlertProps, ref: React.Ref) => {\n const analyticsMetadata = getAnalyticsMetadataProps(props as BasePropsWithAnalyticsMetadata);\n const baseComponentProps = useBaseComponent(\n 'Alert',\n {\n props: { type, visible, dismissible: props.dismissible },\n },\n analyticsMetadata\n );\n\n const { funnelInteractionId, submissionAttempt, funnelState, errorCount } = useFunnel();\n const { stepNumber, stepNameSelector } = useFunnelStep();\n const { subStepSelector, subStepNameSelector } = useFunnelSubStep();\n\n useEffect(() => {\n if (funnelInteractionId && visible && type === 'error' && funnelState.current !== 'complete') {\n const stepName = getNameFromSelector(stepNameSelector);\n const subStepName = getNameFromSelector(subStepNameSelector);\n\n errorCount.current++;\n\n // We don't want to report an error if it is hidden, e.g. inside an Expandable Section.\n const errorIsVisible = (baseComponentProps.__internalRootRef.current?.getBoundingClientRect()?.width ?? 0) > 0;\n\n if (errorIsVisible) {\n if (subStepSelector) {\n FunnelMetrics.funnelSubStepError({\n funnelInteractionId,\n subStepSelector,\n subStepName,\n subStepNameSelector,\n stepNumber,\n stepName,\n stepNameSelector,\n subStepAllSelector: getSubStepAllSelector(),\n instanceIdentifier: analyticsMetadata?.instanceIdentifier,\n errorContext: analyticsMetadata?.errorContext,\n });\n } else {\n FunnelMetrics.funnelError({\n funnelInteractionId,\n });\n }\n }\n\n return () => {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n errorCount.current--;\n };\n }\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [funnelInteractionId, visible, submissionAttempt, errorCount]);\n\n return ;\n }\n);\n\napplyDisplayName(Alert, 'Alert');\nexport default Alert;\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\nimport clsx from 'clsx';\nimport { InternalButton } from '../button/internal';\nimport { IconProps } from '../icon/interfaces';\nimport InternalIcon from '../icon/internal';\nimport { getBaseProps } from '../internal/base-component';\nimport VisualContext from '../internal/components/visual-context';\nimport styles from './styles.css.js';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { useContainerBreakpoints } from '../internal/hooks/container-queries';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport useForwardFocus from '../internal/hooks/forward-focus';\nimport { AlertProps } from './interfaces';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { SomeRequired } from '../internal/types';\nimport { useInternalI18n } from '../i18n/context';\nimport { DATA_ATTR_ANALYTICS_ALERT } from '../internal/analytics/selectors';\nimport { LinkDefaultVariantContext } from '../internal/context/link-default-variant-context';\nimport { createUseDiscoveredAction } from '../internal/plugins/helpers';\nimport { awsuiPluginsInternal } from '../internal/plugins/api';\nimport { ActionsWrapper } from './actions-wrapper';\n\nconst typeToIcon: Record = {\n error: 'status-negative',\n warning: 'status-warning',\n success: 'status-positive',\n info: 'status-info',\n};\n\ntype InternalAlertProps = SomeRequired & InternalBaseComponentProps;\n\nconst useDiscoveredAction = createUseDiscoveredAction(awsuiPluginsInternal.alert.onActionRegistered);\n\nconst InternalAlert = React.forwardRef(\n (\n {\n type,\n statusIconAriaLabel,\n visible = true,\n dismissible,\n dismissAriaLabel,\n children,\n header,\n buttonText,\n action,\n onDismiss,\n onButtonClick,\n __internalRootRef = null,\n ...rest\n }: InternalAlertProps,\n ref: React.Ref\n ) => {\n const baseProps = getBaseProps(rest);\n const i18n = useInternalI18n('alert');\n\n const focusRef = useRef(null);\n useForwardFocus(ref, focusRef);\n\n const [breakpoint, breakpointRef] = useContainerBreakpoints(['xs']);\n const mergedRef = useMergeRefs(breakpointRef, __internalRootRef);\n\n const isRefresh = useVisualRefresh();\n const size = isRefresh ? 'normal' : header && children ? 'big' : 'normal';\n\n const { discoveredActions, headerRef, contentRef } = useDiscoveredAction(type);\n\n const hasAction = Boolean(action || buttonText || discoveredActions.length);\n\n const analyticsAttributes = {\n [DATA_ATTR_ANALYTICS_ALERT]: type,\n };\n\n return (\n \n \n \n \n
    \n
    \n \n
    \n
    \n {header && (\n
    \n {header}\n
    \n )}\n
    \n {children}\n
    \n
    \n
    \n fireNonCancelableEvent(onButtonClick)}\n />\n {dismissible && (\n
    \n fireNonCancelableEvent(onDismiss)}\n />\n
    \n )}\n
\n \n \n
\n );\n }\n);\n\nexport default InternalAlert;\n", "\n import './styles.scoped.css';\n export default {\n \"alert\": \"awsui_alert_mx3cw_ipfn3_99\",\n \"awsui-motion-fade-in\": \"awsui_awsui-motion-fade-in_mx3cw_ipfn3_1\",\n \"root\": \"awsui_root_mx3cw_ipfn3_125\",\n \"hidden\": \"awsui_hidden_mx3cw_ipfn3_163\",\n \"with-dismiss\": \"awsui_with-dismiss_mx3cw_ipfn3_213\",\n \"with-action\": \"awsui_with-action_mx3cw_ipfn3_213\",\n \"breakpoint-default\": \"awsui_breakpoint-default_mx3cw_ipfn3_219\",\n \"header\": \"awsui_header_mx3cw_ipfn3_226\",\n \"action\": \"awsui_action_mx3cw_ipfn3_230\",\n \"action-slot\": \"awsui_action-slot_mx3cw_ipfn3_235\",\n \"action-button\": \"awsui_action-button_mx3cw_ipfn3_236\",\n \"alert-focus-wrapper\": \"awsui_alert-focus-wrapper_mx3cw_ipfn3_240\",\n \"text\": \"awsui_text_mx3cw_ipfn3_269\",\n \"icon\": \"awsui_icon_mx3cw_ipfn3_276\",\n \"message\": \"awsui_message_mx3cw_ipfn3_279\",\n \"icon-size-medium\": \"awsui_icon-size-medium_mx3cw_ipfn3_287\",\n \"icon-size-big\": \"awsui_icon-size-big_mx3cw_ipfn3_290\",\n \"icon-size-normal\": \"awsui_icon-size-normal_mx3cw_ipfn3_293\",\n \"content\": \"awsui_content_mx3cw_ipfn3_297\",\n \"dismiss\": \"awsui_dismiss_mx3cw_ipfn3_301\",\n \"dismiss-button\": \"awsui_dismiss-button_mx3cw_ipfn3_306\",\n \"type-error\": \"awsui_type-error_mx3cw_ipfn3_310\",\n \"type-warning\": \"awsui_type-warning_mx3cw_ipfn3_318\",\n \"type-success\": \"awsui_type-success_mx3cw_ipfn3_326\",\n \"type-info\": \"awsui_type-info_mx3cw_ipfn3_334\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef } from 'react';\n\ninterface RuntimeContentWrapperProps {\n mountContent: (container: HTMLElement) => void;\n unmountContent: (container: HTMLElement) => void;\n}\n\nexport function RuntimeContentWrapper({ mountContent, unmountContent }: RuntimeContentWrapperProps) {\n const ref = useRef(null);\n\n useEffect(() => {\n const container = ref.current!;\n mountContent(container);\n return () => unmountContent(container);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return
;\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef, useState } from 'react';\nimport { ActionButtonsController, ActionConfig, ActionContext } from '../controllers/action-buttons';\nimport { RuntimeContentWrapper } from './runtime-content-wrapper';\n\nfunction convertRuntimeAction(action: ActionConfig | null, context: ActionContext) {\n if (!action) {\n return null;\n }\n return (\n action.mountContent(container, context)}\n unmountContent={container => action.unmountContent(container)}\n />\n );\n}\n\nexport function createUseDiscoveredAction(onActionRegistered: ActionButtonsController['onActionRegistered']) {\n return function useDiscoveredAction(type: string) {\n const [discoveredActions, setDiscoveredActions] = useState>([]);\n const headerRef = useRef(null);\n const contentRef = useRef(null);\n\n useEffect(() => {\n return onActionRegistered(actions => {\n setDiscoveredActions(actions.map(action => convertRuntimeAction(action, { type, headerRef, contentRef })));\n });\n }, [type]);\n\n return { discoveredActions, headerRef, contentRef };\n };\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport debounce from '../../debounce';\nimport { NonCancelableEventHandler } from '../../events';\n\nexport interface DrawerConfig {\n id: string;\n ariaLabels: {\n content?: string;\n closeButton?: string;\n triggerButton?: string;\n resizeHandle?: string;\n };\n badge?: boolean;\n resizable?: boolean;\n defaultSize?: number;\n onResize?: NonCancelableEventHandler<{ size: number; id: string }>;\n orderPriority?: number;\n defaultActive?: boolean;\n trigger: {\n iconSvg: string;\n };\n mountContent: (container: HTMLElement) => void;\n unmountContent: (container: HTMLElement) => void;\n}\n\nexport type DrawersRegistrationListener = (drawers: Array) => void;\n\nexport interface DrawersApiPublic {\n registerDrawer(config: DrawerConfig): void;\n}\n\nexport interface DrawersApiInternal {\n clearRegisteredDrawers(): void;\n onDrawersRegistered(listener: DrawersRegistrationListener): () => void;\n}\n\nexport class DrawersController {\n private drawers: Array = [];\n private drawersRegistrationListener: DrawersRegistrationListener | null = null;\n\n scheduleUpdate = debounce(() => {\n this.drawersRegistrationListener?.(this.drawers);\n }, 0);\n\n registerDrawer = (config: DrawerConfig) => {\n this.drawers = this.drawers.concat(config);\n this.scheduleUpdate();\n };\n\n onDrawersRegistered = (listener: DrawersRegistrationListener) => {\n if (this.drawersRegistrationListener !== null) {\n console.warn('[AwsUi] [runtime drawers] multiple app layout instances detected');\n }\n this.drawersRegistrationListener = listener;\n this.scheduleUpdate();\n return () => {\n this.drawersRegistrationListener = null;\n };\n };\n\n clearRegisteredDrawers = () => {\n this.drawers = [];\n };\n\n installPublic(api: Partial = {}): DrawersApiPublic {\n api.registerDrawer ??= this.registerDrawer;\n return api as DrawersApiPublic;\n }\n\n installInternal(internalApi: Partial = {}): DrawersApiInternal {\n internalApi.clearRegisteredDrawers ??= this.clearRegisteredDrawers;\n internalApi.onDrawersRegistered ??= this.onDrawersRegistered;\n return internalApi as DrawersApiInternal;\n }\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nexport function sortByPriority(items: Array) {\n return items.slice().sort((a, b) => {\n if (b.orderPriority !== a.orderPriority) {\n return Math.sign((b.orderPriority ?? 0) - (a.orderPriority ?? 0));\n }\n return b.id < a.id ? 1 : -1;\n });\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport debounce from '../../debounce';\nimport { sortByPriority } from '../helpers/utils';\n\n// this code should not depend on React typings, because it is portable between major versions\ninterface RefShim {\n current: T | null;\n}\n\nexport interface ActionContext {\n type: string;\n headerRef: RefShim;\n contentRef: RefShim;\n}\n\nexport interface ActionConfig {\n id: string;\n orderPriority?: number;\n mountContent: (container: HTMLElement, context: ActionContext) => void;\n unmountContent: (container: HTMLElement) => void;\n}\n\nexport type ActionRegistrationListener = (action: Array) => void;\n\nexport interface ActionsApiPublic {\n registerAction(config: ActionConfig): void;\n}\n\nexport interface ActionsApiInternal {\n clearRegisteredActions(): void;\n onActionRegistered(listener: ActionRegistrationListener): () => void;\n}\n\nexport class ActionButtonsController {\n private listeners: Array = [];\n private actions: Array = [];\n\n private scheduleUpdate = debounce(() => {\n this.listeners.forEach(listener => listener(this.actions));\n }, 0);\n\n registerAction = (action: ActionConfig) => {\n this.actions.push(action);\n this.actions = sortByPriority(this.actions);\n this.scheduleUpdate();\n };\n\n clearRegisteredActions = () => {\n this.actions = [];\n };\n\n onActionRegistered = (listener: ActionRegistrationListener) => {\n this.listeners.push(listener);\n this.scheduleUpdate();\n return () => {\n this.listeners = this.listeners.filter(item => item !== listener);\n };\n };\n\n installPublic(api: Partial = {}): ActionsApiPublic {\n api.registerAction ??= this.registerAction;\n return api as ActionsApiPublic;\n }\n\n installInternal(internalApi: Partial = {}): ActionsApiInternal {\n internalApi.clearRegisteredActions ??= this.clearRegisteredActions;\n internalApi.onActionRegistered ??= this.onActionRegistered;\n return internalApi as ActionsApiInternal;\n }\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { DrawersApiInternal, DrawersApiPublic, DrawersController } from './controllers/drawers';\nimport { ActionsApiInternal, ActionsApiPublic, ActionButtonsController } from './controllers/action-buttons';\n\nconst storageKey = Symbol.for('awsui-plugin-api');\n\ninterface AwsuiApi {\n awsuiPlugins: {\n appLayout: DrawersApiPublic;\n alert: ActionsApiPublic;\n flashbar: ActionsApiPublic;\n };\n awsuiPluginsInternal: {\n appLayout: DrawersApiInternal;\n alert: ActionsApiInternal;\n flashbar: ActionsApiInternal;\n };\n}\n\ninterface WindowWithApi extends Window {\n [storageKey]: AwsuiApi;\n}\n\nfunction findUpApi(currentWindow: WindowWithApi): AwsuiApi | undefined {\n try {\n if (currentWindow?.[storageKey]) {\n return currentWindow[storageKey];\n }\n\n if (!currentWindow || currentWindow.parent === currentWindow) {\n // When the window has no more parents, it references itself\n return undefined;\n }\n\n return findUpApi(currentWindow.parent as WindowWithApi);\n } catch (ex) {\n // Most likely a cross-origin access error\n return undefined;\n }\n}\n\nexport function loadApi() {\n if (typeof window === 'undefined') {\n return installApi({});\n }\n const win = window as unknown as WindowWithApi;\n const existingApi = findUpApi(win);\n win[storageKey] = installApi(existingApi ?? {});\n return win[storageKey];\n}\n\nexport const { awsuiPlugins, awsuiPluginsInternal } = loadApi();\n\ntype DeepPartial = T extends (...args: any) => any ? T : { [P in keyof T]?: DeepPartial };\n\nfunction installApi(api: DeepPartial): AwsuiApi {\n api.awsuiPlugins ??= {};\n api.awsuiPluginsInternal ??= {};\n\n const appLayoutDrawers = new DrawersController();\n api.awsuiPlugins.appLayout = appLayoutDrawers.installPublic(api.awsuiPlugins.appLayout);\n api.awsuiPluginsInternal.appLayout = appLayoutDrawers.installInternal(api.awsuiPluginsInternal.appLayout);\n\n const alertActions = new ActionButtonsController();\n api.awsuiPlugins.alert = alertActions.installPublic(api.awsuiPlugins.alert);\n api.awsuiPluginsInternal.alert = alertActions.installInternal(api.awsuiPluginsInternal.alert);\n\n const flashbarActions = new ActionButtonsController();\n api.awsuiPlugins.flashbar = flashbarActions.installPublic(api.awsuiPlugins.flashbar);\n api.awsuiPluginsInternal.flashbar = flashbarActions.installInternal(api.awsuiPluginsInternal.flashbar);\n\n return api as AwsuiApi;\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React from 'react';\nimport styles from './styles.css.js';\nimport InternalButton, { InternalButtonProps } from '../../button/internal';\n\nfunction createActionButton(\n testUtilClasses: ActionsWrapperProps['testUtilClasses'],\n action: React.ReactNode,\n buttonText: React.ReactNode,\n onButtonClick: InternalButtonProps['onClick']\n) {\n if (!action && buttonText) {\n action = (\n \n {buttonText}\n \n );\n }\n return action ?
{action}
: null;\n}\n\ninterface ActionsWrapperProps {\n className: string;\n testUtilClasses: { actionSlot: string; actionButton: string };\n action: React.ReactNode;\n discoveredActions: Array;\n buttonText: React.ReactNode;\n onButtonClick: InternalButtonProps['onClick'];\n}\n\nexport function ActionsWrapper({\n className,\n testUtilClasses,\n action,\n discoveredActions,\n buttonText,\n onButtonClick,\n}: ActionsWrapperProps) {\n const actionButton = createActionButton(testUtilClasses, action, buttonText, onButtonClick);\n if (!actionButton && discoveredActions.length === 0) {\n return null;\n }\n\n return (\n
\n {actionButton}\n {discoveredActions}\n
\n );\n}\n", "\n import './styles.scoped.css';\n export default {\n \"root\": \"awsui_root_37gf8_14wux_9\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { AnchorNavigationProps } from './interfaces';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport InternalAnchorNavigation from './internal';\nimport useBaseComponent from '../internal/hooks/use-base-component';\n\nexport { AnchorNavigationProps };\n\nexport default function AnchorNavigation({ scrollSpyOffset = 0, ...props }: AnchorNavigationProps) {\n const baseComponentProps = useBaseComponent('AnchorNavigation');\n return ;\n}\napplyDisplayName(AnchorNavigation, 'AnchorNavigation');\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useCallback, useEffect, useMemo } from 'react';\nimport clsx from 'clsx';\nimport styles from './styles.css.js';\nimport testUtilsStyles from './test-classes/styles.css.js';\nimport { AnchorNavigationProps } from './interfaces';\nimport { checkSafeUrl } from '../internal/utils/check-safe-url';\nimport useScrollSpy from './use-scroll-spy.js';\nimport { fireCancelableEvent, fireNonCancelableEvent, isPlainLeftClick } from '../internal/events/index';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component/index.js';\nimport { getBaseProps } from '../internal/base-component/index.js';\n\nexport default function InternalAnchorNavigation({\n anchors,\n ariaLabelledby,\n onFollow,\n onActiveHrefChange,\n activeHref = '',\n __internalRootRef = null,\n scrollSpyOffset = 0,\n ...props\n}: AnchorNavigationProps & InternalBaseComponentProps) {\n const baseProps = getBaseProps(props);\n\n const hrefs = useMemo(() => anchors.map(anchor => anchor.href), [anchors]);\n\n const onFollowHandler = useCallback(\n (anchor: AnchorNavigationProps.Anchor, sourceEvent: React.SyntheticEvent | Event) => {\n fireCancelableEvent(onFollow, anchor, sourceEvent);\n },\n [onFollow]\n );\n\n const currentActiveHref = useScrollSpy({\n hrefs,\n scrollSpyOffset,\n activeHref,\n });\n\n useEffect(() => {\n if (currentActiveHref) {\n const newActiveAnchor = anchors.find(anchor => anchor.href === currentActiveHref);\n fireNonCancelableEvent(onActiveHrefChange, newActiveAnchor);\n }\n }, [onActiveHrefChange, anchors, currentActiveHref]);\n\n return (\n \n
    \n {anchors.map((anchor, index) => {\n return (\n \n );\n })}\n
\n \n );\n}\n\ninterface AnchorProps {\n anchor: AnchorNavigationProps.Anchor;\n onFollow: (anchor: AnchorNavigationProps.Anchor, event: React.SyntheticEvent | Event) => void;\n isActive: boolean;\n index: number;\n}\n\nconst Anchor = ({ anchor, onFollow, isActive, index }: AnchorProps) => {\n checkSafeUrl('AnchorNavigation', anchor.href);\n\n const onClick = useCallback(\n (event: React.MouseEvent) => {\n if (isPlainLeftClick(event)) {\n onFollow(anchor, event);\n }\n },\n [onFollow, anchor]\n );\n\n const activeItemClasses = clsx(styles['anchor-item--active'], testUtilsStyles['anchor-item--active']);\n\n return (\n
  • \n \n \n {anchor.text}\n \n {anchor.info && (\n {anchor.info}\n )}\n \n
  • \n );\n};\n", "\n import './styles.scoped.css';\n export default {\n \"root\": \"awsui_root_swimc_yjm0c_99\",\n \"anchor-list\": \"awsui_anchor-list_swimc_yjm0c_134\",\n \"anchor-item\": \"awsui_anchor-item_swimc_yjm0c_157\",\n \"anchor-item--active\": \"awsui_anchor-item--active_swimc_yjm0c_177\",\n \"anchor-link\": \"awsui_anchor-link_swimc_yjm0c_194\",\n \"anchor-link--active\": \"awsui_anchor-link--active_swimc_yjm0c_236\",\n \"anchor-link-text\": \"awsui_anchor-link-text_swimc_yjm0c_243\",\n \"anchor-link-info\": \"awsui_anchor-link-info_swimc_yjm0c_247\"\n};\n ", "\n import './styles.scoped.css';\n export default {\n \"root\": \"awsui_root_17oho_5eh15_5\",\n \"anchor-list\": \"awsui_anchor-list_17oho_5eh15_9\",\n \"anchor-item--active\": \"awsui_anchor-item--active_17oho_5eh15_13\",\n \"anchor-link\": \"awsui_anchor-link_17oho_5eh15_17\",\n \"anchor-link-text\": \"awsui_anchor-link-text_17oho_5eh15_21\",\n \"anchor-link-info\": \"awsui_anchor-link-info_17oho_5eh15_25\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useCallback, useEffect, useState } from 'react';\n\nconst isBrowser = typeof window !== 'undefined';\n\n/**\n * Hook to implement scroll-spy functionality.\n *\n * @param hrefs An array of href strings that correspond to the IDs of the target elements on the page.\n * The hrefs should be sorted in the order they appear on the page for accurate scroll-spy behavior.\n * @param scrollSpyOffset The number of pixels to offset from the top of the document when activating anchors.\n * Useful for accommodating fixed or sticky headers.\n * @param activeHref The currently active href. If provided, the hook will operate in a controlled manner,\n * and the scroll-spy logic will be disabled.\n *\n * @returns {string | undefined} - The href of the currently active element as per scroll position, or undefined if none is active.\n */\nexport default function useScrollSpy({\n hrefs,\n scrollSpyOffset,\n activeHref,\n}: {\n hrefs: string[];\n scrollSpyOffset: number;\n activeHref?: string;\n}): string | undefined {\n const [currentHref, setCurrentHref] = useState(activeHref);\n const [lastAnchorExists, setLastAnchorExists] = useState(false);\n\n useEffect(() => {\n setCurrentHref(activeHref);\n }, [activeHref]);\n\n useEffect(() => {\n setLastAnchorExists(isBrowser && !!document.getElementById(hrefs[hrefs.length - 1]?.slice(1)));\n }, [hrefs]);\n\n // Get the bounding rectangle of an element by href\n const getRectByHref = useCallback((href: string) => {\n return document.getElementById(href.slice(1))?.getBoundingClientRect();\n }, []);\n\n // Check if we're scrolled to the bottom of the page\n const isPageBottom = useCallback(() => {\n return lastAnchorExists && Math.ceil(window.scrollY) >= Math.floor(document.body.scrollHeight - window.innerHeight);\n }, [lastAnchorExists]);\n\n // Find the first href for which the element is within the viewport\n const findHrefInView = useCallback(() => {\n return hrefs.find(href => {\n const rect = getRectByHref(href);\n return rect && rect.bottom <= window.innerHeight && rect.top >= scrollSpyOffset;\n });\n }, [getRectByHref, scrollSpyOffset, hrefs]);\n\n // Find the last href where its element is above or within the viewport\n const findLastHrefInView = useCallback(() => {\n return [...hrefs].reverse().find(href => {\n const rect = getRectByHref(href);\n return rect && rect.bottom <= window.innerHeight;\n });\n }, [getRectByHref, hrefs]);\n\n // Scroll event handler\n const handleScroll = useCallback(() => {\n if (activeHref || !isBrowser) {\n return;\n }\n\n const { scrollY } = window;\n\n if (document.body.scrollHeight > window.innerHeight && isPageBottom()) {\n setCurrentHref(hrefs[hrefs.length - 1]);\n } else {\n setCurrentHref(findHrefInView() || (scrollY > 0 ? findLastHrefInView() : undefined));\n }\n }, [activeHref, isPageBottom, findHrefInView, findLastHrefInView, hrefs]);\n\n useEffect(() => {\n if (isBrowser) {\n handleScroll();\n window.addEventListener('scroll', handleScroll, { passive: true });\n return () => {\n window.removeEventListener('scroll', handleScroll);\n };\n }\n }, [handleScroll]);\n\n return currentHref;\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { OpenAnnotation } from './annotation/open-annotation';\nimport { ClosedAnnotation } from './annotation/closed-annotation';\nimport { AnnotationContextProps } from './interfaces';\nimport { HotspotContext, hotspotContext } from './context';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { HotspotProps } from '../hotspot/interfaces';\nimport { useTelemetry } from '../internal/hooks/use-telemetry';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { getStepInfo } from './utils';\n\nexport { AnnotationContextProps };\n\n// constant empty array to keep hook dependency stable\nconst emptyTasks: ReadonlyArray = [];\n\nexport default function AnnotationContext({\n currentTutorial,\n children,\n onStepChange,\n onFinish: onFinishHandler,\n onStartTutorial,\n onExitTutorial,\n i18nStrings,\n}: AnnotationContextProps): JSX.Element {\n useTelemetry('AnnotationContext');\n\n const [open, setOpen] = useState(true);\n\n const [currentStepIndex, setCurrentStepIndex] = useState(0);\n useEffect(() => {\n // When a tutorial is started, we reset the progress to the first step.\n setCurrentStepIndex(0);\n setOpen(true);\n }, [currentTutorial, setOpen]);\n\n const [availableHotspots, setAvailableHotspots] = useState>({});\n // availableHotspots is mirrored in this ref to prevent endless loops\n // in between registerHotspot and unregisterHotspot callbacks.\n const availableHotspotsRef = useRef>(availableHotspots);\n\n const annotations = currentTutorial ? currentTutorial.tasks : emptyTasks;\n const { task, step, localIndex, taskIndex } = getStepInfo(annotations, currentStepIndex);\n const currentId = step?.hotspotId;\n const totalStepCount = annotations.map(a => a.steps.length).reduce((a, b) => a + b, 0);\n\n const id2index = useMemo(() => {\n const mapping: Record = {};\n\n let counter = 0;\n for (const annotation of annotations) {\n for (const step of annotation.steps) {\n if (mapping[step.hotspotId] === undefined) {\n mapping[step.hotspotId] = counter;\n }\n counter++;\n }\n }\n\n return mapping;\n }, [annotations]);\n\n const openNextStep = useCallback(() => {\n const newStepIndex = Math.min(currentStepIndex + 1, totalStepCount);\n setCurrentStepIndex(newStepIndex);\n fireNonCancelableEvent(onStepChange, { step: newStepIndex, reason: 'next' });\n }, [currentStepIndex, onStepChange, totalStepCount]);\n\n const openPreviousStep = useCallback(() => {\n const newStepIndex = Math.max(currentStepIndex - 1, 0);\n setCurrentStepIndex(newStepIndex);\n fireNonCancelableEvent(onStepChange, { step: newStepIndex, reason: 'previous' });\n }, [onStepChange, currentStepIndex]);\n\n const onFinish = useCallback(() => fireNonCancelableEvent(onFinishHandler), [onFinishHandler]);\n\n /**\n * If the currently open hotspot disappears from the page (e.g. because of a react-router navigation),\n * this Effect detects the nearest available hotspot and changes to it. This allows us to e.g. automatically\n * advance to the first step on the new page (or the last step on the previous page, in case the user\n * navigates back).\n */\n const isCurrentHotspotAvailable = currentId ? availableHotspots[currentId] : null;\n useEffect(() => {\n if (!currentId || availableHotspotsRef.current[currentId]) {\n return;\n }\n\n const findNearestHotspot = () => {\n let nearestHotspot: string | undefined = undefined;\n let nearestDistance = Infinity;\n for (const hotspotId of Object.keys(availableHotspotsRef.current)) {\n const distanceFromCurrentHotspot = Math.abs(id2index[hotspotId] - currentStepIndex);\n if (distanceFromCurrentHotspot < nearestDistance) {\n nearestDistance = distanceFromCurrentHotspot;\n nearestHotspot = hotspotId;\n }\n }\n return nearestHotspot;\n };\n\n const nearestHotspot = findNearestHotspot();\n if (nearestHotspot) {\n const newStepIndex = id2index[nearestHotspot];\n setCurrentStepIndex(newStepIndex);\n setOpen(true);\n fireNonCancelableEvent(onStepChange, { step: newStepIndex, reason: 'auto-fallback' });\n }\n }, [annotations, isCurrentHotspotAvailable, currentId, currentStepIndex, id2index, onStepChange]);\n\n const onDismiss = useCallback(() => {\n setOpen(false);\n }, [setOpen]);\n\n const onOpen = useCallback(\n (stepIndex: number) => {\n setCurrentStepIndex(stepIndex);\n fireNonCancelableEvent(onStepChange, { step: stepIndex, reason: 'open' });\n setOpen(true);\n },\n [onStepChange, setOpen]\n );\n\n const idOfPreviousHotspot = getStepInfo(annotations, currentStepIndex - 1).step?.hotspotId;\n const idOfNextHotspot = getStepInfo(annotations, currentStepIndex + 1).step?.hotspotId;\n const previousHotspotIsAvailable =\n (idOfPreviousHotspot !== undefined && availableHotspots[idOfPreviousHotspot]) ?? false;\n const nextHotspotIsAvailable = (idOfNextHotspot !== undefined && availableHotspots[idOfNextHotspot]) ?? false;\n\n const getContentForId = useCallback(\n (id: string, direction: HotspotProps['direction']) => {\n if (currentTutorial?.completed) {\n return null;\n }\n\n const globalStepIndex = id2index[id];\n if (globalStepIndex === undefined) {\n // This hotspot is not used in the current tutorial.\n return null;\n }\n\n if (!task || !step || !open || id !== currentId) {\n const { task: currentTask, localIndex: currentStepIndex } = getStepInfo(annotations, globalStepIndex);\n return (\n \n );\n }\n\n return (\n \n );\n },\n [\n id2index,\n currentTutorial,\n task,\n step,\n open,\n currentId,\n currentStepIndex,\n i18nStrings,\n taskIndex,\n localIndex,\n totalStepCount,\n nextHotspotIsAvailable,\n openNextStep,\n onFinish,\n previousHotspotIsAvailable,\n openPreviousStep,\n onDismiss,\n onOpen,\n annotations,\n ]\n );\n\n const registerHotspot = useCallback(\n (id: string) => {\n if (!id2index || id2index[id] === undefined) {\n // This hotspot is not used in the current tutorial.\n return;\n }\n\n /*\n To ensure that all hotspots are immediately known to all triggered useEffects, we\n need to update the availableHotspotsRef BEFORE the setAvailableHotspots calls, since\n they will be batched and delayed until after the useEffects are run.\n */\n availableHotspotsRef.current = { ...availableHotspotsRef.current, [id]: true } as const;\n\n setAvailableHotspots(availableHotspots => {\n if (availableHotspots[id]) {\n return availableHotspots;\n }\n\n return { ...availableHotspots, [id]: true } as const;\n });\n },\n // We need to react on id2index changes for registering new hotspots when the map changes.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [id2index]\n );\n\n const unregisterHotspot = useCallback((id: string) => {\n if (!availableHotspotsRef.current[id]) {\n // Prevents unnecessary re-renders.\n return;\n }\n\n /*\n To ensure that all hotspots are immediately known to all triggered useEffects, we\n need to update the availableHotspotsRef BEFORE the setAvailableHotspots calls, since\n they will be batched and delayed until after the useEffects are run.\n */\n availableHotspotsRef.current = removeKey(id, availableHotspotsRef.current);\n\n setAvailableHotspots(availableHotspots => {\n if (!availableHotspots[id]) {\n return availableHotspots;\n }\n\n return removeKey(id, availableHotspots);\n });\n }, []);\n\n const context: HotspotContext = {\n getContentForId,\n registerHotspot,\n unregisterHotspot,\n onStartTutorial,\n onExitTutorial,\n currentStepIndex,\n currentTutorial,\n };\n\n return {children};\n}\n\napplyDisplayName(AnnotationContext, 'AnnotationContext');\n\nfunction removeKey>(key: keyof T, object: T) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { [key]: _, ...remainingObject } = object;\n return remainingObject;\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\nimport { HotspotProps } from '../../hotspot/interfaces';\nimport { AnnotationContextProps } from '../interfaces';\nimport AnnotationTrigger from './annotation-trigger';\nimport { AnnotationPopover } from './annotation-popover';\n\nexport interface AnnotationProps {\n title: string;\n content: React.ReactNode;\n alert?: React.ReactNode;\n\n direction: HotspotProps['direction'];\n\n nextButtonEnabled: boolean;\n onNextButtonClick: () => void;\n\n onFinish: () => void;\n\n previousButtonEnabled: boolean;\n onPreviousButtonClick: () => void;\n\n showPreviousButton: boolean;\n showFinishButton: boolean;\n\n taskLocalStepIndex: number;\n\n totalLocalSteps: number;\n\n onDismiss: () => void;\n\n i18nStrings: AnnotationContextProps['i18nStrings'];\n}\n\nexport function OpenAnnotation({\n title,\n content,\n alert,\n\n direction,\n\n showPreviousButton,\n showFinishButton,\n taskLocalStepIndex,\n\n totalLocalSteps,\n\n onDismiss,\n\n nextButtonEnabled,\n onNextButtonClick,\n\n onFinish,\n\n previousButtonEnabled,\n onPreviousButtonClick,\n i18nStrings,\n}: AnnotationProps) {\n const trackRef = useRef(null);\n\n return (\n <>\n \n\n \n \n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useCallback } from 'react';\nimport styles from './styles.css.js';\nimport { AnnotationIcon } from './annotation-icon';\nimport { AnnotationContextProps } from '../interfaces';\n\nexport interface AnnotationTriggerProps {\n open: boolean;\n\n onClick: () => void;\n\n i18nStrings: AnnotationContextProps['i18nStrings'];\n taskLocalStepIndex: number;\n totalLocalSteps: number;\n}\n\nexport default React.forwardRef(function AnnotationTrigger(\n { open, onClick: onClickHandler, i18nStrings, taskLocalStepIndex, totalLocalSteps }: AnnotationTriggerProps,\n ref\n) {\n const onClick = useCallback(\n (event: React.MouseEvent) => {\n event.preventDefault();\n onClickHandler();\n },\n [onClickHandler]\n );\n\n return (\n \n \n \n );\n});\n", "\n import './styles.scoped.css';\n export default {\n \"arrow\": \"awsui_arrow_1hpp3_10w1c_99\",\n \"arrow-outer\": \"awsui_arrow-outer_1hpp3_10w1c_103\",\n \"arrow-inner\": \"awsui_arrow-inner_1hpp3_10w1c_103\",\n \"arrow-position-right-top\": \"awsui_arrow-position-right-top_1hpp3_10w1c_144\",\n \"arrow-position-right-bottom\": \"awsui_arrow-position-right-bottom_1hpp3_10w1c_144\",\n \"arrow-position-left-top\": \"awsui_arrow-position-left-top_1hpp3_10w1c_147\",\n \"arrow-position-left-bottom\": \"awsui_arrow-position-left-bottom_1hpp3_10w1c_147\",\n \"arrow-position-top-center\": \"awsui_arrow-position-top-center_1hpp3_10w1c_150\",\n \"arrow-position-top-responsive\": \"awsui_arrow-position-top-responsive_1hpp3_10w1c_150\",\n \"arrow-position-bottom-center\": \"awsui_arrow-position-bottom-center_1hpp3_10w1c_153\",\n \"arrow-position-bottom-responsive\": \"awsui_arrow-position-bottom-responsive_1hpp3_10w1c_153\",\n \"annotation\": \"awsui_annotation_1hpp3_10w1c_161\",\n \"next-button\": \"awsui_next-button_1hpp3_10w1c_162\",\n \"previous-button\": \"awsui_previous-button_1hpp3_10w1c_163\",\n \"finish-button\": \"awsui_finish-button_1hpp3_10w1c_164\",\n \"header\": \"awsui_header_1hpp3_10w1c_165\",\n \"step-counter-content\": \"awsui_step-counter-content_1hpp3_10w1c_166\",\n \"content\": \"awsui_content_1hpp3_10w1c_167\",\n \"description\": \"awsui_description_1hpp3_10w1c_171\",\n \"actionBar\": \"awsui_actionBar_1hpp3_10w1c_176\",\n \"stepCounter\": \"awsui_stepCounter_1hpp3_10w1c_183\",\n \"divider\": \"awsui_divider_1hpp3_10w1c_187\",\n \"hotspot\": \"awsui_hotspot_1hpp3_10w1c_191\",\n \"icon\": \"awsui_icon_1hpp3_10w1c_258\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport styles from './styles.css.js';\n\nexport interface AnnotationIconProps {\n open?: boolean;\n}\n\nexport const AnnotationIcon = ({ open }: AnnotationIconProps) => {\n if (open) {\n return (\n \n \n \n \n \n \n );\n } else {\n return (\n \n \n \n \n \n \n \n \n \n );\n }\n};\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect } from 'react';\nimport clsx from 'clsx';\nimport styles from './styles.css.js';\nimport InternalBox from '../../box/internal';\nimport { InternalButton } from '../../button/internal';\nimport InternalSpaceBetween from '../../space-between/internal';\nimport PopoverContainer from '../../popover/container';\nimport PopoverBody from '../../popover/body';\nimport { HotspotProps } from '../../hotspot/interfaces';\nimport { AnnotationContextProps } from '../interfaces';\nimport InternalAlert from '../../alert/internal';\nimport { InternalPosition } from '../../popover/interfaces';\nimport { scrollElementIntoView } from '../../internal/utils/scrollable-containers';\nimport { useUniqueId } from '../../internal/hooks/use-unique-id/index.js';\nimport { joinStrings } from '../../internal/utils/strings/join-strings.js';\n\nexport interface AnnotationPopoverProps {\n title: string;\n content: React.ReactNode;\n alert: React.ReactNode;\n\n direction: HotspotProps['direction'];\n\n nextButtonEnabled: boolean;\n onNextButtonClick: () => void;\n\n onFinish: () => void;\n\n showPreviousButton: boolean;\n previousButtonEnabled: boolean;\n onPreviousButtonClick: () => void;\n\n taskLocalStepIndex: number;\n\n totalLocalSteps: number;\n\n showFinishButton: boolean;\n\n onDismiss: () => void;\n\n trackRef: React.RefObject;\n\n i18nStrings: AnnotationContextProps['i18nStrings'];\n}\n\nconst arrow = (position: InternalPosition | null) => (\n
    \n
    \n
    \n
    \n);\n\nexport function AnnotationPopover({\n title,\n content,\n alert,\n\n direction = 'top',\n\n taskLocalStepIndex,\n\n totalLocalSteps,\n\n showPreviousButton,\n showFinishButton,\n\n onDismiss,\n\n nextButtonEnabled,\n onNextButtonClick,\n\n onFinish,\n\n trackRef,\n\n previousButtonEnabled,\n onPreviousButtonClick,\n i18nStrings,\n}: AnnotationPopoverProps) {\n useEffect(() => {\n scrollElementIntoView(trackRef.current ?? undefined);\n }, [trackRef]);\n\n const popoverHeaderId = useUniqueId('poppver-header-');\n const stepCounterId = useUniqueId('step-counter-');\n\n return (\n \n \n {title}\n \n }\n onDismiss={onDismiss}\n className={styles.annotation}\n variant=\"annotation\"\n overflowVisible=\"content\"\n // create new dialog to have the native dialog behavior of the screen readers\n key={taskLocalStepIndex}\n ariaLabelledby={joinStrings(popoverHeaderId, stepCounterId)}\n >\n \n
    \n {content}\n
    \n\n {alert && {alert}}\n\n \n
    \n\n
    \n
    \n \n {i18nStrings.stepCounterText(taskLocalStepIndex ?? 0, totalLocalSteps ?? 0)}\n \n
    \n \n {showPreviousButton && (\n \n {i18nStrings.previousButtonText}\n \n )}\n\n {showFinishButton ? (\n \n {i18nStrings.finishButtonText}\n \n ) : (\n \n {i18nStrings.nextButtonText}\n \n )}\n \n
    \n \n \n \n \n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useCallback, useEffect, useState } from 'react';\nimport { AnnotationContextProps } from '../interfaces';\nimport AnnotationTrigger from './annotation-trigger';\n\nexport interface AnnotationProps {\n globalStepIndex: number;\n\n onOpen: (stepId: number) => void;\n\n i18nStrings: AnnotationContextProps['i18nStrings'];\n\n focusOnRender: boolean;\n totalLocalSteps: number;\n taskLocalStepIndex: number;\n}\n\nexport function ClosedAnnotation({\n globalStepIndex,\n onOpen,\n i18nStrings,\n focusOnRender,\n totalLocalSteps,\n taskLocalStepIndex,\n}: AnnotationProps) {\n const [hotspotRef, setHotspotRef] = useState(null);\n const onClick = useCallback(() => {\n onOpen(globalStepIndex);\n }, [globalStepIndex, onOpen]);\n\n useEffect(() => {\n if (focusOnRender && hotspotRef) {\n hotspotRef.focus();\n }\n }, [focusOnRender, hotspotRef]);\n\n return (\n \n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { HotspotProps } from '../hotspot/interfaces';\nimport { AnnotationContextProps } from './interfaces';\n\nexport interface HotspotContext {\n getContentForId(id: string, direction: HotspotProps['direction']): JSX.Element | null;\n registerHotspot(id: string): void;\n unregisterHotspot(id: string): void;\n currentStepIndex: number;\n currentTutorial: AnnotationContextProps.Tutorial | null;\n onStartTutorial: AnnotationContextProps['onStartTutorial'];\n onExitTutorial: AnnotationContextProps['onExitTutorial'];\n}\n\nconst defaultContext: HotspotContext = {\n getContentForId: () => null,\n registerHotspot() {},\n unregisterHotspot() {},\n currentStepIndex: 0,\n currentTutorial: null,\n onStartTutorial() {},\n onExitTutorial() {},\n};\n\nexport const hotspotContext = React.createContext(defaultContext);\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { AnnotationContextProps } from './interfaces';\n\nexport function getStepInfo(annotations: readonly AnnotationContextProps.Task[], index: number) {\n if (index >= 0) {\n let taskIndex = 0;\n for (const task of annotations) {\n if (task.steps.length <= index) {\n index -= task.steps.length;\n taskIndex++;\n continue;\n }\n return { task, step: task.steps[index], localIndex: index, taskIndex };\n }\n }\n return { task: undefined, step: undefined, localIndex: 0, taskIndex: 0 };\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { useInternalI18n } from '../i18n/context';\nimport { getBaseProps } from '../internal/base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { AppLayoutProps } from './interfaces';\nimport { AppLayoutInternal } from './internal';\nimport { applyDefaults } from './defaults';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { useControllable } from '../internal/hooks/use-controllable';\nimport { useMobile } from '../internal/hooks/use-mobile';\nimport { NonCancelableCustomEvent } from '../internal/events';\nimport { isDevelopment } from '../internal/is-development';\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\nimport { useAppLayoutPlacement } from './utils/use-app-layout-placement';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\n\nexport { AppLayoutProps };\n\nconst AppLayout = React.forwardRef(\n (\n {\n contentType = 'default',\n headerSelector = '#b #h',\n footerSelector = '#b #f',\n navigationWidth = 280,\n toolsWidth = 290,\n maxContentWidth,\n minContentWidth,\n navigationOpen: controlledNavigationOpen,\n onNavigationChange: controlledOnNavigationChange,\n ...rest\n }: AppLayoutProps,\n ref: React.Ref\n ) => {\n if (isDevelopment) {\n if (rest.toolsOpen && rest.toolsHide) {\n warnOnce(\n 'AppLayout',\n `You have enabled both the \\`toolsOpen\\` prop and the \\`toolsHide\\` prop. This is not supported. Set \\`toolsOpen\\` to \\`false\\` when you set \\`toolsHide\\` to \\`true\\`.`\n );\n }\n }\n const { __internalRootRef } = useBaseComponent('AppLayout', {\n props: {\n contentType,\n disableContentPaddings: rest.disableContentPaddings,\n disableBodyScroll: rest.disableBodyScroll,\n navigationWidth,\n navigationHide: rest.navigationHide,\n toolsHide: rest.toolsHide,\n toolsWidth,\n maxContentWidth,\n minContentWidth,\n stickyNotifications: rest.stickyNotifications,\n disableContentHeaderOverlap: rest.disableContentHeaderOverlap,\n },\n metadata: {\n drawersCount: rest.drawers?.length ?? null,\n hasContentHeader: !!rest.contentHeader,\n },\n });\n const isRefresh = useVisualRefresh();\n const isMobile = useMobile();\n\n const i18n = useInternalI18n('app-layout');\n const ariaLabels = {\n navigation: i18n('ariaLabels.navigation', rest.ariaLabels?.navigation),\n navigationClose: i18n('ariaLabels.navigationClose', rest.ariaLabels?.navigationClose),\n navigationToggle: i18n('ariaLabels.navigationToggle', rest.ariaLabels?.navigationToggle),\n notifications: i18n('ariaLabels.notifications', rest.ariaLabels?.notifications),\n tools: i18n('ariaLabels.tools', rest.ariaLabels?.tools),\n toolsClose: i18n('ariaLabels.toolsClose', rest.ariaLabels?.toolsClose),\n toolsToggle: i18n('ariaLabels.toolsToggle', rest.ariaLabels?.toolsToggle),\n drawers: i18n('ariaLabels.drawers', rest.ariaLabels?.drawers),\n drawersOverflow: i18n('ariaLabels.drawersOverflow', rest.ariaLabels?.drawersOverflow),\n drawersOverflowWithBadge: i18n('ariaLabels.drawersOverflowWithBadge', rest.ariaLabels?.drawersOverflowWithBadge),\n };\n const { navigationOpen: defaultNavigationOpen, ...restDefaults } = applyDefaults(\n contentType,\n { maxContentWidth, minContentWidth },\n isRefresh\n );\n\n const [navigationOpen = false, setNavigationOpen] = useControllable(\n controlledNavigationOpen,\n controlledOnNavigationChange,\n isMobile ? false : defaultNavigationOpen,\n { componentName: 'AppLayout', controlledProp: 'navigationOpen', changeHandler: 'onNavigationChange' }\n );\n const onNavigationChange = (event: NonCancelableCustomEvent) => {\n setNavigationOpen(event.detail.open);\n controlledOnNavigationChange?.(event);\n };\n\n const [rootRef, placement] = useAppLayoutPlacement(headerSelector, footerSelector);\n\n // This re-builds the props including the default values\n const props = {\n contentType,\n navigationWidth,\n toolsWidth,\n navigationOpen,\n onNavigationChange,\n ...restDefaults,\n ...rest,\n ariaLabels,\n placement,\n };\n\n const baseProps = getBaseProps(rest);\n\n return (\n
    \n \n
    \n );\n }\n);\n\napplyDisplayName(AppLayout, 'AppLayout');\nexport default AppLayout;\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { getGlobalFlag } from '../internal/utils/global-flags';\nimport { AppLayoutProps, AppLayoutPropsWithDefaults } from './interfaces';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { AppLayoutImplementation } from './implementation';\n\ntype AppLayoutType = React.ForwardRefExoticComponent<\n AppLayoutPropsWithDefaults & React.RefAttributes\n>;\n\nexport function createWidgetizedAppLayout(AppLayoutLoader?: AppLayoutType): AppLayoutType {\n return React.forwardRef((props, ref) => {\n const isRefresh = useVisualRefresh();\n if (isRefresh && getGlobalFlag('appLayoutWidget') && AppLayoutLoader) {\n return ;\n }\n\n return ;\n });\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport ClassicAppLayout from './classic';\nimport RefreshedAppLayout from './visual-refresh';\nimport { AppLayoutProps, AppLayoutPropsWithDefaults } from './interfaces';\n\nexport const AppLayoutImplementation = React.forwardRef(\n (props, ref) => {\n const isRefresh = useVisualRefresh();\n return isRefresh ? : ;\n }\n);\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { useCallback, useEffect, useImperativeHandle, useRef, useState } from 'react';\nimport { useControllable } from '../internal/hooks/use-controllable';\nimport { useMobile } from '../internal/hooks/use-mobile';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { AppLayoutProps, AppLayoutPropsWithDefaults } from './interfaces';\nimport { Notifications } from './notifications';\nimport { MobileToolbar } from './mobile-toolbar';\nimport { useFocusControl } from './utils/use-focus-control';\nimport styles from './styles.css.js';\nimport testutilStyles from './test-classes/styles.css.js';\nimport { findUpUntil } from '../internal/utils/dom';\nimport { AppLayoutContext } from '../internal/context/app-layout-context';\nimport { SplitPanelSideToggleProps } from '../internal/context/split-panel-context';\nimport {\n CONSTRAINED_MAIN_PANEL_MIN_HEIGHT,\n CONSTRAINED_PAGE_HEIGHT,\n getSplitPanelDefaultSize,\n MAIN_PANEL_MIN_HEIGHT,\n} from '../split-panel/utils/size-utils';\nimport ContentWrapper, { ContentWrapperProps } from './content-wrapper';\nimport { Drawer, DrawerTriggersBar } from './drawer';\nimport { ResizableDrawer } from './drawer/resizable-drawer';\nimport {\n SPLIT_PANEL_MIN_WIDTH,\n SideSplitPanelDrawer,\n SplitPanelProvider,\n SplitPanelProviderProps,\n} from './split-panel';\nimport { useStableCallback } from '@cloudscape-design/component-toolkit/internal';\n\nimport { useSplitPanelFocusControl } from './utils/use-split-panel-focus-control';\nimport { TOOLS_DRAWER_ID, useDrawers } from './utils/use-drawers';\nimport { useContainerQuery } from '@cloudscape-design/component-toolkit';\nimport { togglesConfig } from './toggles';\n\nconst ClassicAppLayout = React.forwardRef(\n (\n {\n navigation,\n navigationWidth,\n navigationHide,\n navigationOpen,\n tools,\n toolsWidth,\n toolsHide,\n toolsOpen: controlledToolsOpen,\n breadcrumbs,\n notifications,\n stickyNotifications,\n contentHeader,\n disableContentHeaderOverlap,\n content,\n contentType,\n disableContentPaddings,\n disableBodyScroll,\n maxContentWidth,\n minContentWidth,\n placement,\n ariaLabels,\n splitPanel,\n splitPanelSize: controlledSplitPanelSize,\n splitPanelOpen: controlledSplitPanelOpen,\n splitPanelPreferences: controlledSplitPanelPreferences,\n onSplitPanelPreferencesChange,\n onSplitPanelResize,\n onSplitPanelToggle,\n onNavigationChange,\n onToolsChange,\n drawers: controlledDrawers,\n onDrawerChange,\n activeDrawerId: controlledActiveDrawerId,\n ...rest\n }: AppLayoutPropsWithDefaults,\n ref: React.Ref\n ) => {\n // Private API for embedded view mode\n const __embeddedViewMode = Boolean((rest as any).__embeddedViewMode);\n\n const rootRef = useRef(null);\n const isMobile = useMobile();\n\n const [toolsOpen = false, setToolsOpen] = useControllable(controlledToolsOpen, onToolsChange, false, {\n componentName: 'AppLayout',\n controlledProp: 'toolsOpen',\n changeHandler: 'onToolsChange',\n });\n const onToolsToggle = (open: boolean) => {\n setToolsOpen(open);\n focusToolsButtons();\n fireNonCancelableEvent(onToolsChange, { open });\n };\n\n const {\n drawers,\n activeDrawer,\n minDrawerSize,\n activeDrawerSize,\n activeDrawerId,\n ariaLabelsWithDrawers,\n onActiveDrawerChange,\n onActiveDrawerResize,\n } = useDrawers(\n {\n drawers: controlledDrawers,\n onDrawerChange,\n activeDrawerId: controlledActiveDrawerId,\n ...rest,\n },\n ariaLabels,\n {\n ariaLabels,\n tools,\n toolsOpen,\n toolsHide,\n toolsWidth,\n onToolsToggle,\n }\n );\n ariaLabels = ariaLabelsWithDrawers;\n const hasDrawers = !!drawers;\n\n const { refs: navigationRefs, setFocus: focusNavButtons } = useFocusControl(navigationOpen);\n const {\n refs: toolsRefs,\n setFocus: focusToolsButtons,\n loseFocus: loseToolsFocus,\n } = useFocusControl(toolsOpen || activeDrawer !== undefined, true);\n const {\n refs: drawerRefs,\n setFocus: focusDrawersButtons,\n loseFocus: loseDrawersFocus,\n } = useFocusControl(!!activeDrawerId, true, activeDrawerId);\n\n const onNavigationToggle = useStableCallback((open: boolean) => {\n focusNavButtons();\n fireNonCancelableEvent(onNavigationChange, { open });\n });\n\n const onNavigationClick = (event: React.MouseEvent) => {\n const hasLink = findUpUntil(\n event.target as HTMLElement,\n node => node.tagName === 'A' && !!(node as HTMLAnchorElement).href\n );\n if (hasLink) {\n onNavigationToggle(false);\n }\n };\n\n useEffect(() => {\n // Close navigation drawer on mobile so that the main content is visible\n if (isMobile) {\n onNavigationToggle(false);\n }\n }, [isMobile, onNavigationToggle]);\n\n const navigationVisible = !navigationHide && navigationOpen;\n const toolsVisible = !toolsHide && toolsOpen;\n\n const [headerFooterHeight, setHeaderFooterHeight] = useState(0);\n // Delay applying changes in header/footer height, as applying them immediately can cause\n // ResizeOberver warnings due to the algorithm thinking that the change might have side-effects\n // further up the tree, therefore blocking notifications to prevent loops\n useEffect(() => {\n const id = requestAnimationFrame(() => setHeaderFooterHeight(placement.top + placement.bottom));\n return () => cancelAnimationFrame(id);\n }, [placement.top, placement.bottom]);\n const contentHeightStyle = {\n [disableBodyScroll ? 'height' : 'minHeight']: `calc(100vh - ${headerFooterHeight}px)`,\n };\n\n const [notificationsHeight, notificationsRef] = useContainerQuery(rect => rect.contentBoxHeight);\n const anyPanelOpen = navigationVisible || toolsVisible || !!activeDrawer;\n const hasRenderedNotifications = notificationsHeight ? notificationsHeight > 0 : false;\n const stickyNotificationsHeight = stickyNotifications ? notificationsHeight : null;\n\n const [splitPanelPreferences, setSplitPanelPreferences] = useControllable(\n controlledSplitPanelPreferences,\n onSplitPanelPreferencesChange,\n undefined,\n {\n componentName: 'AppLayout',\n controlledProp: 'splitPanelPreferences',\n changeHandler: 'onSplitPanelPreferencesChange',\n }\n );\n const [splitPanelOpen = false, setSplitPanelOpen] = useControllable(\n controlledSplitPanelOpen,\n onSplitPanelToggle,\n false,\n {\n componentName: 'AppLayout',\n controlledProp: 'splitPanelOpen',\n changeHandler: 'onSplitPanelToggle',\n }\n );\n\n const splitPanelPosition = splitPanelPreferences?.position || 'bottom';\n const [splitPanelReportedToggle, setSplitPanelReportedToggle] = useState({\n displayed: false,\n ariaLabel: undefined,\n });\n const splitPanelDisplayed = !!(splitPanel && (splitPanelReportedToggle.displayed || splitPanelOpen));\n\n const closedDrawerWidth = 40;\n const effectiveNavigationWidth = navigationHide ? 0 : navigationOpen ? navigationWidth : closedDrawerWidth;\n\n const getEffectiveToolsWidth = () => {\n if (activeDrawer && activeDrawerSize) {\n return activeDrawerSize;\n }\n\n if (toolsHide || drawers) {\n return 0;\n }\n\n if (toolsOpen) {\n return toolsWidth;\n }\n\n return closedDrawerWidth;\n };\n\n const effectiveToolsWidth = getEffectiveToolsWidth();\n\n const defaultSplitPanelSize = getSplitPanelDefaultSize(splitPanelPosition);\n const [splitPanelSize = defaultSplitPanelSize, setSplitPanelSize] = useControllable(\n controlledSplitPanelSize,\n onSplitPanelResize,\n defaultSplitPanelSize,\n {\n componentName: 'AppLayout',\n controlledProp: 'splitPanelSize',\n changeHandler: 'onSplitPanelResize',\n }\n );\n\n const mainContentRef = useRef(null);\n const legacyScrollRootRef = useRef(null);\n\n const { refs: splitPanelRefs, setLastInteraction: setSplitPanelLastInteraction } = useSplitPanelFocusControl([\n splitPanelPreferences,\n splitPanelOpen,\n ]);\n\n const onSplitPanelPreferencesSet = useCallback(\n (detail: { position: 'side' | 'bottom' }) => {\n setSplitPanelPreferences(detail);\n setSplitPanelLastInteraction({ type: 'position' });\n fireNonCancelableEvent(onSplitPanelPreferencesChange, detail);\n },\n [setSplitPanelPreferences, onSplitPanelPreferencesChange, setSplitPanelLastInteraction]\n );\n const onSplitPanelSizeSet = useCallback(\n (newSize: number) => {\n setSplitPanelSize(newSize);\n fireNonCancelableEvent(onSplitPanelResize, { size: newSize });\n },\n [setSplitPanelSize, onSplitPanelResize]\n );\n\n const onSplitPanelToggleHandler = useCallback(() => {\n setSplitPanelOpen(!splitPanelOpen);\n setSplitPanelLastInteraction({ type: splitPanelOpen ? 'close' : 'open' });\n fireNonCancelableEvent(onSplitPanelToggle, { open: !splitPanelOpen });\n }, [setSplitPanelOpen, splitPanelOpen, onSplitPanelToggle, setSplitPanelLastInteraction]);\n\n const getSplitPanelMaxHeight = useStableCallback(() => {\n if (typeof document === 'undefined') {\n return 0; // render the split panel in its minimum possible size\n } else if (disableBodyScroll && legacyScrollRootRef.current) {\n const availableHeight = legacyScrollRootRef.current.clientHeight;\n return availableHeight < CONSTRAINED_PAGE_HEIGHT ? availableHeight : availableHeight - MAIN_PANEL_MIN_HEIGHT;\n } else {\n const availableHeight = document.documentElement.clientHeight - placement.top - placement.bottom;\n return availableHeight < CONSTRAINED_PAGE_HEIGHT\n ? availableHeight - CONSTRAINED_MAIN_PANEL_MIN_HEIGHT\n : availableHeight - MAIN_PANEL_MIN_HEIGHT;\n }\n });\n\n const rightDrawerBarWidth = drawers ? (drawers.length > 1 ? closedDrawerWidth : 0) : 0;\n const contentPadding = 80;\n // all content except split-panel + drawers/tools area\n const resizableSpaceAvailable = Math.max(\n 0,\n placement.width - effectiveNavigationWidth - minContentWidth - contentPadding - rightDrawerBarWidth\n );\n\n // if there is no space to display split panel in the side, force to bottom\n const isSplitPanelForcedPosition =\n isMobile || resizableSpaceAvailable - effectiveToolsWidth < SPLIT_PANEL_MIN_WIDTH;\n const finalSplitPanePosition = isSplitPanelForcedPosition ? 'bottom' : splitPanelPosition;\n\n const splitPaneAvailableOnTheSide = splitPanelDisplayed && finalSplitPanePosition === 'side';\n\n const sideSplitPanelSize = splitPaneAvailableOnTheSide ? (splitPanelOpen ? splitPanelSize : closedDrawerWidth) : 0;\n const splitPanelMaxWidth = Math.max(0, resizableSpaceAvailable - effectiveToolsWidth);\n const drawerMaxSize = Math.max(0, resizableSpaceAvailable - sideSplitPanelSize);\n\n const navigationClosedWidth = navigationHide || isMobile ? 0 : closedDrawerWidth;\n\n const contentMaxWidthStyle = !isMobile ? { maxWidth: maxContentWidth } : undefined;\n\n const [splitPanelReportedSize, setSplitPanelReportedSize] = useState(0);\n const [splitPanelReportedHeaderHeight, setSplitPanelReportedHeaderHeight] = useState(0);\n\n const splitPanelContextProps: SplitPanelProviderProps = {\n topOffset: placement.top + (finalSplitPanePosition === 'bottom' ? stickyNotificationsHeight || 0 : 0),\n bottomOffset: placement.bottom,\n leftOffset:\n placement.left + (isMobile ? 0 : !navigationHide && navigationOpen ? navigationWidth : navigationClosedWidth),\n rightOffset: isMobile ? 0 : placement.right + effectiveToolsWidth + rightDrawerBarWidth,\n position: finalSplitPanePosition,\n size: splitPanelSize,\n maxWidth: splitPanelMaxWidth,\n getMaxHeight: getSplitPanelMaxHeight,\n disableContentPaddings,\n contentWidthStyles: contentMaxWidthStyle,\n isOpen: splitPanelOpen,\n isForcedPosition: isSplitPanelForcedPosition,\n onResize: onSplitPanelSizeSet,\n onToggle: onSplitPanelToggleHandler,\n onPreferencesChange: onSplitPanelPreferencesSet,\n setSplitPanelToggle: setSplitPanelReportedToggle,\n reportSize: setSplitPanelReportedSize,\n reportHeaderHeight: setSplitPanelReportedHeaderHeight,\n refs: splitPanelRefs,\n };\n const splitPanelWrapped = splitPanel && (\n \n {finalSplitPanePosition === 'side' ? (\n {splitPanel}\n ) : (\n splitPanel\n )}\n \n );\n\n const contentWrapperProps: ContentWrapperProps = {\n contentType,\n navigationPadding: navigationHide || !!navigationOpen,\n contentWidthStyles: !isMobile ? { minWidth: minContentWidth, maxWidth: maxContentWidth } : undefined,\n toolsPadding:\n // tools padding is displayed in one of the three cases\n // 1. Nothing on the that screen edge (no tools panel and no split panel)\n toolsHide ||\n (hasDrawers && !activeDrawer && (!splitPanelDisplayed || finalSplitPanePosition !== 'side')) ||\n // 2. Tools panel is present and open\n toolsVisible ||\n // 3. Split panel is open in side position\n (splitPaneAvailableOnTheSide && splitPanelOpen),\n isMobile,\n };\n\n useImperativeHandle(ref, () => ({\n openTools: () => onToolsToggle(true),\n closeNavigationIfNecessary: () => {\n if (isMobile) {\n onNavigationToggle(false);\n }\n },\n focusToolsClose: () => {\n if (hasDrawers) {\n focusDrawersButtons(true);\n } else {\n focusToolsButtons(true);\n }\n },\n focusActiveDrawer: () => focusDrawersButtons(true),\n focusSplitPanel: () => splitPanelRefs.slider.current?.focus(),\n }));\n\n const splitPanelBottomOffset =\n (!splitPanelDisplayed || finalSplitPanePosition !== 'bottom'\n ? undefined\n : splitPanelOpen\n ? splitPanelReportedSize\n : splitPanelReportedHeaderHeight) ?? undefined;\n\n const [mobileBarHeight, mobileBarRef] = useContainerQuery(rect => rect.contentBoxHeight);\n\n return (\n \n {isMobile && !__embeddedViewMode && (!toolsHide || !navigationHide || breadcrumbs) && (\n onNavigationToggle(true)}\n onToolsOpen={() => onToolsToggle(true)}\n unfocusable={anyPanelOpen}\n mobileBarRef={mobileBarRef}\n drawers={drawers}\n activeDrawerId={activeDrawerId}\n onDrawerChange={newDrawerId => {\n onActiveDrawerChange(newDrawerId);\n if (newDrawerId !== activeDrawerId) {\n focusToolsButtons();\n focusDrawersButtons();\n }\n }}\n >\n {breadcrumbs}\n \n )}\n
    \n {!navigationHide && (\n \n {navigation}\n \n )}\n \n \n {notifications && (\n \n {notifications}\n \n )}\n {((!isMobile && breadcrumbs) || contentHeader) && (\n \n {!isMobile && breadcrumbs && (\n
    {breadcrumbs}
    \n )}\n {contentHeader && (\n \n {contentHeader}\n
    \n )}\n \n )}\n \n \n {content}\n \n \n
    \n {finalSplitPanePosition === 'bottom' && splitPanelWrapped}\n \n\n {finalSplitPanePosition === 'side' && splitPanelWrapped}\n\n {hasDrawers ? (\n {\n if (!isOpen) {\n focusToolsButtons();\n focusDrawersButtons();\n onActiveDrawerChange(null);\n }\n }}\n isOpen={true}\n hideOpenButton={true}\n toggleRefs={drawerRefs}\n type=\"tools\"\n onLoseFocus={loseDrawersFocus}\n activeDrawer={activeDrawer}\n onResize={changeDetail => onActiveDrawerResize(changeDetail)}\n refs={drawerRefs}\n toolsContent={drawers?.find(drawer => drawer.id === TOOLS_DRAWER_ID)?.content}\n >\n {activeDrawer?.content}\n \n ) : (\n !toolsHide && (\n \n {tools}\n \n )\n )}\n {hasDrawers && drawers.length > 0 && (\n {\n if (activeDrawerId !== newDrawerId) {\n focusToolsButtons();\n focusDrawersButtons();\n }\n onActiveDrawerChange(newDrawerId);\n }}\n ariaLabels={ariaLabels}\n />\n )}\n
    \n
    \n );\n }\n);\n\nexport default ClassicAppLayout;\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport * as React from 'react';\nimport { isDevelopment } from '../../is-development';\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\ninterface PropertyDescription {\n componentName: string;\n controlledProp: string;\n changeHandler: string;\n}\n\n/**\n * This hook allows you to make a component that can be used both in controlled mode and uncontrolled mode.\n * Pass in your component's props, and then implement your component as if it was only controlled.\n * When calling onChange callbacks (or the equivalent for your property), you need to call both the callback returned by this function\n * as well as the callback provided in your component's props.\n *\n * A component determines its mode (either controlled or uncontrolled) on the first render and keeps it for its lifetime. The mode cannot\n * be switched later.\n *\n *\n * Example usage:\n * ```jsx\n * const [checked, setChecked] = useControllable(\n * props,\n * props.defaultEnabled ?? false,\n * {\n * componentName: 'MyCheckboxComponent',\n * controlledProp: 'enabled',\n * changeHandler: 'onCheckedStatusChange'\n * }\n * )\n *\n * return\n * {\n * setChecked(event.target.checked);\n * fireNonCancelableEvent(props.onCheckedStatusChange, { checked: event.target.checked })\n * }} />\n * ```\n *\n * @param controlledValue value for the controlled mode\n * @param handler update handler for controlled mode\n * @param defaultValue initial value for uncontrolled mode\n * @param description property metadata\n */\nexport function useControllable(\n controlledValue: ValueType,\n handler: ((...args: any[]) => unknown) | undefined,\n defaultValue: ValueType,\n { componentName, changeHandler, controlledProp }: PropertyDescription\n) {\n // The decision whether a component is controlled or uncontrolled is made on its first render and cannot be changed afterwards.\n const isControlled = React.useState(controlledValue !== undefined)[0];\n\n if (isDevelopment) {\n // Print a warning if the component switches between controlled and uncontrolled mode.\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(() => {\n if (isControlled && handler === undefined) {\n warnOnce(\n componentName,\n `You provided a \\`${controlledProp}\\` prop without an \\`${changeHandler}\\` handler. This will render a non-interactive component.`\n );\n }\n }, [handler, isControlled, componentName, changeHandler, controlledProp]);\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(() => {\n const isControlledNow = controlledValue !== undefined;\n if (isControlled !== isControlledNow) {\n const initialMode = isControlled ? 'controlled' : 'uncontrolled';\n const modeNow = isControlledNow ? 'controlled' : 'uncontrolled';\n warnOnce(\n componentName,\n `A component tried to change ${initialMode} '${controlledProp}' property to be ${modeNow}. ` +\n `This is not supported. Properties should not switch from ${initialMode} to ${modeNow} (or vice versa). ` +\n `Decide between using a controlled or uncontrolled mode for the lifetime of the component. ` +\n `More info: https://fb.me/react-controlled-components`\n );\n }\n }, [isControlled, controlledProp, componentName, controlledValue]);\n }\n\n // This is the value that is used if the component is uncontrolled.\n const [valueState, setValue] = React.useState(defaultValue);\n const [valueHasBeenSet, setValueHasBeenSet] = React.useState(false);\n\n // We track changes to the defaultValue\n const currentUncontrolledValue = valueHasBeenSet ? valueState : defaultValue;\n\n const setUncontrolledValue = React.useCallback(\n (newValue: React.SetStateAction) => {\n setValue(newValue);\n setValueHasBeenSet(true);\n },\n [setValue, setValueHasBeenSet]\n );\n\n if (isControlled) {\n return [controlledValue, defaultCallback] as const;\n } else {\n return [currentUncontrolledValue, setUncontrolledValue] as const;\n }\n}\n\nfunction defaultCallback() {\n return void 0;\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport styles from './styles.css.js';\nimport { AppLayoutProps } from '../interfaces';\nimport clsx from 'clsx';\n\ninterface NotificationsProps {\n testUtilsClassName: string;\n children?: React.ReactNode;\n labels: AppLayoutProps.Labels | undefined;\n topOffset: number | undefined;\n disableContentPaddings?: boolean;\n}\ninterface NotificationWrapperProps extends NotificationsProps {\n sticky: boolean | undefined;\n}\n\nexport const Notifications = React.forwardRef(\n ({ sticky, disableContentPaddings, ...props }: NotificationWrapperProps, ref: React.Ref) => {\n return sticky ? (\n
    \n \n {props.children}\n
    \n \n ) : (\n \n {props.children}\n \n );\n }\n);\n", "\n import './styles.scoped.css';\n export default {\n \"notifications\": \"awsui_notifications_1hmm4_1xs0q_9\",\n \"notifications-sticky\": \"awsui_notifications-sticky_1hmm4_1xs0q_10\",\n \"no-content-paddings\": \"awsui_no-content-paddings_1hmm4_1xs0q_25\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { useEffect } from 'react';\nimport { ButtonProps } from '../../button/interfaces';\nimport { AppLayoutProps } from '../interfaces';\nimport { ToggleButton, togglesConfig } from '../toggles';\nimport OverflowMenu from '../drawer/overflow-menu';\nimport styles from './styles.css.js';\nimport sharedStyles from '../styles.css.js';\nimport testutilStyles from '../test-classes/styles.css.js';\nimport { splitItems } from '../drawer/drawers-helpers';\nimport { TOOLS_DRAWER_ID } from '../utils/use-drawers';\n\ninterface MobileToggleProps {\n className?: string;\n ariaLabels?: AppLayoutProps.Labels;\n type: keyof typeof togglesConfig;\n disabled?: boolean;\n onClick: () => void;\n}\nconst MobileToggle = React.forwardRef(\n ({ className, ariaLabels, type, disabled, onClick }: MobileToggleProps, ref: React.Ref) => {\n const { TagName, iconName, getLabels } = togglesConfig[type];\n const { mainLabel, openLabel } = getLabels(ariaLabels);\n\n return (\n e.target === e.currentTarget && onClick()}\n >\n \n \n );\n }\n);\ninterface MobileToolbarProps {\n anyPanelOpen: boolean;\n unfocusable: boolean | undefined;\n toggleRefs: {\n navigation: React.Ref;\n tools: React.Ref;\n };\n navigationHide: boolean | undefined;\n toolsHide: boolean | undefined;\n topOffset?: number;\n ariaLabels: AppLayoutProps.Labels | undefined;\n mobileBarRef: React.Ref;\n children: React.ReactNode;\n onNavigationOpen: () => void;\n onToolsOpen: () => void;\n drawers: Array | undefined;\n activeDrawerId: string | null;\n onDrawerChange: (newDrawerId: string | null) => void;\n}\n\nexport function MobileToolbar({\n ariaLabels,\n toggleRefs,\n topOffset,\n navigationHide,\n toolsHide,\n anyPanelOpen,\n unfocusable,\n drawers,\n activeDrawerId,\n children,\n onNavigationOpen,\n onToolsOpen,\n onDrawerChange,\n mobileBarRef,\n}: MobileToolbarProps) {\n useEffect(() => {\n if (anyPanelOpen) {\n document.body.classList.add(styles['block-body-scroll']);\n return () => {\n document.body.classList.remove(styles['block-body-scroll']);\n };\n } else {\n document.body.classList.remove(styles['block-body-scroll']);\n }\n }, [anyPanelOpen]);\n\n const { overflowItems, visibleItems } = splitItems(drawers, 2, activeDrawerId);\n const overflowMenuHasBadge = !!overflowItems.find(item => item.badge);\n\n return (\n \n {!navigationHide && (\n \n )}\n
    \n {children &&
    {children}
    }\n
    \n {!toolsHide && !drawers && (\n \n )}\n {drawers && (\n \n )}\n \n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React from 'react';\nimport { ButtonProps } from '../../button/interfaces';\nimport { InternalButton } from '../../button/internal';\nimport InternalIcon from '../../icon/internal';\nimport { AppLayoutProps } from '../interfaces';\nimport { AppLayoutButtonProps } from './interfaces';\nimport styles from './styles.css.js';\n\nexport const togglesConfig = {\n navigation: {\n TagName: 'nav',\n iconName: 'menu',\n getLabels: (labels: AppLayoutProps.Labels = {}) => ({\n mainLabel: labels.navigation,\n openLabel: labels.navigationToggle,\n closeLabel: labels.navigationClose,\n }),\n },\n tools: {\n TagName: 'aside',\n iconName: 'status-info',\n getLabels: (labels: AppLayoutProps.Labels = {}) => ({\n mainLabel: labels.tools,\n openLabel: labels.toolsToggle,\n closeLabel: labels.toolsClose,\n }),\n },\n} as const;\n\nexport const ToggleButton = React.forwardRef(\n (\n {\n className,\n ariaLabel,\n ariaExpanded,\n ariaControls,\n iconName,\n iconSvg,\n disabled,\n testId,\n onClick,\n badge,\n }: AppLayoutButtonProps,\n ref: React.Ref<{ focus(): void }>\n ) => {\n return (\n }\n className={clsx(className, styles['toggle-button'])}\n aria-label={ariaLabel}\n type=\"button\"\n onClick={onClick}\n disabled={disabled}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaExpanded ? undefined : true}\n aria-controls={ariaControls}\n data-testid={testId}\n >\n \n \n );\n }\n);\n\ninterface CloseButtonProps {\n className?: string;\n ariaLabel: string | undefined;\n onClick: () => void;\n}\n\nexport const CloseButton = React.forwardRef(\n ({ className, ariaLabel, onClick }: CloseButtonProps, ref: React.Ref) => {\n return (\n \n \n \n );\n }\n);\n", "\n import './styles.scoped.css';\n export default {\n \"toggle-button\": \"awsui_toggle-button_16w0h_1lkgf_99\",\n \"close-button\": \"awsui_close-button_16w0h_1lkgf_134\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport InternalButtonDropdown from '../../button-dropdown/internal';\nimport { ButtonDropdownProps, InternalButtonDropdownProps } from '../../button-dropdown/interfaces';\nimport { CancelableEventHandler } from '../../internal/events';\nimport { AppLayoutProps } from '../interfaces';\nimport testutilStyles from '../test-classes/styles.css.js';\n\ninterface OverflowMenuProps {\n items: Array;\n onItemClick: CancelableEventHandler;\n customTriggerBuilder?: InternalButtonDropdownProps['customTriggerBuilder'];\n ariaLabel?: string;\n}\n\nexport default function OverflowMenu({ items, onItemClick, customTriggerBuilder, ariaLabel }: OverflowMenuProps) {\n return (\n ({\n id: item.id,\n text: item.ariaLabels.drawerName,\n iconName: item.trigger.iconName,\n iconSvg: item.trigger.iconSvg,\n badge: item.badge,\n }))}\n className={testutilStyles['overflow-menu']}\n onItemClick={onItemClick}\n ariaLabel={ariaLabel}\n variant=\"icon\"\n customTriggerBuilder={customTriggerBuilder}\n expandToViewport={true}\n />\n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef } from 'react';\nimport clsx from 'clsx';\nimport styles from './styles.css.js';\nimport { ButtonDropdownProps, InternalButtonDropdownProps } from './interfaces';\nimport { getBaseProps } from '../internal/base-component';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport Dropdown from '../internal/components/dropdown';\nimport ItemsList from './items-list';\nimport { useButtonDropdown } from './utils/use-button-dropdown';\nimport OptionsList from '../internal/components/options-list';\nimport { InternalButton, InternalButtonProps } from '../button/internal';\nimport { ButtonProps } from '../button/interfaces';\nimport { useMobile } from '../internal/hooks/use-mobile';\nimport useForwardFocus from '../internal/hooks/forward-focus';\nimport InternalBox from '../box/internal';\nimport { checkSafeUrl } from '../internal/utils/check-safe-url';\nimport { isDevelopment } from '../internal/is-development';\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode/index.js';\nimport { useFunnel } from '../internal/analytics/hooks/use-funnel.js';\n\nconst InternalButtonDropdown = React.forwardRef(\n (\n {\n items,\n variant = 'normal',\n loading = false,\n loadingText,\n disabled = false,\n expandableGroups = false,\n children,\n onItemClick,\n onItemFollow,\n customTriggerBuilder,\n expandToViewport,\n ariaLabel,\n title,\n description,\n preferCenter,\n mainAction,\n __internalRootRef,\n ...props\n }: InternalButtonDropdownProps,\n ref: React.Ref\n ) => {\n const isInRestrictedView = useMobile();\n const dropdownId = useUniqueId('dropdown');\n for (const item of items) {\n checkSafeUrl('ButtonDropdown', item.href);\n }\n if (mainAction) {\n checkSafeUrl('ButtonDropdown', mainAction.href);\n }\n\n if (isDevelopment) {\n if (mainAction && variant !== 'primary' && variant !== 'normal') {\n warnOnce('ButtonDropdown', 'Main action is only supported for \"primary\" and \"normal\" component variant.');\n }\n }\n const isMainAction = mainAction && (variant === 'primary' || variant === 'normal');\n const isVisualRefresh = useVisualRefresh();\n\n const {\n isOpen,\n targetItem,\n isHighlighted,\n isKeyboardHighlight,\n isExpanded,\n highlightItem,\n onKeyDown,\n onKeyUp,\n onItemActivate,\n onGroupToggle,\n toggleDropdown,\n closeDropdown,\n setIsUsingMouse,\n } = useButtonDropdown({\n items,\n onItemClick,\n onItemFollow,\n // Scroll is unnecessary when moving focus back to the dropdown trigger.\n onReturnFocus: () => triggerRef.current?.focus({ preventScroll: true }),\n expandToViewport,\n hasExpandableGroups: expandableGroups,\n isInRestrictedView,\n });\n\n const handleMouseEvent = () => {\n setIsUsingMouse(true);\n };\n\n const baseProps = getBaseProps(props);\n\n const mainActionRef = useRef(null);\n const triggerRef = useRef(null);\n\n useForwardFocus(ref, isMainAction ? mainActionRef : triggerRef);\n\n const clickHandler = () => {\n if (!loading && !disabled) {\n // Prevent moving highlight on mobiles to avoid disabled state reason popup if defined.\n toggleDropdown({ moveHighlightOnOpen: !isInRestrictedView });\n }\n };\n\n const canBeOpened = !loading && !disabled;\n\n const triggerVariant = variant === 'navigation' ? undefined : variant === 'inline-icon' ? 'inline-icon' : variant;\n const iconProps: Partial =\n variant === 'icon' || variant === 'inline-icon'\n ? {\n iconName: 'ellipsis',\n }\n : {\n iconName: 'caret-down-filled',\n iconAlign: 'right',\n __iconClass: canBeOpened && isOpen ? styles['rotate-up'] : styles['rotate-down'],\n };\n\n const baseTriggerProps: InternalButtonProps = {\n className: clsx(styles['trigger-button'], styles['test-utils-button-trigger']),\n ...iconProps,\n variant: triggerVariant,\n loading,\n loadingText,\n disabled,\n onClick: (event: Event) => {\n event.preventDefault();\n clickHandler();\n },\n ariaLabel,\n ariaExpanded: canBeOpened && isOpen,\n formAction: 'none',\n __nativeAttributes: {\n 'aria-haspopup': true,\n },\n };\n\n const triggerId = useUniqueId('awsui-button-dropdown__trigger');\n\n const triggerHasBadge = () => {\n const flatItems = items.flatMap(item => {\n if ('items' in item) {\n return item.items;\n }\n return item;\n });\n\n return (\n variant === 'icon' &&\n !!flatItems?.find(item => {\n if ('badge' in item) {\n return item.badge;\n }\n })\n );\n };\n\n let trigger: React.ReactNode = null;\n if (customTriggerBuilder) {\n trigger = (\n
    \n {customTriggerBuilder({\n testUtilsClass: styles['test-utils-button-trigger'],\n ariaExpanded: canBeOpened && isOpen,\n onClick: clickHandler,\n triggerRef,\n ariaLabel,\n disabled,\n isOpen,\n })}\n
    \n );\n } else if (isMainAction) {\n const { text, iconName, iconAlt, iconSvg, iconUrl, external, externalIconAriaLabel, ...mainActionProps } =\n mainAction;\n const mainActionIconProps = external\n ? ({ iconName: 'external', iconAlign: 'right' } as const)\n : ({ iconName, iconAlt, iconSvg, iconUrl } as const);\n const mainActionAriaLabel = externalIconAriaLabel\n ? `${mainAction.ariaLabel ?? mainAction.text} ${mainAction.externalIconAriaLabel}`\n : undefined;\n\n trigger = (\n
    \n e.stopPropagation()}\n onKeyUp={e => e.stopPropagation()}\n >\n \n {text}\n \n
    \n \n \n \n \n );\n } else {\n trigger = (\n
    \n \n {children}\n \n
    \n );\n }\n\n const hasHeader = title || description;\n const headerId = useUniqueId('awsui-button-dropdown__header');\n\n const shouldLabelWithTrigger = !ariaLabel && !mainAction && variant !== 'icon' && variant !== 'inline-icon';\n\n const { loadingButtonCount } = useFunnel();\n useEffect(() => {\n if (loading) {\n loadingButtonCount.current++;\n return () => {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n loadingButtonCount.current--;\n };\n }\n }, [loading, loadingButtonCount]);\n\n return (\n \n toggleDropdown()}\n trigger={trigger}\n dropdownId={dropdownId}\n >\n {hasHeader && (\n
    \n {title && (\n
    \n \n {title}\n \n
    \n )}\n {description && (\n \n {description}\n \n )}\n
    \n )}\n \n \n \n \n \n );\n }\n);\n\nexport default InternalButtonDropdown;\n", "\n import './styles.scoped.css';\n export default {\n \"button-dropdown\": \"awsui_button-dropdown_sne0l_17rq9_99\",\n \"items-list-container\": \"awsui_items-list-container_sne0l_17rq9_103\",\n \"awsui-motion-fade-in-0\": \"awsui_awsui-motion-fade-in-0_sne0l_17rq9_1\",\n \"rotate-up\": \"awsui_rotate-up_sne0l_17rq9_122\",\n \"rotate-down\": \"awsui_rotate-down_sne0l_17rq9_137\",\n \"header\": \"awsui_header_sne0l_17rq9_152\",\n \"title\": \"awsui_title_sne0l_17rq9_163\",\n \"description\": \"awsui_description_sne0l_17rq9_164\",\n \"split-trigger-wrapper\": \"awsui_split-trigger-wrapper_sne0l_17rq9_168\",\n \"trigger-item\": \"awsui_trigger-item_sne0l_17rq9_171\",\n \"trigger-button\": \"awsui_trigger-button_sne0l_17rq9_174\",\n \"visual-refresh\": \"awsui_visual-refresh_sne0l_17rq9_185\",\n \"split-trigger\": \"awsui_split-trigger_sne0l_17rq9_168\",\n \"dropdown-trigger\": \"awsui_dropdown-trigger_sne0l_17rq9_193\",\n \"test-utils-button-trigger\": \"awsui_test-utils-button-trigger_sne0l_17rq9_197\"\n};\n ", "\n import './styles.scoped.css';\n export default {\n \"dropdown-content-wrapper\": \"awsui_dropdown-content-wrapper_qwoo0_3gt2b_99\",\n \"awsui-motion-fade-in-dropdown\": \"awsui_awsui-motion-fade-in-dropdown_qwoo0_3gt2b_1\",\n \"refresh\": \"awsui_refresh_qwoo0_3gt2b_120\",\n \"awsui-motion-fade-in-0\": \"awsui_awsui-motion-fade-in-0_qwoo0_3gt2b_1\",\n \"root\": \"awsui_root_qwoo0_3gt2b_149\",\n \"interior\": \"awsui_interior_qwoo0_3gt2b_185\",\n \"dropdown\": \"awsui_dropdown_qwoo0_3gt2b_99\",\n \"use-portal\": \"awsui_use-portal_qwoo0_3gt2b_196\",\n \"is-empty\": \"awsui_is-empty_qwoo0_3gt2b_248\",\n \"dropdown-drop-up\": \"awsui_dropdown-drop-up_qwoo0_3gt2b_255\",\n \"with-limited-width\": \"awsui_with-limited-width_qwoo0_3gt2b_259\",\n \"dropdown-drop-left\": \"awsui_dropdown-drop-left_qwoo0_3gt2b_262\",\n \"dropdown-drop-right\": \"awsui_dropdown-drop-right_qwoo0_3gt2b_268\",\n \"occupy-entire-width\": \"awsui_occupy-entire-width_qwoo0_3gt2b_274\",\n \"stretch-beyond-trigger-width\": \"awsui_stretch-beyond-trigger-width_qwoo0_3gt2b_277\",\n \"hide-block-border\": \"awsui_hide-block-border_qwoo0_3gt2b_281\",\n \"open\": \"awsui_open_qwoo0_3gt2b_287\",\n \"nowrap\": \"awsui_nowrap_qwoo0_3gt2b_296\",\n \"dropdown-content\": \"awsui_dropdown-content_qwoo0_3gt2b_99\",\n \"stretch-trigger-height\": \"awsui_stretch-trigger-height_qwoo0_3gt2b_307\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport styles from './styles.css.js';\nimport clsx from 'clsx';\nimport { useMergeRefs } from '../../hooks/use-merge-refs';\nimport React, { useEffect, useLayoutEffect, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\nimport { fireNonCancelableEvent } from '../../events';\nimport { DropdownProps } from './interfaces';\nimport {\n DropdownPosition,\n InteriorDropdownPosition,\n calculatePosition,\n defaultMaxDropdownWidth,\n hasEnoughSpaceToStretchBeyondTriggerWidth,\n} from './dropdown-fit-handler';\nimport { Transition, TransitionStatus } from '../transition';\nimport { useVisualRefresh } from '../../hooks/use-visual-mode';\nimport { usePortalModeClasses } from '../../hooks/use-portal-mode-classes';\nimport { DropdownContextProvider, DropdownContextProviderProps } from './context';\nimport { useMobile } from '../../hooks/use-mobile';\nimport TabTrap from '../tab-trap/index.js';\nimport { getFirstFocusable, getLastFocusable } from '../focus-lock/utils.js';\nimport { useUniqueId } from '../../hooks/use-unique-id/index.js';\nimport customCssProps from '../../generated/custom-css-properties';\nimport { useResizeObserver } from '@cloudscape-design/component-toolkit/internal';\nimport { nodeBelongs } from '../../utils/node-belongs';\nimport { getLogicalBoundingClientRect } from '../../direction.js';\n\ninterface DropdownContainerProps {\n children?: React.ReactNode;\n renderWithPortal?: boolean;\n id?: string;\n referrerId?: string;\n open?: boolean;\n}\n\nconst DropdownContainer = ({ children, renderWithPortal = false, id, referrerId, open }: DropdownContainerProps) => {\n if (renderWithPortal) {\n if (open) {\n return createPortal(\n
    \n {children}\n
    ,\n document.body\n );\n } else {\n return null;\n }\n } else {\n return <>{children};\n }\n};\n\ninterface TransitionContentProps {\n state: TransitionStatus;\n transitionRef: React.MutableRefObject;\n dropdownClasses: string;\n stretchWidth: boolean;\n interior: boolean;\n isRefresh: boolean;\n dropdownRef: React.RefObject;\n verticalContainerRef: React.RefObject;\n expandToViewport?: boolean;\n stretchBeyondTriggerWidth?: boolean;\n header?: React.ReactNode;\n children?: React.ReactNode;\n footer?: React.ReactNode;\n position?: DropdownContextProviderProps['position'];\n open?: boolean;\n onMouseDown?: React.MouseEventHandler;\n id?: string;\n role?: string;\n ariaLabelledby?: string;\n ariaDescribedby?: string;\n}\n\nconst TransitionContent = ({\n state,\n transitionRef,\n dropdownClasses,\n stretchWidth,\n interior,\n isRefresh,\n dropdownRef,\n verticalContainerRef,\n expandToViewport,\n stretchBeyondTriggerWidth,\n header,\n children,\n footer,\n position,\n open,\n onMouseDown,\n id,\n role,\n ariaLabelledby,\n ariaDescribedby,\n}: TransitionContentProps) => {\n const contentRef = useMergeRefs(dropdownRef, transitionRef);\n return (\n \n \n
    \n \n {header}\n {children}\n {footer}\n \n
    \n \n \n );\n};\n\nconst Dropdown = ({\n children,\n trigger,\n open,\n onDropdownClose,\n onMouseDown,\n header,\n footer,\n dropdownId,\n stretchTriggerHeight = false,\n stretchWidth = true,\n stretchHeight = false,\n stretchToTriggerWidth = true,\n stretchBeyondTriggerWidth = false,\n expandToViewport = false,\n preferCenter = false,\n interior = false,\n minWidth,\n scrollable = true,\n loopFocus = expandToViewport,\n onFocus,\n onBlur,\n contentKey,\n dropdownContentId,\n dropdownContentRole,\n ariaLabelledby,\n ariaDescribedby,\n}: DropdownProps) => {\n const wrapperRef = useRef(null);\n const triggerRef = useRef(null);\n const dropdownRef = useRef(null);\n const dropdownContainerRef = useRef(null);\n // This container is only needed to apply max-height to. We can't move max-height to it's parent\n // because of an IE11 issue with flexbox. https://github.com/philipwalton/flexbugs/issues/216\n const verticalContainerRef = useRef(null);\n // To keep track of the initial position (drop up/down) which is kept the same during fixed repositioning\n const fixedPosition = useRef(null);\n\n const isRefresh = useVisualRefresh();\n\n const dropdownClasses = usePortalModeClasses(triggerRef);\n const [position, setPosition] = useState('bottom-right');\n\n const isMobile = useMobile();\n\n const setDropdownPosition = (\n position: DropdownPosition | InteriorDropdownPosition,\n triggerBox: DOMRect,\n target: HTMLDivElement,\n verticalContainer: HTMLDivElement\n ) => {\n const entireWidth = !interior && stretchWidth;\n if (!stretchWidth) {\n // 1px offset for dropdowns where the dropdown itself needs a border, rather than on the items\n verticalContainer.style.maxBlockSize = `${parseInt(position.blockSize) + 1}px`;\n } else {\n verticalContainer.style.maxBlockSize = position.blockSize;\n }\n\n if (entireWidth && !expandToViewport) {\n if (stretchToTriggerWidth) {\n target.classList.add(styles['occupy-entire-width']);\n }\n } else {\n target.style.inlineSize = position.inlineSize;\n }\n\n // Using styles for main dropdown to adjust its position as preferred alternative\n if (position.dropBlockStart && !interior) {\n target.classList.add(styles['dropdown-drop-up']);\n if (!expandToViewport) {\n target.style.insetBlockEnd = '100%';\n }\n } else {\n target.classList.remove(styles['dropdown-drop-up']);\n }\n target.classList.add(position.dropInlineStart ? styles['dropdown-drop-left'] : styles['dropdown-drop-right']);\n\n if (position.insetInlineStart && position.insetInlineStart !== 'auto') {\n target.style.insetInlineStart = position.insetInlineStart;\n }\n\n // Position normal overflow dropdowns with fixed positioning relative to viewport\n if (expandToViewport && !interior) {\n target.style.position = 'fixed';\n if (position.dropBlockStart) {\n target.style.insetBlockEnd = `calc(100% - ${triggerBox.top}px)`;\n } else {\n target.style.insetBlockStart = `${triggerBox.bottom}px`;\n }\n if (position.dropInlineStart) {\n target.style.insetInlineStart = `calc(${triggerBox.right}px - ${position.inlineSize})`;\n } else {\n target.style.insetInlineStart = `${triggerBox.left}px`;\n }\n // Keep track of the initial dropdown position and direction.\n // Dropdown direction doesn't need to change as the user scrolls, just needs to stay attached to the trigger.\n fixedPosition.current = position;\n return;\n }\n\n // For an interior dropdown (the fly out) we need exact values for positioning\n // and classes are not enough\n // usage of relative position is impossible due to overwrite of overflow-x\n if (interior && isInteriorPosition(position)) {\n if (position.dropBlockStart) {\n target.style.insetBlockEnd = position.insetBlockEnd;\n } else {\n target.style.insetBlockStart = position.insetBlockStart;\n }\n target.style.insetInlineStart = position.insetInlineStart;\n }\n\n if (position.dropBlockStart && position.dropInlineStart) {\n setPosition('top-left');\n } else if (position.dropBlockStart) {\n setPosition('top-right');\n } else if (position.dropInlineStart) {\n setPosition('bottom-left');\n } else {\n setPosition('bottom-right');\n }\n };\n\n const isOutsideDropdown = (element: Element) =>\n (!wrapperRef.current || !nodeBelongs(wrapperRef.current, element)) &&\n (!dropdownContainerRef.current || !nodeBelongs(dropdownContainerRef.current, element));\n\n const focusHandler = (event: React.FocusEvent) => {\n if (!event.relatedTarget || isOutsideDropdown(event.relatedTarget)) {\n fireNonCancelableEvent(onFocus, event);\n }\n };\n\n const blurHandler = (event: React.FocusEvent) => {\n if (!event.relatedTarget || isOutsideDropdown(event.relatedTarget)) {\n fireNonCancelableEvent(onBlur, event);\n }\n };\n\n // Prevent the dropdown width from stretching beyond the trigger width\n // if that is going to cause the dropdown to be cropped because of overflow\n const fixStretching = () => {\n const classNameToRemove = styles['stretch-beyond-trigger-width'];\n if (\n open &&\n stretchBeyondTriggerWidth &&\n dropdownRef.current &&\n triggerRef.current &&\n dropdownRef.current.classList.contains(classNameToRemove) &&\n !hasEnoughSpaceToStretchBeyondTriggerWidth({\n triggerElement: triggerRef.current,\n dropdownElement: dropdownRef.current,\n desiredMinWidth: minWidth,\n expandToViewport,\n stretchWidth,\n stretchHeight,\n isMobile,\n })\n ) {\n dropdownRef.current.classList.remove(classNameToRemove);\n }\n };\n\n useResizeObserver(() => dropdownRef.current, fixStretching);\n\n useLayoutEffect(() => {\n const onDropdownOpen = () => {\n if (open && dropdownRef.current && triggerRef.current && verticalContainerRef.current) {\n // calculate scroll width only for dropdowns that has a scrollbar and ignore it for date picker components\n if (scrollable) {\n dropdownRef.current.classList.add(styles.nowrap);\n }\n setDropdownPosition(\n ...calculatePosition(\n dropdownRef.current,\n triggerRef.current,\n verticalContainerRef.current,\n interior,\n expandToViewport,\n preferCenter,\n stretchWidth,\n stretchHeight,\n isMobile,\n minWidth,\n stretchBeyondTriggerWidth\n ),\n dropdownRef.current,\n verticalContainerRef.current\n );\n if (scrollable) {\n dropdownRef.current.classList.remove(styles.nowrap);\n }\n }\n };\n onDropdownOpen();\n\n if (open) {\n // window may scroll when dropdown opens, for example when soft keyboard shows up\n window.addEventListener('scroll', onDropdownOpen);\n // only listen to window scroll within very short time after the dropdown opens\n // do not want to interfere dropdown position on scroll afterwards\n const timeoutId = setTimeout(() => {\n window.removeEventListener('scroll', onDropdownOpen);\n }, 500);\n\n return () => {\n clearTimeout(timeoutId);\n window.removeEventListener('scroll', onDropdownOpen);\n };\n }\n // See AWSUI-13040\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [open, dropdownRef, triggerRef, verticalContainerRef, interior, stretchWidth, isMobile, contentKey]);\n\n // subscribe to outside click\n useEffect(() => {\n if (!open) {\n return;\n }\n const clickListener = (e: MouseEvent) => {\n if (!nodeBelongs(dropdownRef.current, e.target) && !nodeBelongs(triggerRef.current, e.target)) {\n fireNonCancelableEvent(onDropdownClose);\n }\n };\n window.addEventListener('click', clickListener, true);\n\n return () => {\n window.removeEventListener('click', clickListener, true);\n };\n }, [open, onDropdownClose]);\n\n // sync dropdown position on scroll and resize\n useLayoutEffect(() => {\n if (!expandToViewport || !open) {\n return;\n }\n const updateDropdownPosition = () => {\n if (triggerRef.current && dropdownRef.current && verticalContainerRef.current) {\n const triggerRect = getLogicalBoundingClientRect(triggerRef.current);\n const target = dropdownRef.current;\n if (fixedPosition.current) {\n if (fixedPosition.current.dropBlockStart) {\n dropdownRef.current.style.insetBlockEnd = `calc(100% - ${triggerRect.insetBlockStart}px)`;\n } else {\n target.style.insetBlockStart = `${triggerRect.insetBlockEnd}px`;\n }\n if (fixedPosition.current.dropInlineStart) {\n target.style.insetInlineStart = `calc(${triggerRect.insetInlineEnd}px - ${fixedPosition.current.inlineSize})`;\n } else {\n target.style.insetInlineStart = `${triggerRect.insetInlineStart}px`;\n }\n }\n }\n };\n\n updateDropdownPosition();\n\n window.addEventListener('scroll', updateDropdownPosition, true);\n window.addEventListener('resize', updateDropdownPosition, true);\n return () => {\n window.removeEventListener('scroll', updateDropdownPosition, true);\n window.removeEventListener('resize', updateDropdownPosition, true);\n };\n }, [open, expandToViewport]);\n\n const referrerId = useUniqueId();\n\n return (\n \n
    \n {trigger}\n
    \n\n dropdownRef.current && getFirstFocusable(dropdownRef.current)?.focus()}\n disabled={!open || !loopFocus}\n />\n\n \n \n {(state, ref) => (\n
    \n triggerRef.current && getLastFocusable(triggerRef.current)?.focus()}\n disabled={!open || !loopFocus}\n />\n\n \n {children}\n \n\n triggerRef.current && getFirstFocusable(triggerRef.current)?.focus()}\n disabled={!open || !loopFocus}\n />\n
    \n )}\n
    \n \n \n );\n};\n\nconst isInteriorPosition = (\n position: DropdownPosition | InteriorDropdownPosition\n): position is InteriorDropdownPosition => (position as InteriorDropdownPosition).insetBlockEnd !== undefined;\n\nexport default Dropdown;\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { getBreakpointValue } from '../../breakpoints';\nimport { getLogicalBoundingClientRect } from '../../direction';\nimport { BoundingBox, getOverflowParents, getOverflowParentDimensions } from '../../utils/scrollable-containers';\nimport styles from './styles.css.js';\n\nconst AVAILABLE_SPACE_RESERVE_DEFAULT = 50;\nconst AVAILABLE_SPACE_RESERVE_MOBILE_VERTICAL = 19; // 50 - 31\nconst AVAILABLE_SPACE_RESERVE_MOBILE_HORIZONTAL = 20;\n\ninterface AvailableSpace {\n blockStart: number;\n blockEnd: number;\n inlineStart: number;\n inlineEnd: number;\n}\nexport interface DropdownPosition {\n blockSize: string;\n inlineSize: string;\n dropBlockStart: boolean;\n dropInlineStart: boolean;\n insetInlineStart: string;\n}\nexport interface InteriorDropdownPosition extends DropdownPosition {\n insetBlockEnd: string;\n insetBlockStart: string;\n}\n\nconst getClosestParentDimensions = (element: HTMLElement): any => {\n const parents = getOverflowParents(element).map(element => {\n const { blockSize, inlineSize, insetBlockStart, insetInlineStart } = getLogicalBoundingClientRect(element);\n return {\n blockSize,\n inlineSize,\n insetBlockStart,\n insetInlineStart,\n };\n });\n\n return parents.shift();\n};\n\n// By default, most dropdowns should expand their content as necessary, but to a maximum of 465px (the XXS breakpoint).\n// This value was determined by UX but may be subject to change in the future, depending on the feedback.\nexport const defaultMaxDropdownWidth = getBreakpointValue('xxs');\n\nexport const getAvailableSpace = ({\n trigger,\n overflowParents,\n stretchWidth = false,\n stretchHeight = false,\n isMobile,\n}: {\n trigger: HTMLElement;\n overflowParents: ReadonlyArray;\n stretchWidth?: boolean;\n stretchHeight?: boolean;\n isMobile?: boolean;\n}): AvailableSpace => {\n const availableSpaceReserveVertical = stretchHeight\n ? 0\n : isMobile\n ? AVAILABLE_SPACE_RESERVE_MOBILE_VERTICAL\n : AVAILABLE_SPACE_RESERVE_DEFAULT;\n const availableSpaceReserveHorizontal = stretchWidth\n ? 0\n : isMobile\n ? AVAILABLE_SPACE_RESERVE_MOBILE_HORIZONTAL\n : AVAILABLE_SPACE_RESERVE_DEFAULT;\n const {\n insetBlockEnd: triggerBlockEnd,\n insetInlineStart: triggerInlineStart,\n insetInlineEnd: triggerInlineEnd,\n } = getLogicalBoundingClientRect(trigger);\n\n return overflowParents.reduce(\n ({ blockStart, blockEnd, inlineStart, inlineEnd }, overflowParent) => {\n const offsetTop = triggerBlockEnd - overflowParent.insetBlockStart;\n const currentBlockStart = offsetTop - trigger.offsetHeight - availableSpaceReserveVertical;\n const currentBlockEnd = overflowParent.blockSize - offsetTop - availableSpaceReserveVertical;\n const currentInlineStart = triggerInlineEnd - overflowParent.insetInlineStart - availableSpaceReserveHorizontal;\n const currentInlineEnd =\n overflowParent.insetInlineStart +\n overflowParent.inlineSize -\n triggerInlineStart -\n availableSpaceReserveHorizontal;\n\n return {\n blockStart: Math.min(blockStart, currentBlockStart),\n blockEnd: Math.min(blockEnd, currentBlockEnd),\n inlineStart: Math.min(inlineStart, currentInlineStart),\n inlineEnd: Math.min(inlineEnd, currentInlineEnd),\n };\n },\n {\n blockStart: Number.MAX_VALUE,\n blockEnd: Number.MAX_VALUE,\n inlineStart: Number.MAX_VALUE,\n inlineEnd: Number.MAX_VALUE,\n }\n );\n};\n\nexport const getInteriorAvailableSpace = ({\n trigger,\n overflowParents,\n isMobile,\n}: {\n trigger: HTMLElement;\n overflowParents: ReadonlyArray;\n isMobile?: boolean;\n}): AvailableSpace => {\n const AVAILABLE_SPACE_RESERVE_VERTICAL = isMobile\n ? AVAILABLE_SPACE_RESERVE_MOBILE_VERTICAL\n : AVAILABLE_SPACE_RESERVE_DEFAULT;\n const AVAILABLE_SPACE_RESERVE_HORIZONTAL = isMobile\n ? AVAILABLE_SPACE_RESERVE_MOBILE_HORIZONTAL\n : AVAILABLE_SPACE_RESERVE_DEFAULT;\n const {\n insetBlockEnd: triggerBlockEnd,\n insetBlockStart: triggerBlockStart,\n insetInlineStart: triggerInlineStart,\n insetInlineEnd: triggerInlineEnd,\n } = getLogicalBoundingClientRect(trigger);\n\n return overflowParents.reduce(\n ({ blockStart, blockEnd, inlineStart, inlineEnd }, overflowParent) => {\n const currentBlockStart = triggerBlockEnd - overflowParent.insetBlockStart - AVAILABLE_SPACE_RESERVE_VERTICAL;\n const currentBlockEnd =\n overflowParent.blockSize -\n triggerBlockStart +\n overflowParent.insetBlockStart -\n AVAILABLE_SPACE_RESERVE_VERTICAL;\n const currentInlineStart =\n triggerInlineStart - overflowParent.insetInlineStart - AVAILABLE_SPACE_RESERVE_HORIZONTAL;\n const currentInlineEnd =\n overflowParent.insetInlineStart +\n overflowParent.inlineSize -\n triggerInlineEnd -\n AVAILABLE_SPACE_RESERVE_HORIZONTAL;\n\n return {\n blockStart: Math.min(blockStart, currentBlockStart),\n blockEnd: Math.min(blockEnd, currentBlockEnd),\n inlineStart: Math.min(inlineStart, currentInlineStart),\n inlineEnd: Math.min(inlineEnd, currentInlineEnd),\n };\n },\n {\n blockStart: Number.MAX_VALUE,\n blockEnd: Number.MAX_VALUE,\n inlineStart: Number.MAX_VALUE,\n inlineEnd: Number.MAX_VALUE,\n }\n );\n};\n\nexport const getWidths = ({\n triggerElement,\n dropdownElement,\n desiredMinWidth,\n stretchBeyondTriggerWidth = false,\n}: {\n triggerElement: HTMLElement;\n dropdownElement: HTMLElement;\n desiredMinWidth?: number;\n stretchBeyondTriggerWidth?: boolean;\n}) => {\n // Determine the width of the trigger\n const { inlineSize: triggerInlineSize } = getLogicalBoundingClientRect(triggerElement);\n // Minimum width is determined by either an explicit number (desiredMinWidth) or the trigger width\n const minWidth = desiredMinWidth ? Math.min(triggerInlineSize, desiredMinWidth) : triggerInlineSize;\n // If stretchBeyondTriggerWidth is true, the maximum width is the XS breakpoint (465px) or the trigger width (if bigger).\n const maxWidth = stretchBeyondTriggerWidth ? Math.max(defaultMaxDropdownWidth, triggerInlineSize) : Number.MAX_VALUE;\n // Determine the actual dropdown width, the size that it \"wants\" to be\n const { inlineSize: requiredWidth } = getLogicalBoundingClientRect(dropdownElement);\n // Try to achieve the required/desired width within the given parameters\n const idealWidth = Math.min(Math.max(requiredWidth, minWidth), maxWidth);\n return { idealWidth, minWidth, triggerInlineSize };\n};\n\nexport const hasEnoughSpaceToStretchBeyondTriggerWidth = ({\n triggerElement,\n dropdownElement,\n desiredMinWidth,\n expandToViewport,\n stretchWidth,\n stretchHeight,\n isMobile,\n}: {\n triggerElement: HTMLElement;\n dropdownElement: HTMLElement;\n desiredMinWidth?: number;\n expandToViewport: boolean;\n stretchWidth: boolean;\n stretchHeight: boolean;\n isMobile: boolean;\n}) => {\n const overflowParents = getOverflowParentDimensions({\n element: dropdownElement,\n excludeClosestParent: false,\n expandToViewport,\n canExpandOutsideViewport: stretchHeight,\n });\n const { idealWidth } = getWidths({\n triggerElement: triggerElement,\n dropdownElement,\n desiredMinWidth,\n stretchBeyondTriggerWidth: true,\n });\n const availableSpace = getAvailableSpace({\n trigger: triggerElement,\n overflowParents,\n stretchWidth,\n stretchHeight,\n isMobile,\n });\n return idealWidth <= availableSpace.inlineStart || idealWidth <= availableSpace.inlineEnd;\n};\n\nexport const getDropdownPosition = ({\n triggerElement,\n dropdownElement,\n overflowParents,\n minWidth: desiredMinWidth,\n preferCenter = false,\n stretchWidth = false,\n stretchHeight = false,\n isMobile = false,\n stretchBeyondTriggerWidth = false,\n}: {\n triggerElement: HTMLElement;\n dropdownElement: HTMLElement;\n overflowParents: ReadonlyArray;\n minWidth?: number;\n preferCenter?: boolean;\n stretchWidth?: boolean;\n stretchHeight?: boolean;\n isMobile?: boolean;\n stretchBeyondTriggerWidth?: boolean;\n}): DropdownPosition => {\n // Determine the space available around the dropdown that it can grow in\n const availableSpace = getAvailableSpace({\n trigger: triggerElement,\n overflowParents,\n stretchWidth,\n stretchHeight,\n isMobile,\n });\n const { idealWidth, minWidth, triggerInlineSize } = getWidths({\n triggerElement,\n dropdownElement,\n desiredMinWidth,\n stretchBeyondTriggerWidth,\n });\n\n let dropInlineStart: boolean;\n let insetInlineStart: number | null = null;\n let inlineSize = idealWidth;\n\n //1. Can it be positioned with ideal width to the right?\n if (idealWidth <= availableSpace.inlineEnd) {\n dropInlineStart = false;\n //2. Can it be positioned with ideal width to the left?\n } else if (idealWidth <= availableSpace.inlineStart) {\n dropInlineStart = true;\n //3. Fit into biggest available space either on left or right\n } else {\n dropInlineStart = availableSpace.inlineStart > availableSpace.inlineEnd;\n inlineSize = Math.max(availableSpace.inlineStart, availableSpace.inlineEnd, minWidth);\n }\n\n if (preferCenter) {\n const spillOver = (idealWidth - triggerInlineSize) / 2;\n\n // availableSpace always includes the trigger width, but we want to exclude that\n const availableOutsideLeft = availableSpace.inlineStart - triggerInlineSize;\n const availableOutsideRight = availableSpace.inlineEnd - triggerInlineSize;\n\n const fitsInCenter = availableOutsideLeft >= spillOver && availableOutsideRight >= spillOver;\n if (fitsInCenter) {\n insetInlineStart = -spillOver;\n }\n }\n\n const dropBlockStart =\n availableSpace.blockEnd < dropdownElement.offsetHeight && availableSpace.blockStart > availableSpace.blockEnd;\n const availableHeight = dropBlockStart ? availableSpace.blockStart : availableSpace.blockEnd;\n // Try and crop the bottom item when all options can't be displayed, affordance for \"there's more\"\n const croppedHeight = stretchHeight ? availableHeight : Math.floor(availableHeight / 31) * 31 + 16;\n\n return {\n dropBlockStart,\n dropInlineStart,\n insetInlineStart: insetInlineStart === null ? 'auto' : `${insetInlineStart}px`,\n blockSize: `${croppedHeight}px`,\n inlineSize: `${inlineSize}px`,\n };\n};\n\nexport const getInteriorDropdownPosition = (\n trigger: HTMLElement,\n dropdown: HTMLElement,\n overflowParents: ReadonlyArray,\n isMobile?: boolean\n): InteriorDropdownPosition => {\n const availableSpace = getInteriorAvailableSpace({ trigger, overflowParents, isMobile });\n const {\n insetBlockEnd: triggerBlockEnd,\n insetBlockStart: triggerBlockStart,\n inlineSize: triggerInlineSize,\n } = getLogicalBoundingClientRect(trigger);\n const { insetBlockStart: parentDropdownBlockStart, blockSize: parentDropdownHeight } =\n getClosestParentDimensions(trigger);\n\n let dropInlineStart;\n\n let { inlineSize } = getLogicalBoundingClientRect(dropdown);\n const insetBlockStart = triggerBlockStart - parentDropdownBlockStart;\n if (inlineSize <= availableSpace.inlineEnd) {\n dropInlineStart = false;\n } else if (inlineSize <= availableSpace.inlineStart) {\n dropInlineStart = true;\n } else {\n dropInlineStart = availableSpace.inlineStart > availableSpace.inlineEnd;\n inlineSize = Math.max(availableSpace.inlineStart, availableSpace.inlineEnd);\n }\n\n const insetInlineStart = dropInlineStart ? 0 - inlineSize : triggerInlineSize;\n\n const dropBlockStart =\n availableSpace.blockEnd < dropdown.offsetHeight && availableSpace.blockStart > availableSpace.blockEnd;\n const insetBlockEnd = dropBlockStart ? parentDropdownBlockStart + parentDropdownHeight - triggerBlockEnd : 0;\n const availableHeight = dropBlockStart ? availableSpace.blockStart : availableSpace.blockEnd;\n // Try and crop the bottom item when all options can't be displayed, affordance for \"there's more\"\n const croppedHeight = Math.floor(availableHeight / 31) * 31 + 16;\n\n return {\n dropBlockStart,\n dropInlineStart,\n blockSize: `${croppedHeight}px`,\n inlineSize: `${inlineSize}px`,\n insetBlockStart: `${insetBlockStart}px`,\n insetBlockEnd: `${insetBlockEnd}px`,\n insetInlineStart: `${insetInlineStart}px`,\n };\n};\n\nexport const calculatePosition = (\n dropdownElement: HTMLDivElement,\n triggerElement: HTMLDivElement,\n verticalContainerElement: HTMLDivElement,\n interior: boolean,\n expandToViewport: boolean,\n preferCenter: boolean,\n stretchWidth: boolean,\n stretchHeight: boolean,\n isMobile: boolean,\n minWidth?: number,\n stretchBeyondTriggerWidth?: boolean\n): [DropdownPosition, DOMRect] => {\n // cleaning previously assigned values,\n // so that they are not reused in case of screen resize and similar events\n verticalContainerElement.style.maxBlockSize = '';\n dropdownElement.style.inlineSize = '';\n dropdownElement.style.insetBlockStart = '';\n dropdownElement.style.insetBlockEnd = '';\n dropdownElement.style.insetInlineStart = '';\n\n dropdownElement.classList.remove(styles['dropdown-drop-left']);\n dropdownElement.classList.remove(styles['dropdown-drop-right']);\n dropdownElement.classList.remove(styles['dropdown-drop-up']);\n\n const overflowParents = getOverflowParentDimensions({\n element: dropdownElement,\n excludeClosestParent: interior,\n expandToViewport,\n canExpandOutsideViewport: stretchHeight,\n });\n const position = interior\n ? getInteriorDropdownPosition(triggerElement, dropdownElement, overflowParents, isMobile)\n : getDropdownPosition({\n triggerElement,\n dropdownElement,\n overflowParents,\n minWidth,\n preferCenter,\n stretchWidth,\n stretchHeight,\n isMobile,\n stretchBeyondTriggerWidth,\n });\n const triggerBox = triggerElement.getBoundingClientRect();\n return [position, triggerBox];\n};\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useState } from 'react';\nimport { MutableRefObject, useCallback, useRef } from 'react';\nimport {\n Transition as ReactTransitionGroupTransition,\n TransitionStatus as ReactTransitionGroupTransitionStatus,\n} from 'react-transition-group';\nimport { useReducedMotion } from '@cloudscape-design/component-toolkit/internal';\n\nexport type TransitionStatus = ReactTransitionGroupTransitionStatus | 'enter' | 'exit';\n\nexport interface TransitionProps {\n in: boolean;\n exit?: boolean;\n\n disabled?: boolean;\n\n children: (state: TransitionStatus, transitioningElementRef: MutableRefObject) => React.ReactNode;\n onStatusChange?: (status: TransitionStatus) => void;\n transitionChangeDelay?: { entering?: number };\n}\n\n/**\n * This component is a wrapper around the CSSTransition component.\n *\n * It provides a second parameter in its rendering function that must be\n * attached to the node that is transitioning.\n */\nexport function Transition({\n in: isIn,\n children,\n exit = true,\n onStatusChange = () => void 0,\n disabled = false,\n transitionChangeDelay,\n ...rest\n}: TransitionProps) {\n const transitionRootElement = useRef(null);\n // the initial state of the transition should be either 'exited' or 'entered' depending\n // on the `in` property, this mimicks how internally the Transition component works here:\n // https://github.com/reactjs/react-transition-group/blob/6cbd6aaedaf8e9472007640b429ddb48c6c24158/src/Transition.js#L121\n const [transitionState, setTransitionState] = useState(isIn ? 'entered' : 'exited');\n const motionDisabled = useReducedMotion(transitionRootElement) || disabled;\n\n const addTransitionEndListener = useCallback((done: () => void) => {\n const node = transitionRootElement.current;\n\n if (node === null) {\n return;\n }\n const listener = (e: TransitionEvent | AnimationEvent) => {\n if (e.target === node) {\n node.removeEventListener('transitionend', listener);\n node.removeEventListener('animationend', listener);\n done();\n }\n };\n node.addEventListener('transitionend', listener);\n node.addEventListener('animationend', listener);\n }, []);\n\n return (\n {\n if (!isAppearing) {\n setTransitionState('enter');\n onStatusChange('enter');\n }\n }}\n onEntering={isAppearing => {\n if (!isAppearing) {\n // This line forces the browser to recalculate the layout because we want the starting state in the 'enter' style\n // to be applied before the animation starts.\n void transitionRootElement.current?.offsetHeight;\n\n if (transitionChangeDelay?.entering) {\n setTimeout(() => {\n setTransitionState('entering');\n onStatusChange('entering');\n }, transitionChangeDelay?.entering);\n } else {\n setTransitionState('entering');\n onStatusChange('entering');\n }\n }\n }}\n onEntered={isAppearing => {\n if (!isAppearing) {\n setTransitionState('entered');\n onStatusChange('entered');\n }\n }}\n onExit={() => {\n setTransitionState('exit');\n onStatusChange('exit');\n }}\n onExiting={() => {\n setTransitionState('exiting');\n onStatusChange('exiting');\n }}\n onExited={() => {\n setTransitionState('exited');\n onStatusChange('exited');\n }}\n {...rest}\n >\n {() => children(transitionState, transitionRootElement)}\n \n );\n}\n", "export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}", "export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}", "import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}", "import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport PropTypes from 'prop-types';\nimport addOneClass from 'dom-helpers/addClass';\nimport removeOneClass from 'dom-helpers/removeClass';\nimport React from 'react';\nimport Transition from './Transition';\nimport { classNamesShape } from './utils/PropTypes';\nimport { forceReflow } from './utils/reflow';\n\nvar _addClass = function addClass(node, classes) {\n return node && classes && classes.split(' ').forEach(function (c) {\n return addOneClass(node, c);\n });\n};\n\nvar removeClass = function removeClass(node, classes) {\n return node && classes && classes.split(' ').forEach(function (c) {\n return removeOneClass(node, c);\n });\n};\n/**\n * A transition component inspired by the excellent\n * [ng-animate](https://docs.angularjs.org/api/ngAnimate) library, you should\n * use it if you're using CSS transitions or animations. It's built upon the\n * [`Transition`](https://reactcommunity.org/react-transition-group/transition)\n * component, so it inherits all of its props.\n *\n * `CSSTransition` applies a pair of class names during the `appear`, `enter`,\n * and `exit` states of the transition. The first class is applied and then a\n * second `*-active` class in order to activate the CSS transition. After the\n * transition, matching `*-done` class names are applied to persist the\n * transition state.\n *\n * ```jsx\n * function App() {\n * const [inProp, setInProp] = useState(false);\n * return (\n *
    \n * \n *
    \n * {\"I'll receive my-node-* classes\"}\n *
    \n *
    \n * \n *
    \n * );\n * }\n * ```\n *\n * When the `in` prop is set to `true`, the child component will first receive\n * the class `example-enter`, then the `example-enter-active` will be added in\n * the next tick. `CSSTransition` [forces a\n * reflow](https://github.com/reactjs/react-transition-group/blob/5007303e729a74be66a21c3e2205e4916821524b/src/CSSTransition.js#L208-L215)\n * between before adding the `example-enter-active`. This is an important trick\n * because it allows us to transition between `example-enter` and\n * `example-enter-active` even though they were added immediately one after\n * another. Most notably, this is what makes it possible for us to animate\n * _appearance_.\n *\n * ```css\n * .my-node-enter {\n * opacity: 0;\n * }\n * .my-node-enter-active {\n * opacity: 1;\n * transition: opacity 200ms;\n * }\n * .my-node-exit {\n * opacity: 1;\n * }\n * .my-node-exit-active {\n * opacity: 0;\n * transition: opacity 200ms;\n * }\n * ```\n *\n * `*-active` classes represent which styles you want to animate **to**, so it's\n * important to add `transition` declaration only to them, otherwise transitions\n * might not behave as intended! This might not be obvious when the transitions\n * are symmetrical, i.e. when `*-enter-active` is the same as `*-exit`, like in\n * the example above (minus `transition`), but it becomes apparent in more\n * complex transitions.\n *\n * **Note**: If you're using the\n * [`appear`](http://reactcommunity.org/react-transition-group/transition#Transition-prop-appear)\n * prop, make sure to define styles for `.appear-*` classes as well.\n */\n\n\nvar CSSTransition = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(CSSTransition, _React$Component);\n\n function CSSTransition() {\n var _this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n _this.appliedClasses = {\n appear: {},\n enter: {},\n exit: {}\n };\n\n _this.onEnter = function (maybeNode, maybeAppearing) {\n var _this$resolveArgument = _this.resolveArguments(maybeNode, maybeAppearing),\n node = _this$resolveArgument[0],\n appearing = _this$resolveArgument[1];\n\n _this.removeClasses(node, 'exit');\n\n _this.addClass(node, appearing ? 'appear' : 'enter', 'base');\n\n if (_this.props.onEnter) {\n _this.props.onEnter(maybeNode, maybeAppearing);\n }\n };\n\n _this.onEntering = function (maybeNode, maybeAppearing) {\n var _this$resolveArgument2 = _this.resolveArguments(maybeNode, maybeAppearing),\n node = _this$resolveArgument2[0],\n appearing = _this$resolveArgument2[1];\n\n var type = appearing ? 'appear' : 'enter';\n\n _this.addClass(node, type, 'active');\n\n if (_this.props.onEntering) {\n _this.props.onEntering(maybeNode, maybeAppearing);\n }\n };\n\n _this.onEntered = function (maybeNode, maybeAppearing) {\n var _this$resolveArgument3 = _this.resolveArguments(maybeNode, maybeAppearing),\n node = _this$resolveArgument3[0],\n appearing = _this$resolveArgument3[1];\n\n var type = appearing ? 'appear' : 'enter';\n\n _this.removeClasses(node, type);\n\n _this.addClass(node, type, 'done');\n\n if (_this.props.onEntered) {\n _this.props.onEntered(maybeNode, maybeAppearing);\n }\n };\n\n _this.onExit = function (maybeNode) {\n var _this$resolveArgument4 = _this.resolveArguments(maybeNode),\n node = _this$resolveArgument4[0];\n\n _this.removeClasses(node, 'appear');\n\n _this.removeClasses(node, 'enter');\n\n _this.addClass(node, 'exit', 'base');\n\n if (_this.props.onExit) {\n _this.props.onExit(maybeNode);\n }\n };\n\n _this.onExiting = function (maybeNode) {\n var _this$resolveArgument5 = _this.resolveArguments(maybeNode),\n node = _this$resolveArgument5[0];\n\n _this.addClass(node, 'exit', 'active');\n\n if (_this.props.onExiting) {\n _this.props.onExiting(maybeNode);\n }\n };\n\n _this.onExited = function (maybeNode) {\n var _this$resolveArgument6 = _this.resolveArguments(maybeNode),\n node = _this$resolveArgument6[0];\n\n _this.removeClasses(node, 'exit');\n\n _this.addClass(node, 'exit', 'done');\n\n if (_this.props.onExited) {\n _this.props.onExited(maybeNode);\n }\n };\n\n _this.resolveArguments = function (maybeNode, maybeAppearing) {\n return _this.props.nodeRef ? [_this.props.nodeRef.current, maybeNode] // here `maybeNode` is actually `appearing`\n : [maybeNode, maybeAppearing];\n };\n\n _this.getClassNames = function (type) {\n var classNames = _this.props.classNames;\n var isStringClassNames = typeof classNames === 'string';\n var prefix = isStringClassNames && classNames ? classNames + \"-\" : '';\n var baseClassName = isStringClassNames ? \"\" + prefix + type : classNames[type];\n var activeClassName = isStringClassNames ? baseClassName + \"-active\" : classNames[type + \"Active\"];\n var doneClassName = isStringClassNames ? baseClassName + \"-done\" : classNames[type + \"Done\"];\n return {\n baseClassName: baseClassName,\n activeClassName: activeClassName,\n doneClassName: doneClassName\n };\n };\n\n return _this;\n }\n\n var _proto = CSSTransition.prototype;\n\n _proto.addClass = function addClass(node, type, phase) {\n var className = this.getClassNames(type)[phase + \"ClassName\"];\n\n var _this$getClassNames = this.getClassNames('enter'),\n doneClassName = _this$getClassNames.doneClassName;\n\n if (type === 'appear' && phase === 'done' && doneClassName) {\n className += \" \" + doneClassName;\n } // This is to force a repaint,\n // which is necessary in order to transition styles when adding a class name.\n\n\n if (phase === 'active') {\n if (node) forceReflow(node);\n }\n\n if (className) {\n this.appliedClasses[type][phase] = className;\n\n _addClass(node, className);\n }\n };\n\n _proto.removeClasses = function removeClasses(node, type) {\n var _this$appliedClasses$ = this.appliedClasses[type],\n baseClassName = _this$appliedClasses$.base,\n activeClassName = _this$appliedClasses$.active,\n doneClassName = _this$appliedClasses$.done;\n this.appliedClasses[type] = {};\n\n if (baseClassName) {\n removeClass(node, baseClassName);\n }\n\n if (activeClassName) {\n removeClass(node, activeClassName);\n }\n\n if (doneClassName) {\n removeClass(node, doneClassName);\n }\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n _ = _this$props.classNames,\n props = _objectWithoutPropertiesLoose(_this$props, [\"classNames\"]);\n\n return /*#__PURE__*/React.createElement(Transition, _extends({}, props, {\n onEnter: this.onEnter,\n onEntered: this.onEntered,\n onEntering: this.onEntering,\n onExit: this.onExit,\n onExiting: this.onExiting,\n onExited: this.onExited\n }));\n };\n\n return CSSTransition;\n}(React.Component);\n\nCSSTransition.defaultProps = {\n classNames: ''\n};\nCSSTransition.propTypes = process.env.NODE_ENV !== \"production\" ? _extends({}, Transition.propTypes, {\n /**\n * The animation classNames applied to the component as it appears, enters,\n * exits or has finished the transition. A single name can be provided, which\n * will be suffixed for each stage, e.g. `classNames=\"fade\"` applies:\n *\n * - `fade-appear`, `fade-appear-active`, `fade-appear-done`\n * - `fade-enter`, `fade-enter-active`, `fade-enter-done`\n * - `fade-exit`, `fade-exit-active`, `fade-exit-done`\n *\n * A few details to note about how these classes are applied:\n *\n * 1. They are _joined_ with the ones that are already defined on the child\n * component, so if you want to add some base styles, you can use\n * `className` without worrying that it will be overridden.\n *\n * 2. If the transition component mounts with `in={false}`, no classes are\n * applied yet. You might be expecting `*-exit-done`, but if you think\n * about it, a component cannot finish exiting if it hasn't entered yet.\n *\n * 2. `fade-appear-done` and `fade-enter-done` will _both_ be applied. This\n * allows you to define different behavior for when appearing is done and\n * when regular entering is done, using selectors like\n * `.fade-enter-done:not(.fade-appear-done)`. For example, you could apply\n * an epic entrance animation when element first appears in the DOM using\n * [Animate.css](https://daneden.github.io/animate.css/). Otherwise you can\n * simply use `fade-enter-done` for defining both cases.\n *\n * Each individual classNames can also be specified independently like:\n *\n * ```js\n * classNames={{\n * appear: 'my-appear',\n * appearActive: 'my-active-appear',\n * appearDone: 'my-done-appear',\n * enter: 'my-enter',\n * enterActive: 'my-active-enter',\n * enterDone: 'my-done-enter',\n * exit: 'my-exit',\n * exitActive: 'my-active-exit',\n * exitDone: 'my-done-exit',\n * }}\n * ```\n *\n * If you want to set these classes using CSS Modules:\n *\n * ```js\n * import styles from './styles.css';\n * ```\n *\n * you might want to use camelCase in your CSS file, that way could simply\n * spread them instead of listing them one by one:\n *\n * ```js\n * classNames={{ ...styles }}\n * ```\n *\n * @type {string | {\n * appear?: string,\n * appearActive?: string,\n * appearDone?: string,\n * enter?: string,\n * enterActive?: string,\n * enterDone?: string,\n * exit?: string,\n * exitActive?: string,\n * exitDone?: string,\n * }}\n */\n classNames: classNamesShape,\n\n /**\n * A `` callback fired immediately after the 'enter' or 'appear' class is\n * applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEnter: PropTypes.func,\n\n /**\n * A `` callback fired immediately after the 'enter-active' or\n * 'appear-active' class is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEntering: PropTypes.func,\n\n /**\n * A `` callback fired immediately after the 'enter' or\n * 'appear' classes are **removed** and the `done` class is added to the DOM node.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEntered: PropTypes.func,\n\n /**\n * A `` callback fired immediately after the 'exit' class is\n * applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed\n *\n * @type Function(node: HtmlElement)\n */\n onExit: PropTypes.func,\n\n /**\n * A `` callback fired immediately after the 'exit-active' is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed\n *\n * @type Function(node: HtmlElement)\n */\n onExiting: PropTypes.func,\n\n /**\n * A `` callback fired immediately after the 'exit' classes\n * are **removed** and the `exit-done` class is added to the DOM node.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed\n *\n * @type Function(node: HtmlElement)\n */\n onExited: PropTypes.func\n}) : {};\nexport default CSSTransition;", "/**\n * Checks if a given element has a CSS class.\n * \n * @param element the element\n * @param className the CSS class name\n */\nexport default function hasClass(element, className) {\n if (element.classList) return !!className && element.classList.contains(className);\n return (\" \" + (element.className.baseVal || element.className) + \" \").indexOf(\" \" + className + \" \") !== -1;\n}", "import hasClass from './hasClass';\n/**\n * Adds a CSS class to a given element.\n * \n * @param element the element\n * @param className the CSS class name\n */\n\nexport default function addClass(element, className) {\n if (element.classList) element.classList.add(className);else if (!hasClass(element, className)) if (typeof element.className === 'string') element.className = element.className + \" \" + className;else element.setAttribute('class', (element.className && element.className.baseVal || '') + \" \" + className);\n}", "function replaceClassName(origClass, classToRemove) {\n return origClass.replace(new RegExp(\"(^|\\\\s)\" + classToRemove + \"(?:\\\\s|$)\", 'g'), '$1').replace(/\\s+/g, ' ').replace(/^\\s*|\\s*$/g, '');\n}\n/**\n * Removes a CSS class from a given element.\n * \n * @param element the element\n * @param className the CSS class name\n */\n\n\nexport default function removeClass(element, className) {\n if (element.classList) {\n element.classList.remove(className);\n } else if (typeof element.className === 'string') {\n element.className = replaceClassName(element.className, className);\n } else {\n element.setAttribute('class', replaceClassName(element.className && element.className.baseVal || '', className));\n }\n}", "import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport config from './config';\nimport { timeoutsShape } from './utils/PropTypes';\nimport TransitionGroupContext from './TransitionGroupContext';\nimport { forceReflow } from './utils/reflow';\nexport var UNMOUNTED = 'unmounted';\nexport var EXITED = 'exited';\nexport var ENTERING = 'entering';\nexport var ENTERED = 'entered';\nexport var EXITING = 'exiting';\n/**\n * The Transition component lets you describe a transition from one component\n * state to another _over time_ with a simple declarative API. Most commonly\n * it's used to animate the mounting and unmounting of a component, but can also\n * be used to describe in-place transition states as well.\n *\n * ---\n *\n * **Note**: `Transition` is a platform-agnostic base component. If you're using\n * transitions in CSS, you'll probably want to use\n * [`CSSTransition`](https://reactcommunity.org/react-transition-group/css-transition)\n * instead. It inherits all the features of `Transition`, but contains\n * additional features necessary to play nice with CSS transitions (hence the\n * name of the component).\n *\n * ---\n *\n * By default the `Transition` component does not alter the behavior of the\n * component it renders, it only tracks \"enter\" and \"exit\" states for the\n * components. It's up to you to give meaning and effect to those states. For\n * example we can add styles to a component when it enters or exits:\n *\n * ```jsx\n * import { Transition } from 'react-transition-group';\n *\n * const duration = 300;\n *\n * const defaultStyle = {\n * transition: `opacity ${duration}ms ease-in-out`,\n * opacity: 0,\n * }\n *\n * const transitionStyles = {\n * entering: { opacity: 1 },\n * entered: { opacity: 1 },\n * exiting: { opacity: 0 },\n * exited: { opacity: 0 },\n * };\n *\n * const Fade = ({ in: inProp }) => (\n * \n * {state => (\n *
    \n * I'm a fade Transition!\n *
    \n * )}\n *
    \n * );\n * ```\n *\n * There are 4 main states a Transition can be in:\n * - `'entering'`\n * - `'entered'`\n * - `'exiting'`\n * - `'exited'`\n *\n * Transition state is toggled via the `in` prop. When `true` the component\n * begins the \"Enter\" stage. During this stage, the component will shift from\n * its current transition state, to `'entering'` for the duration of the\n * transition and then to the `'entered'` stage once it's complete. Let's take\n * the following example (we'll use the\n * [useState](https://reactjs.org/docs/hooks-reference.html#usestate) hook):\n *\n * ```jsx\n * function App() {\n * const [inProp, setInProp] = useState(false);\n * return (\n *
    \n * \n * {state => (\n * // ...\n * )}\n * \n * \n *
    \n * );\n * }\n * ```\n *\n * When the button is clicked the component will shift to the `'entering'` state\n * and stay there for 500ms (the value of `timeout`) before it finally switches\n * to `'entered'`.\n *\n * When `in` is `false` the same thing happens except the state moves from\n * `'exiting'` to `'exited'`.\n */\n\nvar Transition = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(Transition, _React$Component);\n\n function Transition(props, context) {\n var _this;\n\n _this = _React$Component.call(this, props, context) || this;\n var parentGroup = context; // In the context of a TransitionGroup all enters are really appears\n\n var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear;\n var initialStatus;\n _this.appearStatus = null;\n\n if (props.in) {\n if (appear) {\n initialStatus = EXITED;\n _this.appearStatus = ENTERING;\n } else {\n initialStatus = ENTERED;\n }\n } else {\n if (props.unmountOnExit || props.mountOnEnter) {\n initialStatus = UNMOUNTED;\n } else {\n initialStatus = EXITED;\n }\n }\n\n _this.state = {\n status: initialStatus\n };\n _this.nextCallback = null;\n return _this;\n }\n\n Transition.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {\n var nextIn = _ref.in;\n\n if (nextIn && prevState.status === UNMOUNTED) {\n return {\n status: EXITED\n };\n }\n\n return null;\n } // getSnapshotBeforeUpdate(prevProps) {\n // let nextStatus = null\n // if (prevProps !== this.props) {\n // const { status } = this.state\n // if (this.props.in) {\n // if (status !== ENTERING && status !== ENTERED) {\n // nextStatus = ENTERING\n // }\n // } else {\n // if (status === ENTERING || status === ENTERED) {\n // nextStatus = EXITING\n // }\n // }\n // }\n // return { nextStatus }\n // }\n ;\n\n var _proto = Transition.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n this.updateStatus(true, this.appearStatus);\n };\n\n _proto.componentDidUpdate = function componentDidUpdate(prevProps) {\n var nextStatus = null;\n\n if (prevProps !== this.props) {\n var status = this.state.status;\n\n if (this.props.in) {\n if (status !== ENTERING && status !== ENTERED) {\n nextStatus = ENTERING;\n }\n } else {\n if (status === ENTERING || status === ENTERED) {\n nextStatus = EXITING;\n }\n }\n }\n\n this.updateStatus(false, nextStatus);\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.cancelNextCallback();\n };\n\n _proto.getTimeouts = function getTimeouts() {\n var timeout = this.props.timeout;\n var exit, enter, appear;\n exit = enter = appear = timeout;\n\n if (timeout != null && typeof timeout !== 'number') {\n exit = timeout.exit;\n enter = timeout.enter; // TODO: remove fallback for next major\n\n appear = timeout.appear !== undefined ? timeout.appear : enter;\n }\n\n return {\n exit: exit,\n enter: enter,\n appear: appear\n };\n };\n\n _proto.updateStatus = function updateStatus(mounting, nextStatus) {\n if (mounting === void 0) {\n mounting = false;\n }\n\n if (nextStatus !== null) {\n // nextStatus will always be ENTERING or EXITING.\n this.cancelNextCallback();\n\n if (nextStatus === ENTERING) {\n if (this.props.unmountOnExit || this.props.mountOnEnter) {\n var node = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM.findDOMNode(this); // https://github.com/reactjs/react-transition-group/pull/749\n // With unmountOnExit or mountOnEnter, the enter animation should happen at the transition between `exited` and `entering`.\n // To make the animation happen, we have to separate each rendering and avoid being processed as batched.\n\n if (node) forceReflow(node);\n }\n\n this.performEnter(mounting);\n } else {\n this.performExit();\n }\n } else if (this.props.unmountOnExit && this.state.status === EXITED) {\n this.setState({\n status: UNMOUNTED\n });\n }\n };\n\n _proto.performEnter = function performEnter(mounting) {\n var _this2 = this;\n\n var enter = this.props.enter;\n var appearing = this.context ? this.context.isMounting : mounting;\n\n var _ref2 = this.props.nodeRef ? [appearing] : [ReactDOM.findDOMNode(this), appearing],\n maybeNode = _ref2[0],\n maybeAppearing = _ref2[1];\n\n var timeouts = this.getTimeouts();\n var enterTimeout = appearing ? timeouts.appear : timeouts.enter; // no enter animation skip right to ENTERED\n // if we are mounting and running this it means appear _must_ be set\n\n if (!mounting && !enter || config.disabled) {\n this.safeSetState({\n status: ENTERED\n }, function () {\n _this2.props.onEntered(maybeNode);\n });\n return;\n }\n\n this.props.onEnter(maybeNode, maybeAppearing);\n this.safeSetState({\n status: ENTERING\n }, function () {\n _this2.props.onEntering(maybeNode, maybeAppearing);\n\n _this2.onTransitionEnd(enterTimeout, function () {\n _this2.safeSetState({\n status: ENTERED\n }, function () {\n _this2.props.onEntered(maybeNode, maybeAppearing);\n });\n });\n });\n };\n\n _proto.performExit = function performExit() {\n var _this3 = this;\n\n var exit = this.props.exit;\n var timeouts = this.getTimeouts();\n var maybeNode = this.props.nodeRef ? undefined : ReactDOM.findDOMNode(this); // no exit animation skip right to EXITED\n\n if (!exit || config.disabled) {\n this.safeSetState({\n status: EXITED\n }, function () {\n _this3.props.onExited(maybeNode);\n });\n return;\n }\n\n this.props.onExit(maybeNode);\n this.safeSetState({\n status: EXITING\n }, function () {\n _this3.props.onExiting(maybeNode);\n\n _this3.onTransitionEnd(timeouts.exit, function () {\n _this3.safeSetState({\n status: EXITED\n }, function () {\n _this3.props.onExited(maybeNode);\n });\n });\n });\n };\n\n _proto.cancelNextCallback = function cancelNextCallback() {\n if (this.nextCallback !== null) {\n this.nextCallback.cancel();\n this.nextCallback = null;\n }\n };\n\n _proto.safeSetState = function safeSetState(nextState, callback) {\n // This shouldn't be necessary, but there are weird race conditions with\n // setState callbacks and unmounting in testing, so always make sure that\n // we can cancel any pending setState callbacks after we unmount.\n callback = this.setNextCallback(callback);\n this.setState(nextState, callback);\n };\n\n _proto.setNextCallback = function setNextCallback(callback) {\n var _this4 = this;\n\n var active = true;\n\n this.nextCallback = function (event) {\n if (active) {\n active = false;\n _this4.nextCallback = null;\n callback(event);\n }\n };\n\n this.nextCallback.cancel = function () {\n active = false;\n };\n\n return this.nextCallback;\n };\n\n _proto.onTransitionEnd = function onTransitionEnd(timeout, handler) {\n this.setNextCallback(handler);\n var node = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM.findDOMNode(this);\n var doesNotHaveTimeoutOrListener = timeout == null && !this.props.addEndListener;\n\n if (!node || doesNotHaveTimeoutOrListener) {\n setTimeout(this.nextCallback, 0);\n return;\n }\n\n if (this.props.addEndListener) {\n var _ref3 = this.props.nodeRef ? [this.nextCallback] : [node, this.nextCallback],\n maybeNode = _ref3[0],\n maybeNextCallback = _ref3[1];\n\n this.props.addEndListener(maybeNode, maybeNextCallback);\n }\n\n if (timeout != null) {\n setTimeout(this.nextCallback, timeout);\n }\n };\n\n _proto.render = function render() {\n var status = this.state.status;\n\n if (status === UNMOUNTED) {\n return null;\n }\n\n var _this$props = this.props,\n children = _this$props.children,\n _in = _this$props.in,\n _mountOnEnter = _this$props.mountOnEnter,\n _unmountOnExit = _this$props.unmountOnExit,\n _appear = _this$props.appear,\n _enter = _this$props.enter,\n _exit = _this$props.exit,\n _timeout = _this$props.timeout,\n _addEndListener = _this$props.addEndListener,\n _onEnter = _this$props.onEnter,\n _onEntering = _this$props.onEntering,\n _onEntered = _this$props.onEntered,\n _onExit = _this$props.onExit,\n _onExiting = _this$props.onExiting,\n _onExited = _this$props.onExited,\n _nodeRef = _this$props.nodeRef,\n childProps = _objectWithoutPropertiesLoose(_this$props, [\"children\", \"in\", \"mountOnEnter\", \"unmountOnExit\", \"appear\", \"enter\", \"exit\", \"timeout\", \"addEndListener\", \"onEnter\", \"onEntering\", \"onEntered\", \"onExit\", \"onExiting\", \"onExited\", \"nodeRef\"]);\n\n return (\n /*#__PURE__*/\n // allows for nested Transitions\n React.createElement(TransitionGroupContext.Provider, {\n value: null\n }, typeof children === 'function' ? children(status, childProps) : React.cloneElement(React.Children.only(children), childProps))\n );\n };\n\n return Transition;\n}(React.Component);\n\nTransition.contextType = TransitionGroupContext;\nTransition.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * A React reference to DOM element that need to transition:\n * https://stackoverflow.com/a/51127130/4671932\n *\n * - When `nodeRef` prop is used, `node` is not passed to callback functions\n * (e.g. `onEnter`) because user already has direct access to the node.\n * - When changing `key` prop of `Transition` in a `TransitionGroup` a new\n * `nodeRef` need to be provided to `Transition` with changed `key` prop\n * (see\n * [test/CSSTransition-test.js](https://github.com/reactjs/react-transition-group/blob/13435f897b3ab71f6e19d724f145596f5910581c/test/CSSTransition-test.js#L362-L437)).\n */\n nodeRef: PropTypes.shape({\n current: typeof Element === 'undefined' ? PropTypes.any : function (propValue, key, componentName, location, propFullName, secret) {\n var value = propValue[key];\n return PropTypes.instanceOf(value && 'ownerDocument' in value ? value.ownerDocument.defaultView.Element : Element)(propValue, key, componentName, location, propFullName, secret);\n }\n }),\n\n /**\n * A `function` child can be used instead of a React element. This function is\n * called with the current transition status (`'entering'`, `'entered'`,\n * `'exiting'`, `'exited'`), which can be used to apply context\n * specific props to a component.\n *\n * ```jsx\n * \n * {state => (\n * \n * )}\n * \n * ```\n */\n children: PropTypes.oneOfType([PropTypes.func.isRequired, PropTypes.element.isRequired]).isRequired,\n\n /**\n * Show the component; triggers the enter or exit states\n */\n in: PropTypes.bool,\n\n /**\n * By default the child component is mounted immediately along with\n * the parent `Transition` component. If you want to \"lazy mount\" the component on the\n * first `in={true}` you can set `mountOnEnter`. After the first enter transition the component will stay\n * mounted, even on \"exited\", unless you also specify `unmountOnExit`.\n */\n mountOnEnter: PropTypes.bool,\n\n /**\n * By default the child component stays mounted after it reaches the `'exited'` state.\n * Set `unmountOnExit` if you'd prefer to unmount the component after it finishes exiting.\n */\n unmountOnExit: PropTypes.bool,\n\n /**\n * By default the child component does not perform the enter transition when\n * it first mounts, regardless of the value of `in`. If you want this\n * behavior, set both `appear` and `in` to `true`.\n *\n * > **Note**: there are no special appear states like `appearing`/`appeared`, this prop\n * > only adds an additional enter transition. However, in the\n * > `` component that first enter transition does result in\n * > additional `.appear-*` classes, that way you can choose to style it\n * > differently.\n */\n appear: PropTypes.bool,\n\n /**\n * Enable or disable enter transitions.\n */\n enter: PropTypes.bool,\n\n /**\n * Enable or disable exit transitions.\n */\n exit: PropTypes.bool,\n\n /**\n * The duration of the transition, in milliseconds.\n * Required unless `addEndListener` is provided.\n *\n * You may specify a single timeout for all transitions:\n *\n * ```jsx\n * timeout={500}\n * ```\n *\n * or individually:\n *\n * ```jsx\n * timeout={{\n * appear: 500,\n * enter: 300,\n * exit: 500,\n * }}\n * ```\n *\n * - `appear` defaults to the value of `enter`\n * - `enter` defaults to `0`\n * - `exit` defaults to `0`\n *\n * @type {number | { enter?: number, exit?: number, appear?: number }}\n */\n timeout: function timeout(props) {\n var pt = timeoutsShape;\n if (!props.addEndListener) pt = pt.isRequired;\n\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n return pt.apply(void 0, [props].concat(args));\n },\n\n /**\n * Add a custom transition end trigger. Called with the transitioning\n * DOM node and a `done` callback. Allows for more fine grained transition end\n * logic. Timeouts are still used as a fallback if provided.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * ```jsx\n * addEndListener={(node, done) => {\n * // use the css transitionend event to mark the finish of a transition\n * node.addEventListener('transitionend', done, false);\n * }}\n * ```\n */\n addEndListener: PropTypes.func,\n\n /**\n * Callback fired before the \"entering\" status is applied. An extra parameter\n * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool) -> void\n */\n onEnter: PropTypes.func,\n\n /**\n * Callback fired after the \"entering\" status is applied. An extra parameter\n * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEntering: PropTypes.func,\n\n /**\n * Callback fired after the \"entered\" status is applied. An extra parameter\n * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool) -> void\n */\n onEntered: PropTypes.func,\n\n /**\n * Callback fired before the \"exiting\" status is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement) -> void\n */\n onExit: PropTypes.func,\n\n /**\n * Callback fired after the \"exiting\" status is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement) -> void\n */\n onExiting: PropTypes.func,\n\n /**\n * Callback fired after the \"exited\" status is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed\n *\n * @type Function(node: HtmlElement) -> void\n */\n onExited: PropTypes.func\n} : {}; // Name the function so it is clearer in the documentation\n\nfunction noop() {}\n\nTransition.defaultProps = {\n in: false,\n mountOnEnter: false,\n unmountOnExit: false,\n appear: false,\n enter: true,\n exit: true,\n onEnter: noop,\n onEntering: noop,\n onEntered: noop,\n onExit: noop,\n onExiting: noop,\n onExited: noop\n};\nTransition.UNMOUNTED = UNMOUNTED;\nTransition.EXITED = EXITED;\nTransition.ENTERING = ENTERING;\nTransition.ENTERED = ENTERED;\nTransition.EXITING = EXITING;\nexport default Transition;", "export default {\n disabled: false\n};", "import PropTypes from 'prop-types';\nexport var timeoutsShape = process.env.NODE_ENV !== 'production' ? PropTypes.oneOfType([PropTypes.number, PropTypes.shape({\n enter: PropTypes.number,\n exit: PropTypes.number,\n appear: PropTypes.number\n}).isRequired]) : null;\nexport var classNamesShape = process.env.NODE_ENV !== 'production' ? PropTypes.oneOfType([PropTypes.string, PropTypes.shape({\n enter: PropTypes.string,\n exit: PropTypes.string,\n active: PropTypes.string\n}), PropTypes.shape({\n enter: PropTypes.string,\n enterDone: PropTypes.string,\n enterActive: PropTypes.string,\n exit: PropTypes.string,\n exitDone: PropTypes.string,\n exitActive: PropTypes.string\n})]) : null;", "import React from 'react';\nexport default React.createContext(null);", "export var forceReflow = function forceReflow(node) {\n return node.scrollTop;\n};", "import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport TransitionGroup from './TransitionGroup';\n/**\n * The `` component is a specialized `Transition` component\n * that animates between two children.\n *\n * ```jsx\n * \n *
    I appear first
    \n *
    I replace the above
    \n *
    \n * ```\n */\n\nvar ReplaceTransition = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(ReplaceTransition, _React$Component);\n\n function ReplaceTransition() {\n var _this;\n\n for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {\n _args[_key] = arguments[_key];\n }\n\n _this = _React$Component.call.apply(_React$Component, [this].concat(_args)) || this;\n\n _this.handleEnter = function () {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n return _this.handleLifecycle('onEnter', 0, args);\n };\n\n _this.handleEntering = function () {\n for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n args[_key3] = arguments[_key3];\n }\n\n return _this.handleLifecycle('onEntering', 0, args);\n };\n\n _this.handleEntered = function () {\n for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n args[_key4] = arguments[_key4];\n }\n\n return _this.handleLifecycle('onEntered', 0, args);\n };\n\n _this.handleExit = function () {\n for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {\n args[_key5] = arguments[_key5];\n }\n\n return _this.handleLifecycle('onExit', 1, args);\n };\n\n _this.handleExiting = function () {\n for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {\n args[_key6] = arguments[_key6];\n }\n\n return _this.handleLifecycle('onExiting', 1, args);\n };\n\n _this.handleExited = function () {\n for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {\n args[_key7] = arguments[_key7];\n }\n\n return _this.handleLifecycle('onExited', 1, args);\n };\n\n return _this;\n }\n\n var _proto = ReplaceTransition.prototype;\n\n _proto.handleLifecycle = function handleLifecycle(handler, idx, originalArgs) {\n var _child$props;\n\n var children = this.props.children;\n var child = React.Children.toArray(children)[idx];\n if (child.props[handler]) (_child$props = child.props)[handler].apply(_child$props, originalArgs);\n\n if (this.props[handler]) {\n var maybeNode = child.props.nodeRef ? undefined : ReactDOM.findDOMNode(this);\n this.props[handler](maybeNode);\n }\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n children = _this$props.children,\n inProp = _this$props.in,\n props = _objectWithoutPropertiesLoose(_this$props, [\"children\", \"in\"]);\n\n var _React$Children$toArr = React.Children.toArray(children),\n first = _React$Children$toArr[0],\n second = _React$Children$toArr[1];\n\n delete props.onEnter;\n delete props.onEntering;\n delete props.onEntered;\n delete props.onExit;\n delete props.onExiting;\n delete props.onExited;\n return /*#__PURE__*/React.createElement(TransitionGroup, props, inProp ? React.cloneElement(first, {\n key: 'first',\n onEnter: this.handleEnter,\n onEntering: this.handleEntering,\n onEntered: this.handleEntered\n }) : React.cloneElement(second, {\n key: 'second',\n onEnter: this.handleExit,\n onEntering: this.handleExiting,\n onEntered: this.handleExited\n }));\n };\n\n return ReplaceTransition;\n}(React.Component);\n\nReplaceTransition.propTypes = process.env.NODE_ENV !== \"production\" ? {\n in: PropTypes.bool.isRequired,\n children: function children(props, propName) {\n if (React.Children.count(props[propName]) !== 2) return new Error(\"\\\"\" + propName + \"\\\" must be exactly two transition components.\");\n return null;\n }\n} : {};\nexport default ReplaceTransition;", "import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport TransitionGroupContext from './TransitionGroupContext';\nimport { getChildMapping, getInitialChildMapping, getNextChildMapping } from './utils/ChildMapping';\n\nvar values = Object.values || function (obj) {\n return Object.keys(obj).map(function (k) {\n return obj[k];\n });\n};\n\nvar defaultProps = {\n component: 'div',\n childFactory: function childFactory(child) {\n return child;\n }\n};\n/**\n * The `` component manages a set of transition components\n * (`` and ``) in a list. Like with the transition\n * components, `` is a state machine for managing the mounting\n * and unmounting of components over time.\n *\n * Consider the example below. As items are removed or added to the TodoList the\n * `in` prop is toggled automatically by the ``.\n *\n * Note that `` does not define any animation behavior!\n * Exactly _how_ a list item animates is up to the individual transition\n * component. This means you can mix and match animations across different list\n * items.\n */\n\nvar TransitionGroup = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(TransitionGroup, _React$Component);\n\n function TransitionGroup(props, context) {\n var _this;\n\n _this = _React$Component.call(this, props, context) || this;\n\n var handleExited = _this.handleExited.bind(_assertThisInitialized(_this)); // Initial children should all be entering, dependent on appear\n\n\n _this.state = {\n contextValue: {\n isMounting: true\n },\n handleExited: handleExited,\n firstRender: true\n };\n return _this;\n }\n\n var _proto = TransitionGroup.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n this.mounted = true;\n this.setState({\n contextValue: {\n isMounting: false\n }\n });\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.mounted = false;\n };\n\n TransitionGroup.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, _ref) {\n var prevChildMapping = _ref.children,\n handleExited = _ref.handleExited,\n firstRender = _ref.firstRender;\n return {\n children: firstRender ? getInitialChildMapping(nextProps, handleExited) : getNextChildMapping(nextProps, prevChildMapping, handleExited),\n firstRender: false\n };\n } // node is `undefined` when user provided `nodeRef` prop\n ;\n\n _proto.handleExited = function handleExited(child, node) {\n var currentChildMapping = getChildMapping(this.props.children);\n if (child.key in currentChildMapping) return;\n\n if (child.props.onExited) {\n child.props.onExited(node);\n }\n\n if (this.mounted) {\n this.setState(function (state) {\n var children = _extends({}, state.children);\n\n delete children[child.key];\n return {\n children: children\n };\n });\n }\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n Component = _this$props.component,\n childFactory = _this$props.childFactory,\n props = _objectWithoutPropertiesLoose(_this$props, [\"component\", \"childFactory\"]);\n\n var contextValue = this.state.contextValue;\n var children = values(this.state.children).map(childFactory);\n delete props.appear;\n delete props.enter;\n delete props.exit;\n\n if (Component === null) {\n return /*#__PURE__*/React.createElement(TransitionGroupContext.Provider, {\n value: contextValue\n }, children);\n }\n\n return /*#__PURE__*/React.createElement(TransitionGroupContext.Provider, {\n value: contextValue\n }, /*#__PURE__*/React.createElement(Component, props, children));\n };\n\n return TransitionGroup;\n}(React.Component);\n\nTransitionGroup.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * `` renders a `
    ` by default. You can change this\n * behavior by providing a `component` prop.\n * If you use React v16+ and would like to avoid a wrapping `
    ` element\n * you can pass in `component={null}`. This is useful if the wrapping div\n * borks your css styles.\n */\n component: PropTypes.any,\n\n /**\n * A set of `` components, that are toggled `in` and out as they\n * leave. the `` will inject specific transition props, so\n * remember to spread them through if you are wrapping the `` as\n * with our `` example.\n *\n * While this component is meant for multiple `Transition` or `CSSTransition`\n * children, sometimes you may want to have a single transition child with\n * content that you want to be transitioned out and in when you change it\n * (e.g. routes, images etc.) In that case you can change the `key` prop of\n * the transition child as you change its content, this will cause\n * `TransitionGroup` to transition the child out and back in.\n */\n children: PropTypes.node,\n\n /**\n * A convenience prop that enables or disables appear animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n appear: PropTypes.bool,\n\n /**\n * A convenience prop that enables or disables enter animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n enter: PropTypes.bool,\n\n /**\n * A convenience prop that enables or disables exit animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n exit: PropTypes.bool,\n\n /**\n * You may need to apply reactive updates to a child as it is exiting.\n * This is generally done by using `cloneElement` however in the case of an exiting\n * child the element has already been removed and not accessible to the consumer.\n *\n * If you do need to update a child as it leaves you can provide a `childFactory`\n * to wrap every child, even the ones that are leaving.\n *\n * @type Function(child: ReactElement) -> ReactElement\n */\n childFactory: PropTypes.func\n} : {};\nTransitionGroup.defaultProps = defaultProps;\nexport default TransitionGroup;", "import { Children, cloneElement, isValidElement } from 'react';\n/**\n * Given `this.props.children`, return an object mapping key to child.\n *\n * @param {*} children `this.props.children`\n * @return {object} Mapping of key to child\n */\n\nexport function getChildMapping(children, mapFn) {\n var mapper = function mapper(child) {\n return mapFn && isValidElement(child) ? mapFn(child) : child;\n };\n\n var result = Object.create(null);\n if (children) Children.map(children, function (c) {\n return c;\n }).forEach(function (child) {\n // run the map function here instead so that the key is the computed one\n result[child.key] = mapper(child);\n });\n return result;\n}\n/**\n * When you're adding or removing children some may be added or removed in the\n * same render pass. We want to show *both* since we want to simultaneously\n * animate elements in and out. This function takes a previous set of keys\n * and a new set of keys and merges them with its best guess of the correct\n * ordering. In the future we may expose some of the utilities in\n * ReactMultiChild to make this easy, but for now React itself does not\n * directly have this concept of the union of prevChildren and nextChildren\n * so we implement it here.\n *\n * @param {object} prev prev children as returned from\n * `ReactTransitionChildMapping.getChildMapping()`.\n * @param {object} next next children as returned from\n * `ReactTransitionChildMapping.getChildMapping()`.\n * @return {object} a key set that contains all keys in `prev` and all keys\n * in `next` in a reasonable order.\n */\n\nexport function mergeChildMappings(prev, next) {\n prev = prev || {};\n next = next || {};\n\n function getValueForKey(key) {\n return key in next ? next[key] : prev[key];\n } // For each key of `next`, the list of keys to insert before that key in\n // the combined list\n\n\n var nextKeysPending = Object.create(null);\n var pendingKeys = [];\n\n for (var prevKey in prev) {\n if (prevKey in next) {\n if (pendingKeys.length) {\n nextKeysPending[prevKey] = pendingKeys;\n pendingKeys = [];\n }\n } else {\n pendingKeys.push(prevKey);\n }\n }\n\n var i;\n var childMapping = {};\n\n for (var nextKey in next) {\n if (nextKeysPending[nextKey]) {\n for (i = 0; i < nextKeysPending[nextKey].length; i++) {\n var pendingNextKey = nextKeysPending[nextKey][i];\n childMapping[nextKeysPending[nextKey][i]] = getValueForKey(pendingNextKey);\n }\n }\n\n childMapping[nextKey] = getValueForKey(nextKey);\n } // Finally, add the keys which didn't appear before any key in `next`\n\n\n for (i = 0; i < pendingKeys.length; i++) {\n childMapping[pendingKeys[i]] = getValueForKey(pendingKeys[i]);\n }\n\n return childMapping;\n}\n\nfunction getProp(child, prop, props) {\n return props[prop] != null ? props[prop] : child.props[prop];\n}\n\nexport function getInitialChildMapping(props, onExited) {\n return getChildMapping(props.children, function (child) {\n return cloneElement(child, {\n onExited: onExited.bind(null, child),\n in: true,\n appear: getProp(child, 'appear', props),\n enter: getProp(child, 'enter', props),\n exit: getProp(child, 'exit', props)\n });\n });\n}\nexport function getNextChildMapping(nextProps, prevChildMapping, onExited) {\n var nextChildMapping = getChildMapping(nextProps.children);\n var children = mergeChildMappings(prevChildMapping, nextChildMapping);\n Object.keys(children).forEach(function (key) {\n var child = children[key];\n if (!isValidElement(child)) return;\n var hasPrev = (key in prevChildMapping);\n var hasNext = (key in nextChildMapping);\n var prevChild = prevChildMapping[key];\n var isLeaving = isValidElement(prevChild) && !prevChild.props.in; // item is new (entering)\n\n if (hasNext && (!hasPrev || isLeaving)) {\n // console.log('entering', key)\n children[key] = cloneElement(child, {\n onExited: onExited.bind(null, child),\n in: true,\n exit: getProp(child, 'exit', nextProps),\n enter: getProp(child, 'enter', nextProps)\n });\n } else if (!hasNext && hasPrev && !isLeaving) {\n // item is old (exiting)\n // console.log('leaving', key)\n children[key] = cloneElement(child, {\n in: false\n });\n } else if (hasNext && hasPrev && isValidElement(prevChild)) {\n // item hasn't changed transition states\n // copy over the last transition props;\n // console.log('unchanged', key)\n children[key] = cloneElement(child, {\n onExited: onExited.bind(null, child),\n in: prevChild.props.in,\n exit: getProp(child, 'exit', nextProps),\n enter: getProp(child, 'enter', nextProps)\n });\n }\n });\n return children;\n}", "import _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\n\nvar _leaveRenders, _enterRenders;\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { ENTERED, ENTERING, EXITING } from './Transition';\nimport TransitionGroupContext from './TransitionGroupContext';\n\nfunction areChildrenDifferent(oldChildren, newChildren) {\n if (oldChildren === newChildren) return false;\n\n if (React.isValidElement(oldChildren) && React.isValidElement(newChildren) && oldChildren.key != null && oldChildren.key === newChildren.key) {\n return false;\n }\n\n return true;\n}\n/**\n * Enum of modes for SwitchTransition component\n * @enum { string }\n */\n\n\nexport var modes = {\n out: 'out-in',\n in: 'in-out'\n};\n\nvar callHook = function callHook(element, name, cb) {\n return function () {\n var _element$props;\n\n element.props[name] && (_element$props = element.props)[name].apply(_element$props, arguments);\n cb();\n };\n};\n\nvar leaveRenders = (_leaveRenders = {}, _leaveRenders[modes.out] = function (_ref) {\n var current = _ref.current,\n changeState = _ref.changeState;\n return React.cloneElement(current, {\n in: false,\n onExited: callHook(current, 'onExited', function () {\n changeState(ENTERING, null);\n })\n });\n}, _leaveRenders[modes.in] = function (_ref2) {\n var current = _ref2.current,\n changeState = _ref2.changeState,\n children = _ref2.children;\n return [current, React.cloneElement(children, {\n in: true,\n onEntered: callHook(children, 'onEntered', function () {\n changeState(ENTERING);\n })\n })];\n}, _leaveRenders);\nvar enterRenders = (_enterRenders = {}, _enterRenders[modes.out] = function (_ref3) {\n var children = _ref3.children,\n changeState = _ref3.changeState;\n return React.cloneElement(children, {\n in: true,\n onEntered: callHook(children, 'onEntered', function () {\n changeState(ENTERED, React.cloneElement(children, {\n in: true\n }));\n })\n });\n}, _enterRenders[modes.in] = function (_ref4) {\n var current = _ref4.current,\n children = _ref4.children,\n changeState = _ref4.changeState;\n return [React.cloneElement(current, {\n in: false,\n onExited: callHook(current, 'onExited', function () {\n changeState(ENTERED, React.cloneElement(children, {\n in: true\n }));\n })\n }), React.cloneElement(children, {\n in: true\n })];\n}, _enterRenders);\n/**\n * A transition component inspired by the [vue transition modes](https://vuejs.org/v2/guide/transitions.html#Transition-Modes).\n * You can use it when you want to control the render between state transitions.\n * Based on the selected mode and the child's key which is the `Transition` or `CSSTransition` component, the `SwitchTransition` makes a consistent transition between them.\n *\n * If the `out-in` mode is selected, the `SwitchTransition` waits until the old child leaves and then inserts a new child.\n * If the `in-out` mode is selected, the `SwitchTransition` inserts a new child first, waits for the new child to enter and then removes the old child.\n *\n * **Note**: If you want the animation to happen simultaneously\n * (that is, to have the old child removed and a new child inserted **at the same time**),\n * you should use\n * [`TransitionGroup`](https://reactcommunity.org/react-transition-group/transition-group)\n * instead.\n *\n * ```jsx\n * function App() {\n * const [state, setState] = useState(false);\n * return (\n * \n * node.addEventListener(\"transitionend\", done, false)}\n * classNames='fade'\n * >\n * \n * \n * \n * );\n * }\n * ```\n *\n * ```css\n * .fade-enter{\n * opacity: 0;\n * }\n * .fade-exit{\n * opacity: 1;\n * }\n * .fade-enter-active{\n * opacity: 1;\n * }\n * .fade-exit-active{\n * opacity: 0;\n * }\n * .fade-enter-active,\n * .fade-exit-active{\n * transition: opacity 500ms;\n * }\n * ```\n */\n\nvar SwitchTransition = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(SwitchTransition, _React$Component);\n\n function SwitchTransition() {\n var _this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n _this.state = {\n status: ENTERED,\n current: null\n };\n _this.appeared = false;\n\n _this.changeState = function (status, current) {\n if (current === void 0) {\n current = _this.state.current;\n }\n\n _this.setState({\n status: status,\n current: current\n });\n };\n\n return _this;\n }\n\n var _proto = SwitchTransition.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n this.appeared = true;\n };\n\n SwitchTransition.getDerivedStateFromProps = function getDerivedStateFromProps(props, state) {\n if (props.children == null) {\n return {\n current: null\n };\n }\n\n if (state.status === ENTERING && props.mode === modes.in) {\n return {\n status: ENTERING\n };\n }\n\n if (state.current && areChildrenDifferent(state.current, props.children)) {\n return {\n status: EXITING\n };\n }\n\n return {\n current: React.cloneElement(props.children, {\n in: true\n })\n };\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n children = _this$props.children,\n mode = _this$props.mode,\n _this$state = this.state,\n status = _this$state.status,\n current = _this$state.current;\n var data = {\n children: children,\n current: current,\n changeState: this.changeState,\n status: status\n };\n var component;\n\n switch (status) {\n case ENTERING:\n component = enterRenders[mode](data);\n break;\n\n case EXITING:\n component = leaveRenders[mode](data);\n break;\n\n case ENTERED:\n component = current;\n }\n\n return /*#__PURE__*/React.createElement(TransitionGroupContext.Provider, {\n value: {\n isMounting: !this.appeared\n }\n }, component);\n };\n\n return SwitchTransition;\n}(React.Component);\n\nSwitchTransition.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * Transition modes.\n * `out-in`: Current element transitions out first, then when complete, the new element transitions in.\n * `in-out`: New element transitions in first, then when complete, the current element transitions out.\n *\n * @type {'out-in'|'in-out'}\n */\n mode: PropTypes.oneOf([modes.in, modes.out]),\n\n /**\n * Any `Transition` or `CSSTransition` component.\n */\n children: PropTypes.oneOfType([PropTypes.element.isRequired])\n} : {};\nSwitchTransition.defaultProps = {\n mode: modes.out\n};\nexport default SwitchTransition;", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useContext } from 'react';\n\ntype Position = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';\n\nconst DropdownContext = React.createContext<{ position: Position }>({\n position: 'bottom-right',\n});\n\nexport interface DropdownContextProviderProps {\n position?: Position;\n children?: React.ReactNode;\n}\n\nexport function DropdownContextProvider({ children, position = 'bottom-right' }: DropdownContextProviderProps) {\n return {children};\n}\n\nexport function useDropdownContext() {\n return useContext(DropdownContext);\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { ItemListProps } from './interfaces';\nimport ItemElement from './item-element';\nimport ExpandableCategoryElement from './category-elements/expandable-category-element';\nimport CategoryElement from './category-elements/category-element';\nimport { isItemGroup } from './utils/utils';\nimport { useMobile } from '../internal/hooks/use-mobile';\nimport MobileExpandableCategoryElement from './category-elements/mobile-expandable-category-element';\n\nexport default function ItemsList({\n items,\n onItemActivate,\n onGroupToggle,\n targetItem,\n isHighlighted,\n isKeyboardHighlight,\n isExpanded,\n lastInDropdown,\n highlightItem,\n categoryDisabled = false,\n hasExpandableGroups = false,\n hasCategoryHeader = false,\n expandToViewport = false,\n variant = 'normal',\n}: ItemListProps) {\n const isMobile = useMobile();\n\n const elements = items.map((item, index) => {\n if (!isItemGroup(item)) {\n const showDivider = (index === items.length - 1 && !lastInDropdown) || isItemGroup(items[index + 1]);\n\n return (\n \n );\n }\n if (hasExpandableGroups) {\n return item.text ? (\n isMobile ? (\n \n ) : (\n \n )\n ) : null;\n }\n return (\n \n );\n });\n\n return <>{elements};\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef } from 'react';\nimport clsx from 'clsx';\nimport { ItemProps } from '../interfaces';\nimport { isLinkItem } from '../utils/utils';\nimport styles from './styles.css.js';\nimport Tooltip from '../tooltip';\n\nimport { ButtonDropdownProps } from '../interfaces';\nimport { getItemTarget } from '../utils/utils';\nimport useHiddenDescription from '../utils/use-hidden-description';\nimport InternalIcon, { InternalIconProps } from '../../icon/internal';\nimport { useDropdownContext } from '../../internal/components/dropdown/context';\nimport { getMenuItemProps } from '../utils/menu-item';\n\nconst ItemElement = ({\n item,\n disabled,\n onItemActivate,\n highlighted,\n highlightItem,\n showDivider,\n hasCategoryHeader,\n isKeyboardHighlighted = false,\n variant = 'normal',\n}: ItemProps) => {\n const isLink = isLinkItem(item);\n const onClick = (event: React.MouseEvent) => {\n // Stop propagation to parent node and handle event exclusively in here. This ensures\n // that no group will interfere with the default behavior of links\n event.stopPropagation();\n if (!isLink) {\n event.preventDefault();\n }\n if (!disabled) {\n onItemActivate(item, event);\n }\n };\n\n const onHover = () => {\n highlightItem(item);\n };\n\n return (\n \n \n \n );\n};\n\nexport type InternalItemProps = ButtonDropdownProps.Item & {\n badge?: boolean;\n};\n\ninterface MenuItemProps {\n item: InternalItemProps;\n disabled: boolean;\n highlighted: boolean;\n}\n\nfunction MenuItem({ item, disabled, highlighted }: MenuItemProps) {\n const menuItemRef = useRef<(HTMLSpanElement & HTMLAnchorElement) | null>(null);\n\n useEffect(() => {\n if (highlighted && menuItemRef.current) {\n menuItemRef.current.focus();\n }\n }, [highlighted]);\n\n const isDisabledWithReason = disabled && item.disabledReason;\n const { targetProps, descriptionEl } = useHiddenDescription(item.disabledReason);\n const menuItemProps: React.HTMLAttributes = {\n className: styles['menu-item'],\n lang: item.lang,\n ref: menuItemRef,\n // We are using the roving tabindex technique to manage the focus state of the dropdown.\n // The current element will always have tabindex=0 which means that it can be tabbed to,\n // while all other items have tabindex=-1 so we can focus them when necessary.\n tabIndex: highlighted ? 0 : -1,\n ...getMenuItemProps({ disabled }),\n ...(isDisabledWithReason ? targetProps : {}),\n };\n\n const menuItem = isLinkItem(item) ? (\n \n \n \n ) : (\n \n \n \n );\n\n const { position } = useDropdownContext();\n const tooltipPosition = position === 'bottom-left' || position === 'top-left' ? 'left' : 'right';\n return isDisabledWithReason ? (\n \n {menuItem}\n {descriptionEl}\n \n ) : (\n menuItem\n );\n}\n\nconst MenuItemContent = ({ item, disabled }: { item: InternalItemProps; disabled: boolean }) => {\n const hasIcon = !!(item.iconName || item.iconUrl || item.iconSvg);\n const hasExternal = isLinkItem(item) && item.external;\n return (\n <>\n {hasIcon && (\n \n )}{' '}\n {item.text} {hasExternal && }\n \n );\n};\n\nconst MenuItemIcon = (props: InternalIconProps) => (\n \n \n \n);\n\nconst ExternalIcon = ({ disabled, ariaLabel }: { disabled: boolean; ariaLabel?: string }) => {\n const icon = ;\n return (\n \n {icon}\n \n );\n};\n\nexport default ItemElement;\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ButtonDropdownProps, LinkItem } from '../interfaces';\n\nexport const isItemGroup = (item: ButtonDropdownProps.ItemOrGroup): item is ButtonDropdownProps.ItemGroup =>\n item && (item as ButtonDropdownProps.ItemGroup).items !== undefined;\n\nexport const isLinkItem = (item: LinkItem | ButtonDropdownProps.ItemOrGroup): item is LinkItem =>\n item && (item as LinkItem).href !== undefined;\n\nexport const getItemTarget = (item: ButtonDropdownProps.Item) => (item.external ? '_blank' : undefined);\n\nexport function indexIncludes(source: number[], target: number[]) {\n for (let index = 0; index < source.length; index++) {\n if (source[index] !== target[index]) {\n return false;\n }\n }\n\n return true;\n}\n\nexport function indexEquals(left: number[], right: number[]) {\n if (left.length !== right.length) {\n return false;\n }\n\n for (let index = 0; index < left.length; index++) {\n if (left[index] !== right[index]) {\n return false;\n }\n }\n\n return true;\n}\n", "\n import './styles.scoped.css';\n export default {\n \"item-element\": \"awsui_item-element_93a1u_goggu_99\",\n \"disabled\": \"awsui_disabled_93a1u_goggu_111\",\n \"show-divider\": \"awsui_show-divider_93a1u_goggu_118\",\n \"highlighted\": \"awsui_highlighted_93a1u_goggu_121\",\n \"is-focused\": \"awsui_is-focused_93a1u_goggu_136\",\n \"menu-item\": \"awsui_menu-item_93a1u_goggu_141\",\n \"has-category-header\": \"awsui_has-category-header_93a1u_goggu_155\",\n \"icon\": \"awsui_icon_93a1u_goggu_159\",\n \"external-icon\": \"awsui_external-icon_93a1u_goggu_164\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { KeyboardEventHandler, useRef, useState } from 'react';\n\nimport Arrow from '../popover/arrow';\nimport PopoverContainer from '../popover/container';\nimport PopoverBody from '../popover/body';\nimport Portal from '../internal/components/portal';\nimport { usePortalModeClasses } from '../internal/hooks/use-portal-mode-classes';\nimport { useReducedMotion } from '@cloudscape-design/component-toolkit/internal';\n\nexport interface TooltipProps {\n children?: React.ReactNode;\n content?: React.ReactNode;\n position?: 'top' | 'right' | 'bottom' | 'left';\n}\n\nconst DEFAULT_OPEN_TIMEOUT_IN_MS = 120;\n\nexport default function Tooltip({ children, content, position = 'right' }: TooltipProps) {\n const ref = useRef(null);\n const isReducedMotion = useReducedMotion(ref);\n const { open, triggerProps } = useTooltipOpen(isReducedMotion ? 0 : DEFAULT_OPEN_TIMEOUT_IN_MS);\n const portalClasses = usePortalModeClasses(ref);\n\n return (\n \n {children}\n {open && (\n \n \n }\n renderWithPortal={true}\n zIndex={7000}\n >\n {}}\n overflowVisible=\"both\"\n >\n \n {content}\n \n \n \n \n \n )}\n \n );\n}\n\nfunction useTooltipOpen(timeout: number) {\n const handle = useRef();\n const [isOpen, setIsOpen] = useState(false);\n\n const close = () => {\n clearTimeout(handle.current);\n setIsOpen(false);\n };\n const open = () => setIsOpen(true);\n const openDelayed = () => {\n handle.current = setTimeout(open, timeout);\n };\n const onKeyDown: KeyboardEventHandler = e => {\n if (isOpen && isEscape(e.key)) {\n e.preventDefault();\n e.stopPropagation();\n close();\n }\n };\n\n const onFocus = openDelayed;\n const onBlur = close;\n\n return {\n open: isOpen,\n triggerProps: {\n onBlur,\n onFocus,\n onKeyDown,\n },\n };\n}\n\nconst isEscape = (key: string) => key === 'Escape' || key === 'Esc';\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nexport interface GetMenuItemPropsParams {\n disabled: boolean;\n parent?: boolean;\n expanded?: boolean;\n}\n/**\n * @returns attributes for a menuitem widget given parameters\n */\nexport const getMenuItemProps: (params: GetMenuItemPropsParams) => React.HTMLProps = ({\n disabled,\n parent,\n expanded,\n}: GetMenuItemPropsParams) => ({\n role: 'menuitem',\n 'aria-disabled': disabled ? 'true' : undefined,\n 'aria-haspopup': parent ? 'true' : undefined,\n 'aria-expanded': expanded ? 'true' : parent ? 'false' : undefined,\n});\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef } from 'react';\nimport clsx from 'clsx';\nimport styles from './styles.css.js';\n\nimport InternalIcon from '../../icon/internal';\nimport ItemsList from '../items-list';\nimport Dropdown from '../../internal/components/dropdown';\nimport { CategoryProps } from '../interfaces';\nimport useHiddenDescription from '../utils/use-hidden-description';\nimport Tooltip from '../tooltip.js';\nimport { getMenuItemProps } from '../utils/menu-item';\n\nconst ExpandableCategoryElement = ({\n item,\n onItemActivate,\n onGroupToggle,\n targetItem,\n isHighlighted,\n isKeyboardHighlight,\n isExpanded,\n lastInDropdown,\n highlightItem,\n disabled,\n expandToViewport,\n variant,\n}: CategoryProps) => {\n const highlighted = isHighlighted(item);\n const expanded = isExpanded(item);\n const isKeyboardHighlighted = isKeyboardHighlight(item);\n const triggerRef = React.useRef(null);\n const ref = useRef(null);\n\n useEffect(() => {\n if (triggerRef.current && highlighted && !expanded) {\n triggerRef.current.focus();\n }\n }, [expanded, highlighted]);\n\n const onClick: React.MouseEventHandler = event => {\n if (!disabled) {\n event.preventDefault();\n onGroupToggle(item, event);\n triggerRef.current?.focus();\n }\n };\n\n const onHover = () => {\n highlightItem(item);\n };\n\n const isDisabledWithReason = !!item.disabledReason && item.disabled;\n const { targetProps, descriptionEl } = useHiddenDescription(item.disabledReason);\n const trigger = item.text && (\n \n {item.text}\n \n \n \n \n );\n\n let content: React.ReactNode;\n // If the category element is disabled, we do not render a dropdown.\n // Screenreaders are confused by additional sections\n if (isDisabledWithReason) {\n content = (\n \n {trigger}\n {descriptionEl}\n \n );\n } else if (disabled) {\n content = trigger;\n } else {\n content = (\n \n {item.items && expanded && (\n \n \n \n )}\n \n );\n }\n\n return (\n \n {content}\n \n );\n};\n\nexport default ExpandableCategoryElement;\n", "\n import './styles.scoped.css';\n export default {\n \"header\": \"awsui_header_16mm3_w5lmn_99\",\n \"disabled\": \"awsui_disabled_16mm3_w5lmn_116\",\n \"expandable-header\": \"awsui_expandable-header_16mm3_w5lmn_120\",\n \"rolled-down\": \"awsui_rolled-down_16mm3_w5lmn_131\",\n \"highlighted\": \"awsui_highlighted_16mm3_w5lmn_134\",\n \"is-focused\": \"awsui_is-focused_16mm3_w5lmn_152\",\n \"category\": \"awsui_category_16mm3_w5lmn_157\",\n \"expandable\": \"awsui_expandable_16mm3_w5lmn_120\",\n \"variant-navigation\": \"awsui_variant-navigation_16mm3_w5lmn_172\",\n \"expand-icon\": \"awsui_expand-icon_16mm3_w5lmn_179\",\n \"expand-icon-up\": \"awsui_expand-icon-up_16mm3_w5lmn_186\",\n \"expand-icon-right\": \"awsui_expand-icon-right_16mm3_w5lmn_189\",\n \"items-list-container\": \"awsui_items-list-container_16mm3_w5lmn_206\",\n \"in-dropdown\": \"awsui_in-dropdown_16mm3_w5lmn_215\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { CategoryProps } from '../interfaces';\nimport React from 'react';\nimport clsx from 'clsx';\nimport styles from './styles.css.js';\nimport ItemsList from '../items-list';\n\nconst CategoryElement = ({\n item,\n onItemActivate,\n onGroupToggle,\n targetItem,\n isHighlighted,\n isKeyboardHighlight,\n isExpanded,\n lastInDropdown,\n highlightItem,\n disabled,\n variant,\n}: CategoryProps) => {\n // Hide the category title element from screen readers because it will be\n // provided as an ARIA label.\n return (\n \n {item.text && (\n

    \n {item.text}\n

    \n )}\n
      \n {item.items && (\n \n )}\n
    \n \n );\n};\n\nexport default CategoryElement;\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect } from 'react';\nimport clsx from 'clsx';\nimport styles from './styles.css.js';\n\nimport InternalIcon from '../../icon/internal';\nimport ItemsList from '../items-list';\nimport MobileExpandableGroup from '../mobile-expandable-group/mobile-expandable-group';\nimport { CategoryProps } from '../interfaces';\nimport Tooltip from '../tooltip.js';\nimport useHiddenDescription from '../utils/use-hidden-description.js';\nimport { getMenuItemProps } from '../utils/menu-item.js';\n\nconst MobileExpandableCategoryElement = ({\n item,\n onItemActivate,\n onGroupToggle,\n targetItem,\n isHighlighted,\n isKeyboardHighlight,\n isExpanded,\n lastInDropdown,\n highlightItem,\n disabled,\n variant,\n}: CategoryProps) => {\n const highlighted = isHighlighted(item);\n const expanded = isExpanded(item);\n const isKeyboardHighlighted = isKeyboardHighlight(item);\n const triggerRef = React.useRef(null);\n\n useEffect(() => {\n if (triggerRef.current && highlighted && !expanded) {\n triggerRef.current.focus();\n }\n }, [expanded, highlighted]);\n\n const onClick = (e: React.MouseEvent) => {\n if (!disabled) {\n e.preventDefault();\n onGroupToggle(item, e);\n }\n };\n\n const onHover = () => {\n highlightItem(item);\n };\n\n const isDisabledWithReason = !!item.disabledReason && item.disabled;\n const { targetProps, descriptionEl } = useHiddenDescription(item.disabledReason);\n const trigger = item.text && (\n \n {item.text}\n \n \n \n \n );\n\n let content: React.ReactNode;\n\n if (isDisabledWithReason) {\n content = (\n <>\n {descriptionEl}\n {trigger}\n \n );\n } else if (disabled) {\n content = trigger;\n } else {\n content = (\n \n {item.items && expanded && (\n
      \n \n
    \n )}\n
    \n );\n }\n\n return (\n \n {content}\n \n );\n};\n\nexport default MobileExpandableCategoryElement;\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\nimport styles from './styles.css.js';\n\nexport interface MobileExpandableGroupProps {\n /**\n * Trigger element.\n */\n trigger: React.ReactNode;\n /**\n * mobile expandable groups content elements.\n */\n children?: React.ReactNode;\n /**\n * Open state of the mobile expandable groups.\n */\n open?: boolean;\n}\n\nconst MobileExpandableGroup = ({ children, trigger, open }: MobileExpandableGroupProps) => {\n return (\n
    \n
    {trigger}
    \n
    \n {children}\n
    \n
    \n );\n};\n\nexport default MobileExpandableGroup;\n", "\n import './styles.scoped.css';\n export default {\n \"root\": \"awsui_root_14cnr_1ev1z_99\",\n \"trigger\": \"awsui_trigger_14cnr_1ev1z_136\",\n \"dropdown\": \"awsui_dropdown_14cnr_1ev1z_139\",\n \"nowrap\": \"awsui_nowrap_14cnr_1ev1z_150\",\n \"open\": \"awsui_open_14cnr_1ev1z_153\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useState } from 'react';\n\ninterface OpenStateProps {\n onOpen?: () => void;\n onClose?: () => void;\n}\n\nexport const useOpenState = ({ onOpen, onClose }: OpenStateProps) => {\n const [isOpen, setIsOpen] = useState(false);\n const [openedWithKeyboard, setOpenedWithKeyboard] = useState(false);\n\n const openDropdown = (isKeyboard: boolean) => {\n if (!isOpen) {\n setIsOpen(true);\n setOpenedWithKeyboard(!!isKeyboard);\n onOpen?.();\n }\n };\n\n const closeDropdown = () => {\n if (isOpen) {\n setIsOpen(false);\n onClose?.();\n }\n };\n\n const toggleDropdown = () => {\n if (isOpen) {\n closeDropdown();\n } else {\n openDropdown(false);\n }\n };\n\n return { isOpen, openDropdown, closeDropdown, toggleDropdown, openedWithKeyboard };\n};\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useState, useMemo, useCallback } from 'react';\n\nimport { indexIncludes, indexEquals } from './utils';\nimport { ButtonDropdownProps, HighlightProps } from '../interfaces';\nimport createItemsTree, { TreeIndex } from './create-items-tree';\nimport moveHighlightOneStep from './move-highlight';\n\ninterface UseHighlightedMenuOptions {\n items: ButtonDropdownProps.Items;\n hasExpandableGroups: boolean;\n isInRestrictedView?: boolean;\n}\n\ninterface UseHighlightedMenuApi extends HighlightProps {\n moveHighlight: (direction: -1 | 1) => void;\n expandGroup: (group?: ButtonDropdownProps.ItemGroup) => void;\n collapseGroup: () => void;\n reset: () => void;\n setIsUsingMouse: (isUsingMouse: boolean) => void;\n}\n\nexport default function useHighlightedMenu({\n items,\n hasExpandableGroups,\n isInRestrictedView = false,\n}: UseHighlightedMenuOptions): UseHighlightedMenuApi {\n const [targetIndex, setTargetIndex] = useState([]);\n const [expandedIndex, setExpandedIndex] = useState([]);\n const [isUsingMouse, setIsUsingMouse] = useState(true);\n\n const { getItem, getItemIndex, getSequentialIndex, getParentIndex } = useMemo(() => createItemsTree(items), [items]);\n\n const targetItem = useMemo(() => getItem(targetIndex), [targetIndex, getItem]);\n\n const isHighlighted = useCallback(\n (item: ButtonDropdownProps.ItemOrGroup) => {\n const index = getItemIndex(item);\n return indexIncludes(index, targetIndex);\n },\n [targetIndex, getItemIndex]\n );\n\n // check if keyboard focus is on the element\n const isKeyboardHighlight = useCallback(\n (item: ButtonDropdownProps.ItemOrGroup) => {\n const index = getItemIndex(item);\n return !isUsingMouse && indexEquals(index, targetIndex);\n },\n [targetIndex, getItemIndex, isUsingMouse]\n );\n\n const isExpanded = useCallback(\n (group: ButtonDropdownProps.ItemGroup) => {\n const index = getItemIndex(group);\n\n return indexIncludes(index, expandedIndex);\n },\n [expandedIndex, getItemIndex]\n );\n\n const moveHighlight = useCallback(\n (direction: -1 | 1) => {\n const getNext = (index: TreeIndex) => {\n const nextIndex = getSequentialIndex(index, direction);\n const item = getItem(nextIndex || [-1]);\n\n if (!nextIndex || !item) {\n return null;\n }\n\n const parentIndex = getParentIndex(item);\n const parentItem = parentIndex && getItem(parentIndex);\n\n return { index: nextIndex, item, parent: parentItem || undefined };\n };\n\n const nextIndex = moveHighlightOneStep({\n startIndex: targetIndex,\n expandedIndex,\n getNext,\n hasExpandableGroups,\n isInRestrictedView,\n });\n\n if (nextIndex) {\n setTargetIndex(nextIndex);\n }\n },\n [targetIndex, expandedIndex, getItem, getSequentialIndex, getParentIndex, hasExpandableGroups, isInRestrictedView]\n );\n\n const highlightItem = useCallback(\n (item: ButtonDropdownProps.ItemOrGroup) => {\n setTargetIndex(getItemIndex(item));\n },\n [getItemIndex]\n );\n\n const expandGroup = useCallback(\n (group?: ButtonDropdownProps.ItemGroup) => {\n const groupIndex = group ? getItemIndex(group) : targetIndex;\n const firstChildIndex = [...groupIndex, 0];\n\n // move to the first child item unless in restricted mode\n setTargetIndex(isInRestrictedView ? groupIndex : firstChildIndex);\n setExpandedIndex(groupIndex);\n },\n [targetIndex, getItemIndex, isInRestrictedView]\n );\n\n const collapseGroup = useCallback(() => {\n if (expandedIndex.length > 0) {\n setTargetIndex(expandedIndex);\n setExpandedIndex(expandedIndex.slice(0, -1));\n }\n }, [expandedIndex]);\n\n const reset = useCallback(() => {\n setTargetIndex([]);\n setExpandedIndex([]);\n }, []);\n\n return {\n targetItem,\n isHighlighted,\n isKeyboardHighlight,\n isExpanded,\n moveHighlight,\n highlightItem,\n expandGroup,\n collapseGroup,\n reset,\n setIsUsingMouse,\n };\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { isItemGroup } from './utils';\nimport { ButtonDropdownProps } from '../interfaces';\n\n// The function turns a tree of items into a structure optimized for lookup of\n// items and corresponding indices as well as iteration on indices in the given order.\n\n// As trees are multidimensional, the index is represented as an array\nexport type TreeIndex = number[];\n\ninterface ItemsTreeApi {\n // Returns an item for the given tree index or null if not found\n getItem: (index: TreeIndex) => ButtonDropdownProps.ItemOrGroup | null;\n // Returns the tree index of the given item. The item must be present\n // in the tree (referential comparison), or an error will be thrown\n getItemIndex: (item: ButtonDropdownProps.ItemOrGroup) => TreeIndex;\n // Returns the index of next or previous sequential node or null if out of bounds\n getSequentialIndex: (index: TreeIndex, direction: -1 | 1) => TreeIndex | null;\n // Returns parent tree index of a given item or null if no parent is present\n getParentIndex: (item: ButtonDropdownProps.ItemOrGroup) => TreeIndex | null;\n}\n\nexport default function createItemsTree(items: ButtonDropdownProps.Items): ItemsTreeApi {\n const itemToIndex = new Map();\n const indexToItem = new Map();\n const flatIndices: string[] = [];\n\n traverseItems(items, (item, index) => {\n const indexKey = stringifyIndex(index);\n itemToIndex.set(item, indexKey);\n indexToItem.set(indexKey, item);\n flatIndices.push(indexKey);\n });\n\n return {\n getItem: (index: TreeIndex): ButtonDropdownProps.ItemOrGroup | null => {\n const indexKey = stringifyIndex(index);\n\n return indexToItem.get(indexKey) || null;\n },\n getItemIndex: (item: ButtonDropdownProps.ItemOrGroup): TreeIndex => {\n const indexKey = itemToIndex.get(item);\n\n if (!indexKey) {\n throw new Error('Invariant violation: item is not found.');\n }\n\n return parseIndex(indexKey);\n },\n getSequentialIndex: (index: TreeIndex, direction: -1 | 1): TreeIndex | null => {\n const indexKey = stringifyIndex(index);\n const position = flatIndices.indexOf(indexKey);\n\n const nextIndexKey = flatIndices[position + direction];\n\n if (!nextIndexKey) {\n return null;\n }\n\n return parseIndex(nextIndexKey);\n },\n getParentIndex: (item: ButtonDropdownProps.ItemOrGroup): TreeIndex | null => {\n const indexKey = itemToIndex.get(item);\n\n if (!indexKey) {\n throw new Error('Invariant violation: item is not found.');\n }\n\n const index = parseIndex(indexKey);\n\n // No parent\n if (index.length === 1) {\n return null;\n }\n\n return index.slice(0, index.length - 1);\n },\n };\n}\n\nfunction traverseItems(\n items: ButtonDropdownProps.Items,\n act: (item: ButtonDropdownProps.ItemOrGroup, index: TreeIndex) => void,\n parentIndex: TreeIndex = []\n) {\n items.forEach((item, index) => {\n const itemIndex = [...parentIndex, index];\n act(item, itemIndex);\n\n if (isItemGroup(item)) {\n traverseItems(item.items, act, itemIndex);\n }\n });\n}\n\nfunction stringifyIndex(index: TreeIndex): string {\n return index.join('-');\n}\n\nfunction parseIndex(index: string): TreeIndex {\n return index.split('-').map(it => parseInt(it));\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { isItemGroup, indexEquals } from './utils';\nimport { ButtonDropdownProps } from '../interfaces';\nimport { TreeIndex } from './create-items-tree';\n\n// While every menu item except the edge ones have successors and predecessors,\n// there are rules determining what items are eligible for highlighting for the\n// given set of conditions. The function implements all these rules.\n\ninterface MoveHighlightProps {\n startIndex: TreeIndex;\n expandedIndex: TreeIndex;\n getNext: (index: TreeIndex) => {\n index: TreeIndex;\n item: ButtonDropdownProps.ItemOrGroup;\n parent?: ButtonDropdownProps.ItemOrGroup;\n } | null;\n hasExpandableGroups: boolean;\n isInRestrictedView: boolean;\n}\n\nexport default function moveHighlight({\n startIndex,\n expandedIndex,\n getNext,\n hasExpandableGroups,\n isInRestrictedView,\n}: MoveHighlightProps): TreeIndex | null {\n const tryMove = (currentIndex: TreeIndex): TreeIndex | null => {\n const next = getNext(currentIndex);\n\n if (!next) {\n return null;\n }\n\n // Prevents stepping into disabled expandable groups. However,\n // it's possible to navigate nested groups.\n if (next.parent?.disabled && hasExpandableGroups) {\n return tryMove(next.index);\n }\n\n // it is not allowed to highlight groups when non-expandable\n if (isItemGroup(next.item) && !hasExpandableGroups) {\n return tryMove(next.index);\n }\n\n // can only move within same parent unless is in restricted view\n if (hasExpandableGroups && !isInRestrictedView && !isSameParent(startIndex, next.index)) {\n return tryMove(next.index);\n }\n\n // in restricted view can only navigate to children if group is expanded\n if (\n hasExpandableGroups &&\n isInRestrictedView &&\n !isSameLevel(next.index, expandedIndex) &&\n !isIncluded(expandedIndex, next.index)\n ) {\n return tryMove(next.index);\n }\n\n return next.index;\n };\n\n return tryMove(startIndex);\n}\n\nfunction isSameParent(left: TreeIndex, right: TreeIndex) {\n return indexEquals(left.slice(0, -1), right.slice(0, -1));\n}\n\nfunction isSameLevel(left: TreeIndex, right: TreeIndex) {\n return left.length === right.length;\n}\n\nfunction isIncluded(parent: TreeIndex, child: TreeIndex) {\n return indexEquals(parent, child.slice(0, -1));\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { useOpenState } from '../../internal/components/options-list/utils/use-open-state';\nimport { ButtonDropdownProps, ButtonDropdownSettings, GroupToggle, HighlightProps, ItemActivate } from '../interfaces';\nimport { fireCancelableEvent, CancelableEventHandler, isPlainLeftClick } from '../../internal/events';\nimport { KeyCode } from '../../internal/keycode';\nimport { getItemTarget, isItemGroup, isLinkItem } from './utils';\nimport useHighlightedMenu from './use-highlighted-menu';\n\ninterface UseButtonDropdownOptions extends ButtonDropdownSettings {\n items: ButtonDropdownProps.Items;\n onItemClick?: CancelableEventHandler;\n onItemFollow?: CancelableEventHandler;\n onReturnFocus: () => void;\n expandToViewport?: boolean;\n}\n\ninterface UseButtonDropdownApi extends HighlightProps {\n isOpen: boolean;\n onKeyDown: (event: React.KeyboardEvent) => void;\n onKeyUp: (event: React.KeyboardEvent) => void;\n onItemActivate: ItemActivate;\n onGroupToggle: GroupToggle;\n toggleDropdown: (options?: { moveHighlightOnOpen?: boolean }) => void;\n closeDropdown: () => void;\n setIsUsingMouse: (isUsingMouse: boolean) => void;\n}\n\nexport function useButtonDropdown({\n items,\n onItemClick,\n onItemFollow,\n onReturnFocus,\n hasExpandableGroups,\n isInRestrictedView = false,\n expandToViewport = false,\n}: UseButtonDropdownOptions): UseButtonDropdownApi {\n const {\n targetItem,\n isHighlighted,\n isKeyboardHighlight,\n isExpanded,\n highlightItem,\n moveHighlight,\n expandGroup,\n collapseGroup,\n reset,\n setIsUsingMouse,\n } = useHighlightedMenu({\n items,\n hasExpandableGroups,\n isInRestrictedView,\n });\n\n const { isOpen, closeDropdown, ...openStateProps } = useOpenState({ onClose: reset });\n const toggleDropdown = (options: { moveHighlightOnOpen?: boolean } = {}) => {\n const moveHighlightOnOpen = options.moveHighlightOnOpen ?? true;\n if (!isOpen && moveHighlightOnOpen) {\n moveHighlight(1);\n }\n openStateProps.toggleDropdown();\n };\n\n const onGroupToggle: GroupToggle = item => (!isExpanded(item) ? expandGroup(item) : collapseGroup());\n\n const onItemActivate: ItemActivate = (item, event) => {\n const details = {\n id: item.id || 'undefined',\n href: item.href,\n external: item.external,\n target: getItemTarget(item),\n };\n if (onItemFollow && item.href && isPlainLeftClick(event)) {\n fireCancelableEvent(onItemFollow, details, event);\n }\n if (onItemClick) {\n fireCancelableEvent(onItemClick, details, event);\n }\n onReturnFocus();\n closeDropdown();\n };\n\n const doVerticalNavigation = (direction: -1 | 1) => {\n if (isOpen) {\n moveHighlight(direction);\n }\n };\n\n const openAndSelectFirst = (event: React.KeyboardEvent) => {\n toggleDropdown();\n event.preventDefault();\n };\n\n const actOnParentDropdown = (event: React.KeyboardEvent) => {\n // if there is no highlighted item we act on the trigger by opening or closing dropdown\n if (!targetItem) {\n if (isOpen && !isInRestrictedView) {\n toggleDropdown();\n } else {\n openAndSelectFirst(event);\n }\n } else {\n if (isItemGroup(targetItem)) {\n onGroupToggle(targetItem, event);\n } else {\n onItemActivate(targetItem, event);\n }\n }\n };\n\n const activate = (event: React.KeyboardEvent, isEnter?: boolean) => {\n setIsUsingMouse(false);\n\n // if item is a link we rely on default behavior of an anchor, no need to prevent\n if (targetItem && isLinkItem(targetItem) && isEnter) {\n return;\n }\n\n event.preventDefault();\n actOnParentDropdown(event);\n };\n\n const onKeyDown = (event: React.KeyboardEvent) => {\n setIsUsingMouse(false);\n switch (event.keyCode) {\n case KeyCode.down: {\n doVerticalNavigation(1);\n event.preventDefault();\n break;\n }\n case KeyCode.up: {\n doVerticalNavigation(-1);\n event.preventDefault();\n break;\n }\n case KeyCode.space: {\n // Prevent scrolling the list of items and highlighting the trigger\n event.preventDefault();\n break;\n }\n case KeyCode.enter: {\n if (!targetItem?.disabled) {\n activate(event, true);\n }\n break;\n }\n case KeyCode.left:\n case KeyCode.right: {\n if (targetItem && !targetItem.disabled && isItemGroup(targetItem) && !isExpanded(targetItem)) {\n expandGroup();\n } else if (hasExpandableGroups) {\n collapseGroup();\n }\n\n event.preventDefault();\n break;\n }\n case KeyCode.escape: {\n onReturnFocus();\n closeDropdown();\n event.preventDefault();\n if (isOpen) {\n event.stopPropagation();\n }\n break;\n }\n case KeyCode.tab: {\n // When expanded to viewport the focus can't move naturally to the next element.\n // Returning the focus to the trigger instead.\n if (expandToViewport) {\n onReturnFocus();\n }\n closeDropdown();\n break;\n }\n }\n };\n const onKeyUp = (event: React.KeyboardEvent) => {\n // We need to handle activating items with Space separately because there is a bug\n // in Firefox where changing the focus during a Space keydown event it will trigger\n // unexpected click events on the new element: https://bugzilla.mozilla.org/show_bug.cgi?id=1220143\n if (event.keyCode === KeyCode.space && !targetItem?.disabled) {\n activate(event);\n }\n };\n\n return {\n isOpen,\n targetItem,\n isHighlighted,\n isKeyboardHighlight,\n isExpanded,\n highlightItem,\n onKeyDown,\n onKeyUp,\n onItemActivate,\n onGroupToggle,\n toggleDropdown,\n closeDropdown,\n setIsUsingMouse,\n };\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport { useMergeRefs } from '../../hooks/use-merge-refs';\nimport React, { useEffect, useRef } from 'react';\nimport { BaseComponentProps, getBaseProps } from '../../base-component';\nimport {\n fireNonCancelableEvent,\n NonCancelableEventHandler,\n CancelableEventHandler,\n BaseKeyDetail,\n fireKeyboardEvent,\n} from '../../events';\nimport { findUpUntil } from '../../utils/dom';\nimport styles from './styles.css.js';\nimport { DropdownStatusProps } from '../dropdown-status';\nimport { useStableCallback } from '@cloudscape-design/component-toolkit/internal';\n\nexport interface OptionsListProps extends BaseComponentProps {\n open?: boolean;\n statusType: DropdownStatusProps.StatusType;\n /**\n * Options list\n */\n children: React.ReactNode;\n nativeAttributes?: Record;\n /**\n * Called when more items need to be loaded.\n */\n onLoadMore?: NonCancelableEventHandler;\n onKeyDown?: CancelableEventHandler;\n onBlur?: NonCancelableEventHandler<{ relatedTarget: Node | null }>;\n onFocus?: NonCancelableEventHandler;\n onMouseUp?: (itemIndex: number) => void;\n onMouseMove?: (itemIndex: number) => void;\n position?: React.CSSProperties['position'];\n role?: 'listbox' | 'list' | 'menu';\n ariaLabel?: string;\n ariaLabelledby?: string;\n ariaDescribedby?: string;\n decreaseBlockMargin?: boolean;\n}\n\nconst BOTTOM_TRIGGER_OFFSET = 80;\n\nconst getItemIndex = (containerRef: React.RefObject, event: React.MouseEvent) => {\n const target = findUpUntil(\n event.target as HTMLElement,\n element => element === containerRef.current || !!element.dataset.mouseTarget\n );\n const mouseTarget = target?.dataset.mouseTarget;\n return mouseTarget ? parseInt(mouseTarget) : -1;\n};\n\nconst OptionsList = (\n {\n open,\n statusType,\n children,\n nativeAttributes = {},\n onKeyDown,\n onBlur,\n onFocus,\n onLoadMore,\n onMouseUp,\n onMouseMove,\n position = 'relative',\n role = 'listbox',\n decreaseBlockMargin = false,\n ariaLabel,\n ariaLabelledby,\n ariaDescribedby,\n ...restProps\n }: OptionsListProps,\n ref: React.Ref\n) => {\n const baseProps = getBaseProps(restProps);\n const menuRef = useRef(null);\n\n const handleScroll = useStableCallback(() => {\n const scrollContainer = menuRef?.current;\n if (scrollContainer) {\n const bottomEdgePosition = scrollContainer.scrollTop + scrollContainer.clientHeight;\n const remainingScrollHeight = scrollContainer.scrollHeight - bottomEdgePosition;\n if (remainingScrollHeight < BOTTOM_TRIGGER_OFFSET) {\n fireNonCancelableEvent(onLoadMore);\n }\n }\n });\n\n useEffect(() => {\n if (open && statusType === 'pending') {\n handleScroll();\n }\n }, [open, statusType, handleScroll]);\n\n const className = clsx(styles['options-list'], {\n [styles['decrease-block-margin']]: decreaseBlockMargin,\n });\n\n const mergedRef = useMergeRefs(ref, menuRef);\n\n return (\n onKeyDown && fireKeyboardEvent(onKeyDown, event)}\n onMouseMove={event => onMouseMove?.(getItemIndex(menuRef, event))}\n onMouseUp={event => onMouseUp?.(getItemIndex(menuRef, event))}\n onBlur={event => fireNonCancelableEvent(onBlur, { relatedTarget: event.relatedTarget })}\n onFocus={() => fireNonCancelableEvent(onFocus)}\n tabIndex={-1}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n aria-describedby={ariaDescribedby}\n >\n {open && children}\n \n );\n};\n\nexport default React.forwardRef(OptionsList);\n", "\n import './styles.scoped.css';\n export default {\n \"options-list\": \"awsui_options-list_19gcf_halkh_99\",\n \"decrease-block-margin\": \"awsui_decrease-block-margin_19gcf_halkh_149\"\n};\n ", "\n import './styles.scoped.css';\n export default {\n \"root\": \"awsui_root_1fj9k_3pu9z_5\",\n \"navigation\": \"awsui_navigation_1fj9k_3pu9z_9\",\n \"navigation-toggle\": \"awsui_navigation-toggle_1fj9k_3pu9z_13\",\n \"navigation-close\": \"awsui_navigation-close_1fj9k_3pu9z_17\",\n \"content\": \"awsui_content_1fj9k_3pu9z_21\",\n \"notifications\": \"awsui_notifications_1fj9k_3pu9z_25\",\n \"breadcrumbs\": \"awsui_breadcrumbs_1fj9k_3pu9z_29\",\n \"tools\": \"awsui_tools_1fj9k_3pu9z_33\",\n \"tools-close\": \"awsui_tools-close_1fj9k_3pu9z_37\",\n \"tools-toggle\": \"awsui_tools-toggle_1fj9k_3pu9z_41\",\n \"drawer-closed\": \"awsui_drawer-closed_1fj9k_3pu9z_45\",\n \"mobile-bar\": \"awsui_mobile-bar_1fj9k_3pu9z_49\",\n \"disable-body-scroll-root\": \"awsui_disable-body-scroll-root_1fj9k_3pu9z_53\",\n \"drawers-trigger\": \"awsui_drawers-trigger_1fj9k_3pu9z_57\",\n \"active-drawer\": \"awsui_active-drawer_1fj9k_3pu9z_61\",\n \"active-drawer-close-button\": \"awsui_active-drawer-close-button_1fj9k_3pu9z_65\",\n \"overflow-menu\": \"awsui_overflow-menu_1fj9k_3pu9z_69\",\n \"drawers-slider\": \"awsui_drawers-slider_1fj9k_3pu9z_73\"\n};\n ", "\n import './styles.scoped.css';\n export default {\n \"block-body-scroll\": \"awsui_block-body-scroll_19d8l_c90gb_103\",\n \"mobile-bar\": \"awsui_mobile-bar_19d8l_c90gb_107\",\n \"mobile-bar-breadcrumbs\": \"awsui_mobile-bar-breadcrumbs_19d8l_c90gb_120\",\n \"mobile-toggle\": \"awsui_mobile-toggle_19d8l_c90gb_127\",\n \"mobile-toggle-type-navigation\": \"awsui_mobile-toggle-type-navigation_19d8l_c90gb_136\",\n \"mobile-toggle-type-tools\": \"awsui_mobile-toggle-type-tools_19d8l_c90gb_139\",\n \"mobile-toggle-type-drawer\": \"awsui_mobile-toggle-type-drawer_19d8l_c90gb_139\",\n \"drawers-container\": \"awsui_drawers-container_19d8l_c90gb_146\"\n};\n ", "\n import './styles.scoped.css';\n export default {\n \"resize-active\": \"awsui_resize-active_lm6vo_1lt83_104\",\n \"resize-side\": \"awsui_resize-side_lm6vo_1lt83_110\",\n \"resize-bottom\": \"awsui_resize-bottom_lm6vo_1lt83_113\",\n \"with-motion\": \"awsui_with-motion_lm6vo_1lt83_118\",\n \"root\": \"awsui_root_lm6vo_1lt83_133\",\n \"root-no-scroll\": \"awsui_root-no-scroll_lm6vo_1lt83_140\",\n \"layout\": \"awsui_layout_lm6vo_1lt83_145\",\n \"layout-no-scroll\": \"awsui_layout-no-scroll_lm6vo_1lt83_151\",\n \"layout-main\": \"awsui_layout-main_lm6vo_1lt83_155\",\n \"layout-main-scrollable\": \"awsui_layout-main-scrollable_lm6vo_1lt83_161\",\n \"unfocusable\": \"awsui_unfocusable_lm6vo_1lt83_166\",\n \"breadcrumbs-desktop\": \"awsui_breadcrumbs-desktop_lm6vo_1lt83_170\",\n \"content-header-wrapper\": \"awsui_content-header-wrapper_lm6vo_1lt83_175\",\n \"content-wrapper\": \"awsui_content-wrapper_lm6vo_1lt83_179\",\n \"content-overlapped\": \"awsui_content-overlapped_lm6vo_1lt83_183\",\n \"content-extra-top-padding\": \"awsui_content-extra-top-padding_lm6vo_1lt83_187\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nexport function splitItems(\n maybeItems: Array | undefined,\n splitIndex: number,\n activeId: string | null\n) {\n const items = maybeItems ?? [];\n const visibleItems = items.slice(0, splitIndex);\n const overflowItems = items.slice(splitIndex);\n\n if (overflowItems.length === 1) {\n return { visibleItems: items, overflowItems: [] };\n }\n\n if (activeId && overflowItems.length > 0 && visibleItems.length > 0) {\n const activeInOverflow = overflowItems.find(item => item.id === activeId);\n if (activeInOverflow) {\n overflowItems.splice(overflowItems.indexOf(activeInOverflow), 1);\n overflowItems.unshift(visibleItems.pop()!);\n visibleItems.push(activeInOverflow);\n }\n }\n return { visibleItems, overflowItems };\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef, useState } from 'react';\nimport { useStableCallback } from '@cloudscape-design/component-toolkit/internal';\nimport { useControllable } from '../../internal/hooks/use-controllable';\nimport { fireNonCancelableEvent } from '../../internal/events';\nimport { awsuiPluginsInternal } from '../../internal/plugins/api';\nimport { sortByPriority } from '../../internal/plugins/helpers/utils';\nimport { convertRuntimeDrawers, DrawersLayout } from '../runtime-api';\nimport { AppLayoutProps } from '../interfaces';\nimport { togglesConfig } from '../toggles';\n\nexport const TOOLS_DRAWER_ID = 'awsui-internal-tools';\n\ninterface ToolsProps {\n toolsHide: boolean | undefined;\n toolsOpen: boolean | undefined;\n toolsWidth: number;\n tools: React.ReactNode | undefined;\n onToolsToggle: (newOpen: boolean) => void;\n ariaLabels: AppLayoutProps.Labels | undefined;\n}\n\nfunction getToolsDrawerItem(props: ToolsProps): AppLayoutProps.Drawer | null {\n if (props.toolsHide) {\n return null;\n }\n const { iconName, getLabels } = togglesConfig.tools;\n const { mainLabel, closeLabel, openLabel } = getLabels(props.ariaLabels);\n return {\n id: TOOLS_DRAWER_ID,\n content: props.tools,\n resizable: false,\n ariaLabels: {\n triggerButton: openLabel,\n closeButton: closeLabel,\n drawerName: mainLabel ?? '',\n },\n trigger: {\n iconName: iconName,\n },\n };\n}\n\nfunction useRuntimeDrawers(\n disableRuntimeDrawers: boolean | undefined,\n activeDrawerId: string | null,\n onActiveDrawerChange: (newDrawerId: string | null) => void\n) {\n const [runtimeDrawers, setRuntimeDrawers] = useState({ before: [], after: [] });\n const onActiveDrawerChangeStable = useStableCallback(onActiveDrawerChange);\n\n const drawerWasOpenRef = useRef(false);\n drawerWasOpenRef.current = drawerWasOpenRef.current || !!activeDrawerId;\n\n useEffect(() => {\n if (disableRuntimeDrawers) {\n return;\n }\n const unsubscribe = awsuiPluginsInternal.appLayout.onDrawersRegistered(drawers => {\n setRuntimeDrawers(convertRuntimeDrawers(drawers));\n if (!drawerWasOpenRef.current) {\n const defaultActiveDrawer = sortByPriority(drawers).find(drawer => drawer.defaultActive);\n if (defaultActiveDrawer) {\n onActiveDrawerChangeStable(defaultActiveDrawer.id);\n }\n }\n });\n return () => {\n unsubscribe();\n setRuntimeDrawers({ before: [], after: [] });\n };\n }, [disableRuntimeDrawers, onActiveDrawerChangeStable]);\n\n return runtimeDrawers;\n}\n\nfunction applyToolsDrawer(toolsProps: ToolsProps, runtimeDrawers: DrawersLayout) {\n const drawers = [...runtimeDrawers.before, ...runtimeDrawers.after];\n if (drawers.length === 0) {\n return null;\n }\n const toolsItem = getToolsDrawerItem(toolsProps);\n if (toolsItem) {\n drawers.unshift(toolsItem);\n }\n\n return drawers;\n}\n\ntype UseDrawersProps = Pick & {\n __disableRuntimeDrawers?: boolean;\n};\n\nexport function useDrawers(\n {\n drawers,\n activeDrawerId: controlledActiveDrawerId,\n onDrawerChange,\n __disableRuntimeDrawers: disableRuntimeDrawers,\n }: UseDrawersProps,\n ariaLabels: AppLayoutProps['ariaLabels'],\n toolsProps: ToolsProps\n) {\n const [activeDrawerId = null, setActiveDrawerId] = useControllable(controlledActiveDrawerId, onDrawerChange, null, {\n componentName: 'AppLayout',\n controlledProp: 'activeDrawerId',\n changeHandler: 'onChange',\n });\n const [drawerSizes, setDrawerSizes] = useState>({});\n\n function onActiveDrawerResize({ id, size }: { id: string; size: number }) {\n setDrawerSizes(oldSizes => ({ ...oldSizes, [id]: size }));\n fireNonCancelableEvent(activeDrawer?.onResize, { id, size });\n }\n\n function onActiveDrawerChange(newDrawerId: string | null) {\n setActiveDrawerId(newDrawerId);\n if (hasOwnDrawers) {\n fireNonCancelableEvent(onDrawerChange, { activeDrawerId: newDrawerId });\n } else if (!toolsProps.toolsHide) {\n toolsProps.onToolsToggle(newDrawerId === TOOLS_DRAWER_ID);\n }\n }\n\n const hasOwnDrawers = !!drawers;\n const runtimeDrawers = useRuntimeDrawers(disableRuntimeDrawers, activeDrawerId, onActiveDrawerChange);\n const combinedDrawers = drawers\n ? [...runtimeDrawers.before, ...drawers, ...runtimeDrawers.after]\n : applyToolsDrawer(toolsProps, runtimeDrawers);\n // support toolsOpen in runtime-drawers-only mode\n let activeDrawerIdResolved = toolsProps?.toolsOpen && !hasOwnDrawers ? TOOLS_DRAWER_ID : activeDrawerId;\n const activeDrawer = combinedDrawers?.find(drawer => drawer.id === activeDrawerIdResolved);\n // ensure that id is only defined when the drawer exists\n activeDrawerIdResolved = activeDrawer?.id ?? null;\n\n const activeDrawerSize = activeDrawerIdResolved\n ? drawerSizes[activeDrawerIdResolved] ?? activeDrawer?.defaultSize ?? toolsProps.toolsWidth\n : toolsProps.toolsWidth;\n const minDrawerSize = Math.min(activeDrawer?.defaultSize ?? 290, 290);\n\n return {\n ariaLabelsWithDrawers: ariaLabels,\n drawers: combinedDrawers || undefined,\n activeDrawer,\n activeDrawerId: activeDrawerIdResolved,\n activeDrawerSize,\n minDrawerSize,\n onActiveDrawerChange,\n onActiveDrawerResize,\n };\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { DrawerConfig as RuntimeDrawerConfig } from '../internal/plugins/controllers/drawers';\nimport { RuntimeContentWrapper } from '../internal/plugins/helpers';\nimport { sortByPriority } from '../internal/plugins/helpers/utils';\nimport { AppLayoutProps } from './interfaces';\nimport { fireNonCancelableEvent } from '../internal/events';\n\nexport interface DrawersLayout {\n before: Array;\n after: Array;\n}\n\nexport function convertRuntimeDrawers(drawers: Array): DrawersLayout {\n const converted = drawers.map(\n ({\n mountContent,\n unmountContent,\n trigger,\n ...runtimeDrawer\n }): AppLayoutProps.Drawer & { orderPriority?: number } => ({\n ...runtimeDrawer,\n ariaLabels: { drawerName: runtimeDrawer.ariaLabels.content ?? '', ...runtimeDrawer.ariaLabels },\n trigger: {\n iconSvg: (\n // eslint-disable-next-line react/no-danger\n \n ),\n },\n content: (\n \n ),\n onResize: event => {\n fireNonCancelableEvent(runtimeDrawer.onResize, { size: event.detail.size, id: runtimeDrawer.id });\n },\n })\n );\n const sorted = sortByPriority(converted);\n return {\n before: sorted.filter(item => (item.orderPriority ?? 0) > 0),\n after: sorted.filter(item => (item.orderPriority ?? 0) <= 0),\n };\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { RefObject, useCallback, useEffect, useRef } from 'react';\nimport { ButtonProps } from '../../button/interfaces';\n\nexport interface FocusControlRefs {\n toggle: RefObject;\n close: RefObject;\n slider: RefObject;\n}\n\ninterface FocusControlState {\n refs: FocusControlRefs;\n setFocus: (force?: boolean) => void;\n loseFocus: () => void;\n}\n\nexport function useFocusControl(\n isOpen: boolean,\n restoreFocus = false,\n activeDrawerId?: string | null\n): FocusControlState {\n const refs = {\n toggle: useRef(null),\n close: useRef(null),\n slider: useRef(null),\n };\n const previousFocusedElement = useRef();\n const shouldFocus = useRef(false);\n\n const doFocus = () => {\n if (!shouldFocus.current) {\n return;\n }\n if (isOpen) {\n previousFocusedElement.current =\n document.activeElement !== document.body ? (document.activeElement as HTMLElement) : undefined;\n if (refs.slider.current) {\n refs.slider.current?.focus();\n } else {\n refs.close.current?.focus();\n }\n } else {\n if (restoreFocus && previousFocusedElement.current && document.contains(previousFocusedElement.current)) {\n previousFocusedElement.current.focus();\n previousFocusedElement.current = undefined;\n } else {\n refs.toggle.current?.focus();\n }\n }\n shouldFocus.current = false;\n };\n\n const setFocus = (force?: boolean) => {\n shouldFocus.current = true;\n if (force && isOpen) {\n doFocus();\n }\n };\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useEffect(doFocus, [isOpen, activeDrawerId]);\n\n const loseFocus = useCallback(() => {\n previousFocusedElement.current = undefined;\n }, []);\n\n return {\n refs,\n setFocus,\n loseFocus,\n };\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * The page height where the page is considered constrained.\n */\nexport const CONSTRAINED_PAGE_HEIGHT = 400;\n\n/**\n * Based on approximate height of breadcrumb, table header, and the first table row\n */\nexport const MAIN_PANEL_MIN_HEIGHT = 250;\n\n/**\n * Based on approximate height of app bar on comfortable mode on mobile.\n */\nexport const CONSTRAINED_MAIN_PANEL_MIN_HEIGHT = 40;\n\n/**\n * Estimate a default split panel size for the first render based on the document size.\n */\nexport function getSplitPanelDefaultSize(position: 'side' | 'bottom') {\n if (typeof document === 'undefined') {\n return 0; // render the split panel in its minimum possible size\n }\n return position === 'side' ? document.documentElement.clientWidth / 3 : document.documentElement.clientHeight / 2;\n}\n\nexport function getLimitedValue(min: number, value: number, max: number) {\n if (min > max) {\n return min;\n }\n if (value < min) {\n return min;\n }\n if (value > max) {\n return max;\n }\n return value;\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React from 'react';\nimport styles from './styles.css.js';\nimport { AppLayoutProps } from '../interfaces';\n\nexport interface ContentWrapperProps {\n className?: string;\n contentType: AppLayoutProps.ContentType;\n children?: React.ReactNode;\n isMobile: boolean;\n navigationPadding: boolean;\n toolsPadding: boolean;\n disablePaddings?: boolean;\n contentWidthStyles?: React.CSSProperties;\n}\n\nconst ContentWrapper = React.forwardRef(\n (\n {\n className,\n contentType,\n children,\n toolsPadding,\n disablePaddings,\n navigationPadding,\n isMobile,\n contentWidthStyles,\n }: ContentWrapperProps,\n ref: React.Ref\n ) => {\n if (disablePaddings) {\n return (\n
    \n {children}\n
    \n );\n }\n return (\n \n
    \n {children}\n
    \n
    \n );\n }\n);\n\nexport default ContentWrapper;\n", "\n import './styles.scoped.css';\n export default {\n \"content-wrapper\": \"awsui_content-wrapper_zycdx_1ocfz_103\",\n \"content-wrapper-mobile\": \"awsui_content-wrapper-mobile_zycdx_1ocfz_107\",\n \"content-type-dashboard\": \"awsui_content-type-dashboard_zycdx_1ocfz_112\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { useRef } from 'react';\nimport { ToggleButton, CloseButton, togglesConfig } from '../toggles';\n\nimport testutilStyles from '../test-classes/styles.css.js';\nimport styles from './styles.css.js';\nimport { DesktopDrawerProps, DrawerTriggersBarProps } from './interfaces';\nimport OverflowMenu from './overflow-menu';\nimport { useContainerQuery } from '@cloudscape-design/component-toolkit';\nimport { useDensityMode } from '@cloudscape-design/component-toolkit/internal';\nimport { splitItems } from './drawers-helpers';\nimport { TOOLS_DRAWER_ID } from '../utils/use-drawers';\nimport { AppLayoutProps } from '../interfaces';\n\n// We are using two landmarks per drawer, i.e. two NAVs and two ASIDEs, because of several\n// known bugs in NVDA that cause focus changes within a container to sometimes not be\n// announced. As a result, we use one region for the open button and one region for the\n// actual drawer content, always hiding the other one when it's not visible.\n// An alternative solution to follow a more classic implementation here to only have one\n// button that triggers the opening/closing of the drawer also did not work due to another\n// series of bugs in NVDA (together with Firefox) which prevent the changed expanded state\n// from being announced.\n// Even with this workaround in place, the announcement of the close button when opening a\n// panel in NVDA is not working correctly. The suspected root cause is one of the bugs below\n// as well.\n// Relevant tickets:\n// * https://github.com/nvaccess/nvda/issues/6606\n// * https://github.com/nvaccess/nvda/issues/5825\n// * https://github.com/nvaccess/nvda/issues/5247\n// * https://github.com/nvaccess/nvda/pull/8869 (reverted PR that was going to fix it)\nexport const Drawer = React.forwardRef(\n (\n {\n id,\n contentClassName,\n toggleClassName,\n closeClassName,\n width,\n type,\n toggleRefs,\n topOffset,\n bottomOffset,\n ariaLabels,\n children,\n hideOpenButton,\n isOpen,\n isHidden,\n isMobile,\n onToggle,\n onClick,\n onLoseFocus,\n resizeHandle,\n }: DesktopDrawerProps,\n ref: React.Ref\n ) => {\n const openButtonWrapperRef = useRef(null);\n const { TagName, iconName } = togglesConfig[type];\n const { mainLabel, closeLabel, openLabel } = ariaLabels;\n const drawerContentWidthOpen = isMobile ? undefined : width;\n const drawerContentWidth = isOpen ? drawerContentWidthOpen : undefined;\n\n const regularOpenButton = (\n \n onToggle(true)}\n ariaExpanded={isOpen ? undefined : false}\n />\n \n );\n\n return (\n {\n if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {\n onLoseFocus(e);\n }\n }\n : undefined\n }\n onClick={event => {\n if (onClick) {\n onClick(event);\n }\n if (!isOpen) {\n // to prevent calling onToggle from the drawer when it's called from the toggle button\n if (\n openButtonWrapperRef.current === event.target ||\n !openButtonWrapperRef.current?.contains(event.target as Node)\n ) {\n onToggle(true);\n }\n }\n }}\n >\n \n {!isMobile && !hideOpenButton && regularOpenButton}\n \n {!isMobile && isOpen && resizeHandle}\n {\n onToggle(false);\n }}\n />\n {children}\n \n
    \n \n );\n }\n);\n\ninterface DrawerTriggerProps {\n testUtilsClassName?: string;\n ariaLabel: string | undefined;\n ariaExpanded: boolean;\n ariaControls?: string;\n badge: boolean | undefined;\n itemId?: string;\n isActive: boolean;\n trigger: AppLayoutProps.Drawer['trigger'];\n onClick: (() => void) | undefined;\n}\n\nconst DrawerTrigger = React.forwardRef(\n (\n {\n testUtilsClassName,\n ariaLabel,\n ariaExpanded,\n ariaControls,\n badge,\n itemId,\n isActive,\n trigger,\n onClick,\n }: DrawerTriggerProps,\n ref: React.Ref<{ focus: () => void }>\n ) => (\n
    \n \n
    \n )\n);\n\nexport const DrawerTriggersBar = ({\n isMobile,\n topOffset,\n bottomOffset,\n activeDrawerId,\n ariaLabels,\n drawers,\n drawerRefs,\n onDrawerChange,\n}: DrawerTriggersBarProps) => {\n const containerRef = React.useRef(null);\n const previousActiveDrawerId = useRef(activeDrawerId);\n const [containerHeight, triggersContainerRef] = useContainerQuery(rect => rect.contentBoxHeight);\n const isCompactMode = useDensityMode(containerRef) === 'compact';\n\n if (activeDrawerId) {\n previousActiveDrawerId.current = activeDrawerId;\n }\n\n const getIndexOfOverflowItem = () => {\n if (containerHeight) {\n const ITEM_HEIGHT = isCompactMode ? 34 : 38;\n const overflowSpot = containerHeight / 1.5;\n\n const index = Math.floor(overflowSpot / ITEM_HEIGHT);\n\n return index;\n }\n return 0;\n };\n\n const { visibleItems, overflowItems } = splitItems(drawers, getIndexOfOverflowItem(), activeDrawerId);\n const overflowMenuHasBadge = !!overflowItems.find(item => item.badge);\n\n return (\n \n onDrawerChange(drawers[0].id !== activeDrawerId ? drawers[0].id : null)\n : undefined\n }\n >\n {!isMobile && (\n \n )}\n \n \n );\n};\n", "\n import './styles.scoped.css';\n export default {\n \"toggle\": \"awsui_toggle_1uo6m_1740t_103\",\n \"drawer-triggers\": \"awsui_drawer-triggers_1uo6m_1740t_109\",\n \"drawer\": \"awsui_drawer_1uo6m_1740t_109\",\n \"drawer-mobile\": \"awsui_drawer-mobile_1uo6m_1740t_119\",\n \"drawer-closed\": \"awsui_drawer-closed_1uo6m_1740t_122\",\n \"drawer-content\": \"awsui_drawer-content_1uo6m_1740t_129\",\n \"drawer-content-clickable\": \"awsui_drawer-content-clickable_1uo6m_1740t_141\",\n \"drawer-resize-content\": \"awsui_drawer-resize-content_1uo6m_1740t_151\",\n \"drawer-triggers-wrapper\": \"awsui_drawer-triggers-wrapper_1uo6m_1740t_157\",\n \"drawer-trigger\": \"awsui_drawer-trigger_1uo6m_1740t_109\",\n \"drawer-trigger-active\": \"awsui_drawer-trigger-active_1uo6m_1740t_176\",\n \"hide\": \"awsui_hide_1uo6m_1740t_184\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { useRef } from 'react';\n\nimport { getLimitedValue } from '../../split-panel/utils/size-utils';\nimport { usePointerEvents } from '../utils/use-pointer-events';\nimport { useKeyboardEvents } from '../utils/use-keyboard-events';\nimport { SizeControlProps } from '../utils/interfaces';\nimport { Drawer } from './index';\nimport testutilStyles from '../test-classes/styles.css.js';\n\nimport ResizeHandler from '../../split-panel/icons/resize-handler';\nimport splitPanelStyles from '../../split-panel/styles.css.js';\nimport styles from './styles.css.js';\nimport { ResizableDrawerProps } from './interfaces';\nimport { TOOLS_DRAWER_ID } from '../utils/use-drawers';\n\nexport const ResizableDrawer = ({\n onResize,\n maxWidth,\n minWidth,\n refs,\n activeDrawer,\n toolsContent,\n ...props\n}: ResizableDrawerProps) => {\n const { isOpen, children, width, isMobile } = props;\n\n const clampedWidth = getLimitedValue(minWidth, width, maxWidth);\n const relativeSize = ((clampedWidth - minWidth) / (maxWidth - minWidth)) * 100;\n\n const setSidePanelWidth = (newWidth: number) => {\n const size = getLimitedValue(minWidth, newWidth, maxWidth);\n const id = activeDrawer?.id;\n\n if (isOpen && id && maxWidth >= minWidth) {\n onResize({ size, id });\n }\n };\n\n const drawerRefObject = useRef(null);\n\n const sizeControlProps: SizeControlProps = {\n position: 'side',\n panelRef: drawerRefObject,\n handleRef: refs.slider,\n onResize: setSidePanelWidth,\n };\n\n const onSliderPointerDown = usePointerEvents(sizeControlProps);\n const onKeyDown = useKeyboardEvents(sizeControlProps);\n\n const resizeHandle = (\n \n \n \n );\n\n return (\n {resizeHandle}\n }\n ariaLabels={{\n openLabel: activeDrawer?.ariaLabels?.triggerButton,\n mainLabel: activeDrawer?.ariaLabels?.drawerName,\n closeLabel: activeDrawer?.ariaLabels?.closeButton,\n }}\n >\n {toolsContent &&
    {toolsContent}
    }\n {activeDrawer?.id !== TOOLS_DRAWER_ID ? children : null}\n \n );\n};\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useCallback } from 'react';\nimport styles from '../styles.css.js';\nimport { SizeControlProps } from './interfaces';\n\nexport const usePointerEvents = ({\n position,\n panelRef,\n handleRef,\n onResize,\n hasTransitions = false,\n}: SizeControlProps) => {\n const onDocumentPointerMove = useCallback(\n (event: PointerEvent) => {\n if (!panelRef || !panelRef.current || !handleRef || !handleRef.current) {\n return;\n }\n\n panelRef.current.classList.remove(styles['with-motion']);\n\n if (position === 'side') {\n const mouseClientX = event.clientX || 0;\n\n // The handle offset aligns the cursor with the middle of the resize handle.\n const handleOffset = handleRef.current.getBoundingClientRect().width / 2;\n const width = panelRef.current.getBoundingClientRect().right - mouseClientX + handleOffset;\n\n onResize(width);\n } else {\n const mouseClientY = event.clientY || 0;\n\n // The handle offset aligns the cursor with the middle of the resize handle.\n const handleOffset = handleRef.current.getBoundingClientRect().height / 2;\n const height = panelRef.current.getBoundingClientRect().bottom - mouseClientY + handleOffset;\n\n onResize(height);\n }\n },\n [position, panelRef, handleRef, onResize]\n );\n\n const onDocumentPointerUp = useCallback(() => {\n if (!panelRef || !panelRef.current) {\n return;\n }\n\n if (hasTransitions) {\n panelRef.current.classList.add(styles['with-motion']);\n }\n document.body.classList.remove(styles['resize-active']);\n document.body.classList.remove(styles[`resize-${position}`]);\n document.removeEventListener('pointerup', onDocumentPointerUp);\n document.removeEventListener('pointermove', onDocumentPointerMove);\n }, [panelRef, onDocumentPointerMove, position, hasTransitions]);\n\n const onSliderPointerDown = useCallback(() => {\n document.body.classList.add(styles['resize-active']);\n document.body.classList.add(styles[`resize-${position}`]);\n document.addEventListener('pointerup', onDocumentPointerUp);\n document.addEventListener('pointermove', onDocumentPointerMove);\n }, [onDocumentPointerMove, onDocumentPointerUp, position]);\n\n return onSliderPointerDown;\n};\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { KeyCode } from '../../internal/keycode';\nimport { SizeControlProps } from './interfaces';\n\nconst KEYBOARD_SINGLE_STEP_SIZE = 10;\nconst KEYBOARD_MULTIPLE_STEPS_SIZE = 60;\n\nconst getCurrentSize = (panelRef?: React.RefObject) => {\n if (!panelRef || !panelRef.current) {\n return {\n panelHeight: 0,\n panelWidth: 0,\n };\n }\n\n return {\n panelHeight: panelRef.current.clientHeight,\n panelWidth: panelRef.current.clientWidth,\n };\n};\n\nexport const useKeyboardEvents = ({ position, onResize, panelRef }: SizeControlProps) => {\n return (event: React.KeyboardEvent) => {\n let currentSize;\n let maxSize;\n\n const { panelHeight, panelWidth } = getCurrentSize(panelRef);\n\n if (position === 'side') {\n currentSize = panelWidth;\n // don't need the exact max size as it's constrained in the set size function\n maxSize = window.innerWidth;\n } else {\n currentSize = panelHeight;\n // don't need the exact max size as it's constrained in the set size function\n maxSize = window.innerHeight;\n }\n\n const primaryGrowKey = position === 'bottom' ? KeyCode.up : KeyCode.left;\n const primaryShrinkKey = position === 'bottom' ? KeyCode.down : KeyCode.right;\n const altGrowKey = position === 'bottom' ? KeyCode.right : KeyCode.down;\n const altShrinkKey = position === 'bottom' ? KeyCode.left : KeyCode.up;\n\n let isEventHandled = true;\n switch (event.keyCode) {\n case primaryGrowKey:\n case altGrowKey:\n onResize(currentSize + KEYBOARD_SINGLE_STEP_SIZE);\n\n break;\n case primaryShrinkKey:\n case altShrinkKey:\n onResize(currentSize - KEYBOARD_SINGLE_STEP_SIZE);\n break;\n case KeyCode.pageUp:\n onResize(currentSize + KEYBOARD_MULTIPLE_STEPS_SIZE);\n break;\n case KeyCode.pageDown:\n onResize(currentSize - KEYBOARD_MULTIPLE_STEPS_SIZE);\n break;\n case KeyCode.home:\n onResize(maxSize);\n break;\n case KeyCode.end:\n onResize(0);\n break;\n default:\n isEventHandled = false;\n }\n\n if (isEventHandled) {\n event.preventDefault();\n event.stopPropagation();\n }\n };\n};\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nconst ResizeHandler = ({ className }: { className?: string }) => (\n \n \n \n \n);\n\nexport default ResizeHandler;\n", "\n import './styles.scoped.css';\n export default {\n \"drawer\": \"awsui_drawer_1r9lg_5jcsd_201\",\n \"refresh\": \"awsui_refresh_1r9lg_5jcsd_201\",\n \"animating\": \"awsui_animating_1r9lg_5jcsd_215\",\n \"preference-icon--layout-border\": \"awsui_preference-icon--layout-border_1r9lg_5jcsd_238\",\n \"preference-icon--layout-background\": \"awsui_preference-icon--layout-background_1r9lg_5jcsd_242\",\n \"preference-icon--layout-header\": \"awsui_preference-icon--layout-header_1r9lg_5jcsd_245\",\n \"preference-icon--border\": \"awsui_preference-icon--border_1r9lg_5jcsd_248\",\n \"preference-icon--primary-button\": \"awsui_preference-icon--primary-button_1r9lg_5jcsd_252\",\n \"preference-icon--secondary\": \"awsui_preference-icon--secondary_1r9lg_5jcsd_255\",\n \"preference-icon--disabled-element\": \"awsui_preference-icon--disabled-element_1r9lg_5jcsd_258\",\n \"preference-icon--separator\": \"awsui_preference-icon--separator_1r9lg_5jcsd_261\",\n \"preference-icon--focus-text\": \"awsui_preference-icon--focus-text_1r9lg_5jcsd_264\",\n \"preference-icon-refresh--layout-top\": \"awsui_preference-icon-refresh--layout-top_1r9lg_5jcsd_268\",\n \"preference-icon-refresh--layout-main\": \"awsui_preference-icon-refresh--layout-main_1r9lg_5jcsd_271\",\n \"preference-icon-refresh--primary\": \"awsui_preference-icon-refresh--primary_1r9lg_5jcsd_274\",\n \"preference-icon-refresh--disabled\": \"awsui_preference-icon-refresh--disabled_1r9lg_5jcsd_277\",\n \"preference-icon-refresh--column-header\": \"awsui_preference-icon-refresh--column-header_1r9lg_5jcsd_280\",\n \"preference-icon-refresh--window\": \"awsui_preference-icon-refresh--window_1r9lg_5jcsd_283\",\n \"preference-icon-refresh--secondary\": \"awsui_preference-icon-refresh--secondary_1r9lg_5jcsd_287\",\n \"preference-icon-refresh--default\": \"awsui_preference-icon-refresh--default_1r9lg_5jcsd_290\",\n \"preference-icon-refresh--separator\": \"awsui_preference-icon-refresh--separator_1r9lg_5jcsd_293\",\n \"preference-icon-refresh--input-default\": \"awsui_preference-icon-refresh--input-default_1r9lg_5jcsd_296\",\n \"preference-icon-refresh--heading\": \"awsui_preference-icon-refresh--heading_1r9lg_5jcsd_299\",\n \"root\": \"awsui_root_1r9lg_5jcsd_303\",\n \"preferences-button\": \"awsui_preferences-button_1r9lg_5jcsd_338\",\n \"close-button\": \"awsui_close-button_1r9lg_5jcsd_342\",\n \"drawer-closed\": \"awsui_drawer-closed_1r9lg_5jcsd_354\",\n \"drawer-content-side\": \"awsui_drawer-content-side_1r9lg_5jcsd_359\",\n \"drawer-content-bottom\": \"awsui_drawer-content-bottom_1r9lg_5jcsd_375\",\n \"position-bottom\": \"awsui_position-bottom_1r9lg_5jcsd_381\",\n \"position-side\": \"awsui_position-side_1r9lg_5jcsd_408\",\n \"slider\": \"awsui_slider_1r9lg_5jcsd_414\",\n \"slider-side\": \"awsui_slider-side_1r9lg_5jcsd_449\",\n \"slider-wrapper-bottom\": \"awsui_slider-wrapper-bottom_1r9lg_5jcsd_456\",\n \"slider-wrapper-side\": \"awsui_slider-wrapper-side_1r9lg_5jcsd_467\",\n \"open-button\": \"awsui_open-button_1r9lg_5jcsd_478\",\n \"open-button-side\": \"awsui_open-button-side_1r9lg_5jcsd_482\",\n \"slider-icon\": \"awsui_slider-icon_1r9lg_5jcsd_491\",\n \"slider-icon-bottom\": \"awsui_slider-icon-bottom_1r9lg_5jcsd_497\",\n \"slider-icon-side\": \"awsui_slider-icon-side_1r9lg_5jcsd_501\",\n \"pane-header-wrapper-bottom\": \"awsui_pane-header-wrapper-bottom_1r9lg_5jcsd_505\",\n \"drawer-mobile\": \"awsui_drawer-mobile_1r9lg_5jcsd_516\",\n \"drawer-disable-content-paddings\": \"awsui_drawer-disable-content-paddings_1r9lg_5jcsd_520\",\n \"content-bottom\": \"awsui_content-bottom_1r9lg_5jcsd_529\",\n \"pane-bottom-center-align\": \"awsui_pane-bottom-center-align_1r9lg_5jcsd_545\",\n \"pane-bottom-content-nav-padding\": \"awsui_pane-bottom-content-nav-padding_1r9lg_5jcsd_550\",\n \"pane-bottom-content-tools-padding\": \"awsui_pane-bottom-content-tools-padding_1r9lg_5jcsd_554\",\n \"content-bottom-max-width\": \"awsui_content-bottom-max-width_1r9lg_5jcsd_558\",\n \"content-side\": \"awsui_content-side_1r9lg_5jcsd_563\",\n \"pane-header-wrapper-side\": \"awsui_pane-header-wrapper-side_1r9lg_5jcsd_573\",\n \"pane-content-wrapper-side\": \"awsui_pane-content-wrapper-side_1r9lg_5jcsd_579\",\n \"header\": \"awsui_header_1r9lg_5jcsd_586\",\n \"header-text\": \"awsui_header-text_1r9lg_5jcsd_596\",\n \"header-actions\": \"awsui_header-actions_1r9lg_5jcsd_609\",\n \"divider\": \"awsui_divider_1r9lg_5jcsd_617\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nexport const SPLIT_PANEL_MIN_HEIGHT = 160;\nexport const SPLIT_PANEL_MIN_WIDTH = 280;\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React from 'react';\nimport styles from './styles.css.js';\nimport { useSplitPanelContext } from '../../internal/context/split-panel-context';\n\ninterface SideSplitPanelDrawer {\n displayed: boolean;\n children: React.ReactNode;\n}\n\nexport function SideSplitPanelDrawer({ displayed, children }: SideSplitPanelDrawer) {\n const { isOpen, size, topOffset, bottomOffset } = useSplitPanelContext();\n const width = isOpen && children ? size : undefined;\n return (\n \n
    \n {children}\n
    \n \n );\n}\n", "\n import './styles.scoped.css';\n export default {\n \"drawer-displayed\": \"awsui_drawer-displayed_1lh3u_1yevz_103\",\n \"drawer-content\": \"awsui_drawer-content_1lh3u_1yevz_107\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useContext, createContext } from 'react';\nimport { SplitPanelFocusControlRefs } from '../../app-layout/utils/use-split-panel-focus-control';\n\nexport interface SplitPanelSideToggleProps {\n displayed: boolean;\n ariaLabel: string | undefined;\n}\n\nexport interface SplitPanelContextBaseProps {\n topOffset: number;\n bottomOffset: number;\n leftOffset: number;\n rightOffset: number;\n position: 'side' | 'bottom';\n size: number;\n disableContentPaddings?: boolean;\n contentWidthStyles?: React.CSSProperties;\n contentWrapperPaddings?: {\n closedNav: boolean;\n closedTools: boolean;\n };\n isOpen?: boolean;\n isForcedPosition: boolean;\n onResize: (newSize: number) => void;\n onToggle: () => void;\n onPreferencesChange: (detail: { position: 'side' | 'bottom' }) => void;\n reportSize: (pixels: number) => void;\n reportHeaderHeight: (pixels: number) => void;\n setSplitPanelToggle: (config: SplitPanelSideToggleProps) => void;\n refs: SplitPanelFocusControlRefs;\n}\n\nexport interface SplitPanelContextProps extends SplitPanelContextBaseProps {\n relativeSize: number;\n}\n\nconst SplitPanelContext = createContext(null);\n\nexport const SplitPanelContextProvider = SplitPanelContext.Provider;\n\nexport function useSplitPanelContext() {\n const ctx = useContext(SplitPanelContext);\n if (!ctx) {\n throw new Error('Split panel can only be used inside app layout');\n }\n return ctx;\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useState } from 'react';\nimport { getLimitedValue } from '../../split-panel/utils/size-utils';\nimport { SplitPanelContextBaseProps, SplitPanelContextProvider } from '../../internal/context/split-panel-context';\nimport { SPLIT_PANEL_MIN_HEIGHT, SPLIT_PANEL_MIN_WIDTH } from './constants';\n\nexport interface SplitPanelProviderProps extends SplitPanelContextBaseProps {\n maxWidth: number;\n getMaxHeight: () => number;\n children?: React.ReactNode;\n}\n\nexport function SplitPanelProvider({\n children,\n size,\n getMaxHeight,\n maxWidth,\n onResize,\n ...rest\n}: SplitPanelProviderProps) {\n const { position, reportSize, isOpen } = rest;\n const [maxHeight, setMaxHeight] = useState(size);\n const minSize = position === 'bottom' ? SPLIT_PANEL_MIN_HEIGHT : SPLIT_PANEL_MIN_WIDTH;\n const maxSize = position === 'bottom' ? maxHeight : maxWidth;\n const cappedSize = getLimitedValue(minSize, size, maxSize);\n const relativeSize = ((size - minSize) / (maxSize - minSize)) * 100;\n\n const onResizeWithValidation = (newSize: number) => {\n const maxSize = position === 'side' ? maxWidth : getMaxHeight();\n const isResizeValid = position === 'side' ? maxSize >= SPLIT_PANEL_MIN_WIDTH : maxSize >= SPLIT_PANEL_MIN_HEIGHT;\n if (isOpen && isResizeValid) {\n onResize(getLimitedValue(minSize, newSize, maxSize));\n }\n };\n\n useEffect(() => {\n if (position !== 'bottom') {\n return;\n }\n // effects are called inside out in the components tree\n // wait one frame to allow app-layout to complete its calculations\n const handle = requestAnimationFrame(() => setMaxHeight(getMaxHeight()));\n return () => cancelAnimationFrame(handle);\n }, [size, minSize, position, getMaxHeight]);\n\n useEffect(() => {\n reportSize(cappedSize);\n }, [reportSize, cappedSize]);\n\n useEffect(() => {\n if (position !== 'bottom') {\n return;\n }\n const handler = () => setMaxHeight(getMaxHeight());\n window.addEventListener('resize', handler);\n return () => window.removeEventListener('resize', handler);\n }, [position, getMaxHeight]);\n\n return (\n \n {children}\n \n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { DependencyList, RefObject, useEffect, useRef } from 'react';\nimport { ButtonProps } from '../../button/interfaces';\n\nexport type SplitPanelLastInteraction = { type: 'open' } | { type: 'close' } | { type: 'position' };\n\nexport interface SplitPanelFocusControlRefs {\n toggle: RefObject;\n slider: RefObject;\n preferences: RefObject;\n}\ninterface SplitPanelFocusControlState {\n refs: SplitPanelFocusControlRefs;\n setLastInteraction: (interaction: SplitPanelLastInteraction) => void;\n}\n\nexport function useSplitPanelFocusControl(dependencies: DependencyList): SplitPanelFocusControlState {\n const refs = {\n toggle: useRef(null),\n slider: useRef(null),\n preferences: useRef(null),\n };\n const lastInteraction = useRef(null);\n\n useEffect(() => {\n switch (lastInteraction.current?.type) {\n case 'open':\n refs.slider.current?.focus();\n break;\n case 'close':\n refs.toggle.current?.focus();\n break;\n case 'position':\n refs.preferences.current?.focus();\n break;\n }\n lastInteraction.current = null;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, dependencies);\n\n return {\n refs,\n setLastInteraction: (interaction: SplitPanelLastInteraction) => (lastInteraction.current = interaction),\n };\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { AppLayoutInternalsProvider } from './context';\nimport { AppLayoutProps, AppLayoutPropsWithDefaults } from '../interfaces';\nimport Background from './background';\nimport Breadcrumbs from './breadcrumbs';\nimport Drawers from './drawers';\nimport Header from './header';\nimport Layout from './layout';\nimport Main from './main';\nimport MobileToolbar from './mobile-toolbar';\nimport Navigation from './navigation';\nimport Notifications from './notifications';\nimport SplitPanel from './split-panel';\nimport Tools from './tools';\n\nconst AppLayoutWithRef = React.forwardRef(function AppLayout(\n props: AppLayoutPropsWithDefaults,\n ref: React.Ref\n) {\n return (\n \n \n \n \n\n \n\n \n\n \n\n \n\n
    \n\n
    \n\n \n\n \n \n \n\n \n \n \n \n );\n});\n\nexport default AppLayoutWithRef;\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, {\n createContext,\n useCallback,\n useEffect,\n useLayoutEffect,\n useImperativeHandle,\n useRef,\n useState,\n useContext,\n} from 'react';\nimport { AppLayoutContext } from '../../internal/context/app-layout-context';\nimport { DynamicOverlapContext } from '../../internal/context/dynamic-overlap-context';\nimport { AppLayoutProps, AppLayoutPropsWithDefaults } from '../interfaces';\nimport { fireNonCancelableEvent } from '../../internal/events';\nimport { FocusControlRefs, useFocusControl } from '../utils/use-focus-control';\nimport { getSplitPanelDefaultSize } from '../../split-panel/utils/size-utils';\nimport { getSplitPanelPosition } from './split-panel';\nimport { useControllable } from '../../internal/hooks/use-controllable';\nimport { SplitPanelFocusControlRefs, useSplitPanelFocusControl } from '../utils/use-split-panel-focus-control';\nimport { SplitPanelSideToggleProps } from '../../internal/context/split-panel-context';\nimport { useMobile } from '../../internal/hooks/use-mobile';\nimport { useStableCallback } from '@cloudscape-design/component-toolkit/internal';\nimport useResize from '../utils/use-resize';\nimport styles from './styles.css.js';\nimport { useContainerQuery } from '@cloudscape-design/component-toolkit';\nimport useBackgroundOverlap from './use-background-overlap';\nimport { useDrawers } from '../utils/use-drawers';\nimport { useUniqueId } from '../../internal/hooks/use-unique-id';\nimport { SPLIT_PANEL_MIN_WIDTH } from '../split-panel';\n\ninterface AppLayoutInternals extends AppLayoutPropsWithDefaults {\n activeDrawerId: string | null;\n drawers: Array | undefined;\n drawersAriaLabel: string | undefined;\n drawersOverflowAriaLabel: string | undefined;\n drawersOverflowWithBadgeAriaLabel: string | undefined;\n drawersRefs: FocusControlRefs;\n drawerSize: number;\n drawersMinWidth: number;\n drawersMaxWidth: number;\n drawerRef: React.Ref;\n resizeHandle: React.ReactElement;\n drawersTriggerCount: number;\n handleDrawersClick: (activeDrawerId: string | null, skipFocusControl?: boolean) => void;\n handleSplitPanelClick: () => void;\n handleNavigationClick: (isOpen: boolean) => void;\n handleSplitPanelPreferencesChange: (detail: AppLayoutProps.SplitPanelPreferences) => void;\n handleSplitPanelResize: (newSize: number) => void;\n handleToolsClick: (value: boolean, skipFocusControl?: boolean) => void;\n hasBackgroundOverlap: boolean;\n hasDrawerViewportOverlay: boolean;\n hasNotificationsContent: boolean;\n hasOpenDrawer?: boolean;\n hasStickyBackground: boolean;\n isBackgroundOverlapDisabled: boolean;\n isMobile: boolean;\n isSplitPanelForcedPosition: boolean;\n isSplitPanelOpen?: boolean;\n isToolsOpen: boolean;\n layoutElement: React.Ref;\n layoutWidth: number;\n loseToolsFocus: () => void;\n loseDrawersFocus: () => void;\n mainElement: React.Ref;\n mainOffsetLeft: number;\n navigationRefs: FocusControlRefs;\n notificationsElement: React.Ref;\n notificationsHeight: number;\n offsetBottom: number;\n setHasStickyBackground: (value: boolean) => void;\n setSplitPanelReportedSize: (value: number) => void;\n setSplitPanelReportedHeaderHeight: (value: number) => void;\n headerHeight: number;\n footerHeight: number;\n splitPanelControlId: string;\n splitPanelMaxWidth: number;\n splitPanelPosition: AppLayoutProps.SplitPanelPosition;\n splitPanelReportedSize: number;\n splitPanelReportedHeaderHeight: number;\n splitPanelToggle: SplitPanelSideToggleProps;\n setSplitPanelToggle: (toggle: SplitPanelSideToggleProps) => void;\n splitPanelDisplayed: boolean;\n splitPanelRefs: SplitPanelFocusControlRefs;\n toolsControlId: string;\n toolsRefs: FocusControlRefs;\n __embeddedViewMode?: boolean;\n}\n\n/**\n * The default values are destructured in the context instantiation to\n * prevent downstream Typescript errors. This could likely be replaced\n * by a context interface definition that extends the AppLayout interface.\n */\nconst AppLayoutInternalsContext = createContext(null);\n\ninterface AppLayoutProviderInternalsProps extends AppLayoutPropsWithDefaults {\n children: React.ReactNode;\n}\n\nexport function useAppLayoutInternals() {\n const ctx = useContext(AppLayoutInternalsContext);\n if (!ctx) {\n throw new Error('Invariant violation: this context is only available inside app layout');\n }\n return ctx;\n}\n\nexport const AppLayoutInternalsProvider = React.forwardRef(\n (props: AppLayoutProviderInternalsProps, forwardRef: React.Ref) => {\n const {\n toolsHide,\n toolsOpen: controlledToolsOpen,\n navigationHide,\n navigationOpen,\n contentType,\n placement,\n children,\n splitPanel,\n } = props;\n const isMobile = useMobile();\n\n // Private API for embedded view mode\n const __embeddedViewMode = Boolean((props as any).__embeddedViewMode);\n\n const [hasStickyBackground, setHasStickyBackground] = useState(false);\n\n /**\n * Set the default values for minimum and maximum content width.\n */\n const geckoMaxCssLength = ((1 << 30) - 1) / 60;\n const halfGeckoMaxCssLength = geckoMaxCssLength / 2;\n // CSS lengths in Gecko are limited to at most (1<<30)-1 app units (Gecko uses 60 as app unit).\n // Limit the maxContentWidth to the half of the upper boundary (≈4230^2) to be on the safe side.\n const maxContentWidth =\n props.maxContentWidth && props.maxContentWidth > halfGeckoMaxCssLength\n ? halfGeckoMaxCssLength\n : props.maxContentWidth ?? 0;\n const minContentWidth = props.minContentWidth ?? 280;\n\n const { refs: navigationRefs, setFocus: focusNavButtons } = useFocusControl(navigationOpen);\n\n const handleNavigationClick = useStableCallback(function handleNavigationChange(isOpen: boolean) {\n focusNavButtons();\n fireNonCancelableEvent(props.onNavigationChange, { open: isOpen });\n });\n\n useEffect(() => {\n // Close navigation drawer on mobile so that the main content is visible\n if (isMobile) {\n handleNavigationClick(false);\n }\n }, [isMobile, handleNavigationClick]);\n\n const toolsWidth = props.toolsWidth;\n const [isToolsOpen = false, setIsToolsOpen] = useControllable(controlledToolsOpen, props.onToolsChange, false, {\n componentName: 'AppLayout',\n controlledProp: 'toolsOpen',\n changeHandler: 'onToolsChange',\n });\n\n const {\n refs: toolsRefs,\n setFocus: focusToolsButtons,\n loseFocus: loseToolsFocus,\n } = useFocusControl(isToolsOpen, true);\n\n const handleToolsClick = useCallback(\n function handleToolsChange(isOpen: boolean, skipFocusControl?: boolean) {\n setIsToolsOpen(isOpen);\n !skipFocusControl && focusToolsButtons();\n fireNonCancelableEvent(props.onToolsChange, { open: isOpen });\n },\n [props.onToolsChange, setIsToolsOpen, focusToolsButtons]\n );\n\n /**\n * Set the default values for the minimum and maximum Split Panel width when it is\n * in the side position. The useLayoutEffect will compute the available space in the\n * DOM for the Split Panel given the current state. The minimum and maximum\n * widths will potentially trigger a side effect that will put the Split Panel into\n * a forced position on the bottom.\n */\n const [splitPanelMaxWidth, setSplitPanelMaxWidth] = useState(SPLIT_PANEL_MIN_WIDTH);\n\n /**\n * The useControllable hook will set the default value and manage either\n * the controlled or uncontrolled state of the Split Panel. By default\n * the Split Panel should always be closed on page load.\n *\n * The callback that will be passed to the SplitPanel component\n * to handle the click events that will change the state of the SplitPanel\n * to open or closed given the current state. It will set the isSplitPanelOpen\n * controlled state and fire the onSplitPanelToggle event.\n */\n const [isSplitPanelOpen, setIsSplitPanelOpen] = useControllable(\n props.splitPanelOpen,\n props.onSplitPanelToggle,\n false,\n { componentName: 'AppLayout', controlledProp: 'splitPanelOpen', changeHandler: 'onSplitPanelToggle' }\n );\n\n /**\n * The useControllable hook will manage the controlled or uncontrolled\n * state of the splitPanelPreferences. By default the splitPanelPreferences\n * is undefined. When set the object shape should have a single key to indicate\n * either bottom or side position.\n *\n * The callback that will handle changes to the splitPanelPreferences\n * object that will determine if the SplitPanel is rendered either on the\n * bottom of the viewport or within the Tools container.\n */\n const [splitPanelPreferences, setSplitPanelPreferences] = useControllable(\n props.splitPanelPreferences,\n props.onSplitPanelPreferencesChange,\n undefined,\n {\n componentName: 'AppLayout',\n controlledProp: 'splitPanelPreferences',\n changeHandler: 'onSplitPanelPreferencesChange',\n }\n );\n\n const { refs: splitPanelRefs, setLastInteraction: setSplitPanelLastInteraction } = useSplitPanelFocusControl([\n splitPanelPreferences,\n isSplitPanelOpen,\n ]);\n\n const handleSplitPanelClick = useCallback(\n function handleSplitPanelChange() {\n setIsSplitPanelOpen(!isSplitPanelOpen);\n setSplitPanelLastInteraction({ type: isSplitPanelOpen ? 'close' : 'open' });\n fireNonCancelableEvent(props.onSplitPanelToggle, { open: !isSplitPanelOpen });\n },\n [props.onSplitPanelToggle, isSplitPanelOpen, setIsSplitPanelOpen, setSplitPanelLastInteraction]\n );\n\n /**\n * The Split Panel will be in forced (bottom) position if the defined minimum width is\n * greater than the maximum width. In other words, the maximum width is the currently\n * available horizontal space based on all other components that are rendered. If the\n * minimum width exceeds this value then there is not enough horizontal space and we must\n * force it to the bottom position.\n */\n const isSplitPanelForcedPosition = isMobile || SPLIT_PANEL_MIN_WIDTH > splitPanelMaxWidth;\n const splitPanelPosition = getSplitPanelPosition(isSplitPanelForcedPosition, splitPanelPreferences);\n\n /**\n * The useControllable hook will set the default size of the SplitPanel based\n * on the default position set in the splitPanelPreferences. The logic for the\n * default size is contained in the SplitPanel component. The splitPanelControlledSize\n * will be bound to the size property in the SplitPanel context for rendering.\n *\n * The callback that will be passed to the SplitPanel component\n * to handle the resize events that will change the size of the SplitPanel.\n * It will set the splitPanelControlledSize controlled state and fire the\n * onSplitPanelResize event.\n */\n const [splitPanelReportedSize, setSplitPanelReportedSize] = useState(0);\n const [splitPanelReportedHeaderHeight, setSplitPanelReportedHeaderHeight] = useState(0);\n const [splitPanelToggle, setSplitPanelToggle] = useState({\n displayed: false,\n ariaLabel: undefined,\n });\n const splitPanelDisplayed = !!(splitPanelToggle.displayed || isSplitPanelOpen) && !!splitPanel;\n const splitPanelControlId = useUniqueId('split-panel-');\n const toolsControlId = useUniqueId('tools-');\n\n const [splitPanelSize, setSplitPanelSize] = useControllable(\n props.splitPanelSize,\n props.onSplitPanelResize,\n getSplitPanelDefaultSize(splitPanelPosition),\n { componentName: 'AppLayout', controlledProp: 'splitPanelSize', changeHandler: 'onSplitPanelResize' }\n );\n\n const handleSplitPanelResize = useCallback(\n (size: number) => {\n setSplitPanelSize(size);\n fireNonCancelableEvent(props.onSplitPanelResize, { size });\n },\n [props.onSplitPanelResize, setSplitPanelSize]\n );\n\n const handleSplitPanelPreferencesChange = useCallback(\n function handleSplitPanelChange(detail: AppLayoutProps.SplitPanelPreferences) {\n setSplitPanelPreferences(detail);\n setSplitPanelLastInteraction({ type: 'position' });\n fireNonCancelableEvent(props.onSplitPanelPreferencesChange, detail);\n },\n [props.onSplitPanelPreferencesChange, setSplitPanelPreferences, setSplitPanelLastInteraction]\n );\n\n const {\n drawers,\n activeDrawer,\n activeDrawerId,\n minDrawerSize: drawersMinWidth,\n onActiveDrawerChange,\n onActiveDrawerResize,\n activeDrawerSize,\n ...drawersProps\n } = useDrawers(props, props.ariaLabels, {\n ariaLabels: props.ariaLabels,\n toolsHide,\n toolsOpen: isToolsOpen,\n tools: props.tools,\n toolsWidth,\n onToolsToggle: handleToolsClick,\n });\n\n const [drawersMaxWidth, setDrawersMaxWidth] = useState(toolsWidth);\n const hasDrawers = !!drawers && drawers.length > 0;\n\n const {\n refs: drawersRefs,\n setFocus: focusDrawersButtons,\n loseFocus: loseDrawersFocus,\n } = useFocusControl(!!activeDrawerId, true, activeDrawerId);\n\n const drawerRef = useRef(null);\n const { resizeHandle, drawerSize } = useResize(drawerRef, {\n onActiveDrawerResize,\n activeDrawerSize,\n activeDrawer,\n drawersRefs,\n isToolsOpen,\n drawersMaxWidth,\n drawersMinWidth,\n });\n\n const handleDrawersClick = (id: string | null, skipFocusControl?: boolean) => {\n const newActiveDrawerId = id !== activeDrawerId ? id : null;\n\n onActiveDrawerChange(newActiveDrawerId);\n\n !skipFocusControl && focusDrawersButtons();\n };\n\n let drawersTriggerCount = drawers ? drawers.length : !toolsHide ? 1 : 0;\n if (splitPanelDisplayed && splitPanelPosition === 'side') {\n drawersTriggerCount++;\n }\n const hasOpenDrawer =\n !!activeDrawerId ||\n (!toolsHide && isToolsOpen) ||\n (splitPanelDisplayed && splitPanelPosition === 'side' && isSplitPanelOpen);\n const hasDrawerViewportOverlay =\n isMobile && (!!activeDrawerId || (!navigationHide && navigationOpen) || (!toolsHide && isToolsOpen));\n\n const layoutElement = useRef(null);\n const mainElement = useRef(null);\n const [mainOffsetLeft, setMainOffsetLeft] = useState(0);\n\n const { hasBackgroundOverlap, updateBackgroundOverlapHeight } = useBackgroundOverlap({\n contentHeader: props.contentHeader,\n disableContentHeaderOverlap: props.disableContentHeaderOverlap,\n layoutElement,\n });\n\n useLayoutEffect(\n function handleMainOffsetLeft() {\n setMainOffsetLeft(mainElement?.current?.offsetLeft ?? 0);\n },\n [placement.width, navigationOpen, isToolsOpen, splitPanelReportedSize]\n );\n\n /**\n * On mobile viewports the navigation and tools drawers are adjusted to a fixed position\n * that consumes 100% of the viewport height and width. The body content could potentially\n * be scrollable underneath the drawer. In order to prevent this a CSS class needs to be\n * added to the document body that sets overflow to hidden.\n */\n useEffect(\n function handleBodyScroll() {\n if (isMobile && (navigationOpen || isToolsOpen || !!activeDrawer)) {\n document.body.classList.add(styles['block-body-scroll']);\n } else {\n document.body.classList.remove(styles['block-body-scroll']);\n }\n\n // Ensure the CSS class is removed from the body on side effect cleanup\n return function cleanup() {\n document.body.classList.remove(styles['block-body-scroll']);\n };\n },\n [isMobile, navigationOpen, isToolsOpen, activeDrawer]\n );\n\n /**\n * Because the notifications slot does not give us any direction insight into\n * what the state of the child content is we need to have a mechanism for\n * tracking the height of the notifications and whether or not it has content.\n * The height of the notifications is an integer that will be used as a custom\n * property on the Layout component to determine what the sticky offset should\n * be if there are sticky notifications. This could be any number including\n * zero based on how the child content renders. The hasNotificationsContent boolean\n * is simply centralizing the logic of the notifications height being > 0 such\n * that it is not repeated in various components (such as MobileToolbar) that need to\n * know if the notifications slot is empty.\n */\n const [notificationsContainerQuery, notificationsElement] = useContainerQuery(rect => rect.contentBoxHeight);\n\n const notificationsHeight = notificationsContainerQuery ?? 0;\n const hasNotificationsContent = notificationsHeight > 0;\n /**\n * Determine the offsetBottom value based on the presence of a footer element and\n * the SplitPanel component. Ignore the SplitPanel if it is not in the bottom\n * position. Use the size property if it is open and the header height if it is closed.\n */\n let offsetBottom = placement.bottom;\n\n if (splitPanelDisplayed && splitPanelPosition === 'bottom') {\n if (isSplitPanelOpen) {\n offsetBottom += splitPanelReportedSize;\n } else {\n offsetBottom += splitPanelReportedHeaderHeight;\n }\n }\n\n /**\n * Warning! This is a hack! In order to accurately calculate if there is adequate\n * horizontal space for the Split Panel to be in the side position we need two values\n * that are not available in JavaScript.\n *\n * The first is the the content gap on the right which is stored in a design token\n * and applied in the Layout CSS:\n *\n * $contentGapRight: #{awsui.$space-layout-content-horizontal};\n *\n * The second is the width of the element that has the circular buttons for the\n * Tools and Split Panel. This could be suppressed given the state of the Tools\n * drawer returning a zero value. It would, however, be rendered if the Split Panel\n * were to move into the side position. This is calculated in the Tools CSS and\n * the Trigger button CSS with design tokens:\n *\n * padding: awsui.$space-scaled-s awsui.$space-layout-toggle-padding;\n * width: awsui.$space-layout-toggle-diameter;\n *\n * These values will be defined below as static integers that are rough approximations\n * of their computed width when rendered in the DOM, but doubled to ensure adequate\n * spacing for the Split Panel to be in side position.\n */\n useLayoutEffect(\n function handleSplitPanelMaxWidth() {\n const contentGapRight = 50; // Approximately 24px when rendered but doubled for safety\n const toolsFormOffsetWidth = 120; // Approximately 60px when rendered but doubled for safety\n const getPanelOffsetWidth = () => {\n if (drawers) {\n return activeDrawerId ? drawerSize : 0;\n }\n return isToolsOpen ? toolsWidth : 0;\n };\n\n setSplitPanelMaxWidth(\n placement.width -\n mainOffsetLeft -\n minContentWidth -\n contentGapRight -\n toolsFormOffsetWidth -\n getPanelOffsetWidth()\n );\n\n setDrawersMaxWidth(placement.width - mainOffsetLeft - minContentWidth - contentGapRight - toolsFormOffsetWidth);\n },\n [\n activeDrawerId,\n drawerSize,\n drawers,\n navigationOpen,\n isToolsOpen,\n placement.width,\n mainOffsetLeft,\n minContentWidth,\n toolsWidth,\n ]\n );\n\n /**\n * The useImperativeHandle hook in conjunction with the forwardRef function\n * in the AppLayout component definition expose the following callable\n * functions to component consumers when they put a ref as a property on\n * their component implementation.\n */\n useImperativeHandle(\n forwardRef,\n function createImperativeHandle() {\n return {\n closeNavigationIfNecessary: function () {\n isMobile && handleNavigationClick(false);\n },\n openTools: function () {\n handleToolsClick(true);\n },\n focusToolsClose: () => {\n if (hasDrawers) {\n focusDrawersButtons(true);\n } else {\n focusToolsButtons(true);\n }\n },\n focusActiveDrawer: () => focusDrawersButtons(true),\n focusSplitPanel: () => splitPanelRefs.slider.current?.focus(),\n };\n },\n [\n isMobile,\n handleNavigationClick,\n handleToolsClick,\n focusToolsButtons,\n focusDrawersButtons,\n splitPanelRefs.slider,\n hasDrawers,\n ]\n );\n\n return (\n \n \n \n {children}\n \n \n \n );\n }\n);\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\nimport { useAppLayoutInternals } from './context';\nimport styles from './styles.css.js';\nimport { SPLIT_PANEL_MIN_WIDTH, SplitPanelProvider, SplitPanelProviderProps } from '../split-panel';\nimport { AppLayoutProps } from '../interfaces';\nimport { Transition } from '../../internal/components/transition';\nimport customCssProps from '../../internal/generated/custom-css-properties';\n\n/**\n * If there is no Split Panel in the AppLayout context then the SplitPanel\n * will pass through the AppLayout children without the context.\n */\nfunction SplitPanel({ children }: React.PropsWithChildren) {\n const {\n footerHeight,\n handleSplitPanelClick,\n handleSplitPanelPreferencesChange,\n handleSplitPanelResize,\n headerHeight,\n isSplitPanelForcedPosition,\n isSplitPanelOpen,\n setSplitPanelReportedSize,\n setSplitPanelReportedHeaderHeight,\n setSplitPanelToggle,\n splitPanelPosition,\n splitPanelRefs,\n splitPanelSize,\n } = useAppLayoutInternals();\n\n const props: SplitPanelProviderProps = {\n bottomOffset: 0,\n getMaxHeight: () => {\n const availableHeight = document.documentElement.clientHeight - headerHeight - footerHeight;\n // If the page is likely zoomed in at 200%, allow the split panel to fill the content area.\n return availableHeight < 400 ? availableHeight - 40 : availableHeight - 250;\n },\n maxWidth: typeof document !== 'undefined' ? document.documentElement.clientWidth : Number.POSITIVE_INFINITY,\n isForcedPosition: isSplitPanelForcedPosition,\n isOpen: isSplitPanelOpen,\n leftOffset: 0,\n onPreferencesChange: handleSplitPanelPreferencesChange,\n onResize: handleSplitPanelResize,\n onToggle: handleSplitPanelClick,\n position: splitPanelPosition,\n reportSize: setSplitPanelReportedSize,\n reportHeaderHeight: setSplitPanelReportedHeaderHeight,\n rightOffset: 0,\n size: splitPanelSize || 0,\n topOffset: 0,\n setSplitPanelToggle,\n refs: splitPanelRefs,\n };\n\n return {children};\n}\n\n/**\n * This is the render function for the SplitPanel when it is in bottom position.\n * The Split Panel container will be another row entry in the grid definition in\n * the Layout component. The start and finish columns will be variable based\n * on the presence and state of the Navigation and Tools components.\n */\nfunction SplitPanelBottom() {\n const {\n disableBodyScroll,\n hasOpenDrawer,\n navigationOpen,\n isSplitPanelOpen,\n splitPanel,\n splitPanelPosition,\n splitPanelReportedSize,\n splitPanelReportedHeaderHeight,\n } = useAppLayoutInternals();\n\n if (!splitPanel) {\n return null;\n }\n\n return (\n \n {(state, transitionEventsRef) => (\n \n \n {splitPanelPosition === 'bottom' && splitPanel}\n \n )}\n \n );\n}\n\n/**\n * This is the render function for the SplitPanel when it is side position.\n * The Split Panel will not be within the grid defined in the Layout component\n * but instead a direct child of the Tools component. The width constraints\n * for this position are computed in the Tools component.\n */\n\n/**\n * This component has no opening animations because it causes lots of rerenders that makes the component lag. *\n */\n\nfunction SplitPanelSide() {\n const {\n isSplitPanelOpen,\n splitPanel,\n splitPanelPosition,\n splitPanelMaxWidth,\n splitPanelControlId,\n isToolsOpen,\n activeDrawerId,\n } = useAppLayoutInternals();\n\n if (!splitPanel) {\n return null;\n }\n\n return (\n \n {splitPanelPosition === 'side' && splitPanel}\n \n );\n}\n\n/**\n * This logic will determine what the Split Panel position should be. It reconciles the possibility\n * of being in forced position with the current selected position in the settings.\n */\nexport function getSplitPanelPosition(\n isSplitPanelForcedPosition: boolean,\n splitPanelPreferences: AppLayoutProps.SplitPanelPreferences | undefined\n) {\n let splitPanelPosition: AppLayoutProps.SplitPanelPosition = 'bottom';\n\n if (!isSplitPanelForcedPosition && splitPanelPreferences?.position === 'side') {\n splitPanelPosition = 'side';\n }\n\n return splitPanelPosition;\n}\nSplitPanel.Bottom = SplitPanelBottom;\nSplitPanel.Side = SplitPanelSide;\n\nexport default SplitPanel;\n", "\n import './styles.scoped.css';\n export default {\n \"background\": \"awsui_background_hyvsj_1t7qb_99\",\n \"scrolling-background\": \"awsui_scrolling-background_hyvsj_1t7qb_102\",\n \"sticky-background\": \"awsui_sticky-background_hyvsj_1t7qb_108\",\n \"has-sticky-notifications\": \"awsui_has-sticky-notifications_hyvsj_1t7qb_116\",\n \"breadcrumbs\": \"awsui_breadcrumbs_hyvsj_1t7qb_129\",\n \"has-sticky-background\": \"awsui_has-sticky-background_hyvsj_1t7qb_139\",\n \"drawers-container\": \"awsui_drawers-container_hyvsj_1t7qb_151\",\n \"has-open-drawer\": \"awsui_has-open-drawer_hyvsj_1t7qb_162\",\n \"disable-body-scroll\": \"awsui_disable-body-scroll_hyvsj_1t7qb_185\",\n \"drawers-desktop-triggers-container\": \"awsui_drawers-desktop-triggers-container_hyvsj_1t7qb_190\",\n \"has-multiple-triggers\": \"awsui_has-multiple-triggers_hyvsj_1t7qb_231\",\n \"drawers-mobile-triggers-container\": \"awsui_drawers-mobile-triggers-container_hyvsj_1t7qb_241\",\n \"drawers-trigger-content\": \"awsui_drawers-trigger-content_hyvsj_1t7qb_245\",\n \"drawers-trigger-overflow\": \"awsui_drawers-trigger-overflow_hyvsj_1t7qb_259\",\n \"drawers-trigger\": \"awsui_drawers-trigger_hyvsj_1t7qb_245\",\n \"drawer\": \"awsui_drawer_hyvsj_1t7qb_151\",\n \"drawer-content-container\": \"awsui_drawer-content-container_hyvsj_1t7qb_290\",\n \"drawer-close-button\": \"awsui_drawer-close-button_hyvsj_1t7qb_299\",\n \"drawer-content\": \"awsui_drawer-content_hyvsj_1t7qb_290\",\n \"drawer-content-hidden\": \"awsui_drawer-content-hidden_hyvsj_1t7qb_307\",\n \"drawer-slider\": \"awsui_drawer-slider_hyvsj_1t7qb_310\",\n \"is-drawer-open\": \"awsui_is-drawer-open_hyvsj_1t7qb_317\",\n \"content\": \"awsui_content_hyvsj_1t7qb_343\",\n \"layout\": \"awsui_layout_hyvsj_1t7qb_364\",\n \"has-max-content-width\": \"awsui_has-max-content-width_hyvsj_1t7qb_445\",\n \"content-type-dashboard\": \"awsui_content-type-dashboard_hyvsj_1t7qb_460\",\n \"content-type-table\": \"awsui_content-type-table_hyvsj_1t7qb_474\",\n \"content-type-cards\": \"awsui_content-type-cards_hyvsj_1t7qb_474\",\n \"is-overlap-disabled\": \"awsui_is-overlap-disabled_hyvsj_1t7qb_480\",\n \"is-hide-mobile-toolbar\": \"awsui_is-hide-mobile-toolbar_hyvsj_1t7qb_483\",\n \"has-content-gap-left\": \"awsui_has-content-gap-left_hyvsj_1t7qb_515\",\n \"has-content-gap-right\": \"awsui_has-content-gap-right_hyvsj_1t7qb_518\",\n \"content-first-child-notifications\": \"awsui_content-first-child-notifications_hyvsj_1t7qb_528\",\n \"has-breadcrumbs\": \"awsui_has-breadcrumbs_hyvsj_1t7qb_531\",\n \"content-first-child-header\": \"awsui_content-first-child-header_hyvsj_1t7qb_534\",\n \"has-header\": \"awsui_has-header_hyvsj_1t7qb_534\",\n \"content-first-child-main\": \"awsui_content-first-child-main_hyvsj_1t7qb_552\",\n \"disable-content-paddings\": \"awsui_disable-content-paddings_hyvsj_1t7qb_552\",\n \"has-split-panel\": \"awsui_has-split-panel_hyvsj_1t7qb_589\",\n \"split-panel-position-bottom\": \"awsui_split-panel-position-bottom_hyvsj_1t7qb_589\",\n \"block-body-scroll\": \"awsui_block-body-scroll_hyvsj_1t7qb_605\",\n \"unfocusable\": \"awsui_unfocusable_hyvsj_1t7qb_610\",\n \"container\": \"awsui_container_hyvsj_1t7qb_620\",\n \"is-navigation-open\": \"awsui_is-navigation-open_hyvsj_1t7qb_646\",\n \"is-tools-open\": \"awsui_is-tools-open_hyvsj_1t7qb_649\",\n \"is-split-panel-open\": \"awsui_is-split-panel-open_hyvsj_1t7qb_649\",\n \"split-panel-position-side\": \"awsui_split-panel-position-side_hyvsj_1t7qb_649\",\n \"has-active-drawer\": \"awsui_has-active-drawer_hyvsj_1t7qb_649\",\n \"mobile-toolbar\": \"awsui_mobile-toolbar_hyvsj_1t7qb_658\",\n \"remove-high-contrast-header\": \"awsui_remove-high-contrast-header_hyvsj_1t7qb_675\",\n \"mobile-toolbar-nav\": \"awsui_mobile-toolbar-nav_hyvsj_1t7qb_679\",\n \"mobile-toolbar-breadcrumbs\": \"awsui_mobile-toolbar-breadcrumbs_hyvsj_1t7qb_683\",\n \"mobile-toolbar-tools\": \"awsui_mobile-toolbar-tools_hyvsj_1t7qb_687\",\n \"navigation-container\": \"awsui_navigation-container_hyvsj_1t7qb_696\",\n \"show-navigation\": \"awsui_show-navigation_hyvsj_1t7qb_734\",\n \"animating\": \"awsui_animating_hyvsj_1t7qb_757\",\n \"showButtons\": \"awsui_showButtons_hyvsj_1t7qb_1\",\n \"navigation\": \"awsui_navigation_hyvsj_1t7qb_696\",\n \"openNavigation\": \"awsui_openNavigation_hyvsj_1t7qb_1\",\n \"animated-content\": \"awsui_animated-content_hyvsj_1t7qb_819\",\n \"hide-navigation\": \"awsui_hide-navigation_hyvsj_1t7qb_828\",\n \"notifications\": \"awsui_notifications_hyvsj_1t7qb_838\",\n \"sticky-notifications\": \"awsui_sticky-notifications_hyvsj_1t7qb_844\",\n \"split-panel-bottom\": \"awsui_split-panel-bottom_hyvsj_1t7qb_861\",\n \"position-bottom\": \"awsui_position-bottom_hyvsj_1t7qb_908\",\n \"openSplitPanelBottom\": \"awsui_openSplitPanelBottom_hyvsj_1t7qb_1\",\n \"split-panel-side\": \"awsui_split-panel-side_hyvsj_1t7qb_937\",\n \"position-side\": \"awsui_position-side_hyvsj_1t7qb_950\",\n \"tools-container\": \"awsui_tools-container_hyvsj_1t7qb_972\",\n \"tools\": \"awsui_tools_hyvsj_1t7qb_972\",\n \"openTools\": \"awsui_openTools_hyvsj_1t7qb_1\",\n \"has-tools-form-persistence\": \"awsui_has-tools-form-persistence_hyvsj_1t7qb_1063\",\n \"hide-tools\": \"awsui_hide-tools_hyvsj_1t7qb_1073\",\n \"show-tools\": \"awsui_show-tools_hyvsj_1t7qb_1085\",\n \"has-tools-form\": \"awsui_has-tools-form_hyvsj_1t7qb_1063\",\n \"trigger-badge-wrapper\": \"awsui_trigger-badge-wrapper_hyvsj_1t7qb_1168\",\n \"trigger\": \"awsui_trigger_hyvsj_1t7qb_1168\",\n \"selected\": \"awsui_selected_hyvsj_1t7qb_1242\",\n \"badge\": \"awsui_badge_hyvsj_1t7qb_1262\",\n \"trigger-wrapper\": \"awsui_trigger-wrapper_hyvsj_1t7qb_1266\",\n \"dot\": \"awsui_dot_hyvsj_1t7qb_1277\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useState, useEffect } from 'react';\n\nimport clsx from 'clsx';\n\nimport ResizeHandler from '../../split-panel/icons/resize-handler';\nimport { getLimitedValue } from '../../split-panel/utils/size-utils';\nimport { usePointerEvents } from './use-pointer-events';\nimport { useKeyboardEvents } from './use-keyboard-events';\nimport { AppLayoutProps } from '../interfaces';\n\nimport splitPanelStyles from '../../split-panel/styles.css.js';\nimport testutilStyles from '../test-classes/styles.css.js';\nimport styles from '../visual-refresh/styles.css.js';\nimport { FocusControlRefs } from './use-focus-control';\nimport { SizeControlProps } from './interfaces';\n\nexport interface DrawerResizeProps {\n activeDrawer: AppLayoutProps.Drawer | undefined;\n activeDrawerSize: number;\n onActiveDrawerResize: (detail: { id: string; size: number }) => void;\n drawersRefs: FocusControlRefs;\n isToolsOpen: boolean;\n drawersMaxWidth: number;\n drawersMinWidth: number;\n}\n\nfunction useResize(\n drawerRefObject: React.RefObject,\n {\n activeDrawer,\n activeDrawerSize,\n onActiveDrawerResize,\n drawersRefs,\n isToolsOpen,\n drawersMinWidth,\n drawersMaxWidth,\n }: DrawerResizeProps\n) {\n const [relativeSize, setRelativeSize] = useState(0);\n\n const drawerSize = !activeDrawer && !isToolsOpen ? 0 : activeDrawerSize;\n\n useEffect(() => {\n // effects are called inside out in the components tree\n // wait one frame to allow app-layout to complete its calculations\n const handle = requestAnimationFrame(() => {\n const maxSize = drawersMaxWidth;\n setRelativeSize(((drawerSize - drawersMinWidth) / (maxSize - drawersMinWidth)) * 100);\n });\n return () => cancelAnimationFrame(handle);\n }, [drawerSize, drawersMaxWidth, drawersMinWidth]);\n\n const setSidePanelWidth = (width: number) => {\n const maxWidth = drawersMaxWidth;\n const size = getLimitedValue(drawersMinWidth, width, maxWidth);\n const id = activeDrawer?.id;\n\n if (id && maxWidth >= drawersMinWidth) {\n onActiveDrawerResize({ size, id });\n }\n };\n\n const sizeControlProps: SizeControlProps = {\n position: 'side',\n panelRef: drawerRefObject,\n handleRef: drawersRefs.slider,\n onResize: setSidePanelWidth,\n hasTransitions: true,\n };\n\n const onSliderPointerDown = usePointerEvents(sizeControlProps);\n const onKeyDown = useKeyboardEvents(sizeControlProps);\n\n const resizeHandle = (\n \n \n \n );\n\n return { resizeHandle:
    {resizeHandle}
    , drawerSize };\n}\n\nexport default useResize;\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useCallback, useState } from 'react';\nimport customCssProps from '../../internal/generated/custom-css-properties';\n\n/**\n * The overlap height has a default set in CSS but can also be dynamically overridden\n * for content types (such as Table and Wizard) that have variable size content in the overlap.\n * If a child component utilizes a sticky header the hasStickyBackground property will determine\n * if the background remains in the same vertical position.\n */\nexport default function useBackgroundOverlap({\n contentHeader,\n disableContentHeaderOverlap,\n layoutElement,\n}: {\n contentHeader: React.ReactNode;\n disableContentHeaderOverlap?: boolean;\n layoutElement: React.Ref;\n}) {\n const hasContentHeader = !!contentHeader;\n\n const [hasBackgroundOverlap, setHasBackgroundOverlap] = useState(hasContentHeader);\n\n const updateBackgroundOverlapHeight = useCallback(\n (height: number) => {\n const hasOverlap = hasContentHeader || height > 0;\n setHasBackgroundOverlap(hasOverlap);\n\n /**\n * React 18 will trigger a paint before the state is correctly updated\n * (see https://github.com/facebook/react/issues/24331).\n * To work around this, we bypass React state updates and imperatively update the custom property on the DOM.\n * An alternative would be to use `queueMicrotask` and `flushSync` in the ResizeObserver callback,\n * but that would have some performance impact as it would delay the render.\n */\n // Layout component uses RefObject, we don't expect a RefCallback\n const element = typeof layoutElement !== 'function' && layoutElement?.current;\n if (!element) {\n return;\n }\n if (disableContentHeaderOverlap || !hasOverlap || height <= 0) {\n element.style.removeProperty(customCssProps.overlapHeight);\n } else {\n element.style.setProperty(customCssProps.overlapHeight, `${height}px`);\n }\n },\n [hasContentHeader, layoutElement, disableContentHeaderOverlap]\n );\n\n return {\n hasBackgroundOverlap,\n updateBackgroundOverlapHeight,\n };\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\nimport { getContentHeaderClassName } from '../../internal/utils/content-header-utils';\nimport { useAppLayoutInternals } from './context';\nimport styles from './styles.css.js';\n\nexport default function Background() {\n const {\n breadcrumbs,\n hasBackgroundOverlap,\n hasNotificationsContent,\n hasStickyBackground,\n isMobile,\n stickyNotifications,\n } = useAppLayoutInternals();\n\n if (!hasNotificationsContent && (!breadcrumbs || isMobile) && !hasBackgroundOverlap) {\n return null;\n }\n\n return (\n
    \n
    \n\n {!isMobile && hasStickyBackground && (\n \n )}\n
    \n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\nimport { getContentHeaderClassName } from '../../internal/utils/content-header-utils';\nimport { useAppLayoutInternals } from './context';\nimport styles from './styles.css.js';\nimport testutilStyles from '../test-classes/styles.css.js';\n\nexport default function Breadcrumbs() {\n const { breadcrumbs, hasStickyBackground, isMobile } = useAppLayoutInternals();\n\n if (isMobile || !breadcrumbs) {\n return null;\n }\n\n return (\n \n {breadcrumbs}\n
    \n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\nimport clsx from 'clsx';\nimport customCssProps from '../../internal/generated/custom-css-properties';\nimport { InternalButton } from '../../button/internal';\nimport SplitPanel from './split-panel';\nimport TriggerButton from './trigger-button';\nimport { useAppLayoutInternals } from './context';\nimport splitPanelStyles from '../../split-panel/styles.css.js';\nimport styles from './styles.css.js';\nimport testutilStyles from '../test-classes/styles.css.js';\nimport { useContainerQuery } from '@cloudscape-design/component-toolkit';\nimport OverflowMenu from '../drawer/overflow-menu';\nimport { splitItems } from '../drawer/drawers-helpers';\nimport { TOOLS_DRAWER_ID } from '../utils/use-drawers';\nimport { getLimitedValue } from '../../split-panel/utils/size-utils';\n\n/**\n * The Drawers root component is mounted in the AppLayout index file. It will only\n * render if the drawers are defined, and it will take over the mounting of and\n * rendering of the Tools and SplitPanel (side position) if they exist. If drawers\n * do not exist then the Tools and SplitPanel will be handled by the Tools component.\n */\nexport default function Drawers() {\n const {\n disableBodyScroll,\n drawers,\n drawersTriggerCount,\n hasDrawerViewportOverlay,\n hasOpenDrawer,\n navigationOpen,\n navigationHide,\n isMobile,\n } = useAppLayoutInternals();\n\n const isUnfocusable = hasDrawerViewportOverlay && navigationOpen && !navigationHide;\n\n if (!drawers || drawersTriggerCount === 0) {\n return null;\n }\n\n return (\n \n \n \n {!isMobile && }\n \n );\n}\n\nfunction ActiveDrawer() {\n const {\n activeDrawerId,\n ariaLabels,\n drawers,\n drawersRefs,\n handleDrawersClick,\n handleToolsClick,\n hasDrawerViewportOverlay,\n isMobile,\n navigationOpen,\n navigationHide,\n loseDrawersFocus,\n resizeHandle,\n drawerSize,\n drawersMinWidth,\n drawersMaxWidth,\n drawerRef,\n } = useAppLayoutInternals();\n\n const activeDrawer = drawers?.find(item => item.id === activeDrawerId) ?? null;\n\n const computedAriaLabels = {\n closeButton: activeDrawerId ? activeDrawer?.ariaLabels?.closeButton : ariaLabels?.toolsClose,\n content: activeDrawerId ? activeDrawer?.ariaLabels?.drawerName : ariaLabels?.tools,\n };\n\n const isHidden = !activeDrawerId;\n const isUnfocusable = isHidden || (hasDrawerViewportOverlay && navigationOpen && !navigationHide);\n const isToolsDrawer = activeDrawerId === TOOLS_DRAWER_ID;\n const toolsContent = drawers?.find(drawer => drawer.id === TOOLS_DRAWER_ID)?.content;\n\n const size = getLimitedValue(drawersMinWidth, drawerSize, drawersMaxWidth);\n\n return (\n {\n if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {\n loseDrawersFocus();\n }\n }}\n >\n {!isMobile && activeDrawer?.resizable && resizeHandle}\n
    \n
    \n {\n handleDrawersClick(activeDrawerId);\n handleToolsClick(false);\n }}\n ref={drawersRefs.close}\n variant=\"icon\"\n />\n
    \n {toolsContent && (\n \n {toolsContent}\n
    \n )}\n {activeDrawerId !== TOOLS_DRAWER_ID && (\n
    {activeDrawerId && activeDrawer?.content}
    \n )}\n \n \n );\n}\n\n/**\n * The DesktopTriggers will render the trigger buttons for Tools, Drawers, and the\n * SplitPanel in non mobile viewports. Changes to the activeDrawerId need to be\n * tracked by the previousActiveDrawerId property in order to appropriately apply\n * the ref required to manage focus control.\n */\nfunction DesktopTriggers() {\n const {\n activeDrawerId,\n drawers,\n drawersAriaLabel,\n drawersOverflowAriaLabel,\n drawersOverflowWithBadgeAriaLabel,\n drawersRefs,\n drawersTriggerCount,\n handleDrawersClick,\n handleSplitPanelClick,\n hasOpenDrawer,\n isSplitPanelOpen,\n splitPanel,\n splitPanelControlId,\n splitPanelDisplayed,\n splitPanelPosition,\n splitPanelRefs,\n splitPanelToggle,\n splitPanelReportedHeaderHeight,\n splitPanelReportedSize,\n } = useAppLayoutInternals();\n\n const hasMultipleTriggers = drawersTriggerCount > 1;\n const hasSplitPanel = splitPanel && splitPanelDisplayed && splitPanelPosition === 'side';\n\n const previousActiveDrawerId = useRef(activeDrawerId);\n const [containerHeight, triggersContainerRef] = useContainerQuery(rect => rect.contentBoxHeight);\n\n if (activeDrawerId) {\n previousActiveDrawerId.current = activeDrawerId;\n }\n\n const splitPanelHeight =\n isSplitPanelOpen && splitPanelPosition === 'bottom' ? splitPanelReportedSize : splitPanelReportedHeaderHeight;\n\n const getIndexOfOverflowItem = () => {\n if (containerHeight) {\n const ITEM_HEIGHT = 48;\n const overflowSpot =\n activeDrawerId && isSplitPanelOpen\n ? (containerHeight - splitPanelReportedHeaderHeight) / 1.5\n : (containerHeight - splitPanelHeight) / 1.5;\n\n const index = Math.floor(overflowSpot / ITEM_HEIGHT);\n\n let splitPanelItem = 0;\n if (hasSplitPanel && splitPanelToggle.displayed) {\n splitPanelItem = 1;\n }\n return index - splitPanelItem;\n }\n\n return 0;\n };\n\n const { visibleItems, overflowItems } = splitItems(drawers ?? undefined, getIndexOfOverflowItem(), activeDrawerId);\n const overflowMenuHasBadge = !!overflowItems.find(item => item.badge);\n\n return (\n \n \n {visibleItems.map(item => {\n return (\n handleDrawersClick(item.id)}\n ref={item.id === previousActiveDrawerId.current ? drawersRefs.toggle : undefined}\n selected={item.id === activeDrawerId}\n badge={item.badge}\n testId={`awsui-app-layout-trigger-${item.id}`}\n />\n );\n })}\n\n {overflowItems.length > 0 && (\n (\n \n )}\n onItemClick={({ detail }) => {\n handleDrawersClick(detail.id);\n }}\n />\n )}\n {hasSplitPanel && splitPanelToggle.displayed && (\n handleSplitPanelClick()}\n selected={hasSplitPanel && isSplitPanelOpen}\n ref={splitPanelRefs.toggle}\n />\n )}\n \n \n );\n}\n\n/**\n * The MobileTriggers will be mounted inside of the AppBar component and\n * only rendered when Drawers are defined in mobile viewports. The same logic\n * will in the AppBar component will suppress the rendering of the legacy\n * trigger button for the Tools drawer.\n */\nexport function MobileTriggers() {\n const {\n activeDrawerId,\n drawers,\n drawersAriaLabel,\n drawersOverflowAriaLabel,\n drawersOverflowWithBadgeAriaLabel,\n drawersRefs,\n handleDrawersClick,\n hasDrawerViewportOverlay,\n } = useAppLayoutInternals();\n\n const previousActiveDrawerId = useRef(activeDrawerId);\n\n if (!drawers) {\n return null;\n }\n\n if (activeDrawerId) {\n previousActiveDrawerId.current = activeDrawerId;\n }\n\n const { visibleItems, overflowItems } = splitItems(drawers, 2, activeDrawerId);\n const overflowMenuHasBadge = !!overflowItems.find(item => item.badge);\n\n return (\n \n
    \n {visibleItems.map(item => (\n handleDrawersClick(item.id)}\n variant=\"icon\"\n __nativeAttributes={{ 'aria-haspopup': true, 'data-testid': `awsui-app-layout-trigger-${item.id}` }}\n />\n ))}\n {overflowItems.length > 0 && (\n handleDrawersClick(detail.id)}\n />\n )}\n
    \n \n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\nimport Icon from '../../icon/internal';\nimport styles from './styles.css.js';\nimport { ButtonProps } from '../../button/interfaces';\nimport { IconProps } from '../../icon/interfaces';\nimport { shouldRemoveHighContrastHeader } from '../../internal/utils/content-header-utils';\n\nexport interface TriggerButtonProps {\n ariaLabel?: string;\n className?: string;\n iconName?: IconProps.Name;\n iconSvg?: React.ReactNode;\n ariaExpanded: boolean | undefined;\n ariaControls?: string;\n testId?: string;\n onClick: React.MouseEventHandler;\n selected?: boolean;\n badge?: boolean;\n}\n\nfunction TriggerButton(\n {\n ariaLabel,\n className,\n iconName,\n iconSvg,\n ariaExpanded,\n ariaControls,\n onClick,\n testId,\n badge,\n selected = false,\n }: TriggerButtonProps,\n ref: React.Ref\n) {\n return (\n \n }\n type=\"button\"\n data-testid={testId}\n >\n \n \n \n \n {badge &&
    }\n
    \n );\n}\n\nexport default React.forwardRef(TriggerButton);\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\nimport { getContentHeaderClassName } from '../../internal/utils/content-header-utils';\nimport { useAppLayoutInternals } from './context';\nimport styles from './styles.css.js';\n\nexport default function Header() {\n const { breadcrumbs, contentHeader, hasDrawerViewportOverlay, hasNotificationsContent } = useAppLayoutInternals();\n\n if (!contentHeader) {\n return null;\n }\n\n return (\n \n {contentHeader}\n
    \n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\nimport customCssProps from '../../internal/generated/custom-css-properties';\nimport { useAppLayoutInternals } from './context';\nimport styles from './styles.css.js';\nimport testutilStyles from '../test-classes/styles.css.js';\n\ninterface LayoutProps {\n children: React.ReactNode;\n}\n\n/**\n * The layoutElement ref will be used by the resize observers to calculate the offset from\n * the top and bottom of the viewport based on the header and footer elements. This is to\n * ensure the Layout component minimum height will fill 100% of the viewport less those\n * cumulative heights.\n */\nexport default function Layout({ children }: LayoutProps) {\n const {\n breadcrumbs,\n contentHeader,\n contentType,\n disableBodyScroll,\n disableContentPaddings,\n drawersTriggerCount,\n footerHeight,\n hasNotificationsContent,\n hasStickyBackground,\n hasOpenDrawer,\n headerHeight,\n isBackgroundOverlapDisabled,\n isMobile,\n navigationOpen,\n layoutElement,\n layoutWidth,\n mainOffsetLeft,\n maxContentWidth,\n minContentWidth,\n navigationHide,\n notificationsHeight,\n __embeddedViewMode,\n splitPanelPosition,\n stickyNotifications,\n splitPanelDisplayed,\n } = useAppLayoutInternals();\n\n // Determine the first content child so the gap will vertically align with the trigger buttons\n const contentFirstChild = getContentFirstChild(breadcrumbs, contentHeader, hasNotificationsContent, isMobile);\n\n // Content gaps on the left and right are used with the minmax function in the CSS grid column definition\n const hasContentGapLeft = navigationOpen || navigationHide;\n const hasContentGapRight = drawersTriggerCount === 0 || hasOpenDrawer;\n\n return (\n 0,\n [styles['has-split-panel']]: splitPanelDisplayed,\n [styles['has-sticky-background']]: hasStickyBackground,\n [styles['has-sticky-notifications']]: stickyNotifications && hasNotificationsContent,\n [styles['is-overlap-disabled']]: isBackgroundOverlapDisabled,\n [styles['is-hide-mobile-toolbar']]: __embeddedViewMode,\n },\n testutilStyles.root\n )}\n ref={layoutElement}\n style={{\n [customCssProps.headerHeight]: `${headerHeight}px`,\n [customCssProps.footerHeight]: `${footerHeight}px`,\n [customCssProps.layoutWidth]: `${layoutWidth}px`,\n [customCssProps.mainOffsetLeft]: `${mainOffsetLeft}px`,\n ...(maxContentWidth && { [customCssProps.maxContentWidth]: `${maxContentWidth}px` }),\n ...(minContentWidth && { [customCssProps.minContentWidth]: `${minContentWidth}px` }),\n [customCssProps.notificationsHeight]: `${notificationsHeight}px`,\n }}\n >\n {children}\n \n );\n}\n\n/*\nThe Notifications, Breadcrumbs, Header, and Main are all rendered in the center\ncolumn of the grid layout. Any of these could be the first child to render in the\ncontent area if the previous siblings do not exist. The grid gap before the first\nchild will be different to ensure vertical alignment with the trigger buttons.\n*/\nfunction getContentFirstChild(\n breadcrumbs: React.ReactNode,\n contentHeader: React.ReactNode,\n hasNotificationsContent: boolean,\n isMobile: boolean\n) {\n let contentFirstChild = 'main';\n\n if (hasNotificationsContent) {\n contentFirstChild = 'notifications';\n } else if (breadcrumbs && !isMobile) {\n contentFirstChild = 'breadcrumbs';\n } else if (contentHeader) {\n contentFirstChild = 'header';\n }\n\n return contentFirstChild;\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\nimport { useAppLayoutInternals } from './context';\nimport customCssProps from '../../internal/generated/custom-css-properties';\nimport styles from './styles.css.js';\nimport testutilStyles from '../test-classes/styles.css.js';\n\nexport default function Main() {\n const {\n content,\n disableContentPaddings,\n footerHeight,\n hasDrawerViewportOverlay,\n navigationOpen,\n isSplitPanelOpen,\n isToolsOpen,\n mainElement,\n offsetBottom,\n splitPanelDisplayed,\n splitPanelPosition,\n activeDrawerId,\n } = useAppLayoutInternals();\n\n const splitPanelHeight = offsetBottom - footerHeight;\n\n return (\n \n {content}\n \n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\nimport { getContentHeaderClassName } from '../../internal/utils/content-header-utils';\nimport { InternalButton } from '../../button/internal';\nimport { MobileTriggers as DrawersMobileTriggers } from './drawers';\nimport { useAppLayoutInternals } from './context';\nimport styles from './styles.css.js';\nimport testutilStyles from '../test-classes/styles.css.js';\nimport { shouldRemoveHighContrastHeader } from '../../internal/utils/content-header-utils';\n\nexport default function MobileToolbar() {\n const {\n ariaLabels,\n breadcrumbs,\n drawers,\n handleNavigationClick,\n handleToolsClick,\n hasDrawerViewportOverlay,\n isMobile,\n navigationOpen,\n __embeddedViewMode,\n isToolsOpen,\n navigationHide,\n navigationRefs,\n toolsHide,\n toolsRefs,\n } = useAppLayoutInternals();\n\n if (\n !isMobile ||\n __embeddedViewMode ||\n (navigationHide && !breadcrumbs && toolsHide && (!drawers || drawers.length === 0))\n ) {\n return null;\n }\n\n return (\n \n {!navigationHide && (\n \n handleNavigationClick(true)}\n variant=\"icon\"\n className={testutilStyles['navigation-toggle']}\n ref={navigationRefs.toggle}\n disabled={hasDrawerViewportOverlay}\n __nativeAttributes={{ 'aria-haspopup': navigationOpen ? undefined : true }}\n />\n \n )}\n\n {breadcrumbs && (\n
    {breadcrumbs}
    \n )}\n\n {drawers ? (\n \n ) : (\n !toolsHide && (\n \n handleToolsClick(true)}\n variant=\"icon\"\n ref={toolsRefs.toggle}\n __nativeAttributes={{ 'aria-haspopup': true }}\n />\n \n )\n )}\n \n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\nimport { useAppLayoutInternals } from './context';\nimport { InternalButton } from '../../button/internal';\nimport TriggerButton from './trigger-button';\nimport styles from './styles.css.js';\nimport testutilStyles from '../test-classes/styles.css.js';\nimport { Transition } from '../../internal/components/transition';\nimport { findUpUntil } from '../../internal/utils/dom';\nimport customCssProps from '../../internal/generated/custom-css-properties';\n\n/**\n * The Navigation component consists of the following elements:\n * the container, or root element, that sits as a direct child to the Layout grid definition;\n * the show navigation form that contains the trigger for the drawer in large viewports;\n * the navigation, or drawer, that contains the hide navigation form and the children\n * passed through the API;\n */\nexport default function Navigation() {\n const {\n ariaLabels,\n disableBodyScroll,\n handleNavigationClick,\n hasDrawerViewportOverlay,\n isMobile,\n navigationOpen,\n isToolsOpen,\n navigation,\n navigationHide,\n navigationRefs,\n navigationWidth,\n toolsHide,\n } = useAppLayoutInternals();\n\n if (navigationHide) {\n return null;\n }\n\n // Close the Navigation drawer on mobile when a user clicks a link inside.\n const onNavigationClick = (event: React.MouseEvent) => {\n const hasLink = findUpUntil(\n event.target as HTMLElement,\n node => node.tagName === 'A' && !!(node as HTMLAnchorElement).href\n );\n if (hasLink && isMobile) {\n handleNavigationClick(false);\n }\n };\n\n const isUnfocusable = hasDrawerViewportOverlay && (!navigationOpen || (isToolsOpen && !toolsHide));\n\n return (\n \n {(state, transitionEventsRef) => (\n \n {!isMobile && (\n \n handleNavigationClick(true)}\n ref={navigationRefs.toggle}\n />\n \n )}\n\n {\n onNavigationClick && onNavigationClick(event);\n }}\n >\n
    \n
    \n handleNavigationClick(false)}\n variant=\"icon\"\n formAction=\"none\"\n className={testutilStyles['navigation-close']}\n ref={navigationRefs.close}\n />\n
    \n {navigation}\n
    \n \n \n )}\n
    \n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\nimport { getContentHeaderClassName } from '../../internal/utils/content-header-utils';\nimport { useAppLayoutInternals } from './context';\nimport styles from './styles.css.js';\nimport testutilStyles from '../test-classes/styles.css.js';\n\nexport default function Notifications() {\n const { ariaLabels, hasDrawerViewportOverlay, notifications, notificationsElement, stickyNotifications } =\n useAppLayoutInternals();\n\n if (!notifications) {\n return null;\n }\n\n /**\n * The notificationsElement ref is assigned to an inner div to prevent internal bottom margin\n * from affecting the calculated height, which is used for sticky elements below.\n */\n return (\n \n
    {notifications}
    \n \n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\nimport { InternalButton } from '../../button/internal';\nimport { useAppLayoutInternals } from './context';\nimport TriggerButton from './trigger-button';\nimport styles from './styles.css.js';\nimport splitPanelStyles from '../../split-panel/styles.css.js';\nimport testutilStyles from '../test-classes/styles.css.js';\nimport { Transition } from '../../internal/components/transition';\nimport customCssProps from '../../internal/generated/custom-css-properties';\n\ninterface ToolsProps {\n children: React.ReactNode;\n}\n\n/**\n * The Tools component consists of the following elements:\n * the container, or root element, that sits as a direct child to the Layout grid definition;\n * the split panel, which exists only if there is a split panel in side position;\n * the tools, or drawer, that contains the hide tools form and the children passed through the API;\n * the show tools form that contains the triggers for both the drawer and the\n * split panel in large viewports;\n */\nexport default function Tools({ children }: ToolsProps) {\n const {\n ariaLabels,\n disableBodyScroll,\n drawers,\n handleSplitPanelClick,\n handleToolsClick,\n hasDrawerViewportOverlay,\n isMobile,\n isSplitPanelOpen,\n isToolsOpen,\n loseToolsFocus,\n splitPanel,\n splitPanelControlId,\n splitPanelDisplayed,\n splitPanelPosition,\n splitPanelRefs,\n splitPanelToggle,\n tools,\n toolsControlId,\n toolsHide,\n toolsRefs,\n toolsWidth,\n } = useAppLayoutInternals();\n\n const hasSplitPanel = !!splitPanel && splitPanelPosition === 'side';\n const hasToolsForm = getToolsFormStatus(\n hasSplitPanel && splitPanelDisplayed,\n isMobile,\n isSplitPanelOpen,\n isToolsOpen,\n toolsHide\n );\n const hasToolsFormPersistence = getToolsFormPersistence(hasSplitPanel, isSplitPanelOpen, isToolsOpen, toolsHide);\n const isUnfocusable = hasDrawerViewportOverlay && !isToolsOpen;\n\n /**\n * If the drawers property is defined the SplitPanel will be mounted and rendered\n * by the Drawers component.\n */\n if ((toolsHide && !hasSplitPanel) || drawers) {\n return null;\n }\n\n return (\n \n {(state, transitionEventsRef) => (\n {\n if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {\n loseToolsFocus();\n }\n }}\n >\n {children}\n\n {!toolsHide && (\n \n
    \n
    \n handleToolsClick(false)}\n variant=\"icon\"\n formAction=\"none\"\n className={testutilStyles['tools-close']}\n ref={toolsRefs.close}\n />\n
    \n\n {tools}\n
    \n \n )}\n\n {!isMobile && (\n \n {!toolsHide && (\n handleToolsClick(!isToolsOpen)}\n selected={hasSplitPanel && isToolsOpen}\n className={testutilStyles['tools-toggle']}\n ref={toolsRefs.toggle}\n />\n )}\n\n {hasSplitPanel && splitPanelToggle.displayed && (\n handleSplitPanelClick()}\n selected={hasSplitPanel && isSplitPanelOpen}\n className={splitPanelStyles['open-button']}\n ref={splitPanelRefs.toggle}\n />\n )}\n \n )}\n \n )}\n
    \n );\n}\n\n/**\n * By default the Tools form is styled as display: none; This behavior should\n * be unchanged in mobile viewports where the Tools form is always suppressed.\n * In large viewports, however the Tools form and its corresponding buttons\n * should be present in the UI under the below circumstances.\n */\nfunction getToolsFormStatus(\n hasSplitPanel: boolean,\n isMobile: boolean,\n isSplitPanelOpen?: boolean,\n isToolsOpen?: boolean,\n toolsHide?: boolean\n) {\n let hasToolsForm = false;\n\n if (!isMobile) {\n // Both the Split Panel and Tools button are needed\n if (hasSplitPanel && !toolsHide) {\n hasToolsForm = true;\n }\n\n // The Split Panel button is needed\n if (hasSplitPanel && !isSplitPanelOpen && toolsHide) {\n hasToolsForm = true;\n }\n\n // The Tools button is needed\n if (!hasSplitPanel && !toolsHide && !isToolsOpen) {\n hasToolsForm = true;\n }\n }\n\n return hasToolsForm;\n}\n\n/**\n * Under two scenarios the Tools form that contains the triggers\n * for the Tools content and the Split Panel may be persistent\n * in the UI (as opposed to disappearing when one of the drawers\n * is open). This will also add a white background as opposed to the\n * default transparent background. The buttons will present and in a\n * selected / not selected state.\n */\nfunction getToolsFormPersistence(\n hasSplitPanel: boolean,\n isSplitPanelOpen?: boolean,\n isToolsOpen?: boolean,\n toolsHide?: boolean\n) {\n let hasToolsFormPersistence = false;\n\n // Both Tools and Split Panel exist and one or both is open\n if (hasSplitPanel && !toolsHide && (isSplitPanelOpen || isToolsOpen)) {\n hasToolsFormPersistence = true;\n }\n\n return hasToolsFormPersistence;\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { createWidgetizedAppLayout } from './widget';\n\nexport const AppLayoutInternal = createWidgetizedAppLayout();\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { AppLayoutProps } from './interfaces';\n\nconst defaultContentTypeState: AppLayoutState = {\n navigationOpen: true,\n minContentWidth: 280,\n maxContentWidth: undefined,\n};\n\nconst defaults: Record = {\n default: {\n ...defaultContentTypeState,\n },\n dashboard: {\n ...defaultContentTypeState,\n },\n cards: {\n navigationOpen: true,\n minContentWidth: 280,\n maxContentWidth: undefined,\n },\n form: {\n navigationOpen: false,\n minContentWidth: 280,\n maxContentWidth: 800,\n },\n table: {\n navigationOpen: true,\n minContentWidth: 280,\n maxContentWidth: undefined,\n },\n wizard: {\n navigationOpen: false,\n minContentWidth: 280,\n maxContentWidth: 1080,\n },\n};\n\nexport interface AppLayoutState {\n navigationOpen?: boolean;\n minContentWidth: number;\n maxContentWidth?: number | undefined;\n}\n\nexport function applyDefaults(\n contentType: AppLayoutProps.ContentType,\n stateFromProps: Pick,\n isRefresh: boolean\n): AppLayoutState {\n const contentTypeDefaults = isRefresh\n ? { ...defaults[contentType], maxContentWidth: undefined }\n : defaults[contentType];\n\n return {\n maxContentWidth: stateFromProps.maxContentWidth ?? contentTypeDefaults.maxContentWidth,\n minContentWidth: stateFromProps.minContentWidth ?? contentTypeDefaults.minContentWidth,\n navigationOpen: stateFromProps.navigationOpen ?? contentTypeDefaults.navigationOpen,\n };\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useCallback, useEffect, useRef, useState } from 'react';\nimport { useObservedElement } from './use-observed-element';\nimport { useResizeObserver } from '@cloudscape-design/component-toolkit/internal';\n\nexport function useAppLayoutPlacement(headerSelector: string, footerSelector: string) {\n const mainElementRef = useRef(null);\n const headerHeight = useObservedElement(headerSelector);\n const footerHeight = useObservedElement(footerSelector);\n const [offsets, setOffsets] = useState({ left: 0, right: 0, width: Number.POSITIVE_INFINITY });\n\n const updatePosition = useCallback(() => {\n if (!mainElementRef.current) {\n return;\n }\n const { left, right, width } = mainElementRef.current.getBoundingClientRect();\n\n // skip reading sizes in JSDOM\n if (width === 0) {\n return;\n }\n\n setOffsets({ left, right: width - right, width });\n }, []);\n\n useEffect(() => {\n window.addEventListener('resize', updatePosition);\n return () => window.removeEventListener('resize', updatePosition);\n }, [updatePosition]);\n\n useResizeObserver(mainElementRef, updatePosition);\n\n return [mainElementRef, { ...offsets, top: headerHeight, bottom: footerHeight }] as const;\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useResizeObserver } from '@cloudscape-design/component-toolkit/internal';\nimport { useCallback, useState } from 'react';\n\nexport function useObservedElement(selector: string) {\n const getElement = useCallback(() => {\n return document.querySelector(selector);\n }, [selector]);\n\n const [height, setHeight] = useState(0);\n\n useResizeObserver(getElement, entry => setHeight(entry.borderBoxHeight));\n\n return height;\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\n\nimport { AreaChartProps } from './interfaces';\nimport InternalAreaChart from './internal';\nimport useBaseComponent from '../internal/hooks/use-base-component';\n\nexport { AreaChartProps };\n\nfunction AreaChart({\n height = 500,\n xScaleType = 'linear',\n yScaleType = 'linear',\n statusType = 'finished',\n detailPopoverSize = 'medium',\n i18nStrings = {},\n ...props\n}: AreaChartProps) {\n const baseComponentProps = useBaseComponent('AreaChart', {\n props: {\n detailPopoverSize,\n hideLegend: props.hideLegend,\n hideFilter: props.hideFilter,\n fitHeight: props.fitHeight,\n xScaleType,\n yScaleType,\n },\n });\n return (\n \n );\n}\n\napplyDisplayName(AreaChart, 'AreaChart');\n\nexport default AreaChart;\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { isDevelopment } from '../internal/is-development';\nimport { getBaseProps } from '../internal/base-component';\nimport ChartStatusContainer, { getChartStatus } from '../internal/components/chart-status-container';\n\nimport AreaChartFilter from './elements/area-chart-filter';\nimport AreaChartLegend from './elements/area-chart-legend';\nimport { AreaChartProps } from './interfaces';\nimport ChartContainer from './chart-container';\nimport styles from './styles.css.js';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport useChartModel from './model/use-chart-model';\nimport useFilterProps from './model/use-filter-props';\nimport useHighlightProps from './model/use-highlight-props';\nimport { isSeriesValid } from './model/utils';\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { SomeRequired } from '../internal/types';\nimport { nodeBelongs } from '../internal/utils/node-belongs';\nimport { ChartWrapper } from '../internal/components/chart-wrapper';\n\ntype InternalAreaChartProps = SomeRequired<\n AreaChartProps,\n 'height' | 'xScaleType' | 'yScaleType' | 'statusType' | 'detailPopoverSize' | 'i18nStrings'\n> &\n InternalBaseComponentProps;\n\nexport default function InternalAreaChart({\n fitHeight,\n height,\n xScaleType,\n yScaleType,\n xDomain,\n yDomain,\n xTickFormatter,\n yTickFormatter,\n detailTotalFormatter,\n highlightedSeries: controlledHighlightedSeries,\n visibleSeries: controlledVisibleSeries,\n series: externalSeries,\n onFilterChange: controlledOnVisibleChange,\n onHighlightChange: controlledOnHighlightChange,\n i18nStrings,\n ariaLabel,\n ariaLabelledby,\n ariaDescription,\n xTitle,\n yTitle,\n hideFilter,\n additionalFilters,\n hideLegend,\n legendTitle,\n statusType,\n detailPopoverSize,\n detailPopoverFooter,\n empty,\n noMatch,\n errorText,\n loadingText,\n recoveryText,\n onRecoveryClick,\n __internalRootRef = null,\n ...props\n}: InternalAreaChartProps) {\n const baseProps = getBaseProps(props);\n const containerRef = useRef(null);\n const popoverRef = useRef(null);\n\n if (isDevelopment) {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useEffect(() => {\n if (!isSeriesValid(externalSeries)) {\n warnOnce(\n 'AreaChart',\n \"The `series` property violates the component's constraints: all `area` \" +\n 'series must have `data` arrays of the same length and with the same x-values.'\n );\n }\n }, [externalSeries]);\n }\n\n const [width, setWidth] = useState(0);\n const [visibleSeries, setVisibleSeries] = useFilterProps(\n externalSeries,\n controlledVisibleSeries,\n controlledOnVisibleChange\n );\n const [highlightedSeries, setHighlightedSeries] = useHighlightProps(\n externalSeries,\n controlledHighlightedSeries,\n controlledOnHighlightChange\n );\n const model = useChartModel({\n fitHeight,\n externalSeries,\n visibleSeries,\n setVisibleSeries,\n highlightedSeries,\n setHighlightedSeries,\n xDomain,\n yDomain,\n xScaleType,\n yScaleType,\n height,\n width,\n popoverRef,\n });\n\n const { isEmpty, isNoMatch, showChart } = getChartStatus({\n externalData: externalSeries,\n visibleData: visibleSeries,\n statusType,\n });\n const showFilters = statusType === 'finished' && (!isEmpty || isNoMatch) && (additionalFilters || !hideFilter);\n const showLegend = !hideLegend && !isEmpty && statusType === 'finished';\n const reserveLegendSpace = !showChart && !hideLegend;\n const reserveFilterSpace = !showChart && !isNoMatch && (!hideFilter || additionalFilters);\n\n useEffect(() => {\n const onKeyDown = model.handlers.onDocumentKeyDown;\n document.addEventListener('keydown', onKeyDown);\n return () => document.removeEventListener('keydown', onKeyDown);\n }, [model.handlers.onDocumentKeyDown]);\n\n const onBlur = (event: React.FocusEvent) => {\n if (event.relatedTarget && !nodeBelongs(containerRef.current, event.relatedTarget)) {\n model.handlers.onContainerBlur();\n }\n };\n\n const mergedRef = useMergeRefs(containerRef, __internalRootRef);\n\n return (\n \n ) : null\n }\n additionalFilters={showFilters ? additionalFilters : null}\n reserveFilterSpace={!!reserveFilterSpace}\n reserveLegendSpace={!!reserveLegendSpace}\n chartStatus={\n \n }\n chart={\n showChart ? (\n \n ) : null\n }\n legend={\n showLegend ? (\n \n ) : null\n }\n onBlur={onBlur}\n />\n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useMemo } from 'react';\n\nimport { BaseComponentProps } from '../../base-component';\nimport { fireNonCancelableEvent, NonCancelableEventHandler } from '../../events';\nimport InternalStatusIndicator from '../../../status-indicator/internal';\nimport InternalLink from '../../../link/internal';\n\nimport styles from './styles.css.js';\nimport { useInternalI18n } from '../../../i18n/context';\n\ninterface ChartStatusContainerProps extends BaseComponentProps {\n statusType: 'loading' | 'finished' | 'error';\n\n empty?: React.ReactNode;\n noMatch?: React.ReactNode;\n\n loadingText?: string;\n errorText?: string;\n recoveryText?: string;\n\n onRecoveryClick?: NonCancelableEventHandler;\n\n // From `getChartStatus`\n isEmpty?: boolean;\n isNoMatch?: boolean;\n showChart?: boolean;\n}\n\nexport function getChartStatus({\n externalData,\n visibleData,\n statusType,\n}: {\n externalData: ReadonlyArray;\n visibleData: ReadonlyArray;\n statusType: 'loading' | 'finished' | 'error';\n}) {\n const isEmpty = !visibleData || visibleData.length === 0;\n const isNoMatch = isEmpty && visibleData.length !== externalData.length;\n const showChart = statusType === 'finished' && !isEmpty;\n return { isEmpty, isNoMatch, showChart };\n}\n\nexport default function ChartStatusContainer({\n statusType,\n errorText,\n loadingText,\n recoveryText,\n noMatch,\n empty,\n onRecoveryClick,\n isNoMatch,\n isEmpty,\n showChart,\n}: ChartStatusContainerProps) {\n const i18n = useInternalI18n('[charts]');\n\n const statusContainer = useMemo(() => {\n const handleRecoveryClick = (event: CustomEvent) => {\n event.preventDefault();\n fireNonCancelableEvent(onRecoveryClick);\n };\n if (statusType === 'error') {\n const renderedRecoveryText = i18n('recoveryText', recoveryText);\n return (\n \n {i18n('errorText', errorText)}{' '}\n {!!renderedRecoveryText && !!onRecoveryClick && (\n \n {renderedRecoveryText}\n \n )}\n \n );\n }\n\n if (statusType === 'loading') {\n return {i18n('loadingText', loadingText)};\n }\n\n if (isNoMatch) {\n return
    {noMatch}
    ;\n }\n\n if (isEmpty) {\n return
    {empty}
    ;\n }\n }, [i18n, statusType, onRecoveryClick, isEmpty, isNoMatch, recoveryText, loadingText, errorText, empty, noMatch]);\n\n return (\n
    \n {!showChart && statusContainer}\n
    \n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useContext, useRef } from 'react';\nimport clsx from 'clsx';\nimport InternalIcon from '../icon/internal';\nimport styles from './styles.css.js';\nimport { getBaseProps } from '../internal/base-component';\nimport { fireCancelableEvent, isPlainLeftClick } from '../internal/events';\nimport useForwardFocus from '../internal/hooks/forward-focus';\nimport { KeyCode } from '../internal/keycode';\nimport { LinkProps } from './interfaces';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { checkSafeUrl } from '../internal/utils/check-safe-url';\nimport { useInternalI18n } from '../i18n/context';\nimport { InfoLinkLabelContext } from '../internal/context/info-link-label-context';\nimport { useFunnel, useFunnelStep, useFunnelSubStep } from '../internal/analytics/hooks/use-funnel';\n\nimport { FunnelMetrics } from '../internal/analytics';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport {\n DATA_ATTR_FUNNEL_VALUE,\n getFunnelValueSelector,\n getNameFromSelector,\n getSubStepAllSelector,\n} from '../internal/analytics/selectors';\nimport { LinkDefaultVariantContext } from '../internal/context/link-default-variant-context';\nimport { useSingleTabStopNavigation } from '../internal/context/single-tab-stop-navigation-context';\n\ntype InternalLinkProps = InternalBaseComponentProps &\n Omit & {\n variant?: LinkProps['variant'] | 'top-navigation' | 'link' | 'recovery';\n };\n\nconst InternalLink = React.forwardRef(\n (\n {\n variant: providedVariant,\n fontSize = 'body-m',\n color = 'normal',\n external = false,\n target,\n href,\n rel,\n ariaLabel,\n externalIconAriaLabel,\n onFollow,\n children,\n __internalRootRef = null,\n ...props\n }: InternalLinkProps,\n ref: React.Ref\n ) => {\n checkSafeUrl('Link', href);\n const isButton = !href;\n const { defaultVariant } = useContext(LinkDefaultVariantContext);\n const variant = providedVariant || defaultVariant;\n const specialStyles = ['top-navigation', 'link', 'recovery'];\n const hasSpecialStyle = specialStyles.indexOf(variant) > -1;\n\n const i18n = useInternalI18n('link');\n const baseProps = getBaseProps(props);\n const anchorTarget = target ?? (external ? '_blank' : undefined);\n const anchorRel = rel ?? (anchorTarget === '_blank' ? 'noopener noreferrer' : undefined);\n const uniqueId = useUniqueId('link');\n const linkId = useUniqueId('link-self');\n const infoId = useUniqueId('link-info');\n\n const infoLinkLabelFromContext = useContext(InfoLinkLabelContext);\n\n const { funnelInteractionId } = useFunnel();\n const { stepNumber, stepNameSelector } = useFunnelStep();\n const { subStepSelector, subStepNameSelector } = useFunnelSubStep();\n\n const fireFunnelEvent = (funnelInteractionId: string) => {\n if (variant === 'info') {\n const stepName = getNameFromSelector(stepNameSelector);\n const subStepName = getNameFromSelector(subStepNameSelector);\n\n FunnelMetrics.helpPanelInteracted({\n funnelInteractionId,\n stepNumber,\n stepName,\n stepNameSelector,\n subStepSelector,\n subStepName,\n subStepNameSelector,\n elementSelector: getFunnelValueSelector(uniqueId),\n subStepAllSelector: getSubStepAllSelector(),\n });\n } else if (external) {\n const stepName = getNameFromSelector(stepNameSelector);\n const subStepName = getNameFromSelector(subStepNameSelector);\n\n FunnelMetrics.externalLinkInteracted({\n funnelInteractionId,\n stepNumber,\n stepName,\n stepNameSelector,\n subStepSelector,\n subStepName,\n subStepNameSelector,\n elementSelector: getFunnelValueSelector(uniqueId),\n subStepAllSelector: getSubStepAllSelector(),\n });\n }\n };\n\n const fireFollowEvent = (event: React.SyntheticEvent) => {\n if (funnelInteractionId) {\n fireFunnelEvent(funnelInteractionId);\n }\n\n fireCancelableEvent(onFollow, { href, external, target: anchorTarget }, event);\n };\n\n const handleLinkClick = (event: React.MouseEvent) => {\n if (isPlainLeftClick(event)) {\n fireFollowEvent(event);\n }\n };\n\n const handleButtonClick = (event: React.MouseEvent) => {\n fireFollowEvent(event);\n };\n\n const handleButtonKeyDown = (event: React.KeyboardEvent) => {\n if (event.keyCode === KeyCode.space || event.keyCode === KeyCode.enter) {\n event.preventDefault();\n fireFollowEvent(event);\n }\n };\n\n const linkRef = useRef(null);\n const isVisualRefresh = useVisualRefresh();\n useForwardFocus(ref, linkRef);\n\n // Visual refresh should only add styles to buttons that don't already have unique styles (e.g. primary/secondary variants)\n const applyButtonStyles = isButton && isVisualRefresh && !hasSpecialStyle;\n\n const sharedProps = {\n id: linkId,\n ...baseProps,\n // https://github.com/microsoft/TypeScript/issues/36659\n ref: useMergeRefs(linkRef, __internalRootRef),\n className: clsx(\n styles.link,\n baseProps.className,\n applyButtonStyles ? styles.button : null,\n styles[getVariantStyle(variant)],\n styles[getFontSizeStyle(variant, fontSize)],\n styles[getColorStyle(variant, color)]\n ),\n 'aria-label': ariaLabel,\n 'aria-labelledby': '',\n [DATA_ATTR_FUNNEL_VALUE]: uniqueId,\n };\n\n if (variant === 'info' && infoLinkLabelFromContext && !ariaLabel) {\n sharedProps['aria-labelledby'] = `${sharedProps.id} ${infoId} ${infoLinkLabelFromContext}`;\n }\n\n const renderedExternalIconAriaLabel = i18n('externalIconAriaLabel', externalIconAriaLabel);\n const content = (\n <>\n {children}\n {external && (\n \n  \n \n \n \n \n )}\n {variant === 'info' && (\n \n )}\n \n );\n\n const { tabIndex } = useSingleTabStopNavigation(linkRef, { tabIndex: isButton ? 0 : undefined });\n\n if (isButton) {\n return (\n \n {content}\n \n );\n }\n\n return (\n // we dynamically set proper rel in the code above\n // eslint-disable-next-line react/jsx-no-target-blank\n \n {content}\n \n );\n }\n);\n\nfunction getVariantStyle(variant: Exclude) {\n return `variant-${variant.replace(/^awsui-/, '')}`;\n}\n\nfunction getFontSizeStyle(variant: InternalLinkProps['variant'], fontSize: InternalLinkProps['fontSize']) {\n switch (variant) {\n case 'info':\n return 'font-size-body-s';\n case 'awsui-value-large':\n return 'font-size-display-l';\n default:\n return `font-size-${fontSize}`;\n }\n}\n\nfunction getColorStyle(variant: InternalLinkProps['variant'], color: InternalLinkProps['color']) {\n return `color-${variant === 'info' ? 'normal' : color}`;\n}\n\nexport default InternalLink;\n", "\n import './styles.scoped.css';\n export default {\n \"link\": \"awsui_link_4c84z_i6aqa_99\",\n \"variant-secondary\": \"awsui_variant-secondary_4c84z_i6aqa_168\",\n \"variant-primary\": \"awsui_variant-primary_4c84z_i6aqa_203\",\n \"variant-info\": \"awsui_variant-info_4c84z_i6aqa_236\",\n \"variant-value-large\": \"awsui_variant-value-large_4c84z_i6aqa_271\",\n \"variant-top-navigation\": \"awsui_variant-top-navigation_4c84z_i6aqa_303\",\n \"variant-recovery\": \"awsui_variant-recovery_4c84z_i6aqa_336\",\n \"button\": \"awsui_button_4c84z_i6aqa_369\",\n \"color-inverted\": \"awsui_color-inverted_4c84z_i6aqa_404\",\n \"font-size-body-s\": \"awsui_font-size-body-s_4c84z_i6aqa_425\",\n \"font-size-body-m\": \"awsui_font-size-body-m_4c84z_i6aqa_432\",\n \"font-size-heading-xs\": \"awsui_font-size-heading-xs_4c84z_i6aqa_438\",\n \"font-size-heading-s\": \"awsui_font-size-heading-s_4c84z_i6aqa_444\",\n \"font-size-heading-m\": \"awsui_font-size-heading-m_4c84z_i6aqa_451\",\n \"font-size-heading-l\": \"awsui_font-size-heading-l_4c84z_i6aqa_458\",\n \"font-size-heading-xl\": \"awsui_font-size-heading-xl_4c84z_i6aqa_465\",\n \"font-size-display-l\": \"awsui_font-size-display-l_4c84z_i6aqa_472\",\n \"font-size-inherit\": \"awsui_font-size-inherit_4c84z_i6aqa_479\",\n \"icon-wrapper\": \"awsui_icon-wrapper_4c84z_i6aqa_491\",\n \"icon\": \"awsui_icon_4c84z_i6aqa_491\"\n};\n ", "\n import './styles.scoped.css';\n export default {\n \"root\": \"awsui_root_11n0s_6tm6j_9\",\n \"empty\": \"awsui_empty_11n0s_6tm6j_13\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { memo } from 'react';\n\nimport { AreaChartProps } from '../interfaces';\nimport { ChartModel } from '../model';\nimport ChartFilter from '../../internal/components/chart-filter';\n\nexport default memo(AreaChartFilter) as typeof AreaChartFilter;\n\nfunction AreaChartFilter({\n model,\n filterLabel,\n filterPlaceholder,\n filterSelectedAriaLabel,\n}: {\n model: ChartModel;\n filterLabel?: string;\n filterPlaceholder?: string;\n filterSelectedAriaLabel?: string;\n}) {\n const filterItems = model.allSeries.map(s => {\n const { title, color, markerType } = model.getInternalSeries(s);\n return { label: title, color, type: markerType, datum: s };\n });\n\n return (\n \n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { useCallback, memo } from 'react';\n\nimport { NonCancelableEventHandler } from '../../events';\nimport InternalFormField from '../../../form-field/internal';\nimport InternalMultiselect from '../../../multiselect/internal';\nimport { BaseComponentProps, getBaseProps } from '../../base-component';\nimport { MultiselectProps } from '../../../multiselect/interfaces';\nimport SeriesMarker, { ChartSeriesMarkerType } from '../chart-series-marker';\nimport { useInternalI18n } from '../../../i18n/context';\n\nimport styles from './styles.css.js';\n\ninterface I18nStrings {\n filterLabel?: string;\n filterPlaceholder?: string;\n filterSelectedAriaLabel?: string;\n}\n\nexport interface ChartFilterItem {\n label: string;\n color: string;\n type: ChartSeriesMarkerType;\n datum: T;\n}\n\nexport interface ChartFilterProps extends BaseComponentProps {\n series: ReadonlyArray>;\n selectedSeries?: ReadonlyArray;\n onChange: (selectedSeries: ReadonlyArray) => void;\n i18nStrings?: I18nStrings;\n}\n\nexport default memo(ChartFilter) as typeof ChartFilter;\n\nfunction ChartFilter({ series, i18nStrings, selectedSeries, onChange, ...restProps }: ChartFilterProps) {\n const baseProps = getBaseProps(restProps);\n const className = clsx(baseProps.className, styles.root);\n const i18n = useInternalI18n('[charts]');\n\n const defaultOptions = series.map((d, i) => ({\n label: d.label,\n value: '' + i,\n datum: d.datum,\n __customIcon: (\n \n \n \n ),\n }));\n\n const selectedOptions = defaultOptions.filter(option => selectedSeries?.indexOf(option.datum) !== -1);\n\n const updateSelection = useCallback>(\n ({ detail: { selectedOptions } }) => {\n const selectedSeries = defaultOptions\n .filter(option => selectedOptions.indexOf(option) !== -1)\n .map(option => option.datum);\n onChange(selectedSeries);\n },\n [onChange, defaultOptions]\n );\n\n return (\n \n \n \n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useCallback, useEffect, useRef, useState } from 'react';\nimport clsx from 'clsx';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\n\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component/index.js';\nimport { useFormFieldContext } from '../internal/context/form-field-context';\nimport { getBaseProps } from '../internal/base-component';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { isGroup } from '../internal/components/option/utils/filter-options';\n\nimport DropdownFooter from '../internal/components/dropdown-footer/index.js';\nimport { prepareOptions } from '../internal/components/option/utils/prepare-options';\nimport { OptionDefinition, OptionGroup } from '../internal/components/option/interfaces';\nimport Dropdown from '../internal/components/dropdown';\nimport { useDropdownStatus } from '../internal/components/dropdown-status';\n\nimport { useSelect, MenuProps } from '../select/utils/use-select';\nimport { useNativeSearch } from '../select/utils/use-native-search';\nimport { useLoadItems } from '../select/utils/use-load-items';\nimport { useAnnouncement } from '../select/utils/use-announcement';\nimport { findOptionIndex } from '../select/utils/connect-options';\nimport PlainList, { SelectListProps } from '../select/parts/plain-list';\nimport VirtualList from '../select/parts/virtual-list';\nimport { checkOptionValueField } from '../select/utils/check-option-value-field.js';\nimport Filter from '../select/parts/filter';\nimport Trigger from '../select/parts/trigger';\n\nimport InternalTokenGroup from '../token-group/internal';\nimport { TokenGroupProps } from '../token-group/interfaces';\n\nimport { MultiselectProps } from './interfaces';\nimport styles from './styles.css.js';\nimport ScreenreaderOnly from '../internal/components/screenreader-only';\nimport { joinStrings } from '../internal/utils/strings';\nimport { useInternalI18n } from '../i18n/context';\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\ntype InternalMultiselectProps = MultiselectProps & InternalBaseComponentProps & { inlineTokens?: boolean };\n\nconst InternalMultiselect = React.forwardRef(\n (\n {\n options = [],\n filteringType = 'none',\n filteringPlaceholder,\n filteringAriaLabel,\n filteringClearAriaLabel,\n filteringResultsText,\n ariaRequired,\n placeholder,\n disabled,\n ariaLabel,\n statusType = 'finished',\n empty,\n loadingText,\n finishedText,\n errorText,\n noMatch,\n renderHighlightedAriaLive,\n selectedOptions = [],\n deselectAriaLabel,\n keepOpen = true,\n tokenLimit,\n i18nStrings,\n onBlur,\n onFocus,\n onLoadItems,\n onChange,\n virtualScroll,\n inlineTokens = false,\n hideTokens = false,\n expandToViewport,\n tokenLimitShowFewerAriaLabel,\n tokenLimitShowMoreAriaLabel,\n __internalRootRef = null,\n autoFocus,\n ...restProps\n }: InternalMultiselectProps,\n externalRef: React.Ref\n ) => {\n checkOptionValueField('Multiselect', 'options', options);\n\n const baseProps = getBaseProps(restProps);\n const formFieldContext = useFormFieldContext(restProps);\n const i18n = useInternalI18n('multiselect');\n\n const i18nCommon = useInternalI18n('select');\n const recoveryText = i18nCommon('recoveryText', restProps.recoveryText);\n const errorIconAriaLabel = i18nCommon('errorIconAriaLabel', restProps.errorIconAriaLabel);\n const selectedAriaLabel = i18nCommon('selectedAriaLabel', restProps.selectedAriaLabel);\n\n if (restProps.recoveryText && !onLoadItems) {\n warnOnce('Multiselect', '`onLoadItems` must be provided for `recoveryText` to be displayed.');\n }\n\n const { handleLoadMore, handleRecoveryClick, fireLoadItems } = useLoadItems({\n onLoadItems,\n options,\n statusType,\n });\n const useInteractiveGroups = true;\n const [filteringValue, setFilteringValue] = useState('');\n const { filteredOptions, parentMap, totalCount, matchesCount } = prepareOptions(\n options,\n filteringType,\n filteringValue\n );\n\n const updateSelectedOption = useCallback(\n (option: OptionDefinition | OptionGroup) => {\n const filtered = filteredOptions.filter(item => item.type !== 'parent').map(item => item.option);\n\n // switch between selection and deselection behavior, ignores disabled options to prevent\n // getting stuck on one behavior when an option is disabled and its state cannot be changed\n const isAllChildrenSelected = (optionsArray: OptionDefinition[]) =>\n optionsArray.every(item => findOptionIndex(selectedOptions, item) > -1 || item.disabled);\n const intersection = (visibleOptions: OptionDefinition[], options: OptionDefinition[]) =>\n visibleOptions.filter(item => findOptionIndex(options, item) > -1 && !item.disabled);\n const union = (visibleOptions: OptionDefinition[], options: OptionDefinition[]) =>\n visibleOptions.filter(item => findOptionIndex(options, item) === -1).concat(options);\n const select = (options: OptionDefinition[], selectedOptions: OptionDefinition[]) => {\n return union(selectedOptions, options);\n };\n const unselect = (options: OptionDefinition[], selectedOptions: OptionDefinition[]) => {\n return selectedOptions.filter(option => findOptionIndex(options, option) === -1);\n };\n let newSelectedOptions = [...selectedOptions];\n\n if (isGroup(option)) {\n const visibleOptions = intersection([...option.options], filtered);\n newSelectedOptions = isAllChildrenSelected(visibleOptions)\n ? unselect(visibleOptions, newSelectedOptions)\n : select(visibleOptions, newSelectedOptions);\n } else {\n newSelectedOptions = isAllChildrenSelected([option])\n ? unselect([option], newSelectedOptions)\n : select([option], newSelectedOptions);\n }\n\n fireNonCancelableEvent(onChange, {\n selectedOptions: newSelectedOptions,\n });\n },\n [onChange, selectedOptions, filteredOptions]\n );\n\n const rootRef = useRef(null);\n\n const selfControlId = useUniqueId('trigger');\n const controlId = formFieldContext.controlId ?? selfControlId;\n\n const multiSelectAriaLabelId = useUniqueId('multiselect-arialabel-');\n\n const footerId = useUniqueId('footer');\n\n const scrollToIndex = useRef(null);\n const {\n isOpen,\n highlightType,\n highlightedOption,\n highlightedIndex,\n getTriggerProps,\n getDropdownProps,\n getFilterProps,\n getMenuProps,\n getOptionProps,\n highlightOption,\n announceSelected,\n } = useSelect({\n selectedOptions,\n updateSelectedOption,\n options: filteredOptions,\n filteringType,\n onFocus,\n onBlur,\n externalRef,\n keepOpen,\n fireLoadItems,\n setFilteringValue,\n useInteractiveGroups,\n statusType,\n });\n\n const handleNativeSearch = useNativeSearch({\n isEnabled: filteringType === 'none' && isOpen,\n options: filteredOptions,\n highlightOption: highlightOption,\n highlightedOption: highlightedOption?.option,\n useInteractiveGroups,\n });\n\n const isEmpty = !options || options.length === 0;\n const isNoMatch = filteredOptions && filteredOptions.length === 0;\n const isFiltered =\n filteringType !== 'none' && filteringValue.length > 0 && filteredOptions && filteredOptions.length > 0;\n const filteredText = isFiltered ? filteringResultsText?.(matchesCount, totalCount) : undefined;\n const dropdownStatus = useDropdownStatus({\n statusType,\n empty,\n loadingText,\n finishedText,\n errorText,\n recoveryText,\n isEmpty,\n isNoMatch,\n noMatch,\n isFiltered,\n filteringResultsText: filteredText,\n onRecoveryClick: handleRecoveryClick,\n errorIconAriaLabel: errorIconAriaLabel,\n hasRecoveryCallback: !!onLoadItems,\n });\n\n const filter = (\n \n );\n\n const trigger = (\n \n );\n\n const menuProps: MenuProps = {\n ...getMenuProps(),\n onLoadMore: handleLoadMore,\n ariaLabelledby: joinStrings(multiSelectAriaLabelId, controlId),\n ariaDescribedby: dropdownStatus.content ? footerId : undefined,\n };\n\n const announcement = useAnnouncement({\n announceSelected,\n highlightedOption,\n getParent: option => parentMap.get(option)?.option as undefined | OptionGroup,\n selectedAriaLabel,\n renderHighlightedAriaLive,\n });\n\n const tokens: TokenGroupProps['items'] = selectedOptions.map(option => ({\n label: option.label,\n disabled: disabled || option.disabled,\n labelTag: option.labelTag,\n description: option.description,\n iconAlt: option.iconAlt,\n iconName: option.iconName,\n iconUrl: option.iconUrl,\n iconSvg: option.iconSvg,\n tags: option.tags,\n dismissLabel: i18n('deselectAriaLabel', deselectAriaLabel?.(option), format =>\n format({ option__label: option.label ?? '' })\n ),\n }));\n\n useEffect(() => {\n scrollToIndex.current?.(highlightedIndex);\n }, [highlightedIndex]);\n\n const ListComponent = virtualScroll ? VirtualList : PlainList;\n\n const handleMouseDown = (event: React.MouseEvent) => {\n const target = event.target as HTMLElement;\n\n if (target !== document.activeElement) {\n // prevent currently focused element from losing it\n event.preventDefault();\n }\n };\n\n const showTokens = !hideTokens && !inlineTokens && tokens.length > 0;\n const handleTokenDismiss: TokenGroupProps['onDismiss'] = ({ detail }) => {\n const optionToDeselect = selectedOptions[detail.itemIndex];\n updateSelectedOption(optionToDeselect);\n const targetRef = getTriggerProps().ref;\n if (targetRef.current) {\n targetRef.current.focus();\n }\n };\n\n const tokenGroupI18nStrings: TokenGroupProps.I18nStrings = {\n limitShowFewer: i18nStrings?.tokenLimitShowFewer,\n limitShowMore: i18nStrings?.tokenLimitShowMore,\n };\n\n const mergedRef = useMergeRefs(rootRef, __internalRootRef);\n\n const dropdownProps = getDropdownProps();\n\n return (\n \n \n ) : null\n }\n expandToViewport={expandToViewport}\n stretchBeyondTriggerWidth={true}\n >\n \n ) : null\n }\n menuProps={menuProps}\n getOptionProps={getOptionProps}\n filteredOptions={filteredOptions}\n filteringValue={filteringValue}\n ref={scrollToIndex}\n hasDropdownStatus={dropdownStatus.content !== null}\n checkboxes={true}\n useInteractiveGroups={useInteractiveGroups}\n screenReaderContent={announcement}\n highlightType={highlightType}\n />\n \n {showTokens && (\n \n )}\n {ariaLabel}\n \n );\n }\n);\n\nexport default InternalMultiselect;\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { DropdownOption, OptionDefinition, OptionGroup } from '../interfaces';\n\ntype SearchableField = 'value' | 'label' | 'description' | 'labelTag';\ntype SearchableTagField = 'tags' | 'filteringTags';\n\nconst searchableFields: SearchableField[] = ['value', 'label', 'description', 'labelTag'];\n\nexport const matchesString = (value: string | undefined, searchText: string, strictMatching: boolean): boolean => {\n if (!value) {\n return false;\n }\n const index = value.toLowerCase().indexOf(searchText);\n return strictMatching ? index === 0 : index > -1;\n};\n\nconst matchesSingleOption = (dropdownOption: DropdownOption, text: string, strictMatching: boolean): boolean => {\n const searchText = text.toLowerCase();\n\n const option: OptionDefinition = dropdownOption.option;\n const searchStrFields = (attr: SearchableField) => matchesString(option[attr], searchText, strictMatching);\n const searchTagsFields = (attr: SearchableTagField) =>\n option[attr]?.some(value => matchesString(value, searchText, strictMatching));\n\n const searchableTagFields: SearchableTagField[] = ['tags'];\n if (!strictMatching) {\n searchableTagFields.push('filteringTags');\n }\n\n return searchableFields.some(searchStrFields) || searchableTagFields.some(searchTagsFields);\n};\n\nexport const filterOptions = (\n options: ReadonlyArray,\n searchText: string,\n strictMatching = false\n): ReadonlyArray => {\n if (searchText === '') {\n return options;\n }\n\n let currentGroup: DropdownOption | null = null;\n let parentMatched = false;\n return options.reduce((acc, option) => {\n if (option.type === 'parent') {\n parentMatched = false;\n currentGroup = option;\n if (matchesSingleOption(option, searchText, strictMatching)) {\n parentMatched = true;\n acc.push(currentGroup);\n }\n return acc;\n }\n if (option.type !== 'child') {\n currentGroup = null;\n parentMatched = false;\n }\n if (parentMatched) {\n acc.push(option);\n } else if (matchesSingleOption(option, searchText, strictMatching)) {\n if (currentGroup) {\n acc.push(currentGroup);\n currentGroup = null;\n }\n acc.push(option);\n }\n return acc;\n }, []);\n};\n\nexport const isInteractive = (option?: DropdownOption) => !!option && !option.disabled && option.type !== 'parent';\n\nexport const isGroupInteractive = (option?: DropdownOption) => !!option && !option.disabled;\n\nexport const isGroup = (option?: OptionDefinition | OptionGroup): option is OptionGroup =>\n !!option && 'options' in option;\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport styles from './styles.css.js';\nimport DropdownStatus from '../dropdown-status/index.js';\nimport LiveRegion from '../live-region/index.js';\n\ninterface DropdownFooter {\n content?: React.ReactNode | null;\n hasItems?: boolean;\n id?: string;\n}\n\nconst DropdownFooter: React.FC = ({ content, id, hasItems = true }: DropdownFooter) => (\n
    \n \n {content && {content}}\n \n
    \n);\n\nexport default DropdownFooter;\n", "\n import './styles.scoped.css';\n export default {\n \"root\": \"awsui_root_1afi9_5kqbd_99\",\n \"hidden\": \"awsui_hidden_1afi9_5kqbd_133\",\n \"no-items\": \"awsui_no-items_1afi9_5kqbd_136\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport InternalLink from '../../../link/internal';\n\nimport InternalStatusIndicator from '../../../status-indicator/internal';\nimport { NonCancelableEventHandler, fireNonCancelableEvent } from '../../events';\nimport { usePrevious } from '../../hooks/use-previous';\n\nimport { DropdownStatusProps } from './interfaces';\nimport styles from './styles.css.js';\n\nexport { DropdownStatusProps };\n\nexport interface DropdownStatusPropsExtended extends DropdownStatusProps {\n isEmpty?: boolean;\n isNoMatch?: boolean;\n isFiltered?: boolean;\n noMatch?: React.ReactNode;\n filteringResultsText?: string;\n /**\n * Called when the user clicks the recovery button placed at the\n * bottom of the dropdown list in the error state. Use this to\n * retry a failed request or provide another option for the user\n * to recover from the error.\n */\n onRecoveryClick?: NonCancelableEventHandler;\n /**\n * Determines if retry button should be rendered\n * in case recoveryText was automatically provided by i18n.\n */\n hasRecoveryCallback?: boolean;\n}\n\nfunction DropdownStatus({ children }: { children: React.ReactNode }) {\n return
    {children}
    ;\n}\n\ntype UseDropdownStatus = ({\n statusType,\n empty,\n loadingText,\n finishedText,\n filteringResultsText,\n errorText,\n recoveryText,\n isEmpty,\n isNoMatch,\n isFiltered,\n noMatch,\n hasRecoveryCallback,\n onRecoveryClick,\n}: DropdownStatusPropsExtended) => DropdownStatusResult;\n\ninterface DropdownStatusResult {\n isSticky: boolean;\n content: React.ReactNode | null;\n}\n\nexport const useDropdownStatus: UseDropdownStatus = ({\n statusType,\n empty,\n loadingText,\n finishedText,\n filteringResultsText,\n errorText,\n recoveryText,\n isEmpty,\n isNoMatch,\n isFiltered,\n noMatch,\n onRecoveryClick,\n hasRecoveryCallback = false,\n errorIconAriaLabel,\n}) => {\n const previousStatusType = usePrevious(statusType);\n const statusResult: DropdownStatusResult = { isSticky: true, content: null };\n\n if (statusType === 'loading') {\n statusResult.content = {loadingText};\n } else if (statusType === 'error') {\n statusResult.content = (\n \n \n {errorText}\n {' '}\n {!!recoveryText && hasRecoveryCallback && (\n fireNonCancelableEvent(onRecoveryClick)}\n variant=\"recovery\"\n className={styles.recovery}\n >\n {recoveryText}\n \n )}\n \n );\n } else if (isEmpty && empty) {\n statusResult.content = empty;\n } else if (isNoMatch && noMatch) {\n statusResult.content = noMatch;\n } else if (isFiltered && filteringResultsText) {\n statusResult.content = filteringResultsText;\n } else if (statusType === 'finished' && finishedText) {\n statusResult.content = finishedText;\n statusResult.isSticky = false;\n }\n\n return statusResult;\n};\n\nexport default DropdownStatus;\n", "\n import './styles.scoped.css';\n export default {\n \"root\": \"awsui_root_vrgzu_ljki3_99\",\n \"recovery\": \"awsui_recovery_vrgzu_ljki3_137\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { OptionGroup, OptionDefinition, DropdownOption } from '../interfaces';\n\nexport const flattenOptions = (options: ReadonlyArray) => {\n const parentMap = new Map();\n\n const flatOptions = options.reduce((acc, option) => {\n if ('options' in option) {\n const { options, ...rest } = option;\n const parentDropdownOption: DropdownOption = { type: 'parent', option };\n const allOptionsDisabled = options.every(option => option.disabled);\n if (option.disabled || allOptionsDisabled) {\n parentDropdownOption.disabled = true;\n }\n acc.push(parentDropdownOption);\n options.forEach(child => {\n const childDropdownOption: DropdownOption = { type: 'child', option: child };\n if (rest.disabled || child.disabled) {\n childDropdownOption.disabled = true;\n }\n acc.push(childDropdownOption);\n parentMap.set(childDropdownOption, parentDropdownOption);\n });\n } else {\n const dropdownOption: DropdownOption = { option };\n if (option.disabled) {\n dropdownOption.disabled = true;\n }\n acc.push(dropdownOption);\n }\n\n return acc;\n }, []);\n\n return {\n flatOptions,\n parentMap,\n };\n};\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\ninterface ListItem {\n type?: string;\n}\ninterface TestIndexes {\n throughIndex?: number;\n groupIndex?: number;\n inGroupIndex?: number;\n}\nconst testIndexMap = new WeakMap();\n//retrieves the test indexes of the option for the findOption and findOptionInGroup test-utils\nexport const getTestOptionIndexes = (item: T) => testIndexMap.get(item);\nexport const generateTestIndexes = (\n filteredItems: ReadonlyArray,\n getParentGroup: (item: T) => Group | undefined\n) => {\n let throughIndex = 1;\n let groupIndex = 0;\n let inGroupIndex = 1;\n let currentGroup: ListItem | null = null;\n filteredItems.forEach(item => {\n const isGroup = item.type === 'parent';\n const group = isGroup ? item : getParentGroup(item);\n if (group && group !== currentGroup) {\n currentGroup = group;\n groupIndex += 1;\n inGroupIndex = 1;\n }\n if (isGroup) {\n testIndexMap.set(item, { groupIndex });\n } else if (group && item.type === 'child') {\n testIndexMap.set(item, {\n throughIndex: throughIndex++,\n groupIndex,\n inGroupIndex: inGroupIndex++,\n });\n } else if (item.type === 'child' || !item.type) {\n testIndexMap.set(item, { throughIndex: throughIndex++ });\n }\n });\n};\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { flattenOptions } from './flatten-options';\nimport { filterOptions } from './filter-options';\nimport { generateTestIndexes } from '../../options-list/utils/test-indexes';\nimport { SelectProps } from '../../../../select/interfaces';\n\nexport function prepareOptions(\n options: SelectProps.Options,\n filteringType: SelectProps.FilteringType,\n filteringText: string\n) {\n const { flatOptions, parentMap } = flattenOptions(options);\n const filteredOptions = filteringType !== 'auto' ? flatOptions : filterOptions(flatOptions, filteringText);\n generateTestIndexes(filteredOptions, parentMap.get.bind(parentMap));\n return {\n filteredOptions,\n parentMap,\n totalCount: flatOptions.length,\n matchesCount: filteredOptions.length,\n };\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { RefObject } from 'react';\nimport { DropdownProps } from '../../internal/components/dropdown/interfaces';\nimport { DropdownOption, OptionDefinition, OptionGroup } from '../../internal/components/option/interfaces';\nimport { isInteractive, isGroupInteractive, isGroup } from '../../internal/components/option/utils/filter-options';\nimport { useEffect, useRef } from 'react';\nimport { useHighlightedOption } from '../../internal/components/options-list/utils/use-highlight-option';\nimport { useOpenState } from '../../internal/components/options-list/utils/use-open-state';\nimport { useMenuKeyboard, useTriggerKeyboard } from '../../internal/components/options-list/utils/use-keyboard';\nimport { getOptionId } from '../../internal/components/options-list/utils/use-ids';\nimport { connectOptionsByValue } from './connect-options';\nimport useForwardFocus from '../../internal/hooks/forward-focus';\nimport { OptionsListProps } from '../../internal/components/options-list';\nimport { FilterProps } from '../parts/filter';\nimport { ItemProps } from '../parts/item';\nimport { usePrevious } from '../../internal/hooks/use-previous';\nimport { NonCancelableEventHandler, fireNonCancelableEvent } from '../../internal/events';\nimport { useUniqueId } from '../../internal/hooks/use-unique-id';\nimport { DropdownStatusProps } from '../../internal/components/dropdown-status';\nimport { ButtonTriggerProps } from '../../internal/components/button-trigger';\n\nexport type MenuProps = Omit & { ref: React.RefObject };\nexport type GetOptionProps = (option: DropdownOption, index: number) => ItemProps;\n\ninterface UseSelectProps {\n selectedOptions: ReadonlyArray;\n updateSelectedOption: (option: OptionDefinition) => void;\n options: ReadonlyArray;\n filteringType: string;\n keepOpen?: boolean;\n onBlur?: NonCancelableEventHandler;\n onFocus?: NonCancelableEventHandler;\n externalRef: React.Ref;\n fireLoadItems: (filteringText: string) => void;\n setFilteringValue: (filteringText: string) => void;\n useInteractiveGroups?: boolean;\n statusType: DropdownStatusProps.StatusType;\n}\n\nexport interface SelectTriggerProps extends ButtonTriggerProps {\n ref: RefObject;\n}\n\nexport function useSelect({\n selectedOptions,\n updateSelectedOption,\n options,\n filteringType,\n onBlur,\n onFocus,\n externalRef,\n keepOpen,\n fireLoadItems,\n setFilteringValue,\n useInteractiveGroups = false,\n statusType,\n}: UseSelectProps) {\n const interactivityCheck = useInteractiveGroups ? isGroupInteractive : isInteractive;\n\n const isHighlightable = (option?: DropdownOption) => !!option && (useInteractiveGroups || option.type !== 'parent');\n\n const filterRef = useRef(null);\n const triggerRef = useRef(null);\n const menuRef = useRef(null);\n const hasFilter = filteringType !== 'none';\n const activeRef = hasFilter ? filterRef : menuRef;\n const __selectedOptions = connectOptionsByValue(options, selectedOptions);\n const __selectedValuesSet = selectedOptions.reduce((selectedValuesSet: Set, item: OptionDefinition) => {\n if (item.value) {\n selectedValuesSet.add(item.value);\n }\n return selectedValuesSet;\n }, new Set());\n const [\n { highlightType, highlightedOption, highlightedIndex },\n {\n moveHighlightWithKeyboard,\n resetHighlightWithKeyboard,\n setHighlightedIndexWithMouse,\n highlightOptionWithKeyboard,\n goHomeWithKeyboard,\n goEndWithKeyboard,\n },\n ] = useHighlightedOption({ options, isHighlightable });\n\n const { isOpen, openDropdown, closeDropdown, toggleDropdown, openedWithKeyboard } = useOpenState({\n onOpen: () => fireLoadItems(''),\n onClose: () => {\n resetHighlightWithKeyboard();\n setFilteringValue('');\n },\n });\n\n const handleFocus = () => {\n fireNonCancelableEvent(onFocus, {});\n };\n\n const handleBlur = () => {\n fireNonCancelableEvent(onBlur, {});\n closeDropdown();\n };\n\n const hasSelectedOption = __selectedOptions.length > 0;\n const menuId = useUniqueId('option-list');\n const dialogId = useUniqueId('dialog');\n const highlightedOptionId = getOptionId(menuId, highlightedIndex);\n\n const selectOption = (option?: DropdownOption) => {\n const optionToSelect = option || highlightedOption;\n if (!optionToSelect || !interactivityCheck(optionToSelect)) {\n return;\n }\n updateSelectedOption(optionToSelect.option);\n if (!keepOpen) {\n triggerRef.current?.focus();\n closeDropdown();\n }\n };\n\n const activeKeyDownHandler = useMenuKeyboard({\n moveHighlight: moveHighlightWithKeyboard,\n selectOption,\n goHome: goHomeWithKeyboard,\n goEnd: goEndWithKeyboard,\n closeDropdown: () => {\n triggerRef.current?.focus();\n closeDropdown();\n },\n preventNativeSpace: !hasFilter,\n });\n\n const triggerKeyDownHandler = useTriggerKeyboard({\n openDropdown: () => openDropdown(true),\n goHome: goHomeWithKeyboard,\n });\n\n const getDropdownProps: () => Pick<\n DropdownProps,\n 'onFocus' | 'onBlur' | 'dropdownContentId' | 'dropdownContentRole'\n > = () => ({\n onFocus: handleFocus,\n onBlur: handleBlur,\n dropdownContentId: dialogId,\n dropdownContentRole: hasFilter ? 'dialog' : undefined,\n });\n\n const getTriggerProps = (disabled = false, autoFocus = false) => {\n const triggerProps: SelectTriggerProps = {\n ref: triggerRef,\n onFocus: () => closeDropdown(),\n autoFocus,\n ariaHasPopup: hasFilter ? 'dialog' : 'listbox',\n ariaControls: isOpen ? (hasFilter ? dialogId : menuId) : undefined,\n };\n if (!disabled) {\n triggerProps.onMouseDown = (event: CustomEvent) => {\n event.preventDefault(); // prevent current focus from blurring as it immediately closes the dropdown\n if (isOpen) {\n triggerRef.current?.focus();\n }\n toggleDropdown();\n };\n triggerProps.onKeyDown = triggerKeyDownHandler;\n }\n return triggerProps;\n };\n\n const getFilterProps = (): Partial => {\n if (!hasFilter) {\n return {};\n }\n\n return {\n ref: filterRef,\n onKeyDown: activeKeyDownHandler,\n onChange: event => {\n setFilteringValue(event.detail.value);\n resetHighlightWithKeyboard();\n },\n __onDelayedInput: event => {\n fireLoadItems(event.detail.value);\n },\n __nativeAttributes: {\n 'aria-activedescendant': highlightedOptionId,\n ['aria-owns']: menuId,\n ['aria-controls']: menuId,\n },\n };\n };\n\n const getMenuProps = () => {\n const menuProps: MenuProps = {\n id: menuId,\n ref: menuRef,\n open: isOpen,\n onMouseUp: itemIndex => {\n if (itemIndex > -1) {\n selectOption(options[itemIndex]);\n }\n },\n onMouseMove: itemIndex => {\n if (itemIndex > -1) {\n setHighlightedIndexWithMouse(itemIndex);\n }\n },\n statusType,\n };\n if (!hasFilter) {\n menuProps.onKeyDown = activeKeyDownHandler;\n menuProps.nativeAttributes = {\n 'aria-activedescendant': highlightedOptionId,\n };\n }\n return menuProps;\n };\n const getGroupState = (option: OptionGroup) => {\n const totalSelected = option.options.filter(item => !!item.value && __selectedValuesSet.has(item.value)).length;\n const hasSelected = totalSelected > 0;\n const allSelected = totalSelected === option.options.length;\n return {\n selected: hasSelected && allSelected,\n indeterminate: hasSelected && !allSelected,\n };\n };\n\n const getOptionProps = (option: DropdownOption, index: number) => {\n const highlighted = option === highlightedOption;\n const groupState = isGroup(option.option) ? getGroupState(option.option) : undefined;\n const selected = __selectedOptions.indexOf(option) > -1 || !!groupState?.selected;\n const nextOption = options[index + 1]?.option;\n const isNextSelected =\n !!nextOption && isGroup(nextOption)\n ? getGroupState(nextOption).selected\n : __selectedOptions.indexOf(options[index + 1]) > -1;\n\n const optionProps: any = {\n key: index,\n option,\n highlighted,\n selected,\n isNextSelected,\n indeterminate: !!groupState?.indeterminate,\n ['data-mouse-target']: isHighlightable(option) ? index : -1,\n id: getOptionId(menuId, index),\n };\n\n return optionProps;\n };\n\n const prevOpen = usePrevious(isOpen);\n useEffect(() => {\n // highlight the first selected option, when opening the Select component without filter input\n // keep the focus in the filter input when opening, so that screenreader can recognize the combobox\n if (isOpen && !prevOpen && hasSelectedOption && !hasFilter) {\n if (openedWithKeyboard) {\n highlightOptionWithKeyboard(__selectedOptions[0]);\n } else {\n setHighlightedIndexWithMouse(options.indexOf(__selectedOptions[0]), true);\n }\n }\n }, [\n isOpen,\n __selectedOptions,\n hasSelectedOption,\n setHighlightedIndexWithMouse,\n highlightOptionWithKeyboard,\n openedWithKeyboard,\n options,\n prevOpen,\n hasFilter,\n ]);\n\n useEffect(() => {\n if (isOpen) {\n // dropdown-fit calculations ensure that the dropdown will fit inside the current\n // viewport, so prevent the browser from trying to scroll it into view (e.g. if\n // scroll-padding-top is set on a parent)\n activeRef.current?.focus({ preventScroll: true });\n }\n }, [isOpen, activeRef]);\n\n useForwardFocus(externalRef, triggerRef as React.RefObject);\n const highlightedGroupSelected =\n !!highlightedOption && isGroup(highlightedOption.option) && getGroupState(highlightedOption.option).selected;\n const announceSelected =\n !!highlightedOption && (__selectedOptions.indexOf(highlightedOption) > -1 || highlightedGroupSelected);\n\n return {\n isOpen,\n highlightedOption,\n highlightedIndex,\n highlightType,\n getTriggerProps,\n getDropdownProps,\n getMenuProps,\n getFilterProps,\n getOptionProps,\n highlightOption: highlightOptionWithKeyboard,\n selectOption,\n announceSelected,\n dialogId,\n };\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useCallback, useState } from 'react';\n\nexport class HighlightType {\n constructor(public type: 'keyboard' | 'mouse', public moveFocus: boolean = type === 'keyboard') {}\n}\n\nexport interface HighlightedOptionProps {\n options: readonly OptionType[];\n isHighlightable: (option: OptionType) => boolean;\n}\n\nexport interface HighlightedOptionState {\n highlightType: HighlightType;\n highlightedIndex: number;\n highlightedOption?: OptionType;\n}\n\nexport interface HighlightedOptionHandlers {\n // Mouse handlers\n setHighlightedIndexWithMouse(index: number, moveFocus?: boolean): void;\n // Keyboard handlers\n moveHighlightWithKeyboard(direction: -1 | 1): void;\n highlightOptionWithKeyboard(option: OptionType): void;\n resetHighlightWithKeyboard(): void;\n goHomeWithKeyboard(): void;\n goEndWithKeyboard(): void;\n}\n\nexport function useHighlightedOption({\n options,\n isHighlightable,\n}: HighlightedOptionProps): [HighlightedOptionState, HighlightedOptionHandlers] {\n const [highlightedIndex, setHighlightedIndexState] = useState(-1);\n const [highlightType, setHighlightType] = useState(new HighlightType('keyboard'));\n const setHighlightedIndex = useCallback((index: number, highlightType: HighlightType) => {\n setHighlightedIndexState(index);\n setHighlightType(highlightType);\n }, []);\n\n const highlightedOption =\n options[highlightedIndex] && isHighlightable(options[highlightedIndex]) ? options[highlightedIndex] : undefined;\n\n const moveHighlightFrom = (direction: -1 | 1, startIndex = highlightedIndex, highlightType: HighlightType) => {\n const fromBottomEnd = startIndex === -1 && direction === -1;\n let newIndex = fromBottomEnd ? options.length : startIndex;\n do {\n newIndex += direction;\n } while (options[newIndex] && !isHighlightable(options[newIndex]));\n\n if (options[newIndex]) {\n setHighlightedIndex(newIndex, highlightType);\n }\n };\n\n const moveHighlight = (direction: -1 | 1, highlightType: HighlightType) =>\n moveHighlightFrom(direction, highlightedIndex, highlightType);\n\n const highlightOption = useCallback(\n (option: OptionType, highlightType: HighlightType) => {\n const index = options.indexOf(option);\n setHighlightedIndex(index, highlightType);\n },\n [options, setHighlightedIndex]\n );\n\n return [\n { highlightType, highlightedIndex, highlightedOption },\n {\n setHighlightedIndexWithMouse: (index: number, moveFocus = false) =>\n setHighlightedIndex(index, new HighlightType('mouse', moveFocus)),\n moveHighlightWithKeyboard: (direction: -1 | 1) => moveHighlight(direction, new HighlightType('keyboard')),\n highlightOptionWithKeyboard: (option: OptionType) => highlightOption(option, new HighlightType('keyboard')),\n resetHighlightWithKeyboard: () => setHighlightedIndex(-1, new HighlightType('keyboard')),\n goHomeWithKeyboard: () => moveHighlightFrom(1, -1, new HighlightType('keyboard')),\n goEndWithKeyboard: () => moveHighlightFrom(-1, options.length, new HighlightType('keyboard')),\n },\n ];\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useCallback } from 'react';\nimport { KeyCode } from '../../../keycode';\nimport { BaseKeyDetail, CancelableEventHandler } from '../../../events';\n\nconst HOME = 36;\nconst END = 35;\n\ninterface UseMenuKeyboard {\n (inputProps: {\n moveHighlight: (direction: -1 | 1, startIndex?: number) => void;\n selectOption: () => void;\n goHome: () => void;\n goEnd: () => void;\n closeDropdown: () => void;\n preventNativeSpace?: boolean;\n }): CancelableEventHandler;\n}\n\nexport const useMenuKeyboard: UseMenuKeyboard = ({\n moveHighlight,\n selectOption,\n goHome,\n goEnd,\n closeDropdown,\n preventNativeSpace = false,\n}) => {\n return useCallback(\n (e: CustomEvent) => {\n switch (e.detail.keyCode) {\n case KeyCode.up:\n e.preventDefault();\n moveHighlight(-1);\n break;\n case KeyCode.down:\n e.preventDefault();\n moveHighlight(1);\n break;\n case HOME:\n goHome();\n break;\n case END:\n goEnd();\n break;\n case KeyCode.escape:\n e.stopPropagation();\n closeDropdown();\n break;\n case KeyCode.enter:\n e.preventDefault();\n selectOption();\n break;\n case KeyCode.space:\n if (preventNativeSpace) {\n e.preventDefault();\n selectOption();\n }\n }\n },\n [moveHighlight, selectOption, goHome, goEnd, closeDropdown, preventNativeSpace]\n );\n};\n\ninterface UseTriggerKeyboard {\n (inputProps: { openDropdown: () => void; goHome: () => void }): CancelableEventHandler;\n}\n\nexport const useTriggerKeyboard: UseTriggerKeyboard = ({ openDropdown, goHome }) => {\n return useCallback(\n (e: CustomEvent) => {\n switch (e.detail.keyCode) {\n case KeyCode.up:\n case KeyCode.down:\n e.preventDefault();\n goHome();\n openDropdown();\n break;\n case KeyCode.space:\n case KeyCode.enter:\n e.preventDefault();\n openDropdown();\n break;\n }\n },\n [openDropdown, goHome]\n );\n};\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nexport const getOptionId = (menuId: string, index: number) => {\n if (index < 0) {\n return undefined;\n }\n return `${menuId}-option-${index}`;\n};\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { DropdownOption, OptionDefinition } from '../../internal/components/option/interfaces';\n\nexport const connectOptionsByValue = (\n options: ReadonlyArray,\n selectedOptions: ReadonlyArray\n): ReadonlyArray => {\n return (selectedOptions || []).map(selectedOption => {\n for (const dropdownOption of options) {\n if (\n dropdownOption.type !== 'parent' &&\n (dropdownOption.option as OptionDefinition).value === selectedOption.value\n ) {\n return dropdownOption;\n }\n }\n return { option: selectedOption };\n });\n};\n\nexport const findOptionIndex = (options: ReadonlyArray, option: OptionDefinition) => {\n for (let index = 0; index < options.length; index++) {\n const __option = options[index];\n if (__option === option || __option.value === option.value) {\n return index;\n }\n }\n return -1;\n};\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\n\nimport {\n filterOptions,\n isInteractive,\n isGroupInteractive,\n isGroup,\n} from '../../internal/components/option/utils/filter-options';\nimport type { DropdownOption, OptionDefinition, OptionGroup } from '../../internal/components/option/interfaces';\nimport { useDebounceCallback } from '../../internal/hooks/use-debounce-callback';\n\nexport const isRepeatedChar = (str: string) => str.split('').every(c => c === str[0]);\n\ninterface UseNativeSearchProps {\n isEnabled: boolean;\n options: ReadonlyArray;\n highlightOption: (option: DropdownOption) => void;\n highlightedOption: OptionDefinition | undefined | null;\n useInteractiveGroups?: boolean;\n}\n\nfunction findMatchingOption(\n options: ReadonlyArray,\n searchText: string,\n currentHighlight: OptionDefinition | OptionGroup | undefined | null,\n useInteractiveGroups?: boolean\n) {\n const interactivityCheck = useInteractiveGroups ? isGroupInteractive : isInteractive;\n const filter = (searchText: string) =>\n filterOptions(options, searchText, true).filter(option => interactivityCheck(option));\n const matchingOptions = filter(searchText);\n\n if (matchingOptions.length === 1) {\n return matchingOptions[0];\n }\n\n // Hit the same char over and over, we assume they want to cycle through\n if (currentHighlight && searchText.length > 1 && isRepeatedChar(searchText)) {\n const matchingOptions = filter(searchText[0]);\n\n if (matchingOptions.length > 0) {\n //handling OptionGroups when useInteractiveGroups is set\n let active: number = isGroup(currentHighlight)\n ? matchingOptions.map(({ option }) => option).indexOf(currentHighlight)\n : matchingOptions\n .map(({ option }) => (option as OptionDefinition).value)\n .indexOf((currentHighlight as OptionDefinition).value);\n\n // Pick the next thing (if something with this prefix wasn't selected\n // we'll end up with the first option)\n active += 1;\n active = active % matchingOptions.length;\n return matchingOptions[active];\n }\n }\n\n // We have multiple things that start with this prefix. Based on the\n // behavior of native select, this is considered after the repeated case\n if (matchingOptions.length > 0) {\n return matchingOptions[0];\n }\n return null;\n}\n\nexport function useNativeSearch({\n isEnabled,\n options,\n highlightOption,\n highlightedOption,\n useInteractiveGroups,\n}: UseNativeSearchProps) {\n const value = useRef('');\n\n const delayedResetValue = useDebounceCallback(() => (value.current = ''), 500);\n\n return (event: React.KeyboardEvent) => {\n if (!isEnabled) {\n return;\n }\n\n const { key } = event;\n\n if (!key || key.length !== 1) {\n return;\n }\n\n delayedResetValue();\n const newValue = value.current + key;\n value.current = newValue;\n\n const nextHighlight = findMatchingOption(options, newValue, highlightedOption, useInteractiveGroups);\n if (nextHighlight) {\n highlightOption(nextHighlight);\n }\n };\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useRef } from 'react';\nimport { fireNonCancelableEvent } from '../../internal/events';\nimport { SelectProps } from '../interfaces';\nimport { OptionDefinition, OptionGroup } from '../../internal/components/option/interfaces';\nimport { DropdownStatusProps } from '../../internal/components/dropdown-status';\n\ninterface UseLoadItemsProps {\n onLoadItems: SelectProps['onLoadItems'];\n options: ReadonlyArray;\n statusType: DropdownStatusProps.StatusType;\n}\n\nexport const useLoadItems = ({ onLoadItems, options, statusType }: UseLoadItemsProps) => {\n const prevFilteringText = useRef(undefined);\n\n const fireLoadItems = (filteringText: string) => {\n if (prevFilteringText.current === filteringText) {\n return;\n }\n prevFilteringText.current = filteringText;\n fireNonCancelableEvent(onLoadItems, { filteringText, firstPage: true, samePage: false });\n };\n\n const handleLoadMore = () => {\n const firstPage = options.length === 0;\n statusType === 'pending' &&\n fireNonCancelableEvent(onLoadItems, {\n firstPage,\n samePage: false,\n filteringText: prevFilteringText.current || '',\n });\n };\n\n const handleRecoveryClick = () =>\n fireNonCancelableEvent(onLoadItems, {\n firstPage: false,\n samePage: true,\n filteringText: prevFilteringText.current || '',\n });\n\n return {\n fireLoadItems,\n handleLoadMore,\n handleRecoveryClick,\n };\n};\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { OptionDefinition, OptionGroup } from '../../internal/components/option/interfaces';\nimport { SelectProps } from '../interfaces';\nimport { useEffect, useRef } from 'react';\nimport defaultOptionDescription from '../../internal/components/option/option-announcer';\n\ninterface OptionHolder {\n option?: OptionDefinition | OptionGroup;\n}\n\n/**\n * The hook produces the live region string to be announced when an option is highlighted.\n * This is a workaround to account for the issues with assistive technologies.\n *\n * If the testing reveals no issues with the native announcements the live-region can be removed.\n */\nexport function useAnnouncement
    \n );\n};\n\nconst EllipsisDropdown = ({\n ariaLabel,\n dropdownItems,\n onDropdownItemClick,\n onDropdownItemFollow,\n}: EllipsisDropdownProps) => {\n const i18n = useInternalI18n('breadcrumb-group');\n\n return (\n
  • \n \n \n \n \n
  • \n );\n};\n\nexport const getEventDetail = (item: T) => ({\n item,\n text: item.text,\n href: item.href,\n});\n\ntype InternalBreadcrumbGroupProps =\n BreadcrumbGroupProps & InternalBaseComponentProps;\n\nexport default function InternalBreadcrumbGroup({\n items = [],\n ariaLabel,\n expandAriaLabel,\n onClick,\n onFollow,\n __internalRootRef,\n ...props\n}: InternalBreadcrumbGroupProps) {\n for (const item of items) {\n checkSafeUrl('BreadcrumbGroup', item.href);\n }\n const baseProps = getBaseProps(props);\n const isMobile = useMobile();\n\n let breadcrumbItems = items.map((item, index) => {\n const isLast = index === items.length - 1;\n\n return (\n
  • \n \n
  • \n );\n });\n\n const getEventItem = (e: CustomEvent<{ id: string }>) => {\n const { id } = e.detail;\n return items[parseInt(id)];\n };\n\n // Add ellipsis\n if (breadcrumbItems.length >= 2) {\n const dropdownItems: Array = items\n .slice(1, items.length - 1)\n .map((item: BreadcrumbGroupProps.Item, index: number) => ({\n id: (index + 1).toString(), // the first item doesn't get inside dropdown\n text: item.text,\n href: item.href || '#',\n }));\n\n breadcrumbItems = [\n breadcrumbItems[0],\n fireCancelableEvent(onClick, getEventDetail(getEventItem(e)), e)}\n onDropdownItemFollow={e => fireCancelableEvent(onFollow, getEventDetail(getEventItem(e)), e)}\n />,\n ...breadcrumbItems.slice(1),\n ];\n }\n\n return (\n \n
      {breadcrumbItems}
    \n \n );\n}\n", "\n import './styles.scoped.css';\n export default {\n \"breadcrumb-group\": \"awsui_breadcrumb-group_d19fg_z6pwg_99\",\n \"item\": \"awsui_item_d19fg_z6pwg_137\",\n \"breadcrumb-group-list\": \"awsui_breadcrumb-group-list_d19fg_z6pwg_172\",\n \"ellipsis\": \"awsui_ellipsis_d19fg_z6pwg_184\",\n \"icon\": \"awsui_icon_d19fg_z6pwg_194\",\n \"mobile\": \"awsui_mobile_d19fg_z6pwg_199\",\n \"mobile-short\": \"awsui_mobile-short_d19fg_z6pwg_212\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef, useState } from 'react';\nimport { BreadcrumbGroupProps, BreadcrumbItemProps } from '../interfaces';\nimport InternalIcon from '../../icon/internal';\nimport styles from './styles.css.js';\nimport clsx from 'clsx';\nimport { fireCancelableEvent, isPlainLeftClick } from '../../internal/events';\nimport { getEventDetail } from '../internal';\n\nimport { DATA_ATTR_FUNNEL_KEY } from '../../internal/analytics/selectors';\nimport { FUNNEL_KEY_FUNNEL_NAME } from '../../internal/analytics/selectors';\nimport Tooltip from '../../internal/components/tooltip';\n\ntype BreadcrumbItemWithPopoverProps = React.HTMLAttributes & {\n item: T;\n isLast: boolean;\n anchorAttributes: React.AnchorHTMLAttributes;\n funnelAttributes: Record;\n};\n\nconst BreadcrumbItemWithPopover = ({\n item,\n isLast,\n anchorAttributes,\n funnelAttributes,\n ...itemAttributes\n}: BreadcrumbItemWithPopoverProps) => {\n const [showPopover, setShowPopover] = useState(false);\n const textRef = useRef(null);\n const virtualTextRef = useRef(null);\n\n const isTruncated = (textRef: React.RefObject, virtualTextRef: React.RefObject) => {\n if (!textRef || !virtualTextRef || !textRef.current || !virtualTextRef.current) {\n return false;\n }\n const virtualTextWidth = virtualTextRef.current.getBoundingClientRect().width;\n const textWidth = textRef.current.getBoundingClientRect().width;\n if (virtualTextWidth > textWidth) {\n return true;\n }\n return false;\n };\n\n const popoverContent = ;\n\n useEffect(() => {\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n setShowPopover(false);\n }\n };\n if (showPopover) {\n document.addEventListener('keydown', onKeyDown);\n }\n return () => {\n document.removeEventListener('keydown', onKeyDown);\n };\n }, [showPopover]);\n\n return (\n <>\n {\n isTruncated(textRef, virtualTextRef) && setShowPopover(true);\n }}\n onBlur={() => setShowPopover(false)}\n onMouseEnter={() => {\n isTruncated(textRef, virtualTextRef) && setShowPopover(true);\n }}\n onMouseLeave={() => setShowPopover(false)}\n anchorAttributes={anchorAttributes}\n >\n \n {item.text}\n \n \n {item.text}\n \n \n {showPopover && popoverContent}\n \n );\n};\n\ntype ItemProps = React.HTMLAttributes & {\n anchorAttributes: React.AnchorHTMLAttributes;\n isLast: boolean;\n};\nconst Item = ({ anchorAttributes, children, isLast, ...itemAttributes }: ItemProps) =>\n isLast ? (\n {children}\n ) : (\n \n {children}\n \n );\n\nexport function BreadcrumbItem({\n item,\n onClick,\n onFollow,\n isDisplayed,\n isLast = false,\n isCompressed = false,\n}: BreadcrumbItemProps) {\n const preventDefault = (event: React.MouseEvent) => event.preventDefault();\n const onClickHandler = (event: React.MouseEvent) => {\n if (isPlainLeftClick(event)) {\n fireCancelableEvent(onFollow, getEventDetail(item), event);\n }\n fireCancelableEvent(onClick, getEventDetail(item), event);\n };\n\n const itemAttributes: React.HTMLAttributes = {\n className: clsx(styles.anchor, { [styles.compressed]: isCompressed }),\n };\n const anchorAttributes: React.AnchorHTMLAttributes = {\n href: item.href || '#',\n onClick: isLast ? preventDefault : onClickHandler,\n };\n\n const funnelAttributes: Record = {};\n if (isLast) {\n funnelAttributes[DATA_ATTR_FUNNEL_KEY] = FUNNEL_KEY_FUNNEL_NAME;\n }\n\n return (\n
    \n {isDisplayed && isCompressed ? (\n \n ) : (\n \n \n {item.text}\n \n \n )}\n {!isLast ? (\n \n \n \n ) : null}\n
    \n );\n}\n", "\n import './styles.scoped.css';\n export default {\n \"link\": \"awsui_link_1kosq_r0i6w_99\",\n \"breadcrumb\": \"awsui_breadcrumb_1kosq_r0i6w_103\",\n \"icon\": \"awsui_icon_1kosq_r0i6w_106\",\n \"anchor\": \"awsui_anchor_1kosq_r0i6w_111\",\n \"last\": \"awsui_last_1kosq_r0i6w_157\",\n \"compressed\": \"awsui_compressed_1kosq_r0i6w_167\",\n \"text\": \"awsui_text_1kosq_r0i6w_171\",\n \"virtual-item\": \"awsui_virtual-item_1kosq_r0i6w_178\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport { Transition } from '../transition';\nimport PopoverContainer from '../../../popover/container';\nimport PopoverBody from '../../../popover/body';\nimport Portal from '../portal';\nimport popoverStyles from '../../../popover/styles.css.js';\nimport styles from './styles.css.js';\n\nexport interface TooltipProps {\n value: number | string;\n trackRef: React.RefObject;\n}\n\nexport default function Tooltip({ value, trackRef }: TooltipProps) {\n return (\n \n
    \n \n {() => (\n (\n
    \n
    \n
    \n
    \n )}\n >\n \n {value}\n \n \n )}\n \n
    \n \n );\n}\n", "\n import './styles.scoped.css';\n export default {\n \"root\": \"awsui_root_1qprf_160mh_5\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { ButtonDropdownProps } from './interfaces';\nimport InternalButtonDropdown from './internal';\nimport { getBaseProps } from '../internal/base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport useBaseComponent from '../internal/hooks/use-base-component';\n\nexport { ButtonDropdownProps };\n\nconst ButtonDropdown = React.forwardRef(\n (\n {\n items,\n variant = 'normal',\n loading = false,\n loadingText,\n disabled = false,\n expandableGroups = false,\n expandToViewport = false,\n ariaLabel,\n children,\n onItemClick,\n onItemFollow,\n mainAction,\n ...props\n }: ButtonDropdownProps,\n ref: React.Ref\n ) => {\n const baseComponentProps = useBaseComponent('ButtonDropdown', {\n props: { expandToViewport, expandableGroups, variant },\n });\n const baseProps = getBaseProps(props);\n return (\n \n {children}\n \n );\n }\n);\n\napplyDisplayName(ButtonDropdown, 'ButtonDropdown');\nexport default ButtonDropdown;\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React from 'react';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { CalendarProps } from './interfaces';\nimport InternalCalendar from './internal';\n\nexport { CalendarProps };\n\nexport default function Calendar({\n locale = '',\n isDateEnabled = () => true,\n granularity = 'day',\n ...props\n}: CalendarProps) {\n const baseComponentProps = useBaseComponent('Calendar');\n return (\n \n );\n}\n\napplyDisplayName(Calendar, 'Calendar');\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { useEffect, useRef, useState } from 'react';\nimport { addMonths, addYears, isSameDay, isSameMonth, isSameYear } from 'date-fns';\nimport styles from './styles.css.js';\nimport CalendarHeader from './header';\nimport Grid from './grid';\nimport { normalizeLocale } from '../internal/utils/locale';\nimport { formatDate, parseDate } from '../internal/utils/date-time';\nimport { fireNonCancelableEvent } from '../internal/events/index.js';\nimport checkControlled from '../internal/hooks/check-controlled/index.js';\nimport clsx from 'clsx';\nimport { CalendarProps } from './interfaces.js';\nimport { getBaseProps } from '../internal/base-component';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component/index.js';\nimport { getBaseDay, getBaseMonth } from './utils/navigation';\nimport { useDateCache } from '../internal/hooks/use-date-cache/index.js';\nimport { useUniqueId } from '../internal/hooks/use-unique-id/index.js';\nimport useCalendarLabels from './use-calendar-labels';\nimport useCalendarGridRows from './grid/use-calendar-grid-rows';\nimport useCalendarGridKeyboardNavigation from './grid/use-calendar-grid-keyboard-navigation';\nimport CalendarGridHeader from './grid/calendar-grid-header';\n\nexport default function Calendar({\n value,\n locale = '',\n startOfWeek,\n isDateEnabled = () => true,\n ariaLabel,\n ariaLabelledby,\n ariaDescribedby,\n onChange,\n __internalRootRef,\n i18nStrings,\n granularity = 'day',\n previousMonthAriaLabel,\n nextMonthAriaLabel,\n todayAriaLabel,\n ...rest\n}: CalendarProps & InternalBaseComponentProps) {\n checkControlled('Calendar', 'value', value, 'onChange', onChange);\n\n const baseProps = getBaseProps(rest);\n const normalizedLocale = normalizeLocale('Calendar', locale);\n\n const gridWrapperRef = useRef(null);\n const [focusedDate, setFocusedDate] = useState(null);\n\n const valueDateCache = useDateCache();\n const focusedDateCache = useDateCache();\n\n // Set displayed date to value if defined or to current date otherwise.\n const parsedValue = value && value.length >= 4 ? parseDate(value) : null;\n const memoizedValue = parsedValue ? valueDateCache(parsedValue) : null;\n const defaultDisplayedDate = memoizedValue ?? new Date();\n const [displayedDate, setDisplayedDate] = useState(defaultDisplayedDate);\n\n const headingId = useUniqueId('calendar-heading');\n\n const isMonthPicker = granularity === 'month';\n\n const baseDate = isMonthPicker\n ? getBaseMonth(displayedDate, isDateEnabled)\n : getBaseDay(displayedDate, isDateEnabled);\n\n const isSameDate = isMonthPicker ? isSameMonth : isSameDay;\n const isSamePage = isMonthPicker ? isSameYear : isSameMonth;\n const isCurrentPage = (date: Date) => isMonthPicker || isSameMonth(date, baseDate);\n\n const { previousButtonLabel, nextButtonLabel, renderDate, renderDateAnnouncement, renderHeaderText } =\n useCalendarLabels({\n granularity,\n i18nStrings,\n locale: normalizedLocale,\n previousMonthAriaLabel,\n nextMonthAriaLabel,\n todayAriaLabel,\n });\n\n const gridRows = useCalendarGridRows({ baseDate, granularity, startOfWeek, locale: normalizedLocale });\n\n // Update displayed date if value changes.\n useEffect(() => {\n memoizedValue && setDisplayedDate(prev => (prev.getTime() !== memoizedValue.getTime() ? memoizedValue : prev));\n }, [memoizedValue]);\n\n const selectFocusedDate = (selected: Date | null, baseDate: Date): Date | null => {\n if (selected && isDateEnabled(selected) && isSamePage(selected, baseDate)) {\n return selected;\n }\n const today = new Date();\n if (isDateEnabled(today) && isSamePage(today, baseDate)) {\n return today;\n }\n if (isDateEnabled(baseDate)) {\n return baseDate;\n }\n return null;\n };\n\n const focusableDate = focusedDate || selectFocusedDate(memoizedValue, baseDate);\n\n const onHeaderChangePageHandler = (amount: number) => {\n const movePage = isMonthPicker ? addYears : addMonths;\n const newDate = movePage(baseDate, amount);\n onChangePageHandler(newDate);\n };\n\n const onChangePageHandler = (newDate: Date) => {\n setDisplayedDate(newDate);\n setFocusedDate(null);\n };\n\n const onGridFocusDateHandler = (date: null | Date) => {\n if (date) {\n setFocusedDate(date ? focusedDateCache(date) : null);\n }\n };\n\n const onGridSelectDateHandler = (date: Date) => {\n fireNonCancelableEvent(onChange, { value: formatDate(date, granularity) });\n setFocusedDate(null);\n };\n\n const onGridBlur = (event: React.FocusEvent) => {\n const newFocusTargetIsInGrid = event.relatedTarget && gridWrapperRef.current?.contains(event.relatedTarget as Node);\n if (!newFocusTargetIsInGrid) {\n setFocusedDate(null);\n }\n };\n\n const onGridKeyDownHandler = useCalendarGridKeyboardNavigation({\n baseDate,\n focusableDate,\n granularity,\n isDateEnabled,\n onChangePage: onChangePageHandler,\n onFocusDate: onGridFocusDateHandler,\n onSelectDate: onGridSelectDateHandler,\n });\n\n const headerText = renderHeaderText(baseDate);\n\n return (\n \n
    \n \n
    \n }\n rows={gridRows}\n isCurrentPage={isCurrentPage}\n renderDate={renderDate}\n renderDateAnnouncement={renderDateAnnouncement}\n isSameDate={isSameDate}\n onGridKeyDownHandler={onGridKeyDownHandler}\n />\n
    \n
    \n
    \n );\n}\n", "\n import './styles.scoped.css';\n export default {\n \"calendar\": \"awsui_calendar_1ykar_1boof_99\",\n \"awsui-motion-fade-in-0\": \"awsui_awsui-motion-fade-in-0_1ykar_1boof_1\",\n \"root\": \"awsui_root_1ykar_1boof_130\",\n \"calendar-inner\": \"awsui_calendar-inner_1ykar_1boof_171\",\n \"calendar-header\": \"awsui_calendar-header_1ykar_1boof_175\",\n \"calendar-header-title\": \"awsui_calendar-header-title_1ykar_1boof_180\",\n \"calendar-next-btn\": \"awsui_calendar-next-btn_1ykar_1boof_188\",\n \"calendar-prev-btn\": \"awsui_calendar-prev-btn_1ykar_1boof_191\",\n \"calendar-grid\": \"awsui_calendar-grid_1ykar_1boof_194\",\n \"calendar-grid-dense\": \"awsui_calendar-grid-dense_1ykar_1boof_198\",\n \"calendar-grid-cell\": \"awsui_calendar-grid-cell_1ykar_1boof_206\",\n \"calendar-date-header\": \"awsui_calendar-date-header_1ykar_1boof_211\",\n \"calendar-date\": \"awsui_calendar-date_1ykar_1boof_211\",\n \"calendar-date-enabled\": \"awsui_calendar-date-enabled_1ykar_1boof_231\",\n \"calendar-date-current-page\": \"awsui_calendar-date-current-page_1ykar_1boof_241\",\n \"calendar-date-selected\": \"awsui_calendar-date-selected_1ykar_1boof_252\",\n \"calendar-date-current\": \"awsui_calendar-date-current_1ykar_1boof_241\",\n \"calendar-date-dense\": \"awsui_calendar-date-dense_1ykar_1boof_273\",\n \"date-inner\": \"awsui_date-inner_1ykar_1boof_281\",\n \"calendar-row\": \"awsui_calendar-row_1ykar_1boof_356\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport styles from '../styles.css.js';\nimport { HeaderPrevButton, HeaderNextButton } from './header-button';\n\ninterface CalendarHeaderProps {\n formattedDate: string;\n onChange: (n: number) => void;\n previousLabel?: string;\n nextLabel?: string;\n headingId: string;\n}\n\nconst CalendarHeader = ({ formattedDate, onChange, previousLabel, nextLabel, headingId }: CalendarHeaderProps) => {\n return (\n
    \n \n

    \n {formattedDate}\n

    \n \n
    \n );\n};\n\nexport default CalendarHeader;\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React from 'react';\nimport { InternalButton } from '../../button/internal';\nimport styles from '../styles.css.js';\n\ninterface HeaderButtonProps {\n ariaLabel?: string;\n onChange: (n: number) => void;\n}\n\nexport function HeaderPrevButton({ ariaLabel, onChange }: HeaderButtonProps) {\n return (\n onChange(-1)}\n formAction=\"none\"\n className={styles['calendar-prev-btn']}\n />\n );\n}\n\nexport function HeaderNextButton({ ariaLabel, onChange }: HeaderButtonProps) {\n return (\n onChange(1)}\n formAction=\"none\"\n className={styles['calendar-next-btn']}\n />\n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\nimport styles from '../styles.css.js';\nimport { DatePickerProps } from '../../date-picker/interfaces';\nimport clsx from 'clsx';\nimport { useEffectOnUpdate } from '../../internal/hooks/use-effect-on-update.js';\nimport ScreenreaderOnly from '../../internal/components/screenreader-only/index.js';\n\n/**\n * Calendar grid supports two mechanisms of keyboard navigation:\n * - Native screen-reader table navigation (semantic table markup);\n * - Keyboard arrow-keys navigation (a custom key-down handler).\n *\n * The implementation largely follows the w3 example (https://www.w3.org/WAI/ARIA/apg/example-index/dialog-modal/datepicker-dialog) and shares the following issues:\n * - (table navigation) Chrome+VO - weekday is announced twice when navigating to the calendar's header;\n * - (table navigation) Safari+VO - \"dimmed\" state is announced twice;\n * - (table navigation) Firefox/Chrome+NVDA - cannot use table navigation if any cell has a focus;\n * - (keyboard navigation) Firefox+NVDA - every date is announced as \"not selected\";\n * - (keyboard navigation) Safari/Chrome+VO - weekdays are not announced;\n * - (keyboard navigation) Safari/Chrome+VO - dates are not announced as interactive (clickable or selectable);\n * - (keyboard navigation) Safari/Chrome+VO - date announcements are not interruptive and can be missed if navigating fast.\n */\n\nexport interface GridProps {\n isDateEnabled: DatePickerProps.IsDateEnabledFunction;\n focusedDate: Date | null;\n focusableDate: Date | null;\n onSelectDate: (date: Date) => void;\n onFocusDate: (date: null | Date) => void;\n onChangePage: (date: Date) => void;\n selectedDate: Date | null;\n ariaLabelledby: string;\n header?: React.ReactNode;\n rows: ReadonlyArray>;\n isCurrentPage: (date: Date) => boolean;\n renderDate: (date: Date) => string;\n renderDateAnnouncement: (date: Date, isOnCurrentDate: boolean) => string;\n isSameDate: (date: Date, baseDate: Date) => boolean;\n onGridKeyDownHandler: (event: React.KeyboardEvent) => void;\n}\n\nexport default function Grid({\n isDateEnabled,\n focusedDate,\n focusableDate,\n onSelectDate,\n selectedDate,\n ariaLabelledby,\n header,\n rows,\n isCurrentPage,\n renderDate,\n renderDateAnnouncement,\n isSameDate,\n onGridKeyDownHandler,\n}: GridProps) {\n const focusedDateRef = useRef(null);\n\n // The focused date changes as a feedback to keyboard navigation in the grid.\n // Once changed, the corresponding date button needs to receive the actual focus.\n useEffectOnUpdate(() => {\n if (focusedDate && focusedDateRef.current) {\n (focusedDateRef.current as HTMLDivElement).focus();\n }\n }, [focusedDate]);\n\n const rowLength = rows[0].length;\n\n const denseGrid = rowLength > 3;\n\n return (\n \n {header}\n \n {rows.map((row, rowIndex) => (\n \n {row.map((date, dateIndex) => {\n const isFocusable = !!focusableDate && isSameDate(date, focusableDate);\n const isSelected = !!selectedDate && isSameDate(date, selectedDate);\n const isEnabled = !isDateEnabled || isDateEnabled(date);\n const isCurrentDate = isSameDate(date, new Date());\n\n // Can't be focused.\n let tabIndex = undefined;\n if (isFocusable && isEnabled) {\n // Next focus target.\n tabIndex = 0;\n } else if (isEnabled) {\n // Can be focused programmatically.\n tabIndex = -1;\n }\n\n return (\n onSelectDate(date) : undefined}\n className={clsx(styles['calendar-grid-cell'], styles['calendar-date'], {\n [styles['calendar-date-current-page']]: isCurrentPage(date),\n [styles['calendar-date-enabled']]: isEnabled,\n [styles['calendar-date-selected']]: isSelected,\n [styles['calendar-date-current']]: isCurrentDate,\n [styles['calendar-date-dense']]: denseGrid,\n })}\n >\n \n {renderDate(date)}\n \n {/* Screen-reader announcement for the focused date. */}\n {renderDateAnnouncement(date, isCurrentDate)}\n \n );\n })}\n \n ))}\n \n \n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nexport function mergeLocales(locale: string, fullLocale: string) {\n const isShort = locale.length === 2;\n if (isShort && fullLocale.indexOf(locale) === 0) {\n return fullLocale;\n }\n return locale;\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\nimport { mergeLocales } from './merge-locales';\n\nexport function normalizeLocale(component: string, locale: string | null): string {\n locale = checkLocale(component, locale);\n const browserLocale = getBrowserLocale();\n if (locale) {\n return mergeLocales(locale, browserLocale);\n }\n const htmlLocale = checkLocale(component, getHtmlElement()?.getAttribute('lang'));\n if (htmlLocale) {\n return mergeLocales(htmlLocale, browserLocale);\n }\n return browserLocale;\n}\n\nfunction checkLocale(component: string, locale: string | null | undefined): string {\n if (!locale || locale === '') {\n return '';\n }\n\n // Support underscore-delimited locales\n locale = locale && locale.replace(/^([a-z]{2})_/, '$1-');\n // Check that the value matches aa-BB pattern\n // TODO: support full BCP 47 spec?\n if (locale && !locale.match(/^[a-z]{2}(-[A-Z]{2})?$/)) {\n warnOnce(component, `Invalid locale provided: ${locale}. Falling back to default`);\n locale = '';\n }\n return locale;\n}\n\nfunction getHtmlElement() {\n return typeof document !== 'undefined' ? document.querySelector('html') : null;\n}\n\nfunction getBrowserLocale() {\n return new Intl.DateTimeFormat().resolvedOptions().locale;\n}\n", "/**\r\n * Functions to get first day of week.\r\n * \r\n * @module api\r\n */\r\n\r\n\r\n/**\r\n * Return first day of week for country/region code.\r\n *\r\n * @example\r\n * getWeekStartByRegion('PNG', {}); // 1\r\n * getWeekStartByRegion('png', {BR: 0, PNG: 3, EG: 6}); // 3\r\n * getWeekStartByRegion('qa', {QA: 6}); // 6\r\n * getWeekStartByRegion(50, {BD: 5, 50: 5, SD: 6}); // 5\r\n *\r\n * @param {number | string} regionCode\r\n * ISO 3166 Alpha-2, Alpha-3 or numeric code.\r\n * @param {object} regionDayMap\r\n * Mapping of country/region code to first day of week that should be used to get result.\r\n * Country codes should be in upper case.\r\n * @return {number}\r\n * Code of first day of week for the given country/region code:\r\n * 0 - Sunday, 1 - Monday, 2 - Tuesday, 3 - Wednesday, 4 - Thursday, 5 - Friday, 6 - Saturday.\r\n * @alias module:api.getWeekStartByRegion\r\n */\r\nexport function getWeekStartByRegion(regionCode, regionDayMap) {\r\n /* eslint-disable indent */\r\n const code = regionDayMap[typeof regionCode === 'string'\r\n ? regionCode.toUpperCase()\r\n : regionCode];\r\n /* eslint-enable indent */\r\n\r\n return typeof code === 'number'\r\n ? code\r\n : 1;\r\n}\r\n\r\n/**\r\n * Return first day of week for locale identifier.\r\n *\r\n * @example\r\n * getWeekStartByLocale('no', {}, {}); // 1\r\n * getWeekStartByLocale('no', {no: 'abc'}, {ABC: 3}); // 3\r\n * getWeekStartByLocale('KK_arab', {kk_arab: 'CN'}, {CN: 0}); // 0\r\n * getWeekStartByLocale('fr-DZ', {fr: 'FR'}, {FR: 1, DZ: 6}); // 6\r\n *\r\n * @param {string} locale\r\n * Locale identifier.\r\n * @param {object} langRegionMap\r\n * Mapping of language code to country/region code that should be used to get result.\r\n * Language codes should be in lower case.\r\n * @param {object} regionDayMap\r\n * Mapping of country/region code to first day of week that should be used to get result.\r\n * Country codes should be in upper case.\r\n * @return {number}\r\n * Code of first day of week for the given locale identifier:\r\n * 0 - Sunday, 1 - Monday, 2 - Tuesday, 3 - Wednesday, 4 - Thursday, 5 - Friday, 6 - Saturday.\r\n * @alias module:api.getWeekStartByLocale\r\n */\r\nexport function getWeekStartByLocale(locale, langRegionMap, regionDayMap) {\r\n if (locale) {\r\n // Locale form: http://www.unicode.org/reports/tr35/tr35.html#Unicode_Language_and_Locale_Identifiers\r\n const data = locale.toLowerCase().split(/[-_]/);\r\n let language = data[0];\r\n let country;\r\n if (data[1] && data[1].length === 4) {\r\n language += `_${data[1]}`;\r\n country = data[2];\r\n }\r\n else {\r\n country = data[1];\r\n }\r\n if (! country) {\r\n country = langRegionMap[language];\r\n }\r\n if (country) {\r\n return getWeekStartByRegion(\r\n country.match(/^\\d+$/)\r\n ? Number(country)\r\n : country,\r\n regionDayMap\r\n );\r\n }\r\n }\r\n\r\n return 1;\r\n}\r\n", "/**\r\n * Contains base mapping of language code to country code.\r\n * \r\n * @module langRegionMap\r\n */\r\n\r\n\r\n/* eslint-disable camelcase */\r\n/**\r\n * Base mapping of language code to country code.\r\n */\r\nconst langRegionMap = {\r\n en: 'US',\r\n \r\n zh: 'CN',\r\n zh_hans: 'CN',\r\n hans: 'CN', // script\r\n wuu: 'CN',\r\n hsn: 'CN',\r\n hak: 'CN',\r\n nan: 'CN',\r\n gan: 'CN',\r\n \r\n hi: 'IN',\r\n te: 'IN',\r\n mr: 'IN',\r\n ta: 'IN',\r\n gu: 'IN',\r\n kn: 'IN',\r\n or: 'IN',\r\n ml: 'IN',\r\n pa_guru: 'IN',\r\n bho: 'IN',\r\n awa: 'IN',\r\n as: 'IN',\r\n mwr: 'IN',\r\n mai: 'IN',\r\n mag: 'IN',\r\n bgc: 'IN',\r\n hne: 'IN',\r\n dcc: 'IN',\r\n\r\n dz: 'BT',\r\n\r\n tn: 'BW',\r\n\r\n am: 'ET',\r\n om: 'ET',\r\n\r\n quc: 'GT',\r\n\r\n id: 'ID',\r\n jv: 'ID',\r\n su: 'ID',\r\n mad: 'ID',\r\n ms_arab: 'ID',\r\n\r\n ga: 'IE',\r\n\r\n he: 'IL',\r\n\r\n jam: 'JM',\r\n\r\n ja: 'JP',\r\n\r\n km: 'KH',\r\n\r\n ko: 'KR',\r\n\r\n lo: 'LA',\r\n\r\n mh: 'MH',\r\n\r\n my: 'MM',\r\n\r\n mt: 'MT',\r\n\r\n ne: 'NP',\r\n\r\n fil: 'PH',\r\n ceb: 'PH',\r\n ilo: 'PH',\r\n\r\n ur: 'PK',\r\n pa: 'PK',\r\n pa_arab: 'PK',\r\n arab: 'PK', // script\r\n lah: 'PK',\r\n ps: 'PK',\r\n sd: 'PK',\r\n sd_arab: 'PK',\r\n skr: 'PK',\r\n\r\n gn: 'PY',\r\n\r\n th: 'TH',\r\n tts: 'TH',\r\n\r\n aeb: 'TN',\r\n\r\n zh_hant: 'TW',\r\n hant: 'TW', // script\r\n\r\n sm: 'WS',\r\n \r\n zu: 'ZA',\r\n\r\n sn: 'ZW',\r\n\r\n\r\n arq: 'DZ',\r\n\r\n ar: 'EG',\r\n arz: 'EG',\r\n\r\n fa: 'IR',\r\n az_arab: 'IR',\r\n\r\n ary: 'MA',\r\n\r\n\r\n bn: 'BD',\r\n rkt: 'BD',\r\n\r\n dv: 'MV'\r\n};\r\n/* eslint-enable camelcase */\r\n\r\nexport default langRegionMap;\r\n", "/**\r\n * Contains data about first day of week depending on country code.\r\n * \r\n * @module regionDayMap\r\n */\r\n\r\n\r\n/* eslint quote-props: ['error', 'as-needed', {'keywords': true, 'numbers': false, 'unnecessary': false}] */\r\n/**\r\n * Data about first day of week depending on country code.\r\n */\r\nconst regionDayMap = {\r\n // Sunday\r\n AG: 0,\r\n ATG: 0,\r\n 28: 0,\r\n AR: 0,\r\n ARG: 0,\r\n 32: 0,\r\n AS: 0,\r\n ASM: 0,\r\n 16: 0,\r\n AU: 0,\r\n AUS: 0,\r\n 36: 0,\r\n BR: 0,\r\n BRA: 0,\r\n 76: 0,\r\n BS: 0,\r\n BHS: 0,\r\n 44: 0,\r\n BT: 0,\r\n BTN: 0,\r\n 64: 0,\r\n BW: 0,\r\n BWA: 0,\r\n 72: 0,\r\n BZ: 0,\r\n BLZ: 0,\r\n 84: 0,\r\n CA: 0,\r\n CAN: 0,\r\n 124: 0,\r\n CN: 0,\r\n CHN: 0,\r\n 156: 0,\r\n CO: 0,\r\n COL: 0,\r\n 170: 0,\r\n DM: 0,\r\n DMA: 0,\r\n 212: 0,\r\n DO: 0,\r\n DOM: 0,\r\n 214: 0,\r\n ET: 0,\r\n ETH: 0,\r\n 231: 0,\r\n GT: 0,\r\n GTM: 0,\r\n 320: 0,\r\n GU: 0,\r\n GUM: 0,\r\n 316: 0,\r\n HK: 0,\r\n HKG: 0,\r\n 344: 0,\r\n HN: 0,\r\n HND: 0,\r\n 340: 0,\r\n ID: 0,\r\n IDN: 0,\r\n 360: 0,\r\n IE: 0,\r\n IRL: 0,\r\n 372: 0,\r\n IL: 0,\r\n ISR: 0,\r\n 376: 0,\r\n IN: 0,\r\n IND: 0,\r\n 356: 0,\r\n JM: 0,\r\n JAM: 0,\r\n 388: 0,\r\n JP: 0,\r\n JPN: 0,\r\n 392: 0,\r\n KE: 0,\r\n KEN: 0,\r\n 404: 0,\r\n KH: 0,\r\n KHM: 0,\r\n 116: 0,\r\n KR: 0,\r\n KOR: 0,\r\n 410: 0,\r\n LA: 0,\r\n LA0: 0,\r\n 418: 0,\r\n MH: 0,\r\n MHL: 0,\r\n 584: 0,\r\n MM: 0,\r\n MMR: 0,\r\n 104: 0,\r\n MO: 0,\r\n MAC: 0,\r\n 446: 0,\r\n MT: 0,\r\n MLT: 0,\r\n 470: 0,\r\n MX: 0,\r\n MEX: 0,\r\n 484: 0,\r\n MZ: 0,\r\n MOZ: 0,\r\n 508: 0,\r\n NI: 0,\r\n NIC: 0,\r\n 558: 0,\r\n NP: 0,\r\n NPL: 0,\r\n 524: 0,\r\n NZ: 0,\r\n NZL: 0,\r\n 554: 0,\r\n PA: 0,\r\n PAN: 0,\r\n 591: 0,\r\n PE: 0,\r\n PER: 0,\r\n 604: 0,\r\n PH: 0,\r\n PHL: 0,\r\n 608: 0,\r\n PK: 0,\r\n PAK: 0,\r\n 586: 0,\r\n PR: 0,\r\n PRI: 0,\r\n 630: 0,\r\n PY: 0,\r\n PRY: 0,\r\n 600: 0,\r\n SA: 0,\r\n SAU: 0,\r\n 682: 0,\r\n SG: 0,\r\n SGP: 0,\r\n 702: 0,\r\n SV: 0,\r\n SLV: 0,\r\n 222: 0,\r\n TH: 0,\r\n THA: 0,\r\n 764: 0,\r\n TN: 0,\r\n TUN: 0,\r\n 788: 0,\r\n TT: 0,\r\n TTO: 0,\r\n 780: 0,\r\n TW: 0,\r\n TWN: 0,\r\n 158: 0,\r\n UM: 0,\r\n UMI: 0,\r\n 581: 0,\r\n US: 0,\r\n USA: 0,\r\n 840: 0,\r\n VE: 0,\r\n VEN: 0,\r\n 862: 0,\r\n VI: 0,\r\n VIR: 0,\r\n 850: 0,\r\n WS: 0,\r\n WSM: 0,\r\n 882: 0,\r\n YE: 0,\r\n YEM: 0,\r\n 887: 0,\r\n ZA: 0,\r\n ZAF: 0,\r\n 710: 0,\r\n ZW: 0,\r\n ZWE: 0,\r\n 716: 0,\r\n\r\n // Saturday\r\n AE: 6,\r\n ARE: 6,\r\n 784: 6,\r\n AF: 6,\r\n AFG: 6,\r\n 4: 6,\r\n BH: 6,\r\n BHR: 6,\r\n 48: 6,\r\n DJ: 6,\r\n DJI: 6,\r\n 262: 6,\r\n DZ: 6,\r\n DZA: 6,\r\n 12: 6,\r\n EG: 6,\r\n EGY: 6,\r\n 818: 6,\r\n IQ: 6,\r\n IRQ: 6,\r\n 368: 6,\r\n IR: 6,\r\n IRN: 6,\r\n 364: 6,\r\n JO: 6,\r\n JOR: 6,\r\n 400: 6,\r\n KW: 6,\r\n KWT: 6,\r\n 414: 6,\r\n LY: 6,\r\n LBY: 6,\r\n 434: 6,\r\n MA: 6,\r\n MAR: 6,\r\n 504: 6,\r\n OM: 6,\r\n OMN: 6,\r\n 512: 6,\r\n QA: 6,\r\n QAT: 6,\r\n 634: 6,\r\n SD: 6,\r\n SDN: 6,\r\n 729: 6,\r\n SY: 6,\r\n SYR: 6,\r\n 760: 6,\r\n\r\n // Friday\r\n BD: 5,\r\n BGD: 5,\r\n 50: 5,\r\n MV: 5,\r\n MDV: 5,\r\n 462: 5\r\n\r\n // Else - Monday\r\n};\r\n\r\nexport default regionDayMap;\r\n", "/*\r\n * weekstart\r\n * https://github.com/gamtiq/weekstart\r\n */\r\n\r\n/**\r\n * Library to get first day of week.\r\n * \r\n * Uses data from {@link module:langRegionMap langRegionMap.js} and\r\n * {@link module:regionDayMap regionDayMap.js}.\r\n * \r\n * @module main\r\n */\r\n\r\nimport * as api from './api';\r\nimport langRegionMap from './langRegionMap';\r\nimport regionDayMap from './regionDayMap';\r\n\r\n/**\r\n * Return first day of week for country/region code.\r\n *\r\n * Based on data from:\r\n * - [https://github.com/unicode-cldr/cldr-core/blob/master/supplemental/weekData.json](https://github.com/unicode-cldr/cldr-core/blob/master/supplemental/weekData.json)\r\n * - [http://www.unicode.org/cldr/charts/28/supplemental/territory_information.html](http://www.unicode.org/cldr/charts/28/supplemental/territory_information.html)\r\n * - [https://www.iso.org/iso-3166-country-codes.html](https://www.iso.org/iso-3166-country-codes.html)\r\n *\r\n * @example\r\n * getWeekStartByRegion('PNG'); // 1\r\n * getWeekStartByRegion('qa'); // 6\r\n * getWeekStartByRegion(50); // 5\r\n *\r\n * @param {number | string} regionCode\r\n * ISO 3166 Alpha-2, Alpha-3 or numeric code.\r\n * @return {number}\r\n * Code of first day of week for the given country/region code:\r\n * 0 - Sunday, 1 - Monday, 2 - Tuesday, 3 - Wednesday, 4 - Thursday, 5 - Friday, 6 - Saturday.\r\n * @alias module:main.getWeekStartByRegion\r\n * @see module:api.getWeekStartByRegion\r\n */\r\nexport function getWeekStartByRegion(regionCode) {\r\n return api.getWeekStartByRegion(regionCode, regionDayMap);\r\n}\r\n\r\n/**\r\n * Return first day of week for locale identifier.\r\n *\r\n * Based on data from:\r\n * - [http://www.unicode.org/cldr/charts/28/supplemental/territory_language_information.html](http://www.unicode.org/cldr/charts/28/supplemental/territory_language_information.html)\r\n * - [http://www.unicode.org/cldr/charts/28/supplemental/language_territory_information.html](http://www.unicode.org/cldr/charts/28/supplemental/language_territory_information.html)\r\n * - [http://www.unicode.org/cldr/charts/28/supplemental/territory_information.html](http://www.unicode.org/cldr/charts/28/supplemental/territory_information.html)\r\n * - [http://www.unicode.org/reports/tr35/tr35.html#Unicode_Language_and_Locale_Identifiers](http://www.unicode.org/reports/tr35/tr35.html#Unicode_Language_and_Locale_Identifiers)\r\n *\r\n * @example\r\n * getWeekStartByLocale('no'); // 1\r\n * getWeekStartByLocale('Pa_Guru'); // 0\r\n * getWeekStartByLocale('fr-DZ'); // 6\r\n *\r\n * @param {string} locale\r\n * Locale identifier.\r\n * @return {number}\r\n * Code of first day of week for the given locale identifier:\r\n * 0 - Sunday, 1 - Monday, 2 - Tuesday, 3 - Wednesday, 4 - Thursday, 5 - Friday, 6 - Saturday.\r\n * @alias module:main.getWeekStartByLocale\r\n * @see module:api.getWeekStartByLocale\r\n */\r\nexport function getWeekStartByLocale(locale) {\r\n return api.getWeekStartByLocale(locale, langRegionMap, regionDayMap);\r\n}\r\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { getWeekStartByLocale } from 'weekstart';\n\ntype DayIndex = 0 | 1 | 2 | 3 | 4 | 5 | 6;\n\nexport function normalizeStartOfWeek(startOfWeek: number | undefined, locale: string) {\n return (typeof startOfWeek === 'number' ? startOfWeek % 7 : getWeekStartByLocale(locale)) as DayIndex;\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { addDays, addMonths, differenceInYears, isSameMonth, isSameYear, startOfMonth, startOfYear } from 'date-fns';\nimport { CalendarProps } from '../interfaces';\n\nexport function moveNextDay(startDate: Date, isDateEnabled: CalendarProps.IsDateEnabledFunction) {\n return moveDay(startDate, isDateEnabled, 1);\n}\n\nexport function movePrevDay(startDate: Date, isDateEnabled: CalendarProps.IsDateEnabledFunction) {\n return moveDay(startDate, isDateEnabled, -1);\n}\n\nexport function moveNextWeek(startDate: Date, isDateEnabled: CalendarProps.IsDateEnabledFunction) {\n return moveDay(startDate, isDateEnabled, 7);\n}\n\nexport function movePrevWeek(startDate: Date, isDateEnabled: CalendarProps.IsDateEnabledFunction) {\n return moveDay(startDate, isDateEnabled, -7);\n}\n\nexport function moveNextMonth(startDate: Date, isDateEnabled: CalendarProps.IsDateEnabledFunction) {\n return moveMonth(startDate, isDateEnabled, 1);\n}\n\nexport function movePrevMonth(startDate: Date, isDateEnabled: CalendarProps.IsDateEnabledFunction) {\n return moveMonth(startDate, isDateEnabled, -1);\n}\n\nexport function moveMonthDown(startDate: Date, isDateEnabled: CalendarProps.IsDateEnabledFunction) {\n return moveMonth(startDate, isDateEnabled, 3);\n}\n\nexport function moveMonthUp(startDate: Date, isDateEnabled: CalendarProps.IsDateEnabledFunction) {\n return moveMonth(startDate, isDateEnabled, -3);\n}\n\n// Returns first enabled date of the month corresponding to the given date.\n// If all month's days are disabled, the first day of the month is returned.\nexport function getBaseDay(date: Date, isDateEnabled: CalendarProps.IsDateEnabledFunction) {\n return getBaseDate({ date, isDateEnabled, granularity: 'day' });\n}\n\n// Returns first enabled month of the year corresponding to the given date.\n// If all year's months are disabled, the first month of the year is returned.\nexport function getBaseMonth(date: Date, isDateEnabled: CalendarProps.IsDateEnabledFunction) {\n return getBaseDate({ date, isDateEnabled, granularity: 'month' });\n}\n\nfunction getBaseDate({\n date,\n granularity,\n isDateEnabled,\n}: {\n date: Date;\n granularity: CalendarProps.Granularity;\n isDateEnabled: CalendarProps.IsDateEnabledFunction;\n}) {\n const isMonthGranularity = granularity === 'month';\n const getStartDate = isMonthGranularity ? startOfYear : startOfMonth;\n const moveDate = isMonthGranularity ? moveMonth : moveDay;\n const isSamePage = isMonthGranularity ? isSameYear : isSameMonth;\n\n const startDate = getStartDate(date);\n if (isDateEnabled(startDate)) {\n return startDate;\n }\n const firstEnabledDate = moveDate(startDate, isDateEnabled, 1);\n return isSamePage(startDate, firstEnabledDate) ? firstEnabledDate : startDate;\n}\n\n// Iterates days forwards or backwards until the next active day is found.\n// If there is no active day in a year range, the start day is returned.\nfunction moveDay(startDate: Date, isDateEnabled: CalendarProps.IsDateEnabledFunction, step: number): Date {\n return moveDate({ startDate, granularity: 'day', isDateEnabled, step });\n}\n\n// Iterates months forwards or backwards until the next active month is found.\n// If there is no active month in a 10 year range, the start month is returned.\nfunction moveMonth(startDate: Date, isDateEnabled: CalendarProps.IsDateEnabledFunction, step: number): Date {\n return moveDate({ startDate, granularity: 'month', isDateEnabled, step });\n}\n\nfunction moveDate({\n startDate,\n granularity,\n isDateEnabled,\n step,\n}: {\n startDate: Date;\n granularity: CalendarProps.Granularity;\n isDateEnabled: CalendarProps.IsDateEnabledFunction;\n step: number;\n}) {\n const isMonthGranularity = granularity === 'month';\n const addSteps = isMonthGranularity ? addMonths : addDays;\n const limitYears = isMonthGranularity ? 1 : 10;\n\n let current = addSteps(startDate, step);\n\n while (!isDateEnabled(current)) {\n if (Math.abs(differenceInYears(startDate, current)) > limitYears) {\n return startDate;\n }\n current = addSteps(current, step);\n }\n\n return current;\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useRef } from 'react';\n\nexport function useDateCache(): (date: Date) => Date {\n const cacheRef = useRef(new Map());\n\n return (date: Date) => {\n const current = cacheRef.current.get(date.getTime());\n if (current) {\n return current;\n }\n cacheRef.current.set(date.getTime(), date);\n return date;\n };\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { TimeInputProps } from '../../time-input/interfaces';\n\nfunction setDayIndex(date: Date, dayIndex: number): void {\n const diff = dayIndex - date.getDay();\n date.setDate(date.getDate() + diff);\n}\n\nexport function renderDayName(locale: string, dayIndex: number, mode: 'short' | 'long'): string {\n const tempDate = new Date();\n setDayIndex(tempDate, dayIndex);\n return tempDate.toLocaleDateString(locale, { weekday: mode });\n}\n\nexport function renderMonthAndYear(locale: string, baseDate: Date): string {\n const result = baseDate.toLocaleDateString(locale, {\n year: 'numeric',\n month: 'long',\n });\n\n return result;\n}\n\nexport function renderYear(locale: string, date: Date): string {\n return date.toLocaleDateString(locale, {\n year: 'numeric',\n });\n}\n\n/*\n `toLocaleDateString` is expensive (10+ ms) to calculate in IE11.\n*/\nconst dayLabelCache = new Map();\nexport function getDateLabel(locale: string, date: Date, mode: 'full' | 'short' = 'full'): string {\n const cacheKey = locale + date.getTime() + mode;\n const cachedValue = dayLabelCache.get(cacheKey);\n if (cachedValue) {\n return cachedValue;\n }\n const value = date.toLocaleDateString(locale, {\n weekday: mode === 'full' ? 'long' : undefined,\n month: 'long',\n day: 'numeric',\n year: 'numeric',\n });\n dayLabelCache.set(cacheKey, value);\n return value;\n}\n\nexport function renderTimeLabel(locale: string, date: Date, format?: TimeInputProps.Format): string {\n let options: Intl.DateTimeFormatOptions = {};\n if (format === 'hh') {\n options = { hour: '2-digit' };\n }\n if (format === 'hh:mm') {\n options = { hour: '2-digit', minute: '2-digit' };\n }\n const value = date.toLocaleTimeString(locale, options);\n return value;\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { CalendarProps } from './interfaces';\nimport { useInternalI18n } from '../i18n/context.js';\nimport { getDateLabel, renderMonthAndYear } from './utils/intl';\n\nexport default function useCalendarLabels({\n granularity,\n locale,\n i18nStrings,\n previousMonthAriaLabel,\n nextMonthAriaLabel,\n todayAriaLabel,\n}: {\n granularity: CalendarProps.Granularity;\n locale: string;\n i18nStrings?: CalendarProps.I18nStrings;\n previousMonthAriaLabel?: string;\n nextMonthAriaLabel?: string;\n previousYearAriaLabel?: string;\n todayAriaLabel?: string;\n}) {\n const i18n = useInternalI18n('calendar');\n\n const isMonthPicker = granularity === 'month';\n const previousButtonLabel = isMonthPicker\n ? i18n('i18nStrings.previousYearAriaLabel', i18nStrings?.previousYearAriaLabel)\n : i18n('previousMonthAriaLabel', i18nStrings?.previousMonthAriaLabel ?? previousMonthAriaLabel);\n\n const nextButtonLabel = isMonthPicker\n ? i18n('i18nStrings.nextYearAriaLabel', i18nStrings?.nextYearAriaLabel)\n : i18n('nextMonthAriaLabel', i18nStrings?.nextMonthAriaLabel ?? nextMonthAriaLabel);\n\n const currentDateLabel = isMonthPicker\n ? i18n('i18nStrings.currentMonthAriaLabel', i18nStrings?.currentMonthAriaLabel)\n : i18n('todayAriaLabel', i18nStrings?.todayAriaLabel ?? todayAriaLabel);\n\n const renderDate = (date: Date) =>\n isMonthPicker ? date.toLocaleString(locale, { month: 'short' }) : date.getDate().toString();\n\n const renderDateAnnouncement = (date: Date, isCurrentDate: boolean) => {\n const formattedDate = isMonthPicker ? renderMonthAndYear(locale, date) : getDateLabel(locale, date, 'short');\n if (isCurrentDate && currentDateLabel) {\n return formattedDate + '. ' + currentDateLabel;\n }\n return formattedDate;\n };\n\n const renderHeaderText = (date: Date) =>\n isMonthPicker ? date.getFullYear().toString() : renderMonthAndYear(locale, date);\n\n return {\n previousButtonLabel,\n nextButtonLabel,\n renderDate,\n renderDateAnnouncement,\n renderHeaderText,\n };\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { useMemo } from 'react';\nimport { normalizeStartOfWeek } from '../../internal/utils/locale/index.js';\nimport { getCalendarMonth } from 'mnth';\nimport { CalendarProps } from '../interfaces.js';\n\nexport default function useCalendarGridRows({\n baseDate,\n granularity,\n locale,\n startOfWeek,\n}: {\n baseDate: Date;\n granularity: CalendarProps.Granularity;\n locale: string;\n startOfWeek?: number;\n}) {\n const isMonthPicker = granularity === 'month';\n\n const rows = useMemo(\n () =>\n isMonthPicker\n ? getCalendarYear(baseDate)\n : getCalendarMonth(baseDate, { firstDayOfWeek: normalizeStartOfWeek(startOfWeek, locale) }),\n [baseDate, isMonthPicker, startOfWeek, locale]\n );\n\n return rows;\n}\n\n// Returns a 3-by-4 matrix with dates corresponding to the initial date-time of each month of the year for a given date.\nfunction getCalendarYear(date: Date): Date[][] {\n const year = date.getFullYear();\n return new Array(4)\n .fill(0)\n .map((_, i: number) => new Array(3).fill(0).map((_, j: number) => new Date(year, i * 3 + j)));\n}\n", "export const addDays = (date: Date, days: number): Date => {\n const result = new Date(date)\n\n result.setDate(result.getDate() + days)\n\n return result\n}\n", "export const setDate = (date: Date, day: number): Date => {\n const result = new Date(date)\n\n result.setDate(day)\n\n return result\n}\n", "import { addDays } from './add-days'\nimport { setDate } from './set-date'\n\nconst DAYS_IN_WEEK = 7\n\ntype TOptions = {\n firstDayOfWeek: 0 | 1 | 2 | 3 | 4 | 5 | 6,\n}\n\nexport const getCalendarMonth = (date: Date, options?: TOptions): Date[][] => {\n const { firstDayOfWeek } = {\n firstDayOfWeek: 1,\n ...options,\n }\n const firstDateOfMonth = new Date(date.getFullYear(), date.getMonth(), 1)\n const lastDateOfMonth = new Date(date.getFullYear(), date.getMonth() + 1, 0)\n const firstWeekdayOfMonth = firstDateOfMonth.getDay()\n const lastWeekdayOfMonth = lastDateOfMonth.getDay()\n const daysInMonth = lastDateOfMonth.getDate()\n const daysToPrepend = (firstWeekdayOfMonth - firstDayOfWeek + DAYS_IN_WEEK) % DAYS_IN_WEEK\n const daysToAppend = (DAYS_IN_WEEK - 1 - lastWeekdayOfMonth + firstDayOfWeek) % DAYS_IN_WEEK\n const month: Date[][] = []\n let week: Date[] = []\n\n for (let i = 1 - daysToPrepend; i <= daysInMonth + daysToAppend + 1; i++) {\n if (i <= 0) {\n week.push(\n addDays(firstDateOfMonth, i - 1)\n )\n } else if (i > daysInMonth) {\n week.push(\n addDays(lastDateOfMonth, i - daysInMonth)\n )\n } else {\n week.push(\n setDate(date, i)\n )\n }\n\n if (week.length === 7) {\n month.push(week)\n week = []\n }\n }\n\n return month\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { KeyCode } from '../keycode';\nimport { isRtl } from '../direction';\n\ninterface EventLike {\n keyCode: number;\n currentTarget: HTMLElement;\n}\n\nexport default function handleKey(\n event: EventLike,\n {\n onActivate,\n onBlockEnd,\n onBlockStart,\n onEnd,\n onHome,\n onInlineEnd,\n onInlineStart,\n onPageDown,\n onPageUp,\n }: {\n onActivate?: () => void;\n onBlockEnd?: () => void;\n onBlockStart?: () => void;\n onEnd?: () => void;\n onHome?: () => void;\n onInlineEnd?: () => void;\n onInlineStart?: () => void;\n onPageDown?: () => void;\n onPageUp?: () => void;\n }\n) {\n switch (event.keyCode) {\n case KeyCode.down:\n onBlockEnd?.();\n break;\n case KeyCode.end:\n onEnd?.();\n break;\n case KeyCode.enter:\n case KeyCode.space:\n onActivate?.();\n break;\n case KeyCode.home:\n onHome?.();\n break;\n case KeyCode.left:\n isRtl(event.currentTarget) ? onInlineEnd?.() : onInlineStart?.();\n break;\n case KeyCode.pageDown:\n onPageDown?.();\n break;\n case KeyCode.pageUp:\n onPageUp?.();\n break;\n case KeyCode.right:\n isRtl(event.currentTarget) ? onInlineStart?.() : onInlineEnd?.();\n break;\n case KeyCode.up:\n onBlockStart?.();\n break;\n }\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React from 'react';\nimport { isSameMonth, isSameYear } from 'date-fns';\nimport { CalendarProps } from '../interfaces';\nimport {\n moveNextDay,\n movePrevDay,\n moveNextWeek,\n movePrevWeek,\n moveNextMonth,\n movePrevMonth,\n moveMonthDown,\n moveMonthUp,\n} from '../utils/navigation';\nimport { KeyCode } from '../../internal/keycode';\nimport handleKey from '../../internal/utils/handle-key';\n\nexport default function useCalendarGridKeyboardNavigation({\n baseDate,\n focusableDate,\n granularity,\n isDateEnabled,\n onChangePage,\n onFocusDate,\n onSelectDate,\n}: {\n baseDate: Date;\n focusableDate: Date | null;\n granularity: CalendarProps.Granularity;\n isDateEnabled: CalendarProps.IsDateEnabledFunction;\n onChangePage: (date: Date) => void;\n onFocusDate: (date: null | Date) => void;\n onSelectDate: (date: Date) => void;\n}) {\n const isMonthPicker = granularity === 'month';\n\n const moveDown = isMonthPicker ? moveMonthDown : moveNextWeek;\n const moveLeft = isMonthPicker ? movePrevMonth : movePrevDay;\n const moveRight = isMonthPicker ? moveNextMonth : moveNextDay;\n const moveUp = isMonthPicker ? moveMonthUp : movePrevWeek;\n\n const isSamePage = isMonthPicker ? isSameYear : isSameMonth;\n\n const onGridKeyDownHandler = (event: React.KeyboardEvent) => {\n let updatedFocusDate;\n\n const keys = [KeyCode.up, KeyCode.down, KeyCode.left, KeyCode.right, KeyCode.space, KeyCode.enter];\n\n if (focusableDate === null || keys.indexOf(event.keyCode) === -1) {\n return;\n }\n\n event.preventDefault();\n\n handleKey(event, {\n onActivate: () => {\n onFocusDate(null);\n onSelectDate(focusableDate);\n },\n onBlockEnd: () => (updatedFocusDate = moveDown(focusableDate, isDateEnabled)),\n onBlockStart: () => (updatedFocusDate = moveUp(focusableDate, isDateEnabled)),\n onInlineStart: () => (updatedFocusDate = moveLeft(focusableDate, isDateEnabled)),\n onInlineEnd: () => (updatedFocusDate = moveRight(focusableDate, isDateEnabled)),\n });\n\n if (!updatedFocusDate) {\n return;\n }\n\n if (!isSamePage(updatedFocusDate, baseDate)) {\n onChangePage(updatedFocusDate);\n }\n onFocusDate(updatedFocusDate);\n };\n\n return onGridKeyDownHandler;\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React from 'react';\nimport clsx from 'clsx';\nimport ScreenreaderOnly from '../../internal/components/screenreader-only';\nimport { renderDayName } from '../utils/intl';\nimport styles from '../styles.css.js';\n\nexport default function CalendarGridHeader({ locale, rows }: { locale: string; rows: Date[][] }) {\n return (\n \n \n {rows[0]\n .map(date => date.getDay())\n .map(dayIndex => (\n \n {renderDayName(locale, dayIndex, 'short')}\n {renderDayName(locale, dayIndex, 'long')}\n \n ))}\n \n \n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { FocusEventHandler, useCallback, useImperativeHandle, useRef } from 'react';\nimport { CardsForwardRefType, CardsProps } from './interfaces';\nimport styles from './styles.css.js';\nimport { getCardsPerRow } from './cards-layout-helper';\nimport { getBaseProps } from '../internal/base-component';\nimport ToolsHeader from '../table/tools-header';\nimport { getItemKey } from '../table/utils';\nimport {\n SelectionControl,\n SelectionControlProps,\n focusMarkers,\n useSelectionFocusMove,\n useSelection,\n} from '../table/selection';\nimport { InternalContainerAsSubstep } from '../container/internal';\nimport InternalStatusIndicator from '../status-indicator/internal';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport stickyScrolling from '../table/sticky-scrolling';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport LiveRegion from '../internal/components/live-region';\nimport useMouseDownTarget from '../internal/hooks/use-mouse-down-target';\nimport { useMobile } from '../internal/hooks/use-mobile';\nimport { supportsStickyPosition } from '../internal/utils/dom';\nimport { useInternalI18n } from '../i18n/context';\nimport { useContainerQuery } from '@cloudscape-design/component-toolkit';\nimport { AnalyticsFunnelSubStep } from '../internal/analytics/components/analytics-funnel';\nimport { CollectionLabelContext } from '../internal/context/collection-label-context';\nimport { LinkDefaultVariantContext } from '../internal/context/link-default-variant-context';\nimport { shouldRemoveHighContrastHeader } from '../internal/utils/content-header-utils';\n\nexport { CardsProps };\n\nconst Cards = React.forwardRef(function (\n {\n items = [],\n cardDefinition,\n cardsPerRow = [],\n header,\n filter,\n pagination,\n preferences,\n empty,\n loading,\n loadingText,\n trackBy,\n selectedItems,\n selectionType,\n isItemDisabled,\n onSelectionChange,\n ariaLabels,\n visibleSections,\n stickyHeader,\n stickyHeaderVerticalOffset,\n variant = 'container',\n renderAriaLive,\n firstIndex,\n totalItemsCount,\n entireCardClickable,\n ...rest\n }: CardsProps,\n ref: React.Ref\n) {\n const { __internalRootRef } = useBaseComponent('Cards', {\n props: { entireCardClickable, selectionType, stickyHeader, variant },\n });\n const baseProps = getBaseProps(rest);\n const isRefresh = useVisualRefresh();\n const isMobile = useMobile();\n\n const computedVariant = isRefresh ? variant : 'container';\n\n const headerIdRef = useRef(undefined);\n const setHeaderRef = useCallback((id: string) => {\n headerIdRef.current = id;\n }, []);\n const isLabelledByHeader = !ariaLabels?.cardsLabel && !!header;\n\n const [columns, measureRef] = useContainerQuery(\n ({ contentBoxWidth }) => getCardsPerRow(contentBoxWidth, cardsPerRow),\n [cardsPerRow]\n );\n const refObject = useRef(null);\n const mergedRef = useMergeRefs(measureRef, refObject, __internalRootRef);\n const getMouseDownTarget = useMouseDownTarget();\n\n const i18n = useInternalI18n('cards');\n const { isItemSelected, getItemSelectionProps, updateShiftToggle } = useSelection({\n items,\n trackBy,\n selectedItems,\n selectionType,\n isItemDisabled,\n onSelectionChange,\n ariaLabels: {\n itemSelectionLabel: ariaLabels?.itemSelectionLabel,\n selectionGroupLabel: i18n('ariaLabels.selectionGroupLabel', ariaLabels?.selectionGroupLabel),\n },\n });\n const hasToolsHeader = header || filter || pagination || preferences;\n const hasFooterPagination = isMobile && variant === 'full-page' && !!pagination;\n const headerRef = useRef(null);\n\n const { scrollToTop, scrollToItem } = stickyScrolling(refObject, headerRef);\n stickyHeader = supportsStickyPosition() && !isMobile && stickyHeader;\n const onCardFocus: FocusEventHandler = event => {\n // When an element inside card receives focus we want to adjust the scroll.\n // However, that behavior is unwanted when the focus is received as result of a click\n // as it causes the click to never reach the target element.\n if (stickyHeader && !event.currentTarget.contains(getMouseDownTarget())) {\n scrollToItem(event.currentTarget);\n }\n };\n useImperativeHandle(\n ref,\n () => ({\n scrollToTop: () => {\n if (stickyHeader) {\n scrollToTop();\n }\n },\n }),\n [stickyHeader, scrollToTop]\n );\n let status;\n if (loading) {\n status = (\n
    \n \n {loadingText}\n \n
    \n );\n } else if (empty && !items.length) {\n status =
    {empty}
    ;\n }\n\n return (\n \n \n
    \n \n \n \n \n
    \n )\n }\n footer={hasFooterPagination &&
    {pagination}
    }\n disableContentPaddings={true}\n disableHeaderPaddings={computedVariant === 'full-page'}\n variant={computedVariant === 'container' ? 'cards' : computedVariant}\n __stickyHeader={stickyHeader}\n __stickyOffset={stickyHeaderVerticalOffset}\n __headerRef={headerRef}\n __darkHeader={computedVariant === 'full-page'}\n __disableFooterDivider={true}\n >\n \n {!!renderAriaLive && !!firstIndex && (\n \n \n {renderAriaLive({ totalItemsCount, firstIndex, lastIndex: firstIndex + items.length - 1 })}\n \n \n )}\n {status ?? (\n \n )}\n
    \n \n \n \n \n );\n}) as CardsForwardRefType;\n\nexport default Cards;\n\nconst CardsList = ({\n items,\n cardDefinition,\n trackBy,\n selectionType,\n columns,\n isItemSelected,\n getItemSelectionProps,\n visibleSections,\n updateShiftToggle,\n onFocus,\n ariaLabelledby,\n ariaLabel,\n entireCardClickable,\n}: Pick<\n CardsProps,\n 'items' | 'cardDefinition' | 'trackBy' | 'selectionType' | 'visibleSections' | 'entireCardClickable'\n> & {\n columns: number | null;\n isItemSelected: (item: T) => boolean;\n getItemSelectionProps: (item: T) => SelectionControlProps;\n updateShiftToggle: (state: boolean) => void;\n onFocus: FocusEventHandler;\n ariaLabel?: string;\n ariaLabelledby?: string;\n ariaDescribedby?: string;\n}) => {\n const selectable = !!selectionType;\n const canClickEntireCard = selectable && entireCardClickable;\n const isRefresh = useVisualRefresh();\n\n const { moveFocusDown, moveFocusUp } = useSelectionFocusMove(selectionType, items.length);\n\n let visibleSectionsDefinition = cardDefinition.sections || [];\n visibleSectionsDefinition = visibleSections\n ? visibleSectionsDefinition.filter(\n (section: CardsProps.SectionDefinition) => section.id && visibleSections.indexOf(section.id) !== -1\n )\n : visibleSectionsDefinition;\n\n let listRole: 'group' | undefined = undefined;\n let listItemRole: 'presentation' | undefined = undefined;\n\n if (selectable) {\n listRole = 'group';\n listItemRole = 'presentation';\n }\n\n return (\n \n {items.map((item, index) => (\n \n {\n getItemSelectionProps(item).onChange();\n // Manually move focus to the native input (checkbox or radio button)\n event.currentTarget.querySelector('input')?.focus();\n }\n : undefined\n }\n >\n
    \n
    \n {cardDefinition.header ? cardDefinition.header(item) : ''}\n
    \n {selectable && (\n
    \n \n
    \n )}\n
    \n {visibleSectionsDefinition.map(({ width = 100, header, content, id }, index) => (\n
    \n {header ?
    {header}
    : ''}\n {content ?
    {content(item)}
    : ''}\n
    \n ))}\n \n \n ))}\n \n );\n};\n\napplyDisplayName(Cards, 'Cards');\n", "\n import './styles.scoped.css';\n export default {\n \"card-inner\": \"awsui_card-inner_p8a6i_6eu0b_103\",\n \"root\": \"awsui_root_p8a6i_6eu0b_139\",\n \"header-variant-full-page\": \"awsui_header-variant-full-page_p8a6i_6eu0b_181\",\n \"header-refresh\": \"awsui_header-refresh_p8a6i_6eu0b_181\",\n \"list\": \"awsui_list_p8a6i_6eu0b_190\",\n \"list-grid-1\": \"awsui_list-grid-1_p8a6i_6eu0b_201\",\n \"card\": \"awsui_card_p8a6i_6eu0b_103\",\n \"list-grid-2\": \"awsui_list-grid-2_p8a6i_6eu0b_204\",\n \"list-grid-3\": \"awsui_list-grid-3_p8a6i_6eu0b_207\",\n \"list-grid-4\": \"awsui_list-grid-4_p8a6i_6eu0b_210\",\n \"list-grid-5\": \"awsui_list-grid-5_p8a6i_6eu0b_213\",\n \"list-grid-6\": \"awsui_list-grid-6_p8a6i_6eu0b_216\",\n \"list-grid-7\": \"awsui_list-grid-7_p8a6i_6eu0b_219\",\n \"list-grid-8\": \"awsui_list-grid-8_p8a6i_6eu0b_222\",\n \"list-grid-9\": \"awsui_list-grid-9_p8a6i_6eu0b_225\",\n \"list-grid-10\": \"awsui_list-grid-10_p8a6i_6eu0b_228\",\n \"list-grid-11\": \"awsui_list-grid-11_p8a6i_6eu0b_231\",\n \"list-grid-12\": \"awsui_list-grid-12_p8a6i_6eu0b_234\",\n \"list-grid-13\": \"awsui_list-grid-13_p8a6i_6eu0b_237\",\n \"list-grid-14\": \"awsui_list-grid-14_p8a6i_6eu0b_240\",\n \"list-grid-15\": \"awsui_list-grid-15_p8a6i_6eu0b_243\",\n \"list-grid-16\": \"awsui_list-grid-16_p8a6i_6eu0b_246\",\n \"list-grid-17\": \"awsui_list-grid-17_p8a6i_6eu0b_249\",\n \"list-grid-18\": \"awsui_list-grid-18_p8a6i_6eu0b_252\",\n \"list-grid-19\": \"awsui_list-grid-19_p8a6i_6eu0b_255\",\n \"list-grid-20\": \"awsui_list-grid-20_p8a6i_6eu0b_258\",\n \"selection-control\": \"awsui_selection-control_p8a6i_6eu0b_262\",\n \"loading\": \"awsui_loading_p8a6i_6eu0b_272\",\n \"empty\": \"awsui_empty_p8a6i_6eu0b_273\",\n \"has-header\": \"awsui_has-header_p8a6i_6eu0b_280\",\n \"refresh\": \"awsui_refresh_p8a6i_6eu0b_283\",\n \"remove-high-contrast-header\": \"awsui_remove-high-contrast-header_p8a6i_6eu0b_283\",\n \"card-header\": \"awsui_card-header_p8a6i_6eu0b_354\",\n \"card-header-inner\": \"awsui_card-header-inner_p8a6i_6eu0b_362\",\n \"card-selectable\": \"awsui_card-selectable_p8a6i_6eu0b_366\",\n \"card-selected\": \"awsui_card-selected_p8a6i_6eu0b_369\",\n \"section\": \"awsui_section_p8a6i_6eu0b_377\",\n \"section-header\": \"awsui_section-header_p8a6i_6eu0b_385\",\n \"section-content\": \"awsui_section-content_p8a6i_6eu0b_391\",\n \"footer-pagination\": \"awsui_footer-pagination_p8a6i_6eu0b_401\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { CardsProps } from './interfaces';\n\nconst WIDTHS = [1920, 1400, 1200, 992, 768];\n\n// Transform the array of widths into a valid cardsPerRow property that is used as default\nconst defaultCardsPerRow = WIDTHS.map((value, index, widths) => ({\n minWidth: value,\n cards: widths.length + 1 - index,\n}));\n\nexport const getCardsPerRow = (width: number, config: ReadonlyArray) => {\n if (config.length === 0) {\n config = defaultCardsPerRow;\n }\n let cardsPerRow = 1;\n // sort them by descending order of minWidth\n const sortedConfig: Required[] = config\n .slice()\n .map(value => ({\n minWidth: value.minWidth || 0,\n cards: value.cards,\n }))\n .sort((a, b) => b.minWidth - a.minWidth);\n\n sortedConfig.some(layout => {\n if (width >= layout.minWidth) {\n cardsPerRow = layout.cards;\n return true;\n }\n });\n return cardsPerRow;\n};\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { CheckboxProps } from './interfaces';\nimport InternalCheckbox from './internal';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport useBaseComponent from '../internal/hooks/use-base-component';\n\nexport { CheckboxProps };\n\nconst Checkbox = React.forwardRef(({ ...props }: CheckboxProps, ref: React.Ref) => {\n const baseComponentProps = useBaseComponent('Checkbox');\n return ;\n});\n\napplyDisplayName(Checkbox, 'Checkbox');\nexport default Checkbox;\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useCallback, useEffect, useMemo, useRef, useState, forwardRef } from 'react';\nimport { Ace } from 'ace-builds';\nimport clsx from 'clsx';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\n\nimport { getBaseProps } from '../internal/base-component';\nimport { KeyCode } from '../internal/keycode';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { CodeEditorProps } from './interfaces';\nimport { Pane } from './pane';\nimport { useChangeEffect } from './listeners';\nimport { PaneStatus, getLanguageLabel, getDefaultTheme, DEFAULT_AVAILABLE_THEMES } from './util';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { setupEditor } from './setup-editor';\nimport { ResizableBox } from './resizable-box';\nimport PreferencesModal from './preferences-modal';\nimport LoadingScreen from './loading-screen';\nimport ErrorScreen from './error-screen';\n\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport useForwardFocus from '../internal/hooks/forward-focus';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { useCurrentMode } from '@cloudscape-design/component-toolkit/internal';\nimport { useInternalI18n } from '../i18n/context';\nimport { StatusBar } from './status-bar';\nimport { useFormFieldContext } from '../internal/context/form-field-context';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { useControllable } from '../internal/hooks/use-controllable';\nimport LiveRegion from '../internal/components/live-region';\n\nimport styles from './styles.css.js';\nimport { useContainerQuery } from '@cloudscape-design/component-toolkit';\nimport {\n useEditor,\n useSyncEditorSize,\n useSyncEditorLabels,\n useSyncEditorValue,\n useSyncEditorLanguage,\n useSyncEditorWrapLines,\n useSyncEditorTheme,\n} from './use-editor';\n\nexport { CodeEditorProps };\n\nconst CodeEditor = forwardRef((props: CodeEditorProps, ref: React.Ref) => {\n const {\n ace,\n value,\n language,\n i18nStrings,\n editorContentHeight,\n onEditorContentResize,\n ariaLabel,\n languageLabel: customLanguageLabel,\n preferences,\n loading,\n themes,\n getModalRoot,\n removeModalRoot,\n ...rest\n } = props;\n const { __internalRootRef } = useBaseComponent('CodeEditor', { props: { language } });\n const { controlId, ariaLabelledby, ariaDescribedby } = useFormFieldContext(props);\n const [editorHeight = 480, setEditorHeight] = useControllable(editorContentHeight, onEditorContentResize, 480, {\n componentName: 'code-editor',\n changeHandler: 'onEditorContentResize',\n controlledProp: 'editorContentHeight',\n });\n const mode = useCurrentMode(__internalRootRef);\n const isRefresh = useVisualRefresh();\n const baseProps = getBaseProps(rest);\n const i18n = useInternalI18n('code-editor');\n\n const errorsTabRef = useRef(null);\n const warningsTabRef = useRef(null);\n const [codeEditorWidth, codeEditorMeasureRef] = useContainerQuery(rect => rect.contentBoxWidth);\n const mergedRef = useMergeRefs(codeEditorMeasureRef, __internalRootRef);\n\n const paneId = useUniqueId('code-editor-pane');\n\n const [paneStatus, setPaneStatus] = useState('hidden');\n const [annotations, setAnnotations] = useState([]);\n const [highlightedAnnotation, setHighlightedAnnotation] = useState();\n const [cursorPosition, setCursorPosition] = useState({ row: 0, column: 0 });\n const [isTabFocused, setTabFocused] = useState(false);\n\n const { editorRef, editor } = useEditor(ace, themes, loading);\n\n useForwardFocus(ref, editorRef);\n\n useEffect(() => {\n if (!ace || !editor) {\n return;\n }\n\n setupEditor(ace, editor, setAnnotations, setCursorPosition, setHighlightedAnnotation, setPaneStatus);\n\n return () => {\n editor?.destroy();\n };\n }, [ace, editor]);\n\n useSyncEditorLabels(editor, { controlId, ariaLabel, ariaLabelledby, ariaDescribedby });\n\n const { onResize } = useSyncEditorSize(editor, { width: codeEditorWidth, height: editorContentHeight });\n\n useSyncEditorValue(editor, value);\n\n useSyncEditorLanguage(editor, language);\n\n useSyncEditorWrapLines(editor, preferences?.wrapLines);\n\n const defaultTheme = getDefaultTheme(mode, themes);\n useSyncEditorTheme(editor, preferences?.theme ?? defaultTheme);\n\n // Change listeners\n useChangeEffect(editor, props.onChange, props.onDelayedChange);\n\n // Hide error panel when there are no errors to show.\n useEffect(() => {\n if (annotations.length === 0) {\n setPaneStatus('hidden');\n }\n\n if (props.onValidate) {\n fireNonCancelableEvent(props.onValidate, { annotations });\n }\n }, [annotations, props.onValidate]);\n\n const languageLabel = customLanguageLabel ?? getLanguageLabel(language);\n\n const errorCount = annotations.filter(a => a.type === 'error').length;\n const warningCount = annotations.filter(a => a.type === 'warning').length;\n const currentAnnotations = useMemo(() => annotations.filter(a => a.type === paneStatus), [annotations, paneStatus]);\n\n /*\n * Callbacks\n */\n\n const onEditorKeydown = useCallback(\n (e: React.KeyboardEvent) => {\n if (editor && e.target === editor.container && e.keyCode === KeyCode.enter) {\n e.stopPropagation();\n e.preventDefault();\n editor.focus();\n }\n },\n [editor]\n );\n\n const onTabFocus = useCallback(() => setTabFocused(true), []);\n const onTabBlur = useCallback(() => setTabFocused(false), []);\n\n const onErrorPaneToggle = useCallback(() => {\n setPaneStatus(paneStatus !== 'error' ? 'error' : 'hidden');\n }, [paneStatus]);\n\n const onWarningPaneToggle = useCallback(() => {\n setPaneStatus(paneStatus !== 'warning' ? 'warning' : 'hidden');\n }, [paneStatus]);\n\n const onPaneClose = () => {\n setPaneStatus('hidden');\n };\n\n const onAnnotationClick = ({ row = 0, column = 0 }: Ace.Annotation) => {\n if (!editor) {\n return;\n }\n editor.focus();\n editor.gotoLine(row + 1, column, false);\n setHighlightedAnnotation(undefined);\n };\n\n const onAnnotationClear = useCallback(() => {\n setHighlightedAnnotation(undefined);\n }, []);\n\n const [isPreferencesModalVisible, setPreferencesModalVisible] = useState(false);\n const onPreferencesOpen = () => setPreferencesModalVisible(true);\n const onPreferencesConfirm = (p: CodeEditorProps.Preferences) => {\n fireNonCancelableEvent(props.onPreferencesChange, p);\n setPreferencesModalVisible(false);\n };\n const onPreferencesDismiss = () => setPreferencesModalVisible(false);\n\n const isPaneVisible = paneStatus !== 'hidden';\n\n return (\n \n {loading && (\n \n {i18n('i18nStrings.loadingState', i18nStrings?.loadingState)}\n \n )}\n\n {!ace && !loading && (\n \n {i18n('i18nStrings.errorState', i18nStrings?.errorState)}\n \n )}\n\n {ace && !loading && (\n <>\n {\n setEditorHeight(height);\n onResize();\n fireNonCancelableEvent(onEditorContentResize, { height });\n }}\n >\n \n \n \n format({ row: cursorPosition.row + 1, column: cursorPosition.column + 1 })\n )}\n errorCount={errorCount}\n warningCount={warningCount}\n paneStatus={paneStatus}\n onErrorPaneToggle={onErrorPaneToggle}\n onWarningPaneToggle={onWarningPaneToggle}\n onTabFocus={onTabFocus}\n onTabBlur={onTabBlur}\n errorsTabRef={errorsTabRef}\n warningsTabRef={warningsTabRef}\n i18nStrings={i18nStrings}\n isTabFocused={isTabFocused}\n paneId={isPaneVisible ? paneId : undefined}\n onPreferencesOpen={onPreferencesOpen}\n isRefresh={isRefresh}\n />\n (row, column) => format({ row, column })\n )}\n closeButtonAriaLabel={i18n('i18nStrings.paneCloseButtonAriaLabel', i18nStrings?.paneCloseButtonAriaLabel)}\n />\n \n {isPreferencesModalVisible && (\n \n )}\n \n )}\n \n );\n});\n\napplyDisplayName(CodeEditor, 'CodeEditor');\nexport default CodeEditor;\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef, useState } from 'react';\nimport clsx from 'clsx';\nimport { Ace } from 'ace-builds';\n\nimport { KeyCode } from '../internal/keycode';\nimport FocusLock from '../internal/components/focus-lock';\n\nimport { InternalButton } from '../button/internal';\nimport { ResizableBox } from './resizable-box';\n\nimport styles from './styles.css.js';\nimport { getStatusButtonId, PaneStatus } from './util';\n\nconst ANNOTATION_ITEM_HEIGHT = 31;\nconst PANE_ANNOTATIONS_PADDING = 12;\nconst MIN_HEIGHT = 3 * ANNOTATION_ITEM_HEIGHT + 2 * PANE_ANNOTATIONS_PADDING;\n\nexport interface PaneProps {\n id: string;\n paneStatus: PaneStatus;\n\n visible: boolean;\n annotations: Ace.Annotation[];\n highlighted?: Ace.Annotation;\n\n cursorPositionLabel?: (row: number, column: number) => string;\n closeButtonAriaLabel?: string;\n\n onClose: () => void;\n onAnnotationClick: (annotation: Ace.Annotation) => void;\n onAnnotationClear: () => void;\n}\n\nexport const Pane = ({\n id,\n paneStatus,\n visible,\n annotations,\n highlighted,\n onClose,\n onAnnotationClick,\n onAnnotationClear,\n cursorPositionLabel,\n closeButtonAriaLabel,\n}: PaneProps) => {\n const [paneHeight, setPaneHeight] = useState(MIN_HEIGHT);\n const listRef = useRef(null);\n\n useEffect(() => {\n if (!highlighted) {\n return;\n }\n const { row, column } = highlighted;\n const highlightedAnnotationIndex = annotations.indexOf(\n annotations.filter(a => a.row === row && a.column === column)[0]\n );\n\n if (highlightedAnnotationIndex > -1) {\n const errorItem = listRef.current?.children[highlightedAnnotationIndex] as HTMLElement | undefined;\n errorItem?.focus();\n }\n }, [highlighted, annotations]);\n\n const onItemClick = (annotation: Ace.Annotation) => {\n onAnnotationClick(annotation);\n };\n\n const onItemKeyDown = (annotation: Ace.Annotation, event: React.KeyboardEvent) => {\n if (event.keyCode === KeyCode.enter || event.keyCode === KeyCode.space) {\n event.preventDefault();\n onAnnotationClick(annotation);\n }\n };\n\n const onEscKeyDown = (event: React.KeyboardEvent) => {\n if (event.keyCode === KeyCode.escape) {\n event.preventDefault();\n onClose();\n }\n };\n\n const ariaLabelledBy = getStatusButtonId({ paneId: id, paneStatus: paneStatus });\n\n if (!visible) {\n return null;\n }\n\n return (\n
    \n setPaneHeight(newHeight)}>\n \n
    \n \n \n \n \n \n \n {annotations.map((annotation, i) => (\n \n \n \n \n ))}\n \n
    \n {cursorPositionLabel?.((annotation.row || 0) + 1, (annotation.column || 0) + 1) ?? ''}\n \n {annotation.text}\n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n );\n};\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef, useState } from 'react';\nimport styles from './styles.css.js';\nimport { useStableCallback } from '@cloudscape-design/component-toolkit/internal';\n\nexport interface ResizeBoxProps {\n children: React.ReactNode;\n height: number;\n minHeight: number;\n onResize: (newHeight: number) => void;\n}\n\nexport function ResizableBox({ children, height, minHeight, onResize }: ResizeBoxProps) {\n const [dragOffset, setDragOffset] = useState(null);\n const onResizeStable = useStableCallback(onResize);\n const containerRef = useRef(null);\n\n const onMouseDown: React.MouseEventHandler = event => {\n if (event.button !== 0 || !containerRef.current) {\n return;\n }\n const containerBottom = containerRef.current.getBoundingClientRect().bottom;\n setDragOffset(containerBottom - event.clientY);\n };\n\n useEffect(() => {\n if (dragOffset === null || !containerRef.current) {\n return;\n }\n const container = containerRef.current;\n\n const onMouseMove = (event: MouseEvent) => {\n const { top } = container.getBoundingClientRect();\n const cursor = event.clientY;\n onResizeStable(Math.max(cursor + dragOffset - top, minHeight));\n };\n const onMouseUp = () => {\n setDragOffset(null);\n };\n document.body.classList.add(styles['resize-active']);\n document.addEventListener('mousemove', onMouseMove);\n document.addEventListener('mouseup', onMouseUp);\n return () => {\n document.removeEventListener('mousemove', onMouseMove);\n document.removeEventListener('mouseup', onMouseUp);\n document.body.classList.remove(styles['resize-active']);\n };\n }, [dragOffset, minHeight, onResizeStable]);\n\n return (\n
    \n {children}\n \n
    \n );\n}\n", "\n import './styles.scoped.css';\n export default {\n \"resizable-box\": \"awsui_resizable-box_cufu9_1kvmu_17\",\n \"resizable-box-handle\": \"awsui_resizable-box-handle_cufu9_1kvmu_22\",\n \"resize-active\": \"awsui_resize-active_cufu9_1kvmu_49\"\n};\n ", "\n import './styles.scoped.css';\n export default {\n \"code-editor-refresh\": \"awsui_code-editor-refresh_1gl9c_162o6_104\",\n \"code-editor\": \"awsui_code-editor_1gl9c_162o6_104\",\n \"pane\": \"awsui_pane_1gl9c_162o6_450\",\n \"pane__close-container\": \"awsui_pane__close-container_1gl9c_162o6_461\",\n \"pane__list\": \"awsui_pane__list_1gl9c_162o6_466\",\n \"pane__table\": \"awsui_pane__table_1gl9c_162o6_473\",\n \"pane__item\": \"awsui_pane__item_1gl9c_162o6_479\",\n \"pane__cell\": \"awsui_pane__cell_1gl9c_162o6_479\",\n \"pane__item--highlighted\": \"awsui_pane__item--highlighted_1gl9c_162o6_493\",\n \"pane__location\": \"awsui_pane__location_1gl9c_162o6_514\",\n \"pane__description\": \"awsui_pane__description_1gl9c_162o6_514\",\n \"focus-lock\": \"awsui_focus-lock_1gl9c_162o6_529\",\n \"editor\": \"awsui_editor_1gl9c_162o6_580\",\n \"editor-refresh\": \"awsui_editor-refresh_1gl9c_162o6_608\",\n \"status-bar\": \"awsui_status-bar_1gl9c_162o6_613\",\n \"status-bar-with-hidden-pane\": \"awsui_status-bar-with-hidden-pane_1gl9c_162o6_621\",\n \"status-bar__left\": \"awsui_status-bar__left_1gl9c_162o6_625\",\n \"status-bar__left-virtual\": \"awsui_status-bar__left-virtual_1gl9c_162o6_632\",\n \"status-bar__right\": \"awsui_status-bar__right_1gl9c_162o6_636\",\n \"status-bar__language-mode\": \"awsui_status-bar__language-mode_1gl9c_162o6_640\",\n \"status-bar__cursor-position\": \"awsui_status-bar__cursor-position_1gl9c_162o6_640\",\n \"status-bar__cog-button\": \"awsui_status-bar__cog-button_1gl9c_162o6_646\",\n \"status-bar-virtual\": \"awsui_status-bar-virtual_1gl9c_162o6_651\",\n \"tab-button\": \"awsui_tab-button_1gl9c_162o6_657\",\n \"tab-button--refresh\": \"awsui_tab-button--refresh_1gl9c_162o6_689\",\n \"tab-button--warnings\": \"awsui_tab-button--warnings_1gl9c_162o6_692\",\n \"tab-button--active\": \"awsui_tab-button--active_1gl9c_162o6_701\",\n \"tab-button--disabled\": \"awsui_tab-button--disabled_1gl9c_162o6_717\",\n \"tab-button--divider\": \"awsui_tab-button--divider_1gl9c_162o6_750\",\n \"tab-button--errors\": \"awsui_tab-button--errors_1gl9c_162o6_757\",\n \"loading-screen\": \"awsui_loading-screen_1gl9c_162o6_761\",\n \"error-screen\": \"awsui_error-screen_1gl9c_162o6_762\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nexport const AceModes = [\n { value: 'abap', label: 'ABAP' },\n { value: 'abc', label: 'ABC' },\n { value: 'actionscript', label: 'ActionScript' },\n { value: 'ada', label: 'ADA' },\n { value: 'alda', label: 'Alda' },\n { value: 'apache_conf', label: 'Apache Conf' },\n { value: 'apex', label: 'Apex' },\n { value: 'aql', label: 'AQL' },\n { value: 'asciidoc', label: 'AsciiDoc' },\n { value: 'asl', label: 'ASL' },\n { value: 'assembly_x86', label: 'Assembly x86' },\n { value: 'autohotkey', label: 'AutoHotkey/AutoIt' },\n { value: 'batchfile', label: 'BatchFile' },\n { value: 'c_cpp', label: 'C/C++' },\n { value: 'c9search', label: 'C9Search' },\n { value: 'cirru', label: 'Cirru' },\n { value: 'clojure', label: 'Clojure' },\n { value: 'cobol', label: 'Cobol' },\n { value: 'coffee', label: 'CoffeeScript' },\n { value: 'coldfusion', label: 'ColdFusion' },\n { value: 'crystal', label: 'Crystal' },\n { value: 'csharp', label: 'C#' },\n { value: 'csound_document', label: 'Csound Document' },\n { value: 'csound_orchestra', label: 'Csound' },\n { value: 'csound_score', label: 'Csound Score' },\n { value: 'css', label: 'CSS' },\n { value: 'curly', label: 'Curly' },\n { value: 'd', label: 'D' },\n { value: 'dart', label: 'Dart' },\n { value: 'diff', label: 'Diff' },\n { value: 'django', label: 'Django' },\n { value: 'dockerfile', label: 'Dockerfile' },\n { value: 'dot', label: 'Dot' },\n { value: 'drools', label: 'Drools' },\n { value: 'edifact', label: 'Edifact' },\n { value: 'eiffel', label: 'Eiffel' },\n { value: 'ejs', label: 'EJS' },\n { value: 'elixir', label: 'Elixir' },\n { value: 'elm', label: 'Elm' },\n { value: 'erlang', label: 'Erlang' },\n { value: 'forth', label: 'Forth' },\n { value: 'fortran', label: 'Fortran' },\n { value: 'fsharp', label: 'FSharp' },\n { value: 'fsl', label: 'FSL' },\n { value: 'ftl', label: 'FreeMarker' },\n { value: 'gcode', label: 'Gcode' },\n { value: 'gherkin', label: 'Gherkin' },\n { value: 'gitignore', label: 'Gitignore' },\n { value: 'glsl', label: 'Glsl' },\n { value: 'gobstones', label: 'Gobstones' },\n { value: 'golang', label: 'Go' },\n { value: 'graphqlschema', label: 'GraphQLSchema' },\n { value: 'groovy', label: 'Groovy' },\n { value: 'haml', label: 'HAML' },\n { value: 'handlebars', label: 'Handlebars' },\n { value: 'haskell', label: 'Haskell' },\n { value: 'haskell_cabal', label: 'Haskell Cabal' },\n { value: 'haxe', label: 'haXe' },\n { value: 'hjson', label: 'Hjson' },\n { value: 'html', label: 'HTML' },\n { value: 'html_elixir', label: 'HTML (Elixir)' },\n { value: 'html_ruby', label: 'HTML (Ruby)' },\n { value: 'ini', label: 'INI' },\n { value: 'io', label: 'Io' },\n { value: 'jack', label: 'Jack' },\n { value: 'jade', label: 'Jade' },\n { value: 'java', label: 'Java' },\n { value: 'javascript', label: 'JavaScript' },\n { value: 'json', label: 'JSON' },\n { value: 'json5', label: 'JSON5' },\n { value: 'jsoniq', label: 'JSONiq' },\n { value: 'jsp', label: 'JSP' },\n { value: 'jssm', label: 'JSSM' },\n { value: 'jsx', label: 'JSX' },\n { value: 'julia', label: 'Julia' },\n { value: 'kotlin', label: 'Kotlin' },\n { value: 'latex', label: 'LaTeX' },\n { value: 'less', label: 'LESS' },\n { value: 'liquid', label: 'Liquid' },\n { value: 'lisp', label: 'Lisp' },\n { value: 'livescript', label: 'LiveScript' },\n { value: 'logiql', label: 'LogiQL' },\n { value: 'lsl', label: 'LSL' },\n { value: 'lua', label: 'Lua' },\n { value: 'luapage', label: 'LuaPage' },\n { value: 'lucene', label: 'Lucene' },\n { value: 'makefile', label: 'Makefile' },\n { value: 'markdown', label: 'Markdown' },\n { value: 'mask', label: 'Mask' },\n { value: 'matlab', label: 'MATLAB' },\n { value: 'maze', label: 'Maze' },\n { value: 'mediawiki', label: 'MediaWiki' },\n { value: 'mel', label: 'MEL' },\n { value: 'mixal', label: 'MIXAL' },\n { value: 'mushcode', label: 'MUSHCode' },\n { value: 'mysql', label: 'MySQL' },\n { value: 'nginx', label: 'Nginx' },\n { value: 'nim', label: 'Nim' },\n { value: 'nix', label: 'Nix' },\n { value: 'nsis', label: 'NSIS' },\n { value: 'nunjucks', label: 'Nunjucks' },\n { value: 'objectivec', label: 'Objective-C' },\n { value: 'ocaml', label: 'OCaml' },\n { value: 'pascal', label: 'Pascal' },\n { value: 'perl', label: 'Perl' },\n { value: 'perl6', label: 'Perl 6' },\n { value: 'pgsql', label: 'pgSQL' },\n { value: 'php', label: 'PHP' },\n { value: 'php_laravel_blade', label: 'PHP (Blade Template)' },\n { value: 'pig', label: 'Pig' },\n { value: 'powershell', label: 'Powershell' },\n { value: 'praat', label: 'Praat' },\n { value: 'prisma', label: 'Prisma' },\n { value: 'prolog', label: 'Prolog' },\n { value: 'properties', label: 'Properties' },\n { value: 'protobuf', label: 'Protobuf' },\n { value: 'puppet', label: 'Puppet' },\n { value: 'python', label: 'Python' },\n { value: 'qml', label: 'QML' },\n { value: 'r', label: 'R' },\n { value: 'razor', label: 'Razor' },\n { value: 'rdoc', label: 'RDoc' },\n { value: 'red', label: 'Red' },\n { value: 'rhtml', label: 'RHTML' },\n { value: 'rst', label: 'RST' },\n { value: 'ruby', label: 'Ruby' },\n { value: 'rust', label: 'Rust' },\n { value: 'sass', label: 'SASS' },\n { value: 'scad', label: 'SCAD' },\n { value: 'scala', label: 'Scala' },\n { value: 'scheme', label: 'Scheme' },\n { value: 'scss', label: 'SCSS' },\n { value: 'sh', label: 'SH' },\n { value: 'sjs', label: 'SJS' },\n { value: 'slim', label: 'Slim' },\n { value: 'smarty', label: 'Smarty' },\n { value: 'snippets', label: 'snippets' },\n { value: 'soy_template', label: 'Soy Template' },\n { value: 'space', label: 'Space' },\n { value: 'sql', label: 'SQL' },\n { value: 'sqlserver', label: 'SQLServer' },\n { value: 'stylus', label: 'Stylus' },\n { value: 'svg', label: 'SVG' },\n { value: 'swift', label: 'Swift' },\n { value: 'tcl', label: 'Tcl' },\n { value: 'terraform', label: 'Terraform' },\n { value: 'tex', label: 'Tex' },\n { value: 'text', label: 'Text' },\n { value: 'textile', label: 'Textile' },\n { value: 'toml', label: 'Toml' },\n { value: 'tsx', label: 'TSX' },\n { value: 'twig', label: 'Twig' },\n { value: 'typescript', label: 'TypeScript' },\n { value: 'vala', label: 'Vala' },\n { value: 'vbscript', label: 'VBScript' },\n { value: 'velocity', label: 'Velocity' },\n { value: 'verilog', label: 'Verilog' },\n { value: 'vhdl', label: 'VHDL' },\n { value: 'visualforce', label: 'Visualforce' },\n { value: 'wollok', label: 'Wollok' },\n { value: 'xml', label: 'XML' },\n { value: 'xquery', label: 'XQuery' },\n { value: 'yaml', label: 'YAML' },\n { value: 'zeek', label: 'Zeek' },\n] as const;\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nexport const LightThemes = [\n { value: 'chrome', label: 'Chrome' },\n { value: 'clouds', label: 'Clouds' },\n { value: 'crimson_editor', label: 'Crimson Editor' },\n { value: 'dawn', label: 'Dawn' },\n { value: 'dreamweaver', label: 'Dreamweaver' },\n { value: 'eclipse', label: 'Eclipse' },\n { value: 'github', label: 'GitHub' },\n { value: 'iplastic', label: 'IPlastic' },\n { value: 'solarized_light', label: 'Solarized Light' },\n { value: 'textmate', label: 'TextMate' },\n { value: 'tomorrow', label: 'Tomorrow' },\n { value: 'xcode', label: 'Xcode' },\n { value: 'kuroir', label: 'Kuroir' },\n { value: 'katzenmilch', label: 'KatzenMilch' },\n { value: 'sqlserver', label: 'SQL Server' },\n { value: 'cloud_editor', label: 'CloudEditor' },\n] as const;\n\nexport const DarkThemes = [\n { value: 'ambiance', label: 'Ambiance' },\n { value: 'chaos', label: 'Chaos' },\n { value: 'clouds_midnight', label: 'Clouds Midnight' },\n { value: 'dracula', label: 'Dracula' },\n { value: 'cobalt', label: 'Cobalt' },\n { value: 'gruvbox', label: 'Gruvbox' },\n { value: 'gob', label: 'Green on Black' },\n { value: 'idle_fingers', label: 'idle Fingers' },\n { value: 'kr_theme', label: 'krTheme' },\n { value: 'merbivore', label: 'Merbivore' },\n { value: 'merbivore_soft', label: 'Merbivore Soft' },\n { value: 'mono_industrial', label: 'Mono Industrial' },\n { value: 'monokai', label: 'Monokai' },\n { value: 'nord_dark', label: 'Nord Dark' },\n { value: 'pastel_on_dark', label: 'Pastel on dark' },\n { value: 'solarized_dark', label: 'Solarized Dark' },\n { value: 'terminal', label: 'Terminal' },\n { value: 'tomorrow_night', label: 'Tomorrow Night' },\n { value: 'tomorrow_night_blue', label: 'Tomorrow Night Blue' },\n { value: 'tomorrow_night_bright', label: 'Tomorrow Night Bright' },\n { value: 'tomorrow_night_eighties', label: 'Tomorrow Night 80s' },\n { value: 'twilight', label: 'Twilight' },\n { value: 'vibrant_ink', label: 'Vibrant Ink' },\n { value: 'cloud_editor_dark', label: 'CloudEditor Dark' },\n] as const;\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { Ace } from 'ace-builds';\n\nimport { AceModes } from './ace-modes';\nimport { LightThemes, DarkThemes } from './ace-themes';\nimport { CodeEditorProps } from './interfaces';\n\nexport type PaneStatus = 'error' | 'warning' | 'hidden';\n\nconst CLOUD_EDITOR_LIGHT_THEME: typeof LightThemes[number]['value'] = 'cloud_editor';\nconst CLOUD_EDITOR_DARK_THEME: typeof DarkThemes[number]['value'] = 'cloud_editor_dark';\nconst FALLBACK_LIGHT_THEME: typeof LightThemes[number]['value'] = 'dawn';\nconst FALLBACK_DARK_THEME: typeof DarkThemes[number]['value'] = 'tomorrow_night_bright';\n\nexport const DEFAULT_AVAILABLE_THEMES = {\n light: LightThemes.map(theme => theme.value).filter(value => value !== CLOUD_EDITOR_LIGHT_THEME),\n dark: DarkThemes.map(theme => theme.value).filter(value => value !== CLOUD_EDITOR_DARK_THEME),\n};\n\nfunction isAceVersionAtLeast(ace: any, minVersion: [number, number, number]): boolean {\n // Split semantic version numbers. We don't need a full semver parser for this.\n const semanticVersion = ace?.version?.split('.').map((part: string) => {\n const parsed = parseInt(part);\n return Number.isNaN(parsed) ? part : parsed;\n });\n\n return (\n !!semanticVersion &&\n typeof semanticVersion[0] === 'number' &&\n semanticVersion[0] >= minVersion[0] &&\n typeof semanticVersion[1] === 'number' &&\n semanticVersion[1] >= minVersion[1] &&\n typeof semanticVersion[2] === 'number' &&\n semanticVersion[2] >= minVersion[2]\n );\n}\n\nexport function supportsKeyboardAccessibility(ace: any): boolean {\n return isAceVersionAtLeast(ace, [1, 23, 0]);\n}\n\nexport function getDefaultConfig(ace: any): Partial {\n return {\n behavioursEnabled: true,\n ...(supportsKeyboardAccessibility(ace) ? { enableKeyboardAccessibility: true } : {}),\n };\n}\n\nexport function getDefaultTheme(\n mode: 'light' | 'dark',\n themes?: CodeEditorProps.AvailableThemes\n): CodeEditorProps.Theme {\n if (mode === 'light') {\n return themes?.light.some(value => value === CLOUD_EDITOR_LIGHT_THEME)\n ? CLOUD_EDITOR_LIGHT_THEME\n : FALLBACK_LIGHT_THEME;\n } else {\n return themes?.dark.some(value => value === CLOUD_EDITOR_DARK_THEME)\n ? CLOUD_EDITOR_DARK_THEME\n : FALLBACK_DARK_THEME;\n }\n}\n\nexport function getAceTheme(theme: CodeEditorProps.Theme) {\n return `ace/theme/${theme}`;\n}\n\nexport function getLanguageLabel(language: CodeEditorProps.Language): string {\n return AceModes.filter((mode: { value: string }) => mode.value === language)[0]?.label || language;\n}\n\nexport function getStatusButtonId({ paneId, paneStatus }: { paneId?: string; paneStatus: PaneStatus }) {\n return paneId ? `${paneId}-button-${paneStatus}` : undefined;\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useEffect } from 'react';\nimport { Ace } from 'ace-builds';\nimport { CodeEditorProps } from './interfaces';\nimport { fireNonCancelableEvent, NonCancelableEventHandler } from '../internal/events';\nimport { useDebounceCallback } from '../internal/hooks/use-debounce-callback';\nimport { useStableCallback } from '@cloudscape-design/component-toolkit/internal';\n\nexport function useChangeEffect(\n editor: null | Ace.Editor,\n onChange?: NonCancelableEventHandler,\n onDelayedChange?: NonCancelableEventHandler\n) {\n const debouncedChangeHandler = useDebounceCallback((detail: CodeEditorProps.ChangeDetail) => {\n fireNonCancelableEvent(onDelayedChange, detail);\n }, 0);\n const handleChange = useStableCallback(() => {\n const changeDetail = { value: editor?.getValue() || '' };\n fireNonCancelableEvent(onChange, changeDetail);\n debouncedChangeHandler(changeDetail);\n });\n useEffect(() => {\n if (!editor) {\n return;\n }\n\n editor.on('change', handleChange);\n return () => editor.off('change', handleChange);\n }, [editor, handleChange]);\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { Ace } from 'ace-builds';\nimport { PaneStatus, supportsKeyboardAccessibility } from './util';\n\nexport function setupEditor(\n ace: any,\n editor: Ace.Editor,\n setAnnotations: React.Dispatch>,\n setCursorPosition: React.Dispatch>,\n setHighlightedAnnotation: React.Dispatch>,\n setPaneStatus: React.Dispatch>\n) {\n setEditorDefaults(ace, editor);\n\n // To display cursor position in status bar\n editor.session.selection.on('changeCursor', () => {\n setCursorPosition(editor.getCursorPosition());\n });\n\n editor.session.on('changeAnnotation' as any, () => {\n const editorAnnotations = editor.session.getAnnotations();\n const newAnnotations = editorAnnotations.filter(a => a.type !== 'info');\n if (editorAnnotations.length !== newAnnotations.length) {\n editor.session.setAnnotations(newAnnotations);\n }\n setAnnotations(newAnnotations);\n });\n\n const moveCursorToAnnotation = (a: Ace.Annotation) => {\n if (typeof a.row === 'number') {\n editor.gotoLine(a.row + 1, a.column || 0, false);\n }\n };\n\n const openAnnotation = (row: number) => {\n const currentAnnotations = editor.session.getAnnotations().filter(a => a.row === row && a.type !== 'info');\n const errors = currentAnnotations.filter(a => a.type === 'error');\n if (errors.length > 0) {\n setHighlightedAnnotation(errors[0]);\n setPaneStatus('error');\n moveCursorToAnnotation(errors[0]);\n } else if (currentAnnotations.length > 0) {\n setHighlightedAnnotation(currentAnnotations[0]);\n setPaneStatus('warning');\n moveCursorToAnnotation(currentAnnotations[0]);\n } else {\n setHighlightedAnnotation(undefined);\n setPaneStatus('hidden');\n editor.gotoLine(row + 1, 0, false);\n }\n };\n\n // open error/warning pane when user clicks on gutter icon\n editor.on('gutterclick' as any, (e: any) => {\n const { row }: Ace.Point = e.getDocumentPosition();\n openAnnotation(row);\n });\n\n // open error/warning pane when user presses space/enter on gutter icon\n editor.on('gutterkeydown', e => {\n if (e.isInAnnotationLane() && (e.getKey() === 'space' || e.getKey() === 'return')) {\n const row: number = e.getRow();\n openAnnotation(row);\n }\n });\n\n // HACK: Annotations aren't cleared when editor is empty.\n editor.on('change', () => {\n if (editor.getValue().length === 0) {\n editor.session.clearAnnotations();\n }\n });\n}\n\nfunction setEditorDefaults(ace: any, editor: Ace.Editor) {\n ace.config.loadModule('ace/ext/language_tools', function () {\n editor.setOptions({\n displayIndentGuides: false,\n enableSnippets: true,\n enableBasicAutocompletion: true,\n });\n });\n\n editor.setAutoScrollEditorIntoView(true);\n\n if (!supportsKeyboardAccessibility(ace)) {\n editor.commands.addCommand({\n name: 'exitCodeEditor',\n bindKey: 'Esc',\n exec: () => {\n editor.container.focus();\n },\n });\n }\n\n editor.on('focus', () => {\n (editor as any).textInput.getElement().setAttribute('tabindex', 0);\n });\n\n editor.on('blur', () => {\n (editor as any).textInput.getElement().setAttribute('tabindex', -1);\n });\n\n // prevent users to step into editor directly by keyboard\n (editor as any).textInput.getElement().setAttribute('tabindex', -1);\n\n editor.commands.removeCommand('showSettingsMenu', false);\n\n // Prevent default behavior on error/warning icon click\n editor.on('guttermousedown' as any, (e: any) => {\n e.stop();\n });\n\n // HACK: Wrapped lines are highlighted individually. This is seriously the recommended fix.\n // See: https://github.com/ajaxorg/ace/issues/3067\n editor.setHighlightActiveLine(false);\n (editor as any).$updateHighlightActiveLine = function () {\n const session = this.getSession();\n\n let highlight;\n if (this.$highlightActiveLine) {\n if (this.$selectionStyle !== 'line' || !this.selection.isMultiLine()) {\n highlight = this.getCursorPosition();\n }\n if (this.renderer.$maxLines && this.session.getLength() === 1 && !(this.renderer.$minLines > 1)) {\n highlight = false;\n }\n }\n\n if (session.$highlightLineMarker && !highlight) {\n session.removeMarker(session.$highlightLineMarker.id);\n session.$highlightLineMarker = null;\n } else if (!session.$highlightLineMarker && highlight) {\n const range = new ace.Range(highlight.row, 0, highlight.row, Infinity);\n (range as any).id = session.addMarker(range, 'ace_active-line', 'fullLine');\n session.$highlightLineMarker = range;\n } else if (highlight) {\n session.$highlightLineMarker.start.row = highlight.row;\n session.$highlightLineMarker.end.row = highlight.row;\n session.$highlightLineMarker.start.column = 0;\n session._signal('changeBackMarker');\n }\n };\n\n editor.setHighlightActiveLine(true);\n\n // HACK: \"disable\" error tooltips by hiding them as soon as they appear.\n // See https://github.com/ajaxorg/ace/issues/4004\n editor.on('showGutterTooltip' as any, (tooltip: any) => {\n tooltip.hide();\n });\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useState } from 'react';\n\nimport InternalBox from '../box/internal';\nimport { InternalButton } from '../button/internal';\nimport InternalCheckbox from '../checkbox/internal';\nimport InternalColumnLayout from '../column-layout/internal';\nimport InternalFormField from '../form-field/internal';\nimport InternalModal from '../modal/internal';\nimport { SelectProps } from '../select/interfaces';\nimport InternalSelect from '../select/internal';\nimport InternalSpaceBetween from '../space-between/internal';\nimport { NonCancelableCustomEvent } from '../internal/events';\nimport { LightThemes, DarkThemes } from './ace-themes';\nimport { CodeEditorProps } from './interfaces';\n\ninterface PreferencesModali18nStrings {\n header?: string;\n cancel?: string;\n confirm?: string;\n wrapLines?: string;\n theme?: string;\n lightThemes?: string;\n darkThemes?: string;\n themeFilteringPlaceholder?: string;\n themeFilteringAriaLabel?: string;\n themeFilteringClearAriaLabel?: string;\n}\n\ninterface PreferencesModalProps {\n preferences?: Partial;\n getModalRoot: CodeEditorProps['getModalRoot'];\n removeModalRoot: CodeEditorProps['removeModalRoot'];\n\n i18nStrings: PreferencesModali18nStrings;\n\n themes: CodeEditorProps.AvailableThemes;\n defaultTheme: CodeEditorProps.Theme;\n\n onConfirm: (preferences: CodeEditorProps.Preferences) => void;\n onDismiss: () => void;\n}\n\nfunction filterThemes(allThemes: ReadonlyArray, available: ReadonlyArray) {\n return allThemes.filter(theme => available.indexOf(theme.value!) > -1);\n}\n\nexport default (props: PreferencesModalProps) => {\n const [wrapLines, setWrapLines] = useState(props.preferences?.wrapLines ?? true);\n const [theme, setTheme] = useState(props.preferences?.theme ?? props.defaultTheme);\n const themeOptions = [\n {\n label: props.i18nStrings.lightThemes,\n options: filterThemes(LightThemes, props.themes.light),\n },\n {\n label: props.i18nStrings.darkThemes,\n options: filterThemes(DarkThemes, props.themes.dark),\n },\n ];\n const [selectedThemeOption, setSelectedThemeOption] = useState(\n () => [...LightThemes, ...DarkThemes].filter(t => t.value === theme)[0]\n );\n\n const onThemeSelected = (e: NonCancelableCustomEvent) => {\n setTheme(e.detail.selectedOption.value as CodeEditorProps.Theme);\n setSelectedThemeOption(e.detail.selectedOption);\n };\n\n return (\n \n \n {props.i18nStrings.cancel}\n props.onConfirm({ wrapLines, theme })} variant=\"primary\">\n {props.i18nStrings.confirm}\n \n \n \n }\n >\n \n
    \n setWrapLines(e.detail.checked)}>\n {props.i18nStrings.wrapLines}\n \n
    \n
    \n \n \n \n
    \n
    \n \n );\n};\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useState, useRef, useEffect } from 'react';\nimport clsx from 'clsx';\nimport styles from './styles.css.js';\n\nimport Dropdown from '../internal/components/dropdown';\nimport { useDropdownStatus } from '../internal/components/dropdown-status';\nimport Filter from './parts/filter';\nimport Trigger from './parts/trigger';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\n\nimport { getBaseProps } from '../internal/base-component';\nimport { SelectProps } from './interfaces';\nimport { prepareOptions } from '../internal/components/option/utils/prepare-options';\nimport { useSelect } from './utils/use-select';\nimport { checkOptionValueField } from './utils/check-option-value-field';\nimport { useNativeSearch } from './utils/use-native-search';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { useLoadItems } from './utils/use-load-items';\nimport { useAnnouncement } from './utils/use-announcement';\nimport { useFormFieldContext } from '../internal/context/form-field-context';\nimport PlainList, { SelectListProps } from './parts/plain-list';\nimport VirtualList from './parts/virtual-list';\nimport DropdownFooter from '../internal/components/dropdown-footer';\nimport checkControlled from '../internal/hooks/check-controlled';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { OptionGroup } from '../internal/components/option/interfaces.js';\nimport { SomeRequired } from '../internal/types';\nimport ScreenreaderOnly from '../internal/components/screenreader-only/index.js';\nimport { joinStrings } from '../internal/utils/strings/join-strings.js';\nimport { useInternalI18n } from '../i18n/context.js';\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\nexport interface InternalSelectProps extends SomeRequired, InternalBaseComponentProps {\n __inFilteringToken?: boolean;\n}\n\nconst InternalSelect = React.forwardRef(\n (\n {\n options,\n filteringType = 'none',\n filteringPlaceholder,\n filteringAriaLabel,\n filteringClearAriaLabel,\n filteringResultsText,\n ariaRequired,\n placeholder,\n disabled,\n ariaLabel,\n statusType = 'finished',\n empty,\n loadingText,\n finishedText,\n errorText,\n noMatch,\n triggerVariant = 'label',\n renderHighlightedAriaLive,\n selectedOption,\n onBlur,\n onFocus,\n onLoadItems,\n onChange,\n virtualScroll,\n expandToViewport,\n autoFocus,\n __inFilteringToken,\n __internalRootRef = null,\n ...restProps\n }: InternalSelectProps,\n externalRef: React.Ref\n ) => {\n const baseProps = getBaseProps(restProps);\n const formFieldContext = useFormFieldContext(restProps);\n\n const i18n = useInternalI18n('select');\n const errorIconAriaLabel = i18n('errorIconAriaLabel', restProps.errorIconAriaLabel);\n const selectedAriaLabel = i18n('selectedAriaLabel', restProps.selectedAriaLabel);\n const recoveryText = i18n('recoveryText', restProps.recoveryText);\n\n if (restProps.recoveryText && !onLoadItems) {\n warnOnce('Select', '`onLoadItems` must be provided for `recoveryText` to be displayed.');\n }\n\n const { handleLoadMore, handleRecoveryClick, fireLoadItems } = useLoadItems({\n onLoadItems,\n options,\n statusType,\n });\n\n checkControlled('Select', 'selectedOption', selectedOption, 'onChange', onChange);\n\n checkOptionValueField('Select', 'options', options);\n\n const [filteringValue, setFilteringValue] = useState('');\n\n const { filteredOptions, parentMap, totalCount, matchesCount } = prepareOptions(\n options,\n filteringType,\n filteringValue\n );\n\n const rootRef = useRef(null);\n const triggerRef = useRef(null);\n\n const selfControlId = useUniqueId('trigger');\n const controlId = formFieldContext.controlId ?? selfControlId;\n\n const scrollToIndex = useRef(null);\n const {\n isOpen,\n highlightType,\n highlightedOption,\n highlightedIndex,\n getTriggerProps,\n getDropdownProps,\n getFilterProps,\n getMenuProps,\n getOptionProps,\n highlightOption,\n selectOption,\n announceSelected,\n } = useSelect({\n selectedOptions: selectedOption ? [selectedOption] : [],\n updateSelectedOption: option => fireNonCancelableEvent(onChange, { selectedOption: option }),\n options: filteredOptions,\n filteringType,\n onBlur,\n onFocus,\n externalRef,\n fireLoadItems,\n setFilteringValue,\n statusType,\n });\n\n const handleNativeSearch = useNativeSearch({\n isEnabled: filteringType === 'none',\n options: filteredOptions,\n highlightOption: !isOpen ? selectOption : highlightOption,\n highlightedOption: !isOpen ? selectedOption : highlightedOption?.option,\n });\n\n const selectAriaLabelId = useUniqueId('select-arialabel-');\n const footerId = useUniqueId('footer');\n\n useEffect(() => {\n scrollToIndex.current?.(highlightedIndex);\n }, [highlightedIndex]);\n\n const filter = (\n \n );\n\n const trigger = (\n \n );\n\n const isEmpty = !options || options.length === 0;\n const isNoMatch = filteredOptions && filteredOptions.length === 0;\n const isFiltered =\n filteringType !== 'none' && filteringValue.length > 0 && filteredOptions && filteredOptions.length > 0;\n const filteredText = isFiltered ? filteringResultsText?.(matchesCount, totalCount) : undefined;\n\n const dropdownStatus = useDropdownStatus({\n statusType,\n empty,\n loadingText,\n finishedText,\n errorText,\n recoveryText,\n isEmpty,\n isNoMatch,\n noMatch,\n isFiltered,\n filteringResultsText: filteredText,\n errorIconAriaLabel,\n onRecoveryClick: handleRecoveryClick,\n hasRecoveryCallback: !!onLoadItems,\n });\n\n const menuProps = {\n ...getMenuProps(),\n onLoadMore: handleLoadMore,\n ariaLabelledby: joinStrings(selectAriaLabelId, controlId),\n ariaDescribedby: dropdownStatus.content ? footerId : undefined,\n };\n\n const announcement = useAnnouncement({\n announceSelected,\n highlightedOption,\n getParent: option => parentMap.get(option)?.option as undefined | OptionGroup,\n selectedAriaLabel,\n renderHighlightedAriaLive,\n });\n\n const ListComponent = virtualScroll ? VirtualList : PlainList;\n\n const handleMouseDown = (event: React.MouseEvent) => {\n const target = event.target as HTMLElement;\n\n if (target !== document.activeElement) {\n // prevent currently focused element from losing it\n event.preventDefault();\n }\n };\n\n const mergedRef = useMergeRefs(rootRef, __internalRootRef);\n\n const dropdownProps = getDropdownProps();\n\n return (\n \n \n ) : null\n }\n expandToViewport={expandToViewport}\n >\n \n ) : null\n }\n menuProps={menuProps}\n getOptionProps={getOptionProps}\n filteredOptions={filteredOptions}\n filteringValue={filteringValue}\n ref={scrollToIndex}\n hasDropdownStatus={dropdownStatus.content !== null}\n screenReaderContent={announcement}\n highlightType={highlightType}\n />\n \n {ariaLabel}\n \n );\n }\n);\n\nexport default InternalSelect;\n", "\n import './styles.scoped.css';\n export default {\n \"root\": \"awsui_root_r2vco_wvvus_99\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport InternalSpinner from '../spinner/internal';\n\nimport styles from './styles.css.js';\n\ninterface Props {\n children: React.ReactNode;\n}\n\nexport default (props: Props) => (\n
    \n \n  \n {props.children}\n
    \n);\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useCallback } from 'react';\n\nimport { fireNonCancelableEvent, NonCancelableEventHandler } from '../internal/events';\nimport InternalIcon from '../icon/internal';\nimport InternalLink from '../link/internal';\n\nimport styles from './styles.css.js';\n\ninterface Props {\n children: React.ReactNode;\n recoveryText?: string;\n onRecoveryClick?: NonCancelableEventHandler;\n}\n\nexport default ({ children, recoveryText, onRecoveryClick }: Props) => {\n const onFollow = useCallback(() => fireNonCancelableEvent(onRecoveryClick), [onRecoveryClick]);\n\n return (\n
    \n \n  \n {children}\n  \n \n {recoveryText}\n \n
    \n );\n};\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\nimport styles from './styles.css.js';\nimport LiveRegion from '../internal/components/live-region/index';\nimport { TabButton } from './tab-button';\nimport { InternalButton } from '../button/internal';\nimport { CodeEditorProps } from './interfaces';\nimport { useInternalI18n } from '../i18n/context.js';\nimport { useContainerQuery } from '@cloudscape-design/component-toolkit';\nimport { getStatusButtonId, PaneStatus } from './util';\n\ninterface StatusBarProps {\n languageLabel: string;\n cursorPosition?: string;\n paneStatus: PaneStatus;\n isTabFocused: boolean;\n paneId?: string;\n i18nStrings?: CodeEditorProps.I18nStrings;\n errorCount: number;\n warningCount: number;\n isRefresh: boolean;\n\n errorsTabRef?: React.RefObject;\n warningsTabRef?: React.RefObject;\n\n onErrorPaneToggle: () => void;\n onWarningPaneToggle: () => void;\n onTabFocus?: React.FocusEventHandler;\n onTabBlur?: React.FocusEventHandler;\n onPreferencesOpen: () => void;\n onHeightChange?: (height: number | null) => void;\n}\n\ntype InternalStatusBarProps = StatusBarProps & {\n leftBarRef: React.Ref;\n isVirtual: boolean;\n minifyCounters: boolean;\n};\n\nfunction InternalStatusBar({\n languageLabel,\n cursorPosition,\n paneStatus,\n onErrorPaneToggle,\n onWarningPaneToggle,\n onTabFocus,\n onTabBlur,\n errorsTabRef,\n warningsTabRef,\n isTabFocused,\n paneId,\n onPreferencesOpen,\n i18nStrings,\n errorCount,\n warningCount,\n leftBarRef,\n isVirtual,\n minifyCounters,\n isRefresh,\n}: InternalStatusBarProps) {\n const i18n = useInternalI18n('code-editor');\n const errorText = `${i18n('i18nStrings.errorsTab', i18nStrings?.errorsTab)}: ${errorCount}`;\n const warningText = `${i18n('i18nStrings.warningsTab', i18nStrings?.warningsTab)}: ${warningCount}`;\n const errorButtonId = !isVirtual ? getStatusButtonId({ paneId, paneStatus: 'error' }) : undefined;\n const warningButtonId = !isVirtual ? getStatusButtonId({ paneId, paneStatus: 'warning' }) : undefined;\n\n // Virtual status bar is inaccessible for screen readers and keyboard interactions.\n\n return (\n \n \n {languageLabel}\n {cursorPosition}\n\n
    \n \n \n \n
    \n \n {errorText} \n {warningText}\n \n \n\n
    \n
    \n \n
    \n
    \n \n );\n}\n\nexport const StatusBar = ({ errorsTabRef, warningsTabRef, ...restProps }: StatusBarProps) => {\n // create a virtual status bar, in order to calculate the width with full tab button text\n // and decide if tab button text needs to be reduced\n const [realWidth, statusLeftBarRef] = useContainerQuery(rect => rect.contentBoxWidth);\n const [virtualWidth, virtualStatusLeftBarRef] = useContainerQuery(rect => rect.contentBoxWidth);\n\n const minifyCounters = virtualWidth !== null && realWidth !== null && virtualWidth > realWidth;\n\n return (\n <>\n \n \n \n );\n};\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport { IconProps } from '../icon/interfaces';\nimport InternalIcon from '../icon/internal';\n\nimport styles from './styles.css.js';\n\ninterface TabButtonProps {\n text: string;\n iconName: IconProps.Name;\n active: boolean;\n disabled: boolean;\n tabIndex?: number;\n ariaHidden?: boolean;\n ariaLabel?: string;\n paneId?: string;\n isRefresh: boolean;\n\n className: string;\n id?: string;\n\n onClick: () => void;\n onFocus?: React.FocusEventHandler;\n onBlur?: React.FocusEventHandler;\n}\n\nexport const TabButton = React.forwardRef(\n (\n {\n active,\n disabled,\n iconName,\n onClick,\n onFocus,\n onBlur,\n tabIndex,\n ariaHidden,\n ariaLabel,\n paneId,\n isRefresh,\n text,\n className,\n id,\n }: TabButtonProps,\n ref: React.Ref\n ) => {\n return (\n \n {text}\n \n );\n }\n);\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Ace } from 'ace-builds';\nimport { useCallback, useEffect, useRef, useState } from 'react';\nimport { useCurrentMode } from '@cloudscape-design/component-toolkit/internal';\nimport { getAceTheme, getDefaultConfig, getDefaultTheme } from './util';\nimport { CodeEditorProps } from './interfaces';\n\nexport function useEditor(ace: any, themes?: CodeEditorProps.AvailableThemes, loading?: boolean) {\n const editorRef = useRef(null);\n const [editor, setEditor] = useState(null);\n const [initialTheme] = useState(getAceTheme(getDefaultTheme(useCurrentMode(editorRef), themes)));\n\n useEffect(() => {\n const elem = editorRef.current;\n if (!ace || !elem) {\n return;\n }\n const config = getDefaultConfig(ace);\n setEditor(\n ace.edit(elem, {\n ...config,\n theme: initialTheme,\n })\n );\n }, [ace, loading, initialTheme]);\n\n return { editorRef, editor };\n}\n\nexport function useSyncEditorLabels(\n editor: null | Ace.Editor,\n {\n controlId,\n ariaLabel,\n ariaLabelledby,\n ariaDescribedby,\n }: { controlId?: string; ariaLabel?: string; ariaLabelledby?: string; ariaDescribedby?: string }\n) {\n useEffect(() => {\n if (!editor) {\n return;\n }\n const { textarea } = editor.renderer as unknown as { textarea: HTMLTextAreaElement };\n if (!textarea) {\n return;\n }\n const updateAttribute = (attribute: string, value: string | undefined) =>\n value ? textarea.setAttribute(attribute, value) : textarea.removeAttribute(attribute);\n updateAttribute('id', controlId);\n updateAttribute('aria-label', ariaLabel);\n updateAttribute('aria-labelledby', ariaLabelledby);\n updateAttribute('aria-describedby', ariaDescribedby);\n }, [ariaLabel, ariaDescribedby, ariaLabelledby, controlId, editor]);\n}\n\nexport function useSyncEditorSize(\n editor: null | Ace.Editor,\n { width, height }: { width?: null | number; height?: null | number }\n) {\n useEffect(() => {\n editor?.resize();\n }, [editor, width, height]);\n\n const onResize = useCallback(() => {\n editor?.resize();\n }, [editor]);\n\n return { onResize };\n}\n\nexport function useSyncEditorValue(editor: null | Ace.Editor, value: string) {\n useEffect(() => {\n if (!editor) {\n return;\n }\n if (value === editor.getValue()) {\n return;\n }\n const pos = editor.session.selection.toJSON();\n editor.setValue(value, -1);\n editor.session.selection.fromJSON(pos);\n }, [editor, value]);\n}\n\nexport function useSyncEditorLanguage(editor: null | Ace.Editor, language: string) {\n useEffect(() => {\n editor?.session.setMode(`ace/mode/${language}`);\n }, [editor, language]);\n}\n\nexport function useSyncEditorWrapLines(editor: null | Ace.Editor, wrapLines?: boolean) {\n useEffect(() => {\n editor?.session.setUseWrapMode(wrapLines ?? true);\n }, [editor, wrapLines]);\n}\n\nexport function useSyncEditorTheme(editor: null | Ace.Editor, theme: CodeEditorProps.Theme) {\n useEffect(() => {\n editor?.setTheme(getAceTheme(theme));\n }, [editor, theme]);\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport InternalColumnLayout from './internal';\nimport { getExternalProps } from '../internal/utils/external-props';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { ColumnLayoutProps } from './interfaces';\n\nexport { ColumnLayoutProps };\n\nexport default function ColumnLayout({\n columns = 1,\n variant = 'default',\n borders = 'none',\n disableGutters = false,\n ...props\n}: ColumnLayoutProps) {\n const baseComponentProps = useBaseComponent('ColumnLayout', {\n props: { borders, columns, disableGutters, minColumnWidth: props.minColumnWidth, variant },\n });\n const externalProps = getExternalProps(props);\n return (\n \n );\n}\n\napplyDisplayName(ColumnLayout, 'ColumnLayout');\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { InternalContainerAsSubstep } from './internal';\nimport { ContainerProps } from './interfaces';\nimport { getExternalProps } from '../internal/utils/external-props';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { AnalyticsFunnelSubStep } from '../internal/analytics/components/analytics-funnel';\nimport { BasePropsWithAnalyticsMetadata, getAnalyticsMetadataProps } from '../internal/base-component';\n\nexport { ContainerProps };\n\nexport default function Container({\n variant = 'default',\n disableHeaderPaddings = false,\n disableContentPaddings = false,\n fitHeight = false,\n ...props\n}: ContainerProps) {\n const analyticsMetadata = getAnalyticsMetadataProps(props as BasePropsWithAnalyticsMetadata);\n const baseComponentProps = useBaseComponent(\n 'Container',\n {\n props: { disableContentPaddings, disableHeaderPaddings, fitHeight, variant },\n },\n analyticsMetadata\n );\n const externalProps = getExternalProps(props);\n\n return (\n \n \n \n );\n}\n\napplyDisplayName(Container, 'Container');\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { ContentLayoutProps } from './interfaces';\nimport InternalContentLayout from './internal';\nimport useBaseComponent from '../internal/hooks/use-base-component';\n\nexport { ContentLayoutProps };\n\nexport default function ContentLayout(props: ContentLayoutProps) {\n const baseComponentProps = useBaseComponent('ContentLayout', {\n props: { disableOverlap: props.disableOverlap },\n });\n return ;\n}\n\napplyDisplayName(ContentLayout, 'ContentLayout');\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\nimport { ContentLayoutProps } from './interfaces';\nimport { getBaseProps } from '../internal/base-component';\nimport { getContentHeaderClassName } from '../internal/utils/content-header-utils';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useDynamicOverlap } from '../internal/hooks/use-dynamic-overlap';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport styles from './styles.css.js';\n\ntype InternalContentLayoutProps = ContentLayoutProps & InternalBaseComponentProps;\n\nexport default function InternalContentLayout({\n children,\n disableOverlap,\n header,\n __internalRootRef,\n ...rest\n}: InternalContentLayoutProps) {\n const baseProps = getBaseProps(rest);\n\n const isVisualRefresh = useVisualRefresh();\n const overlapElement = useDynamicOverlap();\n\n const isOverlapDisabled = !children || disableOverlap;\n\n return (\n \n \n\n {header &&
    {header}
    }\n\n
    {children}
    \n \n );\n}\n", "\n import './styles.scoped.css';\n export default {\n \"layout\": \"awsui_layout_5gtk3_set91_105\",\n \"is-visual-refresh\": \"awsui_is-visual-refresh_5gtk3_set91_105\",\n \"background\": \"awsui_background_5gtk3_set91_108\",\n \"header\": \"awsui_header_5gtk3_set91_111\",\n \"is-overlap-disabled\": \"awsui_is-overlap-disabled_5gtk3_set91_127\",\n \"content\": \"awsui_content_5gtk3_set91_135\",\n \"has-header\": \"awsui_has-header_5gtk3_set91_139\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useState } from 'react';\nimport { getBaseProps } from '../internal/base-component';\nimport { CopyToClipboardProps } from './interfaces';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport InternalButton from '../button/internal';\nimport InternalPopover from '../popover/internal';\nimport InternalStatusIndicator from '../status-indicator/internal';\nimport styles from './styles.css.js';\nimport testStyles from './test-classes/styles.css.js';\nimport clsx from 'clsx';\n\nexport { CopyToClipboardProps };\n\nexport default function CopyToClipboard({\n variant = 'button',\n copyButtonAriaLabel,\n copyButtonText,\n copySuccessText,\n copyErrorText,\n textToCopy,\n ...restProps\n}: CopyToClipboardProps) {\n const { __internalRootRef } = useBaseComponent('CopyToClipboard', {\n props: { variant },\n });\n const baseProps = getBaseProps(restProps);\n\n const copyButtonProps =\n variant === 'button'\n ? { children: copyButtonText, ariaLabel: copyButtonAriaLabel }\n : { ariaLabel: copyButtonAriaLabel ?? copyButtonText };\n\n const [status, setStatus] = useState<'pending' | 'success' | 'error'>('pending');\n const [statusText, setStatusText] = useState('');\n\n const onClick = () => {\n if (navigator.clipboard) {\n setStatus('pending');\n setStatusText('');\n navigator.clipboard\n .writeText(textToCopy)\n .then(() => {\n setStatus('success');\n setStatusText(copySuccessText);\n })\n .catch(() => {\n setStatus('error');\n setStatusText(copyErrorText);\n });\n }\n };\n\n const triggerVariant = (\n {\n button: 'normal',\n icon: 'icon',\n inline: 'inline-icon',\n } as const\n )[variant];\n\n const trigger = (\n {statusText}}\n >\n \n \n );\n\n return (\n \n {variant === 'inline' ? (\n \n {trigger}\n {textToCopy}\n \n ) : (\n trigger\n )}\n \n );\n}\n\napplyDisplayName(CopyToClipboard, 'CopyToClipboard');\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useCallback, useEffect, useRef, useState, useImperativeHandle } from 'react';\nimport clsx from 'clsx';\n\nimport { KeyCode } from '../internal/keycode';\nimport { getBaseProps } from '../internal/base-component';\n\nimport Arrow from './arrow';\nimport Portal from '../internal/components/portal';\nimport { PopoverProps } from './interfaces';\nimport PopoverContainer from './container';\nimport PopoverBody from './body';\n\nimport styles from './styles.css.js';\nimport { NonCancelableEventHandler, fireNonCancelableEvent } from '../internal/events/index';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { usePortalModeClasses } from '../internal/hooks/use-portal-mode-classes';\nimport { useInternalI18n } from '../i18n/context';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { getFirstFocusable } from '../internal/components/focus-lock/utils';\nimport { LinkDefaultVariantContext } from '../internal/context/link-default-variant-context';\nimport ResetContextsForModal from '../internal/context/reset-contexts-for-modal';\nimport { useSingleTabStopNavigation } from '../internal/context/single-tab-stop-navigation-context';\n\nexport interface InternalPopoverProps extends PopoverProps, InternalBaseComponentProps {\n __onOpen?: NonCancelableEventHandler;\n}\n\nexport interface InternalPopoverRef {\n dismissPopover: () => void;\n}\n\nexport default React.forwardRef(InternalPopover);\n\nfunction InternalPopover(\n {\n position = 'right',\n size = 'medium',\n fixedWidth = false,\n triggerType = 'text',\n dismissButton = true,\n\n children,\n header,\n content,\n triggerAriaLabel,\n\n renderWithPortal = false,\n\n __onOpen,\n __internalRootRef = null,\n ...restProps\n }: InternalPopoverProps,\n ref: React.Ref\n) {\n const baseProps = getBaseProps(restProps);\n const triggerRef = useRef(null);\n const popoverRef = useRef(null);\n const clickFrameId = useRef(null);\n\n const i18n = useInternalI18n('popover');\n const dismissAriaLabel = i18n('dismissAriaLabel', restProps.dismissAriaLabel);\n\n const [visible, setVisible] = useState(false);\n\n const focusTrigger = useCallback(() => {\n if (triggerType === 'text') {\n triggerRef.current?.focus();\n } else {\n triggerRef.current && getFirstFocusable(triggerRef.current)?.focus();\n }\n }, [triggerType]);\n\n const onTriggerClick = useCallback(() => {\n fireNonCancelableEvent(__onOpen);\n setVisible(true);\n }, [__onOpen]);\n\n const onDismiss = useCallback(() => {\n setVisible(false);\n focusTrigger();\n }, [focusTrigger]);\n\n const onTriggerKeyDown = useCallback(\n (event: React.KeyboardEvent) => {\n const isEscapeKey = event.keyCode === KeyCode.escape;\n const isTabKey = event.keyCode === KeyCode.tab;\n if (isEscapeKey && visible) {\n event.stopPropagation();\n }\n if (isTabKey || isEscapeKey) {\n setVisible(false);\n }\n },\n [visible]\n );\n\n useImperativeHandle(ref, () => ({\n dismissPopover: onDismiss,\n }));\n\n useEffect(() => {\n if (!triggerRef.current) {\n return;\n }\n const document = triggerRef.current.ownerDocument;\n\n const onDocumentClick = () => {\n // Dismiss popover unless there was a click inside within the last animation frame.\n if (clickFrameId.current === null) {\n setVisible(false);\n }\n };\n\n // useCapture=false makes sure this listener is called after the one attached to the element.\n // the options.capture notation is unsupported by IE.\n document.addEventListener('mousedown', onDocumentClick, false);\n\n return () => {\n document.removeEventListener('mousedown', onDocumentClick, false);\n };\n }, []);\n\n const popoverClasses = usePortalModeClasses(triggerRef);\n\n const triggerProps = {\n // https://github.com/microsoft/TypeScript/issues/36659\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref: triggerRef as any,\n onClick: onTriggerClick,\n onKeyDown: onTriggerKeyDown,\n className: clsx(styles.trigger, styles[`trigger-type-${triggerType}`]),\n };\n const { tabIndex: triggerTabIndex } = useSingleTabStopNavigation(triggerRef);\n\n const referrerId = useUniqueId();\n\n const popoverContent = (\n \n {visible && (\n }\n renderWithPortal={renderWithPortal}\n zIndex={renderWithPortal ? 7000 : undefined}\n >\n \n \n {content}\n \n \n \n )}\n \n );\n\n const mergedRef = useMergeRefs(popoverRef, __internalRootRef);\n\n return (\n {\n // Indicate there was a click inside popover recently, including nested portals.\n clickFrameId.current = requestAnimationFrame(() => {\n clickFrameId.current = null;\n });\n }}\n >\n {triggerType === 'text' ? (\n \n {children}\n \n ) : (\n \n {children}\n \n )}\n \n {renderWithPortal ? {popoverContent} : popoverContent}\n \n \n );\n}\n", "\n import './styles.scoped.css';\n export default {\n \"root\": \"awsui_root_5a145_jw759_9\",\n \"inline-container\": \"awsui_inline-container_5a145_jw759_13\",\n \"inline-container-trigger\": \"awsui_inline-container-trigger_5a145_jw759_16\"\n};\n ", "\n import './styles.scoped.css';\n export default {\n \"root\": \"awsui_root_ljpwc_1spew_5\",\n \"text-to-copy\": \"awsui_text-to-copy_ljpwc_1spew_9\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { Ref } from 'react';\n\nimport { DateInputProps } from './interfaces';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport InternalDateInput from './internal';\n\nexport { DateInputProps };\n\nconst DateInput = React.forwardRef((props: DateInputProps, ref: Ref) => {\n const baseComponentProps = useBaseComponent('DateInput', {\n props: { autoFocus: props.autoFocus, readOnly: props.readOnly },\n });\n return ;\n});\n\napplyDisplayName(DateInput, 'DateInput');\n\nexport default DateInput;\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport clsx from 'clsx';\nimport { getDaysInMonth } from 'date-fns';\nimport React, { Ref } from 'react';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { displayToIso, isoToDisplay, parseDate } from '../internal/utils/date-time';\n\nimport MaskedInput from '../internal/components/masked-input';\nimport { MaskArgs } from '../internal/components/masked-input/utils/mask-format';\n\nimport styles from './styles.css.js';\nimport { DateInputProps } from './interfaces';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { CalendarProps } from '../calendar/interfaces';\n\ntype InternalDateInputProps = DateInputProps &\n InternalBaseComponentProps & {\n granularity?: CalendarProps.Granularity;\n };\n\nfunction daysMax(value: string): number {\n // force to first day in month, as new Date('2018-02-30') -> March 2nd 2018\n const baseDate = displayToIso(value).substring(0, 7);\n return getDaysInMonth(parseDate(baseDate));\n}\n\nconst yearMask = { min: 0, max: 9999, default: 2000, length: 4 };\nconst monthMask = { min: 1, max: 12, length: 2 };\nconst dayMask = { min: 1, max: daysMax, length: 2 };\n\nconst InternalDateInput = React.forwardRef(\n (\n { value, onChange, granularity, __internalRootRef = null, ...props }: InternalDateInputProps,\n ref: Ref\n ) => {\n const maskArgs: MaskArgs = {\n separator: '/',\n inputSeparators: ['-', '.', ' '],\n segments: granularity === 'month' ? [yearMask, monthMask] : [yearMask, monthMask, dayMask],\n };\n\n return (\n fireNonCancelableEvent(onChange, { value: displayToIso(event.detail.value) })}\n className={clsx(styles.root, props.className)}\n mask={maskArgs}\n autofix={true}\n autoComplete={false}\n disableAutocompleteOnBlur={false}\n disableBrowserAutocorrect={true}\n __internalRootRef={__internalRootRef}\n />\n );\n }\n);\n\nexport default InternalDateInput;\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { Ref, useState, useLayoutEffect } from 'react';\nimport { useMergeRefs } from '../../hooks/use-merge-refs';\n\nimport { getBaseProps } from '../../base-component';\nimport { fireCancelableEvent, fireNonCancelableEvent } from '../../events';\n\nimport { useFormFieldContext } from '../../context/form-field-context';\n\nimport InternalInput from '../../../input/internal';\n\nimport useMask from './use-mask';\nimport MaskFormat from './utils/mask-format';\n\nimport { MaskedInputProps } from './interfaces';\n\nconst MaskedInput = React.forwardRef(\n (\n {\n value,\n onBlur,\n onChange,\n onKeyDown,\n mask,\n autofix = false,\n disableAutocompleteOnBlur = false,\n ...rest\n }: MaskedInputProps,\n ref: Ref\n ) => {\n const baseProps = getBaseProps(rest);\n const formFieldContext = useFormFieldContext(rest);\n const inputRef = React.useRef(null);\n const [cursorPosition, setCursorPosition] = useState(null);\n\n useLayoutEffect(() => {\n if (cursorPosition !== null) {\n inputRef.current?.setSelectionRange(cursorPosition, cursorPosition);\n }\n }, [cursorPosition, inputRef]);\n\n const { onPaste, ...maskProps } = useMask({\n format: new MaskFormat(mask),\n value,\n inputRef,\n autofix,\n disableAutocompleteOnBlur,\n onChange: (value: string) => !rest.readOnly && fireNonCancelableEvent(onChange, { value }),\n onKeyDown: (event: CustomEvent) =>\n !rest.readOnly && onKeyDown && fireCancelableEvent(onKeyDown, event.detail, event),\n onBlur: () => fireNonCancelableEvent(onBlur),\n setPosition: setCursorPosition,\n });\n\n const inputProps = { ...rest, ...baseProps, ...formFieldContext, ...maskProps };\n const mergedRef = useMergeRefs(ref, inputRef);\n return (\n \n );\n }\n);\n\nexport { MaskedInputProps, useMask };\nexport default MaskedInput;\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { KeyCode } from '../../../keycode';\n\nconst isSpecialCommand = (keyCode: number): boolean => {\n return keyCode > 7 && keyCode < 47 && keyCode !== KeyCode.space;\n};\n\nconst isClipboardCommand = (ctrlKey: boolean, metaKey: boolean): boolean => ctrlKey || metaKey;\n\nexport const isCommand = (keyCode: number, ctrlKey: boolean, metaKey: boolean): boolean =>\n isSpecialCommand(keyCode) || isClipboardCommand(ctrlKey, metaKey);\nexport const isDigit = (char: string): boolean => !isNaN(parseInt(char, 10));\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport MaskFormat from './utils/mask-format';\n\nexport interface HandlerResult {\n position: number;\n value: string;\n}\n\n/**\n * Handles character removal\n *\n * @param initialValue Current value of input\n * @param format MaskFormat object\n * @param selectionStart Starting index value of selection cursor\n * @param selectionEnd Ending Index value of selection cursor\n */\nexport const backspaceHandler = (\n initialValue: string,\n format: MaskFormat,\n selectionStart: number,\n selectionEnd: number\n): HandlerResult => {\n const multiCharDelete = selectionStart !== selectionEnd;\n if (multiCharDelete) {\n const isCursorAtEnd = selectionEnd === initialValue.length;\n if (!isCursorAtEnd) {\n return format.replaceDigitsWithZeroes(initialValue, selectionStart, selectionEnd);\n }\n\n return {\n value: initialValue.slice(0, selectionStart),\n position: selectionStart,\n };\n }\n\n const isSeparator = format.isSegmentStart(selectionStart);\n const atEnd = selectionStart === initialValue.length;\n\n if (!atEnd) {\n if (isSeparator) {\n return format.deleteSeparator(initialValue, selectionStart);\n } else {\n return format.deleteDigit(initialValue, selectionStart);\n }\n }\n\n if (isSeparator) {\n return {\n value: initialValue.slice(0, selectionStart - 2),\n position: selectionStart - 2,\n };\n }\n\n return {\n value: initialValue.slice(0, selectionStart - 1),\n position: selectionStart - 1,\n };\n};\n\n/**\n * Handle key down events\n *\n * @param initialValue Current value of input\n * @param key Key that was pressed\n * @param format MaskFormat object\n * @param selectionStart Starting index value of selection cursor\n * @param selectionEnd Ending Index value of selection cursor\n */\nexport const keyHandler = (\n initialValue: string,\n key: string,\n format: MaskFormat,\n selectionStart: number,\n selectionEnd: number\n): HandlerResult => {\n let value = initialValue;\n const position = selectionStart;\n\n // return if no more digits can be added at the end\n if (selectionStart === value.length && value.length === format.getMaxLength()) {\n return { value, position };\n }\n\n // if range is selected to the end, remove all of that selection first\n if (selectionStart !== value.length && selectionEnd === value.length) {\n const sliceEnd = format.isCursorAtSeparator(selectionStart) ? selectionStart + 1 : selectionStart;\n value = initialValue.slice(0, sliceEnd);\n }\n\n if (format.isCursorAtSeparator(position)) {\n return { value, position: position + 1 };\n }\n\n return format.processKey(value, key, position);\n};\n\nexport const enterHandler = (value: string, format: MaskFormat): HandlerResult => {\n // Do not autocomplete if input is empty\n if (!value) {\n return { value: '', position: 0 };\n }\n const autoCompletedValue = format.autoComplete(value);\n const position = autoCompletedValue.length;\n return { value: autoCompletedValue, position };\n};\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { RefObject } from 'react';\nimport { InputProps } from '../../../input/interfaces';\nimport { NonCancelableEventHandler, CancelableEventHandler } from '../../events';\nimport { KeyCode } from '../../keycode';\n\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\nimport { isCommand, isDigit } from './utils/keys';\n\nimport MaskFormat from './utils/mask-format';\nimport { backspaceHandler, HandlerResult, keyHandler, enterHandler } from './keyboard-handler';\n\ninterface UseMaskHook {\n value: string;\n onChange: NonCancelableEventHandler;\n onKeyDown: CancelableEventHandler;\n onBlur: NonCancelableEventHandler;\n onPaste: (event: React.ClipboardEvent) => void;\n}\n\ninterface UseMaskProps {\n value: string;\n onChange: (value: string) => void;\n onKeyDown?: (event: CustomEvent) => void;\n onBlur?: () => void;\n format: MaskFormat;\n autofix?: boolean;\n inputRef: RefObject;\n disableAutocompleteOnBlur?: boolean;\n setPosition: (position: number | null) => void;\n}\n\nconst onAutoComplete = (value: string, onChange: UseMaskProps['onChange'], maskFormat: MaskFormat) => {\n // Do not autocomplete if input is empty\n if (!value) {\n return;\n }\n\n const autoCompletedValue = maskFormat.autoComplete(value);\n if (autoCompletedValue !== value) {\n onChange(autoCompletedValue);\n }\n};\n\nconst preventDefault = (event: CustomEvent, result?: HandlerResult | null) => result && event.preventDefault();\n\nconst useMask = ({\n value = '',\n onBlur,\n onChange,\n onKeyDown,\n format,\n inputRef,\n autofix = false,\n disableAutocompleteOnBlur = false,\n setPosition,\n}: UseMaskProps): UseMaskHook => {\n if (!format.isValid(value)) {\n warnOnce('useMask', `Invalid string \"${value}\" provided`);\n }\n\n const onMaskChange = (updatedValue: string) => {\n const autofixedUpdatedValue = autofix ? format.correctMinMaxValues(updatedValue) : updatedValue;\n if (autofixedUpdatedValue === value || !format.isValid(autofixedUpdatedValue)) {\n return;\n }\n\n onChange(autofixedUpdatedValue);\n };\n\n const initialValue = autofix ? format.correctMinMaxValues(value) : value;\n const maskedValue = format.getValidValue(initialValue);\n\n return {\n value: maskedValue,\n onKeyDown: (event: CustomEvent) => {\n const selectionStart = inputRef.current?.selectionStart || 0;\n const selectionEnd = inputRef.current?.selectionEnd || 0;\n\n let result: HandlerResult | undefined;\n const { keyCode, key, ctrlKey, metaKey } = event.detail;\n if (isDigit(key) || format.isSeparator(key)) {\n result = keyHandler(maskedValue, key, format, selectionStart, selectionEnd);\n preventDefault(event, result);\n } else if (keyCode === KeyCode.backspace) {\n result = backspaceHandler(maskedValue, format, selectionStart, selectionEnd);\n preventDefault(event, result);\n } else if (keyCode === KeyCode.enter) {\n result = enterHandler(maskedValue, format);\n } else if (!isCommand(keyCode, ctrlKey, metaKey)) {\n event.preventDefault();\n }\n\n if (result) {\n const { value, position } = result;\n\n onMaskChange(value);\n setPosition(position);\n }\n\n // Proxy original event\n onKeyDown && onKeyDown(event);\n },\n onChange: ({ detail }) => onMaskChange(detail.value),\n onBlur: () => {\n if (!disableAutocompleteOnBlur) {\n onAutoComplete(maskedValue, onChange, format);\n }\n\n onBlur && onBlur();\n },\n onPaste: (event: React.ClipboardEvent) => {\n const text = (event.clipboardData || (window as any).clipboardData).getData('text');\n\n const selectionStart = inputRef.current?.selectionStart || 0;\n const selectionEnd = inputRef.current?.selectionEnd || 0;\n\n const formattedText = format.formatPastedText(text, maskedValue, selectionStart, selectionEnd);\n onMaskChange(formattedText);\n },\n };\n};\n\nexport default useMask;\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nexport const insertAt = (text: string, toInsert: string, start: number, end: number = start): string =>\n text.slice(0, start) + toInsert + text.slice(end);\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { padLeftZeros } from '../../../utils/strings';\nimport { insertAt } from './strings';\n\ninterface FormatSegment {\n min: number;\n max: number | ((value: string) => number);\n length: number;\n default?: number;\n}\n\ninterface FormatSegmentFull extends FormatSegment {\n start: number;\n max(value: string): number;\n end: number;\n}\n\nexport interface MaskArgs {\n separator: string;\n inputSeparators?: Array;\n segments: Array;\n}\n\nexport interface ChangeResult {\n value: string;\n position: number;\n}\n\nclass MaskFormat {\n separator: string;\n private inputSeparators: Array;\n private segments: Array;\n private positionFormats = new Map();\n\n constructor({ separator, inputSeparators = [], segments }: MaskArgs) {\n this.segments = [];\n this.separator = separator;\n\n this.inputSeparators = [...inputSeparators, separator];\n this.enrichSegmentDefinitions(segments);\n }\n\n tryAppendSeparator(value: string) {\n const withSeparator = `${value}${this.separator}`;\n return this.isValid(withSeparator) ? withSeparator : value;\n }\n\n isSeparator(key: string): boolean {\n return this.inputSeparators.indexOf(key) !== -1;\n }\n\n isValid(value: string): boolean {\n const inputSegments = value.split(this.separator);\n\n if (inputSegments.length > this.segments.length) {\n return false;\n }\n\n return inputSegments.every((segmentValue, i) => {\n const segment = this.segments[i];\n\n // disallow empty segments\n if (segmentValue === '') {\n // except empty last segment (e.g. trailing separator \"12:\")\n if (i === inputSegments.length - 1) {\n return true;\n } else {\n return false;\n }\n }\n // only allow numerals\n if (!segmentValue.match(/^\\d+$/)) {\n return false;\n }\n // disallow incomplete segments, except at end\n if (segmentValue.length < segment.length && i !== inputSegments.length - 1) {\n return false;\n }\n // limit numerical value\n const intValue = parseInt(segmentValue, 10);\n\n // Handles values padded with 0s that are lost during parsing\n if (segmentValue.length > segment.length) {\n return false;\n }\n\n if (intValue < segment.min || intValue > segment.max(value)) {\n // allow incomplete segments in final position\n if (i === inputSegments.length - 1 && segmentValue.length < segment.length) {\n return true;\n }\n return false;\n }\n return true;\n });\n }\n\n getValidValue(value: string): string {\n let validValue = value;\n\n do {\n if (this.isValid(validValue)) {\n return this.tryAppendSeparator(validValue);\n }\n\n validValue = validValue.substring(0, validValue.length - 1);\n } while (validValue.length > 0);\n\n return '';\n }\n\n autoComplete(value: string): string {\n // aka [...completeSegments, lastSegment] = value.split(':')\n // but that's not valid :/\n const [lastSegmentValue, ...completeSegmentValues] = value.split(this.separator).reverse();\n const lastSegment = this.segments[completeSegmentValues.length];\n\n // if the last segment isn't complete, pad it with a preceding 0\n // e.g. 10:1 -> 10:01\n const paddedLastSegmentValue = this.padWithDefaultValue(lastSegmentValue, lastSegment);\n\n // recombine, and pad with extra segments for the full format\n const partial = [...completeSegmentValues.reverse(), paddedLastSegmentValue];\n while (partial.length < this.segments.length) {\n const nextSegment = this.segments[partial.length];\n const segmentValue = this.padWithDefaultValue('', nextSegment);\n partial.push(segmentValue);\n }\n value = partial.join(this.separator);\n value = this.correctMinMaxValues(value);\n return value;\n }\n\n getSegmentValueWithAddition(position: number, value: string, enteredDigit: string) {\n const segment = this.positionFormats.get(position)!;\n const segmentValue = value.substr(segment.start, segment.length);\n const segmentPosition = position - segment.start;\n const newValue = insertAt(segmentValue, enteredDigit, segmentPosition, segmentPosition + 1);\n return parseInt(newValue, 10);\n }\n\n replaceDigitsWithZeroes(value: string, cursorStart: number, cursorEnd: number): ChangeResult {\n const position = this.isCursorAtSeparator(cursorStart) ? cursorStart + 1 : cursorStart;\n\n // move selection forwards if it starts with a separator\n if (this.isCursorAtSeparator(cursorStart)) {\n cursorStart++;\n }\n\n // first, insert zeros in a partial segment at beginning of selection\n if (!this.isSegmentStart(cursorStart)) {\n const segment = this.positionFormats.get(cursorStart)!;\n value = insertAt(value, padLeftZeros('', segment.end - cursorStart), cursorStart, segment.end);\n cursorStart = segment.end + 1;\n }\n\n // then loop through remaining segments, filling with zeros\n let currentSegment: FormatSegmentFull;\n while (cursorStart < cursorEnd && (currentSegment = this.positionFormats.get(cursorStart + 1)!)) {\n const insertionEnd = Math.min(cursorEnd, currentSegment.end);\n value = insertAt(\n value,\n padLeftZeros('', insertionEnd - currentSegment.start),\n currentSegment.start,\n insertionEnd\n );\n cursorStart = insertionEnd + 1;\n }\n\n value = this.correctMinMaxValues(value);\n\n return {\n value,\n position,\n };\n }\n\n handleSeparatorInput(value: string, position: number): ChangeResult | void {\n if (position === value.length && !this.isSegmentStart(position)) {\n const segment = this.positionFormats.get(position)!;\n let segmentValue = value.substr(segment.start, segment.length);\n segmentValue = this.padWithDefaultValue(segmentValue, segment);\n value = insertAt(value, segmentValue, segment.start, segment.end);\n value = this.correctMinMaxValues(value);\n return {\n value,\n position: value.length,\n };\n }\n }\n\n isCursorAtSeparator(position: number) {\n return 0 < position && position < this.getMaxLength() && this.positionFormats.get(position) === undefined;\n }\n\n isSegmentStart(position: number) {\n return position === 0 || this.isCursorAtSeparator(position - 1);\n }\n\n getSegmentMaxValue(value: string, position: number): number {\n return this.positionFormats.get(position)!.max(value);\n }\n\n getSegmentMinValue(value: string, position: number): number {\n return this.positionFormats.get(position)!.min;\n }\n\n getMaxLength() {\n const last = this.segments[this.segments.length - 1];\n return last.start + last.length;\n }\n\n deleteSeparator(value: string, position: number): ChangeResult {\n value = insertAt(value, '0', position - 2, position - 1);\n\n return {\n value: this.correctMinMaxValues(value),\n position: position - 2,\n };\n }\n\n deleteDigit(value: string, position: number): ChangeResult {\n value = insertAt(value, '0', position - 1, position);\n\n // 23:59|: => backspace => 23:5|\n const length = value.length;\n if (value.slice(length - 2) === '0:') {\n value = value.slice(0, length - 2);\n }\n\n return {\n value: this.correctMinMaxValues(value),\n position: position - 1,\n };\n }\n\n correctMinMaxValues(value: string): string {\n let segment = this.positionFormats.get(0);\n while (segment && value.length >= segment.end) {\n const segmentValue = parseInt(value.substr(segment.start, segment.length), 10);\n const segmentMax = segment.max(value);\n if (segmentValue < segment.min) {\n let toInsert = segment.min.toFixed();\n toInsert = padLeftZeros(toInsert, segment.length);\n value = insertAt(value, toInsert, segment.start, segment.end);\n }\n if (segmentValue > segmentMax) {\n value = insertAt(value, segmentMax.toFixed(), segment.start, segment.end);\n }\n segment = this.positionFormats.get(segment.end + 1);\n }\n return value.substr(0, this.segments[this.segments.length - 1].end);\n }\n\n formatPastedText(text: string, value: string, cursorStart: number, cursorEnd: number): string {\n const keyArr = text.trim().split('');\n\n let position = cursorStart;\n\n let formattedValue = value;\n // if a selection range captures the end of the current value\n // we replace it with the value in buffer even if the value in buffer is shorter\n if (cursorEnd > cursorStart && cursorEnd === value.length) {\n formattedValue = value.slice(0, cursorStart);\n }\n\n for (const key of keyArr) {\n if (position >= this.getMaxLength()) {\n break;\n }\n\n const result = this.processKey(formattedValue, key, position);\n formattedValue = result.value;\n position = result.position;\n }\n\n return this.tryAppendSeparator(formattedValue);\n }\n\n processKey(initialValue: string, key: string, initialPosition: number) {\n let value = initialValue;\n let position = initialPosition;\n\n if (this.isSeparator(key)) {\n const result = this.handleSeparatorInput(value, position);\n if (result) {\n value = result.value;\n position = result.position;\n }\n } else {\n const isCursorAtEnd = position === value.length;\n const segmentValue = this.getSegmentValueWithAddition(position, value, key);\n const segmentMaxValue = this.getSegmentMaxValue(value, position);\n const segmentMinValue = this.getSegmentMinValue(value, position);\n const firstDigitGreater = parseInt(key, 10) > parseInt(segmentMaxValue.toFixed()[0], 10);\n const isValidPosition = isCursorAtEnd || segmentValue.toFixed().length === 1;\n const exceedsMaxAtSegmentStart = this.isSegmentStart(position) && isValidPosition && firstDigitGreater;\n\n if (exceedsMaxAtSegmentStart) {\n // 22:| => Enter '9' => 22:09|\n // |1 => Enter '9' => 09|\n value = insertAt(value, `0${key}`, position, position + 2);\n position += 2;\n } else if (segmentValue > segmentMaxValue && this.isSegmentStart(position)) {\n // 22:|22 => Enter '9' => 22:59|\n value = insertAt(value, segmentMaxValue.toFixed(), position, position + segmentMaxValue.toFixed().length);\n position += segmentMaxValue.toFixed().length;\n } else if (segmentValue > segmentMaxValue) {\n // 2|2:22 => Enter '9' => 23:|22\n value = insertAt(value, segmentMaxValue.toFixed(), position - 1, position + 1);\n position += 1;\n } else if (segmentValue < segmentMinValue && !this.isSegmentStart(position)) {\n // 0| => enter '0' => 01:\n value = insertAt(value, segmentMinValue.toFixed(), position, position + 1);\n position += 1;\n } else {\n // 22:| => Enter '5' => 23:5|\n value = insertAt(value, key, position, position + 1);\n position += 1;\n }\n }\n\n value = this.tryAppendSeparator(value);\n\n // Move cursor in front of separator if behind after overwriting a character\n if (this.isCursorAtSeparator(position)) {\n position++;\n }\n\n return { value, position };\n }\n\n private padWithDefaultValue(segmentValue: string, segment: FormatSegmentFull) {\n let defaultValue = (segment.default || segment.min).toFixed();\n defaultValue = padLeftZeros(defaultValue, segment.length);\n return insertAt(defaultValue, segmentValue, segment.length - segmentValue.length, segment.length);\n }\n\n private enrichSegmentDefinitions(segments: FormatSegment[]) {\n this.positionFormats = new Map();\n this.segments = [];\n let position = 0;\n for (const segment of segments) {\n const max = segment.max;\n const fullSegment: FormatSegmentFull = {\n ...segment,\n max: typeof max === 'number' ? () => max : max,\n start: position,\n end: position + segment.length,\n };\n this.segments.push(fullSegment);\n // insert this format segment for every char in the max value\n for (let j = 0; j < fullSegment.length; j++) {\n this.positionFormats.set(position++, fullSegment);\n }\n // skip a position for separator\n position++;\n }\n }\n}\n\nexport default MaskFormat;\n", "\n import './styles.scoped.css';\n export default {\n \"root\": \"awsui_root_yodkx_im8v7_5\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { Ref, useCallback, useRef, useState } from 'react';\nimport styles from './styles.css.js';\nimport { DatePickerProps } from './interfaces';\nimport InternalCalendar from '../calendar/internal';\nimport { normalizeLocale } from '../internal/utils/locale';\nimport { InputProps } from '../input/interfaces';\nimport { KeyCode } from '../internal/keycode';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport Dropdown from '../internal/components/dropdown';\nimport InternalDateInput from '../date-input/internal';\nimport { getBaseProps } from '../internal/base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name.js';\nimport checkControlled from '../internal/hooks/check-controlled';\nimport { useFocusTracker } from '../internal/hooks/use-focus-tracker.js';\nimport useForwardFocus from '../internal/hooks/forward-focus';\nimport { ButtonProps } from '../button/interfaces';\nimport { InternalButton } from '../button/internal';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport FocusLock from '../internal/components/focus-lock';\nimport { parseDate } from '../internal/utils/date-time';\nimport LiveRegion from '../internal/components/live-region';\nimport { useFormFieldContext } from '../contexts/form-field.js';\nimport { useLocale } from '../i18n/context.js';\nimport { getBaseDateLabel, getSelectedDateLabel, isValidFullDate } from './utils';\n\nexport { DatePickerProps };\n\nconst DatePicker = React.forwardRef(\n (\n {\n locale = '',\n startOfWeek,\n isDateEnabled,\n nextMonthAriaLabel,\n previousMonthAriaLabel,\n todayAriaLabel,\n i18nStrings,\n placeholder = '',\n value = '',\n readOnly = false,\n disabled = false,\n onBlur,\n autoFocus = false,\n onChange,\n onFocus,\n name,\n ariaLabel,\n ariaRequired,\n controlId,\n invalid,\n openCalendarAriaLabel,\n expandToViewport,\n granularity = 'day',\n ...restProps\n }: DatePickerProps,\n ref: Ref\n ) => {\n const { __internalRootRef } = useBaseComponent('DatePicker', {\n props: { autoFocus, expandToViewport, granularity, readOnly },\n });\n checkControlled('DatePicker', 'value', value, 'onChange', onChange);\n\n const contextLocale = useLocale();\n const normalizedLocale = normalizeLocale('DatePicker', locale || contextLocale);\n\n const baseProps = getBaseProps(restProps);\n const [isDropDownOpen, setIsDropDownOpen] = useState(false);\n const { ariaLabelledby, ariaDescribedby } = useFormFieldContext(restProps);\n\n const internalInputRef = useRef(null);\n const buttonRef = useRef(null);\n useForwardFocus(ref, internalInputRef);\n\n const rootRef = useRef(null);\n const dropdownId = useUniqueId('calender');\n const calendarDescriptionId = useUniqueId('calendar-description-');\n const mergedRef = useMergeRefs(rootRef, __internalRootRef);\n\n useFocusTracker({ rootRef, onBlur, onFocus });\n\n const onDropdownCloseHandler = useCallback(() => setIsDropDownOpen(false), [setIsDropDownOpen]);\n\n const onButtonClickHandler = () => {\n if (!isDropDownOpen) {\n setIsDropDownOpen(true);\n }\n };\n\n const onWrapperKeyDownHandler = (event: React.KeyboardEvent) => {\n if (event.keyCode === KeyCode.escape && isDropDownOpen) {\n event.stopPropagation();\n buttonRef.current?.focus();\n setIsDropDownOpen(false);\n }\n };\n\n const onInputChangeHandler: InputProps['onChange'] = event => {\n fireNonCancelableEvent(onChange, { value: event.detail.value });\n };\n\n const onInputBlurHandler: InputProps['onBlur'] = () => {\n if (!isDropDownOpen) {\n setIsDropDownOpen(false);\n }\n };\n\n // Set displayed date to value if defined or to current date otherwise.\n const parsedValue = value && value.length >= 4 ? parseDate(value) : null;\n const baseDate = parsedValue || new Date();\n\n const hasFullValue = isValidFullDate({ date: value, granularity });\n\n const buttonAriaLabel =\n openCalendarAriaLabel &&\n openCalendarAriaLabel(\n hasFullValue && parsedValue\n ? getSelectedDateLabel({ date: parsedValue, granularity, locale: normalizedLocale })\n : null\n );\n\n const trigger = (\n
    \n
    \n \n
    \n
    \n \n
    \n
    \n );\n\n baseProps.className = clsx(baseProps.className, styles.root, styles['date-picker-container']);\n\n const handleMouseDown = (event: React.MouseEvent) => {\n // prevent currently focused element from losing it\n event.preventDefault();\n };\n\n return (\n
    \n {disabled || readOnly ? (\n trigger\n ) : (\n \n {isDropDownOpen && (\n \n
    \n {\n fireNonCancelableEvent(onChange, e.detail);\n buttonRef?.current?.focus();\n setIsDropDownOpen(false);\n }}\n locale={normalizedLocale}\n startOfWeek={startOfWeek}\n ariaDescribedby={calendarDescriptionId}\n ariaLabel={ariaLabel}\n ariaLabelledby={ariaLabelledby}\n granularity={granularity}\n isDateEnabled={isDateEnabled}\n i18nStrings={{\n ...i18nStrings,\n todayAriaLabel: i18nStrings?.todayAriaLabel ?? todayAriaLabel,\n nextMonthAriaLabel: i18nStrings?.nextMonthAriaLabel ?? nextMonthAriaLabel,\n previousMonthAriaLabel: i18nStrings?.previousMonthAriaLabel ?? previousMonthAriaLabel,\n }}\n />\n \n {getBaseDateLabel({ date: baseDate, granularity, locale: normalizedLocale })}\n \n
    \n
    \n )}\n \n )}\n
    \n );\n }\n);\n\napplyDisplayName(DatePicker, 'DatePicker');\nexport default DatePicker;\n", "\n import './styles.scoped.css';\n export default {\n \"root\": \"awsui_root_145pa_ot559_99\",\n \"focus-lock\": \"awsui_focus-lock_145pa_ot559_134\",\n \"calendar\": \"awsui_calendar_145pa_ot559_138\",\n \"date-picker-container\": \"awsui_date-picker-container_145pa_ot559_154\",\n \"date-picker-trigger\": \"awsui_date-picker-trigger_145pa_ot559_159\",\n \"date-picker-input\": \"awsui_date-picker-input_145pa_ot559_163\",\n \"open-calendar-button\": \"awsui_open-calendar-button_145pa_ot559_168\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useRef, useEffect, MutableRefObject } from 'react';\nimport { NonCancelableEventHandler, fireNonCancelableEvent } from '../events';\nimport FocusTracker from '../focus-tracker';\n\ninterface UseFocusTracker {\n (inputProps: {\n onBlur?: NonCancelableEventHandler;\n onFocus?: NonCancelableEventHandler;\n rootRef: MutableRefObject;\n }): void;\n}\n\nexport const useFocusTracker: UseFocusTracker = ({ rootRef, onBlur, onFocus }) => {\n const focusTracker = useRef(null);\n\n useEffect(() => {\n if (!rootRef.current) {\n return;\n }\n focusTracker.current = new FocusTracker(rootRef.current, {\n onFocusLeave: () => {\n fireNonCancelableEvent(onBlur);\n },\n onFocusEnter: () => {\n fireNonCancelableEvent(onFocus);\n },\n });\n focusTracker.current.initialize();\n return () => {\n focusTracker.current?.destroy();\n };\n }, [rootRef, onBlur, onFocus]);\n};\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { nodeBelongs } from './utils/node-belongs';\n\ninterface FocusTrackerOptions {\n onFocusEnter: () => void;\n onFocusLeave: () => void;\n}\n\nexport default class FocusTracker {\n private readonly onFocusLeave: () => void;\n private readonly onFocusEnter: () => void;\n\n private currentlyFocused = false;\n\n constructor(private node: HTMLElement, { onFocusEnter, onFocusLeave }: FocusTrackerOptions) {\n this.onFocusEnter = onFocusEnter;\n this.onFocusLeave = onFocusLeave;\n }\n\n initialize() {\n this.currentlyFocused = nodeBelongs(this.node, document.activeElement);\n document.addEventListener('focusin', this.focusInListener);\n document.addEventListener('focusout', this.focusOutListener);\n }\n\n destroy() {\n document.removeEventListener('focusin', this.focusInListener);\n document.removeEventListener('focusout', this.focusOutListener);\n }\n\n private focusInListener = (event: FocusEvent) => {\n const focusIsInside = nodeBelongs(this.node, event.target);\n if (!this.currentlyFocused && focusIsInside) {\n this.triggerFocus();\n }\n };\n\n private focusOutListener = (event: FocusEvent) => {\n const nextFocused = event.relatedTarget;\n const isNextFocusedInParent = !nodeBelongs(this.node, nextFocused);\n if (this.currentlyFocused && (nextFocused === null || isNextFocusedInParent)) {\n this.triggerBlur();\n }\n };\n\n private triggerBlur() {\n this.currentlyFocused = false;\n this.onFocusLeave();\n }\n\n private triggerFocus() {\n this.currentlyFocused = true;\n this.onFocusEnter();\n }\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { CalendarProps } from '../calendar/interfaces';\nimport { getDateLabel, renderMonthAndYear, renderYear } from '../calendar/utils/intl';\n\nexport function isValidFullDate({ date, granularity }: { date: string; granularity: CalendarProps.Granularity }) {\n const regex = granularity === 'month' ? /^\\d{4}-\\d{2}(-\\d{2})?$/ : /^\\d{4}-\\d{2}-\\d{2}$/;\n return !!date.match(regex);\n}\n\nexport function getSelectedDateLabel({\n date,\n granularity,\n locale,\n}: {\n date: Date;\n granularity: CalendarProps.Granularity;\n locale: string;\n}) {\n return granularity === 'month' ? renderMonthAndYear(locale, date) : getDateLabel(locale, date);\n}\n\nexport function getBaseDateLabel({\n date,\n granularity,\n locale,\n}: {\n date: Date;\n granularity: CalendarProps.Granularity;\n locale: string;\n}) {\n return granularity === 'month' ? renderYear(locale, date) : renderMonthAndYear(locale, date);\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { Ref, useEffect, useRef, useState } from 'react';\nimport styles from './styles.css.js';\nimport { DateRangePickerProps } from './interfaces';\nimport { normalizeLocale } from '../internal/utils/locale';\nimport useForwardFocus from '../internal/hooks/forward-focus';\nimport { KeyCode } from '../internal/keycode';\nimport clsx from 'clsx';\nimport { getBaseProps } from '../internal/base-component';\nimport checkControlled from '../internal/hooks/check-controlled';\nimport InternalBox from '../box/internal';\nimport { DateRangePickerDropdown } from './dropdown';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport Dropdown from '../internal/components/dropdown';\nimport { useFocusTracker } from '../internal/hooks/use-focus-tracker';\nimport { useMobile } from '../internal/hooks/use-mobile';\nimport ButtonTrigger from '../internal/components/button-trigger';\nimport { useFormFieldContext } from '../internal/context/form-field-context';\nimport InternalIcon from '../icon/internal';\nimport { normalizeTimeOffset, shiftTimeOffset } from './time-offset';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { isDevelopment } from '../internal/is-development.js';\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\nimport { usePrevious } from '../internal/hooks/use-previous';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { joinStrings } from '../internal/utils/strings/join-strings';\nimport { formatDateRange, isIsoDateOnly } from '../internal/utils/date-time';\nimport { useInternalI18n } from '../i18n/context';\nimport { formatValue } from './utils';\nimport ResetContextsForModal from '../internal/context/reset-contexts-for-modal.js';\n\nexport { DateRangePickerProps };\n\nfunction renderDateRange({\n locale,\n range,\n placeholder = '',\n formatRelativeRange,\n absoluteFormat,\n hideTimeOffset,\n timeOffset,\n}: {\n locale?: string;\n range: null | DateRangePickerProps.Value;\n placeholder?: string;\n formatRelativeRange: DateRangePickerProps.I18nStrings['formatRelativeRange'];\n absoluteFormat: DateRangePickerProps.AbsoluteFormat;\n hideTimeOffset?: boolean;\n timeOffset: { startDate?: number; endDate?: number };\n}) {\n if (!range) {\n return (\n \n {placeholder}\n \n );\n }\n\n const formatted =\n range.type === 'relative' ? (\n formatRelativeRange?.(range) ?? ''\n ) : (\n \n );\n\n return (\n \n {formatted}\n \n );\n}\n\nfunction BreakSpaces({ text }: { text: string }) {\n const tokens = text.split(/( )/);\n return (\n <>\n {tokens.map((token, index) => (\n \n {token.length > 1 ? {token} : token}\n {token === ' ' && }\n \n ))}\n \n );\n}\n\nfunction isDateOnly(value: null | DateRangePickerProps.Value) {\n if (!value || value.type !== 'absolute') {\n return false;\n }\n return isIsoDateOnly(value.startDate) && isIsoDateOnly(value.endDate);\n}\n\nconst DateRangePicker = React.forwardRef(\n (\n {\n locale = '',\n startOfWeek,\n isDateEnabled = () => true,\n value,\n placeholder,\n readOnly = false,\n disabled = false,\n onChange,\n onBlur,\n onFocus,\n relativeOptions = [],\n i18nStrings,\n isValidRange = () => ({ valid: true }),\n showClearButton = true,\n dateOnly = false,\n timeOffset,\n getTimeOffset,\n timeInputFormat = 'hh:mm:ss',\n expandToViewport = false,\n rangeSelectorMode = 'default',\n customAbsoluteRangeControl,\n absoluteFormat = 'iso',\n hideTimeOffset,\n ...rest\n }: DateRangePickerProps,\n ref: Ref\n ) => {\n const { __internalRootRef } = useBaseComponent('DateRangePicker', {\n props: {\n absoluteFormat,\n dateOnly,\n expandToViewport,\n rangeSelectorMode,\n readOnly,\n showClearButton,\n timeInputFormat,\n },\n });\n checkControlled('DateRangePicker', 'value', value, 'onChange', onChange);\n\n const normalizedTimeOffset = normalizeTimeOffset(value, getTimeOffset, timeOffset);\n value = isDateOnly(value) ? value : shiftTimeOffset(value, normalizedTimeOffset);\n\n const baseProps = getBaseProps(rest);\n const { invalid, controlId, ariaDescribedby, ariaLabelledby } = useFormFieldContext({\n ariaLabelledby: rest.ariaLabelledby ?? i18nStrings?.ariaLabelledby,\n ariaDescribedby: rest.ariaDescribedby ?? i18nStrings?.ariaDescribedby,\n ...rest,\n });\n const isSingleGrid = useMobile();\n\n const triggerRef = useRef(null);\n useForwardFocus(ref, triggerRef);\n\n const rootRef = useRef(null);\n const dropdownId = useUniqueId('date-range-picker-dropdown');\n const triggerContentId = useUniqueId('date-range-picker-trigger');\n\n useFocusTracker({ rootRef, onBlur, onFocus });\n\n const [isDropDownOpen, setIsDropDownOpen] = useState(false);\n\n const normalizedLocale = normalizeLocale('DateRangePicker', locale);\n\n const closeDropdown = (focusTrigger = false) => {\n setIsDropDownOpen(false);\n if (focusTrigger) {\n triggerRef.current?.focus();\n }\n };\n\n const onWrapperKeyDownHandler = (event: React.KeyboardEvent) => {\n if (event.keyCode === KeyCode.escape) {\n if (isDropDownOpen) {\n event.stopPropagation();\n }\n closeDropdown(true);\n }\n };\n\n const onClear = () => {\n fireNonCancelableEvent(onChange, { value: null });\n };\n\n const onApply = (newValue: null | DateRangePickerProps.Value): DateRangePickerProps.ValidationResult => {\n const validationResult = isValidRange(newValue);\n if (validationResult?.valid === false) {\n return validationResult;\n }\n\n if (isDevelopment) {\n if (newValue?.type === 'absolute') {\n const [startDateWithoutTime] = newValue.startDate.split('T');\n const [endDateWithoutTime] = newValue.endDate.split('T');\n if (!startDateWithoutTime || !endDateWithoutTime) {\n warnOnce(\n 'DateRangePicker',\n 'You have provided an `isValidRange` prop that did not catch a missing start or end date.'\n );\n }\n }\n }\n fireNonCancelableEvent(onChange, {\n value: formatValue(newValue, {\n dateOnly,\n timeOffset: normalizeTimeOffset(newValue, getTimeOffset, timeOffset),\n }),\n });\n return validationResult || { valid: true };\n };\n\n const prevDateOnly = usePrevious(dateOnly);\n useEffect(() => {\n if (prevDateOnly !== undefined && prevDateOnly !== dateOnly) {\n warnOnce(\n 'DateRangePicker',\n `The provided \\`dateOnly\\` flag has been changed from \"${prevDateOnly}\" to \"${dateOnly}\" which can lead to unexpected value format. Consider using separate components.`\n );\n }\n }, [prevDateOnly, dateOnly]);\n\n if (value && value.type !== 'absolute' && value.type !== 'relative') {\n warnOnce('DateRangePicker', 'You provided an invalid value. Reverting back to default.');\n value = null;\n }\n\n if (\n (value?.type === 'absolute' && rangeSelectorMode === 'relative-only') ||\n (value?.type === 'relative' && rangeSelectorMode === 'absolute-only')\n ) {\n warnOnce(\n 'DateRangePicker',\n 'The provided value does not correspond to the current range selector mode. Reverting back to default.'\n );\n value = null;\n }\n\n const i18n = useInternalI18n('date-range-picker');\n const formatRelativeRange = i18n(\n 'i18nStrings.formatRelativeRange',\n i18nStrings?.formatRelativeRange,\n format =>\n ({ amount, unit }) =>\n format({ amount, unit })\n );\n\n if (isDevelopment) {\n if (!formatRelativeRange && rangeSelectorMode !== 'absolute-only') {\n warnOnce(\n 'DateRangePicker',\n 'A function for i18nStrings.formatRelativeRange was not provided. Relative ranges will not be correctly rendered.'\n );\n }\n }\n\n const formattedDate: string | JSX.Element = renderDateRange({\n locale: normalizedLocale,\n range: value,\n placeholder,\n formatRelativeRange,\n absoluteFormat,\n hideTimeOffset,\n timeOffset: normalizedTimeOffset,\n });\n\n const trigger = (\n
    \n {\n if (!readOnly && !disabled) {\n setIsDropDownOpen(true);\n }\n }}\n disabled={disabled}\n readOnly={readOnly}\n ariaHasPopup=\"dialog\"\n >\n \n \n \n \n {formattedDate}\n \n \n
    \n );\n\n const mergedRef = useMergeRefs(rootRef, __internalRootRef);\n\n return (\n \n closeDropdown()}\n trigger={trigger}\n stretchToTriggerWidth={false}\n expandToViewport={expandToViewport}\n dropdownId={dropdownId}\n >\n {/* Reset form field context to prevent a wrapper form field from labelling all inputs inside the dropdown. */}\n \n {isDropDownOpen && (\n closeDropdown(true)}\n value={value}\n showClearButton={showClearButton}\n isDateEnabled={isDateEnabled}\n i18nStrings={i18nStrings}\n onClear={onClear}\n onApply={onApply}\n relativeOptions={relativeOptions}\n isValidRange={isValidRange}\n dateOnly={dateOnly}\n timeInputFormat={timeInputFormat}\n rangeSelectorMode={rangeSelectorMode}\n ariaLabelledby={ariaLabelledby}\n ariaDescribedby={ariaDescribedby}\n customAbsoluteRangeControl={customAbsoluteRangeControl}\n />\n )}\n \n \n \n );\n }\n);\n\napplyDisplayName(DateRangePicker, 'DateRangePicker');\nexport default DateRangePicker;\n", "\n import './styles.scoped.css';\n export default {\n \"calendar\": \"awsui_calendar_mgja0_1vaht_99\",\n \"awsui-motion-fade-in-0\": \"awsui_awsui-motion-fade-in-0_mgja0_1vaht_1\",\n \"root\": \"awsui_root_mgja0_1vaht_126\",\n \"wide\": \"awsui_wide_mgja0_1vaht_160\",\n \"focus-lock\": \"awsui_focus-lock_mgja0_1vaht_167\",\n \"trigger-wrapper\": \"awsui_trigger-wrapper_mgja0_1vaht_171\",\n \"trigger-flexbox\": \"awsui_trigger-flexbox_mgja0_1vaht_175\",\n \"calendar-container\": \"awsui_calendar-container_mgja0_1vaht_179\",\n \"one-grid\": \"awsui_one-grid_mgja0_1vaht_182\",\n \"calendar-header\": \"awsui_calendar-header_mgja0_1vaht_186\",\n \"calendar-header-months-wrapper\": \"awsui_calendar-header-months-wrapper_mgja0_1vaht_192\",\n \"calendar-header-month\": \"awsui_calendar-header-month_mgja0_1vaht_192\",\n \"calendar-next-month-btn\": \"awsui_calendar-next-month-btn_mgja0_1vaht_211\",\n \"calendar-prev-month-btn\": \"awsui_calendar-prev-month-btn_mgja0_1vaht_214\",\n \"first-grid\": \"awsui_first-grid_mgja0_1vaht_218\",\n \"second-grid\": \"awsui_second-grid_mgja0_1vaht_219\",\n \"date-and-time-container\": \"awsui_date-and-time-container_mgja0_1vaht_223\",\n \"date-and-time-wrapper\": \"awsui_date-and-time-wrapper_mgja0_1vaht_229\",\n \"footer\": \"awsui_footer_mgja0_1vaht_236\",\n \"has-clear-button\": \"awsui_has-clear-button_mgja0_1vaht_245\",\n \"footer-button-wrapper\": \"awsui_footer-button-wrapper_mgja0_1vaht_254\",\n \"icon-wrapper\": \"awsui_icon-wrapper_mgja0_1vaht_261\",\n \"label\": \"awsui_label_mgja0_1vaht_266\",\n \"label-enabled\": \"awsui_label-enabled_mgja0_1vaht_271\",\n \"label-text\": \"awsui_label-text_mgja0_1vaht_275\",\n \"label-token-nowrap\": \"awsui_label-token-nowrap_mgja0_1vaht_280\",\n \"mode-switch\": \"awsui_mode-switch_mgja0_1vaht_284\",\n \"dropdown\": \"awsui_dropdown_mgja0_1vaht_288\",\n \"dropdown-content\": \"awsui_dropdown-content_mgja0_1vaht_310\",\n \"start-date-input\": \"awsui_start-date-input_mgja0_1vaht_319\",\n \"start-time-input\": \"awsui_start-time-input_mgja0_1vaht_320\",\n \"end-date-input\": \"awsui_end-date-input_mgja0_1vaht_321\",\n \"end-time-input\": \"awsui_end-time-input_mgja0_1vaht_322\",\n \"validation-section\": \"awsui_validation-section_mgja0_1vaht_326\",\n \"validation-error\": \"awsui_validation-error_mgja0_1vaht_330\",\n \"clear-button\": \"awsui_clear-button_mgja0_1vaht_334\",\n \"apply-button\": \"awsui_apply-button_mgja0_1vaht_338\",\n \"cancel-button\": \"awsui_cancel-button_mgja0_1vaht_342\",\n \"calendar-aria-live\": \"awsui_calendar-aria-live_mgja0_1vaht_346\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { useEffect, useRef, useState } from 'react';\nimport { DateRangePickerProps } from './interfaces';\nimport Calendar from './calendar';\nimport { ButtonProps } from '../button/interfaces';\nimport { InternalButton } from '../button/internal';\nimport FocusLock from '../internal/components/focus-lock';\nimport InternalBox from '../box/internal';\nimport InternalSpaceBetween from '../space-between/internal';\n\nimport styles from './styles.css.js';\nimport RelativeRangePicker from './relative-range';\nimport ModeSwitcher from './mode-switcher';\nimport clsx from 'clsx';\nimport InternalAlert from '../alert/internal';\nimport LiveRegion from '../internal/components/live-region';\nimport { getDefaultMode, joinAbsoluteValue, splitAbsoluteValue } from './utils';\nimport { useInternalI18n } from '../i18n/context';\n\nexport const VALID_RANGE: DateRangePickerProps.ValidRangeResult = { valid: true };\n\nexport interface DateRangePickerDropdownProps\n extends Pick<\n Required,\n | 'locale'\n | 'isDateEnabled'\n | 'isValidRange'\n | 'value'\n | 'relativeOptions'\n | 'showClearButton'\n | 'dateOnly'\n | 'timeInputFormat'\n | 'rangeSelectorMode'\n > {\n onClear: () => void;\n onApply: (value: null | DateRangePickerProps.Value) => DateRangePickerProps.ValidationResult;\n startOfWeek: number | undefined;\n onDropdownClose: () => void;\n isSingleGrid: boolean;\n i18nStrings?: DateRangePickerProps.I18nStrings;\n\n ariaLabelledby?: string;\n ariaDescribedby?: string;\n customAbsoluteRangeControl: DateRangePickerProps.AbsoluteRangeControl | undefined;\n}\n\nexport function DateRangePickerDropdown({\n locale = '',\n startOfWeek,\n isDateEnabled,\n isValidRange,\n value,\n onClear: clearValue,\n onApply: applyValue,\n onDropdownClose,\n relativeOptions,\n showClearButton,\n isSingleGrid,\n i18nStrings,\n dateOnly,\n timeInputFormat,\n rangeSelectorMode,\n ariaLabelledby,\n ariaDescribedby,\n customAbsoluteRangeControl,\n}: DateRangePickerDropdownProps) {\n const i18n = useInternalI18n('date-range-picker');\n\n const [rangeSelectionMode, setRangeSelectionMode] = useState<'absolute' | 'relative'>(\n getDefaultMode(value, relativeOptions, rangeSelectorMode)\n );\n\n const [selectedAbsoluteRange, setSelectedAbsoluteRange] = useState(() =>\n splitAbsoluteValue(value?.type === 'absolute' ? value : null)\n );\n\n const [selectedRelativeRange, setSelectedRelativeRange] = useState(\n value?.type === 'relative' ? value : null\n );\n\n const scrollableContainerRef = useRef(null);\n const applyButtonRef = useRef(null);\n\n const [applyClicked, setApplyClicked] = useState(false);\n\n const [validationResult, setValidationResult] = useState<\n DateRangePickerProps.ValidRangeResult | DateRangePickerProps.InvalidRangeResult\n >(VALID_RANGE);\n\n const closeDropdown = () => {\n setApplyClicked(false);\n onDropdownClose();\n };\n\n const onClear = () => {\n closeDropdown();\n clearValue();\n };\n\n const onApply = () => {\n const newValue =\n rangeSelectionMode === 'relative' ? selectedRelativeRange : joinAbsoluteValue(selectedAbsoluteRange);\n const newValidationResult = applyValue(newValue);\n if (newValidationResult.valid === false) {\n setApplyClicked(true);\n setValidationResult(newValidationResult);\n } else {\n setApplyClicked(false);\n closeDropdown();\n }\n };\n\n useEffect(() => {\n if (applyClicked) {\n const visibleRange =\n rangeSelectionMode === 'relative' ? selectedRelativeRange : joinAbsoluteValue(selectedAbsoluteRange);\n\n const newValidationResult = isValidRange(visibleRange);\n setValidationResult(newValidationResult || VALID_RANGE);\n }\n }, [\n applyClicked,\n isValidRange,\n rangeSelectionMode,\n selectedRelativeRange,\n selectedAbsoluteRange,\n setValidationResult,\n ]);\n\n useEffect(() => scrollableContainerRef.current?.focus(), [scrollableContainerRef]);\n\n return (\n <>\n \n \n \n \n \n \n {rangeSelectorMode === 'default' && (\n {\n setRangeSelectionMode(mode);\n setApplyClicked(false);\n setValidationResult(VALID_RANGE);\n }}\n i18nStrings={i18nStrings}\n />\n )}\n\n {rangeSelectionMode === 'absolute' && (\n \n )}\n\n {rangeSelectionMode === 'relative' && (\n setSelectedRelativeRange(range)}\n i18nStrings={i18nStrings}\n />\n )}\n \n\n \n {!validationResult.valid && (\n <>\n \n {validationResult.errorMessage}\n \n {validationResult.errorMessage}\n \n )}\n \n \n\n \n {showClearButton && (\n
    \n \n {i18n('i18nStrings.clearButtonLabel', i18nStrings?.clearButtonLabel)}\n \n
    \n )}\n
    \n \n \n {i18n('i18nStrings.cancelButtonLabel', i18nStrings?.cancelButtonLabel)}\n \n\n \n {i18n('i18nStrings.applyButtonLabel', i18nStrings?.applyButtonLabel)}\n \n \n
    \n \n
    \n \n \n
    \n \n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { useState } from 'react';\nimport { addMonths, endOfDay, isAfter, isBefore, isSameMonth, startOfDay, startOfMonth } from 'date-fns';\nimport styles from '../styles.css.js';\nimport SpaceBetween from '../../space-between/internal';\nimport { BaseComponentProps } from '../../internal/base-component';\nimport { DateRangePickerProps, RangeCalendarI18nStrings } from '../interfaces';\nimport CalendarHeader from './header';\nimport { Grids } from './grids';\nimport { TimeInputProps } from '../../time-input/interfaces';\nimport clsx from 'clsx';\nimport { useUniqueId } from '../../internal/hooks/use-unique-id';\nimport { getDateLabel, renderTimeLabel } from '../../calendar/utils/intl';\nimport LiveRegion from '../../internal/components/live-region';\nimport { normalizeLocale, normalizeStartOfWeek } from '../../internal/utils/locale';\nimport { parseDate, splitDateTime, formatDateTime } from '../../internal/utils/date-time';\nimport { getBaseDay } from '../../calendar/utils/navigation';\nimport { useMobile } from '../../internal/hooks/use-mobile/index.js';\nimport RangeInputs from './range-inputs.js';\nimport { findDateToFocus, findMonthToDisplay } from './utils';\nimport { useInternalI18n } from '../../i18n/context.js';\n\nexport interface DateRangePickerCalendarProps extends BaseComponentProps {\n value: DateRangePickerProps.PendingAbsoluteValue;\n setValue: React.Dispatch>;\n locale?: string;\n startOfWeek?: number;\n isDateEnabled?: (date: Date) => boolean;\n i18nStrings?: RangeCalendarI18nStrings;\n dateOnly?: boolean;\n timeInputFormat?: TimeInputProps.Format;\n customAbsoluteRangeControl: DateRangePickerProps.AbsoluteRangeControl | undefined;\n}\n\nexport default function DateRangePickerCalendar({\n value,\n setValue,\n locale = '',\n startOfWeek,\n isDateEnabled = () => true,\n i18nStrings,\n dateOnly = false,\n timeInputFormat = 'hh:mm:ss',\n customAbsoluteRangeControl,\n}: DateRangePickerCalendarProps) {\n const isSingleGrid = useMobile();\n const normalizedLocale = normalizeLocale('DateRangePicker', locale);\n const normalizedStartOfWeek = normalizeStartOfWeek(startOfWeek, normalizedLocale);\n const i18n = useInternalI18n('date-range-picker');\n\n const [announcement, setAnnouncement] = useState('');\n const [currentMonth, setCurrentMonth] = useState(() => findMonthToDisplay(value, isSingleGrid));\n const [focusedDate, setFocusedDate] = useState(() => {\n if (value.start.date) {\n const startDate = parseDate(value.start.date);\n if (isSameMonth(startDate, currentMonth)) {\n return startDate;\n }\n if (!isSingleGrid && isSameMonth(startDate, addMonths(currentMonth, -1))) {\n return startDate;\n }\n }\n return findDateToFocus(parseDate(value.start.date), currentMonth, isDateEnabled);\n });\n\n const updateCurrentMonth = (startDate: string) => {\n if (startDate.length >= 8) {\n const newCurrentMonth = startOfMonth(parseDate(startDate));\n setCurrentMonth(isSingleGrid ? newCurrentMonth : addMonths(newCurrentMonth, 1));\n }\n };\n\n // recommended to include the start/end time announced with the selection\n // because the user is not aware of the fact that a start/end time is also set as soon as they select a date\n const announceStart = (startDate: Date) => {\n return (\n i18n('i18nStrings.startDateLabel', i18nStrings?.startDateLabel) +\n ', ' +\n getDateLabel(normalizedLocale, startDate) +\n ', ' +\n i18n('i18nStrings.startTimeLabel', i18nStrings?.startTimeLabel) +\n ', ' +\n renderTimeLabel(normalizedLocale, startDate, timeInputFormat) +\n '. '\n );\n };\n\n const announceEnd = (endDate: Date) => {\n return (\n i18n('i18nStrings.endDateLabel', i18nStrings?.endDateLabel) +\n ', ' +\n getDateLabel(normalizedLocale, endDate) +\n ', ' +\n i18n('i18nStrings.endTimeLabel', i18nStrings?.endTimeLabel) +\n ', ' +\n renderTimeLabel(normalizedLocale, endDate, timeInputFormat) +\n '. '\n );\n };\n\n const renderSelectedAbsoluteRangeAriaLive = i18n(\n 'i18nStrings.renderSelectedAbsoluteRangeAriaLive',\n i18nStrings?.renderSelectedAbsoluteRangeAriaLive,\n format => (startDate, endDate) => format({ startDate, endDate })\n );\n\n const announceRange = (startDate: Date, endDate: Date) => {\n if (!renderSelectedAbsoluteRangeAriaLive) {\n return `${getDateLabel(normalizedLocale, startDate)} – ${getDateLabel(normalizedLocale, endDate)}`;\n }\n return renderSelectedAbsoluteRangeAriaLive(\n getDateLabel(normalizedLocale, startDate),\n getDateLabel(normalizedLocale, endDate)\n );\n };\n\n const onSelectDateHandler = (selectedDate: Date) => {\n const { start, end } = value;\n let newStart: Date | undefined = undefined;\n let newEnd: Date | null | undefined = undefined;\n let announcement = '';\n\n // If both fields are empty, we set the start date\n if (!start.date && !end.date) {\n newStart = startOfDay(selectedDate);\n announcement = announceStart(newStart);\n }\n // If both fields are set, we start new\n else if (start.date && end.date) {\n newStart = startOfDay(selectedDate);\n newEnd = null;\n announcement = announceStart(newStart);\n }\n // If only the END date is empty, we fill it (and swap dates if needed)\n else if (start.date && !end.date) {\n const parsedStartDate = parseDate(start.date);\n\n if (isBefore(selectedDate, parsedStartDate)) {\n // The user has selected the range backwards, so we swap start and end\n newStart = startOfDay(selectedDate);\n newEnd = endOfDay(parsedStartDate);\n announcement = announceStart(newStart) + announceRange(newStart, newEnd);\n } else {\n newEnd = endOfDay(selectedDate);\n announcement = announceEnd(newEnd) + announceRange(parsedStartDate, newEnd);\n }\n }\n // If only the START date is empty, we fill it (and swap dates if needed)\n else if (!start.date && end.date) {\n const existingEndDate = parseDate(end.date);\n\n if (isAfter(selectedDate, existingEndDate)) {\n // The user has selected the range backwards, so we swap start and end\n newStart = startOfDay(existingEndDate);\n newEnd = endOfDay(selectedDate);\n announcement = announceEnd(newEnd) + announceRange(newStart, newEnd);\n } else {\n newStart = startOfDay(selectedDate);\n announcement = announceStart(newStart) + announceRange(newStart, existingEndDate);\n }\n }\n\n const formatValue = (\n date: Date | null | undefined,\n previous: DateRangePickerProps.DateTimeStrings\n ): DateRangePickerProps.DateTimeStrings => {\n if (date === null) {\n // explicitly reset to empty\n return { date: '', time: '' };\n } else if (date === undefined) {\n // keep old value\n return previous;\n }\n return splitDateTime(formatDateTime(date));\n };\n\n setValue({\n start: formatValue(newStart, value.start),\n end: formatValue(newEnd, value.end),\n });\n setAnnouncement(announcement);\n };\n\n const onHeaderChangeMonthHandler = (newCurrentMonth: Date) => {\n setCurrentMonth(newCurrentMonth);\n\n const newBaseDateMonth = isSingleGrid ? newCurrentMonth : addMonths(newCurrentMonth, -1);\n const newBaseDate = getBaseDay(newBaseDateMonth, isDateEnabled);\n setFocusedDate(newBaseDate);\n };\n\n const onChangeStartDate = (value: string) => {\n setValue((oldValue: DateRangePickerProps.PendingAbsoluteValue) => ({\n ...oldValue,\n start: { ...oldValue.start, date: value },\n }));\n updateCurrentMonth(value);\n };\n\n const interceptedSetValue: DateRangePickerCalendarProps['setValue'] = newValue => {\n setValue(oldValue => {\n const updated = typeof newValue === 'function' ? newValue(oldValue) : newValue;\n updateCurrentMonth(updated.start.date);\n return updated;\n });\n };\n\n const headingIdPrefix = useUniqueId('date-range-picker-calendar-heading');\n return (\n <>\n \n \n \n \n\n \n \n\n \n setValue(oldValue => ({ ...oldValue, start: { ...oldValue.start, time: value } }))\n }\n endDate={value.end.date}\n onChangeEndDate={value => setValue(oldValue => ({ ...oldValue, end: { ...oldValue.end, date: value } }))}\n endTime={value.end.time}\n onChangeEndTime={value => setValue(oldValue => ({ ...oldValue, end: { ...oldValue.end, time: value } }))}\n i18nStrings={i18nStrings}\n dateOnly={dateOnly}\n timeInputFormat={timeInputFormat}\n />\n {customAbsoluteRangeControl &&
    {customAbsoluteRangeControl(value, interceptedSetValue)}
    }\n
    \n \n {announcement}\n \n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { add } from 'date-fns';\nimport React from 'react';\nimport styles from '../../styles.css.js';\nimport { renderMonthAndYear } from '../../../calendar/utils/intl';\nimport { PrevMonthButton, NextMonthButton } from './header-button';\nimport LiveRegion from '../../../internal/components/live-region';\nimport { useInternalI18n } from '../../../i18n/context.js';\n\ninterface CalendarHeaderProps {\n baseDate: Date;\n locale: string;\n onChangeMonth: (date: Date) => void;\n previousMonthLabel?: string;\n nextMonthLabel?: string;\n isSingleGrid: boolean;\n headingIdPrefix: string;\n}\n\nexport default function CalendarHeader({\n baseDate,\n locale,\n onChangeMonth,\n previousMonthLabel,\n nextMonthLabel,\n isSingleGrid,\n headingIdPrefix,\n}: CalendarHeaderProps) {\n const i18n = useInternalI18n('calendar');\n const prevMonthLabel = renderMonthAndYear(locale, add(baseDate, { months: -1 }));\n const currentMonthLabel = renderMonthAndYear(locale, baseDate);\n\n return (\n <>\n
    \n \n

    \n {!isSingleGrid && (\n \n {prevMonthLabel}\n \n )}\n \n {currentMonthLabel}\n \n

    \n \n
    \n {isSingleGrid ? currentMonthLabel : `${prevMonthLabel}, ${currentMonthLabel}`}\n \n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { addMonths } from 'date-fns';\nimport React from 'react';\nimport { InternalButton } from '../../../button/internal';\nimport styles from '../../styles.css.js';\n\ninterface HeaderButtonProps {\n ariaLabel?: string;\n baseDate: Date;\n onChangeMonth: (date: Date) => void;\n}\n\nexport function PrevMonthButton({ ariaLabel, baseDate, onChangeMonth }: HeaderButtonProps) {\n return (\n onChangeMonth(addMonths(baseDate, -1))}\n formAction=\"none\"\n className={styles['calendar-prev-month-btn']}\n />\n );\n}\n\nexport function NextMonthButton({ ariaLabel, baseDate, onChangeMonth }: HeaderButtonProps) {\n return (\n onChangeMonth(addMonths(baseDate, 1))}\n formAction=\"none\"\n className={styles['calendar-next-month-btn']}\n />\n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef, useState } from 'react';\nimport { KeyCode } from '../../../internal/keycode';\nimport { isSameMonth, isAfter, isBefore, addMonths, min, max } from 'date-fns';\n\nimport { DateRangePickerProps, DayIndex } from '../../interfaces';\nimport InternalSpaceBetween from '../../../space-between/internal';\nimport { Grid } from './grid';\nimport styles from '../../styles.css.js';\n\nimport { hasValue } from '../../../internal/utils/has-value';\nimport { useDateCache } from '../../../internal/hooks/use-date-cache';\nimport { moveNextDay, movePrevDay, moveNextWeek, movePrevWeek, getBaseDay } from '../../../calendar/utils/navigation';\nimport { findDateToFocus } from '../utils';\nimport handleKey from '../../../internal/utils/handle-key';\n\nfunction isVisible(date: Date, baseDate: Date, isSingleGrid: boolean) {\n if (isSingleGrid) {\n return isSameMonth(date, baseDate);\n }\n\n const previousMonth = addMonths(baseDate, -1);\n\n return isSameMonth(date, previousMonth) || isSameMonth(date, baseDate);\n}\n\nexport interface GridProps {\n baseDate: Date;\n selectedStartDate: Date | null;\n selectedEndDate: Date | null;\n\n focusedDate: Date | null;\n onFocusedDateChange: React.Dispatch>;\n\n isDateEnabled: DateRangePickerProps.IsDateEnabledFunction;\n isSingleGrid: boolean;\n\n onSelectDate: (date: Date) => void;\n onChangeMonth: (date: Date) => void;\n\n locale: string;\n startOfWeek: DayIndex;\n todayAriaLabel?: string;\n headingIdPrefix: string;\n}\n\nexport const Grids = ({\n baseDate,\n selectedStartDate,\n selectedEndDate,\n\n focusedDate,\n onFocusedDateChange,\n\n isDateEnabled,\n isSingleGrid,\n\n onSelectDate,\n onChangeMonth,\n\n locale,\n startOfWeek,\n todayAriaLabel,\n headingIdPrefix,\n}: GridProps) => {\n const containerRef = useRef(null);\n const [gridHasFocus, setGridHasFocus] = useState(false);\n\n const focusedDateRef = useRef(null);\n\n const dateCache = useDateCache();\n baseDate = dateCache(baseDate);\n focusedDate = focusedDate ? dateCache(focusedDate) : null;\n\n useEffect(() => {\n if (focusedDate && !isVisible(focusedDate, baseDate, isSingleGrid)) {\n const direction = isAfter(focusedDate, baseDate) ? -1 : 1;\n\n const newMonth = !isSingleGrid && direction === -1 ? addMonths(baseDate, -1) : baseDate;\n const nearestBaseDate = getBaseDay(newMonth, isDateEnabled);\n\n const newFocusedDate = findDateToFocus(focusedDate, nearestBaseDate, isDateEnabled);\n\n onFocusedDateChange(newFocusedDate);\n }\n }, [baseDate, focusedDate, isSingleGrid, isDateEnabled, onFocusedDateChange]);\n\n const onGridKeyDownHandler = (event: React.KeyboardEvent) => {\n let updatedFocusDate;\n\n const keys = [KeyCode.up, KeyCode.down, KeyCode.left, KeyCode.right, KeyCode.space, KeyCode.enter];\n\n if (focusedDate === null || keys.indexOf(event.keyCode) === -1) {\n return;\n }\n\n event.preventDefault();\n\n handleKey(event, {\n onActivate: () => focusedDate && onSelectDate(focusedDate),\n onBlockEnd: () => focusedDate && (updatedFocusDate = moveNextWeek(focusedDate, isDateEnabled)),\n onBlockStart: () => focusedDate && (updatedFocusDate = movePrevWeek(focusedDate, isDateEnabled)),\n onInlineEnd: () => focusedDate && (updatedFocusDate = moveNextDay(focusedDate, isDateEnabled)),\n onInlineStart: () => focusedDate && (updatedFocusDate = movePrevDay(focusedDate, isDateEnabled)),\n });\n\n if (!updatedFocusDate) {\n return;\n }\n\n const updatedDateIsVisible = isVisible(updatedFocusDate, baseDate, isSingleGrid);\n\n if (!updatedDateIsVisible) {\n const newMonthIsOnLeftSide = !isSingleGrid && isBefore(updatedFocusDate, baseDate);\n\n onChangeMonth(newMonthIsOnLeftSide ? addMonths(updatedFocusDate, 1) : updatedFocusDate);\n }\n onFocusedDateChange(updatedFocusDate);\n };\n\n useEffect(() => {\n // focus current date if the focus is already inside the calendar\n if (focusedDate !== null && gridHasFocus) {\n if (focusedDateRef.current && focusedDateRef.current !== document.activeElement) {\n focusedDateRef.current.focus();\n }\n }\n }, [focusedDate, gridHasFocus]);\n\n const onGridBlur = (event: React.FocusEvent) => {\n /*\n IE11 does not support event.relatedTarget, but sets document.activeElement to the newly\n focused element before the onBlur handler is called.\n\n However, other browsers do not make any guarantees for the value of document.activeElement\n during the execution of an onBlur handler. Therefore, we have to use event.relatedTarget\n instead.\n */\n const newFocusTarget = event.relatedTarget || document.activeElement;\n const newFocusTargetIsInGrid = containerRef.current?.contains(newFocusTarget as Node);\n if (newFocusTarget && !newFocusTargetIsInGrid && gridHasFocus) {\n setGridHasFocus(false);\n }\n };\n\n const onGridFocus = () => {\n if (!gridHasFocus) {\n setGridHasFocus(true);\n }\n };\n\n const isRangeVisible = (selectedStartDate && selectedEndDate) || gridHasFocus;\n\n const rangeEnds: Date[] = [selectedStartDate ?? focusedDate, selectedEndDate ?? focusedDate].filter(hasValue);\n\n const rangeStartDate = min(rangeEnds);\n const rangeEndDate = max(rangeEnds);\n\n return (\n
    \n \n {!isSingleGrid && (\n \n )}\n \n \n
    \n );\n};\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useMemo } from 'react';\nimport styles from './styles.css.js';\nimport {\n isSameMonth,\n isAfter,\n isBefore,\n isSameDay,\n addWeeks,\n addDays,\n isLastDayOfMonth,\n getDaysInMonth,\n isToday,\n} from 'date-fns';\nimport { getCalendarMonth } from 'mnth';\nimport { DateRangePickerProps, DayIndex } from '../../interfaces';\nimport { getDateLabel, renderDayName } from '../../../calendar/utils/intl';\nimport clsx from 'clsx';\nimport { formatDate } from '../../../internal/utils/date-time';\nimport ScreenreaderOnly from '../../../internal/components/screenreader-only/index.js';\n\n/**\n * Calendar grid supports two mechanisms of keyboard navigation:\n * - Native screen-reader table navigation (semantic table markup);\n * - Keyboard arrow-keys navigation (a custom key-down handler).\n *\n * The implementation largely follows the w3 example (https://www.w3.org/WAI/ARIA/apg/example-index/dialog-modal/datepicker-dialog) and shares the following issues:\n * - (table navigation) Chrome+VO - weekday is announced twice when navigating to the calendar's header;\n * - (table navigation) Safari+VO - \"dimmed\" state is announced twice;\n * - (table navigation) Firefox/Chrome+NVDA - cannot use table navigation if any cell has a focus;\n * - (keyboard navigation) Firefox+NVDA - every day is announced as \"not selected\";\n * - (keyboard navigation) Safari/Chrome+VO - weekdays are not announced;\n * - (keyboard navigation) Safari/Chrome+VO - days are not announced as interactive (clickable or selectable);\n * - (keyboard navigation) Safari/Chrome+VO - day announcements are not interruptive and can be missed if navigating fast.\n */\n\nexport interface GridProps {\n baseDate: Date;\n selectedStartDate: Date | null;\n selectedEndDate: Date | null;\n\n rangeStartDate: Date | null;\n rangeEndDate: Date | null;\n\n focusedDate: Date | null;\n focusedDateRef: React.RefObject;\n\n onSelectDate: (date: Date) => void;\n onGridKeyDownHandler: (e: React.KeyboardEvent) => void;\n onFocusedDateChange: React.Dispatch>;\n\n isDateEnabled: DateRangePickerProps.IsDateEnabledFunction;\n\n locale: string;\n startOfWeek: DayIndex;\n todayAriaLabel?: string;\n ariaLabelledby: string;\n\n className?: string;\n}\n\nexport function Grid({\n baseDate,\n selectedStartDate,\n selectedEndDate,\n rangeStartDate,\n rangeEndDate,\n focusedDate,\n\n focusedDateRef,\n\n onSelectDate,\n onGridKeyDownHandler,\n onFocusedDateChange,\n\n isDateEnabled,\n\n locale,\n startOfWeek,\n todayAriaLabel,\n ariaLabelledby,\n\n className,\n}: GridProps) {\n const baseDateTime = baseDate?.getTime();\n // `baseDateTime` is used as a more stable replacement for baseDate\n const weeks = useMemo(\n () => getCalendarMonth(baseDate, { firstDayOfWeek: startOfWeek }),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [baseDateTime, startOfWeek]\n );\n const weekdays = weeks[0].map(date => date.getDay());\n\n return (\n \n \n \n {weekdays.map(dayIndex => (\n \n ))}\n \n \n \n {weeks.map((week, weekIndex) => {\n return (\n \n {week.map((date, dateIndex) => {\n const isStartDate = !!selectedStartDate && isSameDay(date, selectedStartDate);\n const isEndDate = !!selectedEndDate && isSameDay(date, selectedEndDate);\n const isSelected = isStartDate || isEndDate;\n const isRangeStartDate = !!rangeStartDate && isSameDay(date, rangeStartDate);\n const isRangeEndDate = !!rangeEndDate && isSameDay(date, rangeEndDate);\n\n const isFocused = !!focusedDate && isSameDay(date, focusedDate) && isSameMonth(date, baseDate);\n\n const dateIsInRange = isStartDate || isEndDate || isInRange(date, rangeStartDate, rangeEndDate);\n const inRangeStartWeek =\n rangeStartDate && isInRange(date, rangeStartDate, addDays(addWeeks(rangeStartDate, 1), -1));\n const inRangeEndWeek =\n rangeEndDate && isInRange(date, rangeEndDate, addDays(addWeeks(rangeEndDate, -1), 1));\n const onlyOneSelected =\n !!rangeStartDate && !!rangeEndDate\n ? isSameDay(rangeStartDate, rangeEndDate)\n : !selectedStartDate || !selectedEndDate;\n\n const isEnabled = !isDateEnabled || isDateEnabled(date);\n const isFocusable = isFocused && isEnabled;\n\n const baseClasses = {\n [styles.day]: true,\n [styles['grid-cell']]: true,\n [styles['in-first-row']]: weekIndex === 0,\n [styles['in-first-column']]: dateIndex === 0,\n };\n\n if (!isSameMonth(date, baseDate)) {\n return (\n \n );\n }\n\n const handlers: React.HTMLAttributes = {};\n if (isEnabled) {\n handlers.onClick = () => onSelectDate(date);\n handlers.onFocus = () => onFocusedDateChange(date);\n }\n\n // Can't be focused.\n let tabIndex = undefined;\n if (isFocusable && isEnabled) {\n // Next focus target.\n tabIndex = 0;\n } else if (isEnabled) {\n // Can be focused programmatically.\n tabIndex = -1;\n }\n\n // Screen-reader announcement for the focused day.\n let dayAnnouncement = getDateLabel(locale, date, 'short');\n if (isToday(date)) {\n dayAnnouncement += '. ' + todayAriaLabel;\n }\n\n return (\n getDaysInMonth(date) - 7,\n [styles['in-range-border-inline-start']]:\n dateIndex === 0 || date.getDate() === 1 || isRangeStartDate,\n [styles['in-range-border-inline-end']]:\n dateIndex === week.length - 1 || isLastDayOfMonth(date) || isRangeEndDate,\n [styles.today]: isToday(date),\n })}\n aria-selected={isEnabled ? isSelected || dateIsInRange : undefined}\n aria-current={isToday(date) ? 'date' : undefined}\n data-date={formatDate(date)}\n aria-disabled={!isEnabled}\n tabIndex={tabIndex}\n {...handlers}\n >\n \n {date.getDate()}\n \n {dayAnnouncement}\n \n );\n })}\n \n );\n })}\n \n
    \n {renderDayName(locale, dayIndex, 'short')}\n {renderDayName(locale, dayIndex, 'long')}\n
    \n );\n}\n\nfunction isInRange(date: Date, dateOne: Date | null, dateTwo: Date | null) {\n if (!dateOne || !dateTwo || isSameDay(dateOne, dateTwo)) {\n return false;\n }\n\n const inRange =\n (isAfter(date, dateOne) && isBefore(date, dateTwo)) || (isAfter(date, dateTwo) && isBefore(date, dateOne));\n\n return inRange || isSameDay(date, dateOne) || isSameDay(date, dateTwo);\n}\n", "\n import './styles.scoped.css';\n export default {\n \"grid\": \"awsui_grid_1mfbn_f3jvf_103\",\n \"grid-cell\": \"awsui_grid-cell_1mfbn_f3jvf_108\",\n \"day-header\": \"awsui_day-header_1mfbn_f3jvf_115\",\n \"week\": \"awsui_week_1mfbn_f3jvf_125\",\n \"day\": \"awsui_day_1mfbn_f3jvf_115\",\n \"day-inner\": \"awsui_day-inner_1mfbn_f3jvf_172\",\n \"in-first-row\": \"awsui_in-first-row_1mfbn_f3jvf_177\",\n \"in-previous-month\": \"awsui_in-previous-month_1mfbn_f3jvf_177\",\n \"last-day-of-month\": \"awsui_last-day-of-month_1mfbn_f3jvf_181\",\n \"in-next-month\": \"awsui_in-next-month_1mfbn_f3jvf_185\",\n \"in-first-column\": \"awsui_in-first-column_1mfbn_f3jvf_189\",\n \"in-current-month\": \"awsui_in-current-month_1mfbn_f3jvf_192\",\n \"enabled\": \"awsui_enabled_1mfbn_f3jvf_196\",\n \"in-range\": \"awsui_in-range_1mfbn_f3jvf_202\",\n \"end-date\": \"awsui_end-date_1mfbn_f3jvf_202\",\n \"start-date\": \"awsui_start-date_1mfbn_f3jvf_202\",\n \"no-range\": \"awsui_no-range_1mfbn_f3jvf_202\",\n \"selected\": \"awsui_selected_1mfbn_f3jvf_212\",\n \"today\": \"awsui_today_1mfbn_f3jvf_217\",\n \"range-start-date\": \"awsui_range-start-date_1mfbn_f3jvf_262\",\n \"in-range-border-bottom\": \"awsui_in-range-border-bottom_1mfbn_f3jvf_265\",\n \"range-end-date\": \"awsui_range-end-date_1mfbn_f3jvf_268\",\n \"in-range-border-top\": \"awsui_in-range-border-top_1mfbn_f3jvf_271\",\n \"in-range-border-block-start\": \"awsui_in-range-border-block-start_1mfbn_f3jvf_284\",\n \"in-range-border-inline-end\": \"awsui_in-range-border-inline-end_1mfbn_f3jvf_287\",\n \"in-range-border-block-end\": \"awsui_in-range-border-block-end_1mfbn_f3jvf_290\",\n \"in-range-border-inline-start\": \"awsui_in-range-border-inline-start_1mfbn_f3jvf_293\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nexport function hasValue(value: T | null | undefined): value is T {\n return value !== null && value !== undefined;\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { addMonths, isSameMonth, startOfMonth } from 'date-fns';\nimport { DateRangePickerProps } from '../interfaces';\nimport { parseDate } from '../../internal/utils/date-time';\n\nexport function findDateToFocus(\n selected: Date | null,\n baseDate: Date,\n isDateEnabled: DateRangePickerProps.IsDateEnabledFunction\n) {\n if (selected && isDateEnabled(selected) && isSameMonth(selected, baseDate)) {\n return selected;\n }\n const today = new Date();\n if (isDateEnabled(today) && isSameMonth(today, baseDate)) {\n return today;\n }\n if (isDateEnabled(baseDate)) {\n return baseDate;\n }\n return null;\n}\n\nexport function findMonthToDisplay(value: DateRangePickerProps.PendingAbsoluteValue, isSingleGrid: boolean) {\n if (value.start.date) {\n const startDate = parseDate(value.start.date);\n if (isSingleGrid) {\n return startOfMonth(startDate);\n }\n return startOfMonth(addMonths(startDate, 1));\n }\n if (value.end.date) {\n return startOfMonth(parseDate(value.end.date));\n }\n return startOfMonth(Date.now());\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React from 'react';\nimport styles from '../styles.css.js';\nimport { BaseComponentProps } from '../../internal/base-component';\nimport { RangeCalendarI18nStrings } from '../interfaces';\nimport InternalFormField from '../../form-field/internal';\nimport InternalDateInput from '../../date-input/internal';\nimport { TimeInputProps } from '../../time-input/interfaces';\nimport InternalTimeInput from '../../time-input/internal';\nimport { useInternalI18n } from '../../i18n/context.js';\n\ntype I18nStrings = Pick<\n RangeCalendarI18nStrings,\n 'dateTimeConstraintText' | 'startDateLabel' | 'startTimeLabel' | 'endDateLabel' | 'endTimeLabel'\n>;\n\nexport interface RangeInputsProps extends BaseComponentProps {\n startDate: string;\n onChangeStartDate: (value: string) => void;\n startTime: string;\n onChangeStartTime: (value: string) => void;\n endDate: string;\n onChangeEndDate: (value: string) => void;\n endTime: string;\n onChangeEndTime: (value: string) => void;\n i18nStrings?: I18nStrings;\n dateOnly: boolean;\n timeInputFormat: TimeInputProps.Format;\n}\n\nexport default function RangeInputs({\n startDate,\n onChangeStartDate,\n startTime,\n onChangeStartTime,\n endDate,\n onChangeEndDate,\n endTime,\n onChangeEndTime,\n i18nStrings,\n dateOnly,\n timeInputFormat,\n}: RangeInputsProps) {\n const i18n = useInternalI18n('date-range-picker');\n\n return (\n \n
    \n
    \n \n onChangeStartDate(event.detail.value)}\n placeholder=\"YYYY/MM/DD\"\n />\n \n {!dateOnly && (\n \n onChangeStartTime(event.detail.value)}\n format={timeInputFormat}\n placeholder={timeInputFormat}\n className={styles['start-time-input']}\n />\n \n )}\n
    \n\n
    \n \n onChangeEndDate(event.detail.value)}\n placeholder=\"YYYY/MM/DD\"\n />\n \n {!dateOnly && (\n \n onChangeEndTime(event.detail.value)}\n format={timeInputFormat}\n placeholder={timeInputFormat}\n className={styles['end-time-input']}\n />\n \n )}\n
    \n
    \n
    \n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { Ref, useRef } from 'react';\n\nimport useForwardFocus from '../internal/hooks/forward-focus';\n\nimport MaskedInput from '../internal/components/masked-input';\nimport { MaskArgs } from '../internal/components/masked-input/utils/mask-format';\n\nimport { TimeInputProps } from './interfaces';\nimport styles from './styles.css.js';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\n\nconst getMaskArgs = (format: string, use24Hour: boolean): MaskArgs => {\n const segments = [\n use24Hour ? { min: 0, max: 23, length: 2 } : { min: 1, max: 12, length: 2 },\n { min: 0, max: 59, length: 2 },\n { min: 0, max: 59, length: 2 },\n ];\n\n return {\n separator: ':',\n segments: segments.slice(0, format.split(':').length),\n };\n};\n\ntype InternalTimeInputProps = TimeInputProps & InternalBaseComponentProps;\n\nconst InternalTimeInput = React.forwardRef(\n (\n {\n format = 'hh:mm:ss',\n use24Hour = true,\n autoComplete = true,\n __internalRootRef = null,\n ...props\n }: InternalTimeInputProps,\n ref: Ref\n ) => {\n const inputRef = useRef(null);\n useForwardFocus(ref, inputRef);\n\n const maskArgs = getMaskArgs(format, use24Hour);\n\n return (\n \n );\n }\n);\n\nexport default InternalTimeInput;\n", "\n import './styles.scoped.css';\n export default {\n \"root\": \"awsui_root_l809c_im8v7_5\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { useState } from 'react';\nimport { DateRangePickerProps } from '../interfaces';\nimport InternalBox from '../../box/internal';\nimport InternalFormField from '../../form-field/internal';\nimport InternalInput from '../../input/internal';\nimport { RadioGroupProps } from '../../radio-group/interfaces';\nimport InternalRadioGroup from '../../radio-group/internal';\nimport InternalSelect from '../../select/internal';\nimport InternalSpaceBetween from '../../space-between/internal';\nimport styles from './styles.css.js';\nimport { useInternalI18n } from '../../i18n/context';\n\nexport interface RelativeRangePickerProps {\n dateOnly: boolean;\n options: ReadonlyArray;\n initialSelection: DateRangePickerProps.RelativeValue | null;\n onChange: (range: DateRangePickerProps.RelativeValue) => void;\n i18nStrings?: DateRangePickerProps.I18nStrings;\n isSingleGrid: boolean;\n}\n\ninterface UnitSelectOption {\n value: DateRangePickerProps.TimeUnit;\n label: string;\n}\n\nconst dayUnits: ReadonlyArray = ['day', 'week', 'month', 'year'];\nconst units: ReadonlyArray = ['second', 'minute', 'hour', ...dayUnits];\n\nconst CUSTOM_OPTION_SELECT_KEY = 'awsui-internal-custom-duration-key';\n\nexport default function RelativeRangePicker({\n dateOnly,\n options: clientOptions = [],\n initialSelection: initialRange,\n onChange: onChangeRangeSize,\n i18nStrings,\n isSingleGrid,\n}: RelativeRangePickerProps) {\n const i18n = useInternalI18n('date-range-picker');\n const formatRelativeRange = i18n(\n 'i18nStrings.formatRelativeRange',\n i18nStrings?.formatRelativeRange,\n format =>\n ({ amount, unit }) =>\n format({ amount, unit })\n );\n const formatUnit = i18n(\n 'i18nStrings.formatUnit',\n i18nStrings?.formatUnit,\n format => (unit, amount) => format({ amount, unit })\n );\n\n const radioOptions: RadioGroupProps.RadioButtonDefinition[] = clientOptions.map(option => ({\n value: option.key,\n label: formatRelativeRange?.(option),\n }));\n radioOptions.push({\n value: CUSTOM_OPTION_SELECT_KEY,\n label: i18n('i18nStrings.customRelativeRangeOptionLabel', i18nStrings?.customRelativeRangeOptionLabel),\n description: i18n(\n 'i18nStrings.customRelativeRangeOptionDescription',\n i18nStrings?.customRelativeRangeOptionDescription\n ),\n });\n\n const [selectedRadio, setSelectedRadio] = useState(() => {\n if (initialRange && !initialRange.key) {\n return CUSTOM_OPTION_SELECT_KEY;\n }\n return initialRange?.key ?? null;\n });\n\n const [customDuration, setCustomDuration] = useState(() => {\n if (initialRange) {\n return initialRange.amount;\n }\n // NaN represents an empty duration\n return NaN;\n });\n\n const initialCustomTimeUnit = dateOnly ? 'day' : 'minute';\n const [customUnitOfTime, setCustomUnitOfTime] = useState(\n initialRange?.unit ?? initialCustomTimeUnit\n );\n\n const showRadioControl = clientOptions.length > 0;\n const showCustomControls = clientOptions.length === 0 || selectedRadio === CUSTOM_OPTION_SELECT_KEY;\n\n return (\n
    \n \n {showRadioControl && (\n \n {\n setSelectedRadio(detail.value);\n\n if (detail.value === CUSTOM_OPTION_SELECT_KEY) {\n setCustomDuration(NaN);\n setCustomUnitOfTime(initialCustomTimeUnit);\n onChangeRangeSize({\n amount: NaN,\n unit: initialCustomTimeUnit,\n type: 'relative',\n });\n } else {\n const option = clientOptions.filter(o => o.key === detail.value)[0];\n onChangeRangeSize(option);\n }\n }}\n value={selectedRadio}\n items={radioOptions}\n />\n \n )}\n\n {showCustomControls && (\n \n {!showRadioControl && (\n \n {i18n(\n 'i18nStrings.customRelativeRangeOptionDescription',\n i18nStrings?.customRelativeRangeOptionDescription\n )}\n \n )}\n\n \n \n
    \n \n {\n const amount = Number(e.detail.value);\n\n setCustomDuration(amount);\n onChangeRangeSize({ amount, unit: customUnitOfTime, type: 'relative' });\n }}\n placeholder={i18n(\n 'i18nStrings.customRelativeRangeDurationPlaceholder',\n i18nStrings?.customRelativeRangeDurationPlaceholder\n )}\n __inheritFormFieldProps={true}\n />\n \n
    \n\n
    \n \n {\n const { value: unit } = e.detail.selectedOption as UnitSelectOption;\n\n setCustomUnitOfTime(unit);\n onChangeRangeSize({ amount: customDuration, unit, type: 'relative' });\n }}\n options={(dateOnly ? dayUnits : units).map(unit => ({\n value: unit,\n label: formatUnit?.(unit, customDuration),\n }))}\n renderHighlightedAriaLive={option => option.label || option.value || ''}\n />\n \n
    \n
    \n \n \n )}\n \n \n );\n}\n", "\n import './styles.scoped.css';\n export default {\n \"custom-range\": \"awsui_custom-range_16zmw_1bi9d_99\",\n \"custom-range--no-padding\": \"awsui_custom-range--no-padding_16zmw_1bi9d_105\",\n \"custom-range-form-controls\": \"awsui_custom-range-form-controls_16zmw_1bi9d_109\",\n \"custom-range-duration\": \"awsui_custom-range-duration_16zmw_1bi9d_113\",\n \"custom-range-unit\": \"awsui_custom-range-unit_16zmw_1bi9d_114\",\n \"vertical\": \"awsui_vertical_16zmw_1bi9d_120\",\n \"custom-range-duration-input\": \"awsui_custom-range-duration-input_16zmw_1bi9d_131\",\n \"custom-range-unit-select\": \"awsui_custom-range-unit-select_16zmw_1bi9d_132\",\n \"relative-range-radio-group\": \"awsui_relative-range-radio-group_16zmw_1bi9d_136\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { DateRangePickerProps } from './interfaces';\nimport InternalSegmentedControl from '../segmented-control/internal';\n\nimport styles from './styles.css.js';\nimport { useInternalI18n } from '../i18n/context';\n\ninterface ModeSwitcherProps extends Pick {\n mode: 'absolute' | 'relative';\n onChange: (mode: 'absolute' | 'relative') => void;\n}\n\nexport default function ModeSwitcher({ i18nStrings, mode, onChange }: ModeSwitcherProps) {\n const i18n = useInternalI18n('date-range-picker');\n\n return (\n onChange(e.detail.selectedId as 'absolute' | 'relative')}\n />\n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\nimport InternalSelect, { InternalSelectProps } from '../select/internal';\nimport InternalFormField from '../form-field/internal';\nimport { SegmentedControlProps } from './interfaces';\nimport InternalSegmentedControlComponent from './internal-segmented-control';\nimport { getBaseProps } from '../internal/base-component';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport styles from './styles.css.js';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\n\ntype InternalSegmentedControlProps = SegmentedControlProps & InternalBaseComponentProps;\n\nexport default function InternalSegmentedControl({\n selectedId,\n options,\n label,\n ariaLabelledby,\n onChange,\n __internalRootRef = null,\n ...props\n}: InternalSegmentedControlProps) {\n const baseProps = getBaseProps(props);\n\n const selectOptions = (options || []).map(option => {\n const label = option.text || option.iconAlt;\n return { ...option, label, value: option.id };\n });\n\n const selectedOptions = selectOptions.filter(option => {\n return option.value === selectedId;\n });\n const currentSelectedOption = selectedOptions.length ? selectedOptions[0] : null;\n\n const selectProps: InternalSelectProps = {\n options: selectOptions,\n selectedOption: currentSelectedOption,\n triggerVariant: 'option',\n onChange: event => fireNonCancelableEvent(onChange, { selectedId: event.detail.selectedOption.value! }),\n };\n\n return (\n
    \n \n
    \n {ariaLabelledby && }\n {!ariaLabelledby && label && (\n \n \n \n )}\n {!ariaLabelledby && !label && }\n
    \n
    \n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\nimport clsx from 'clsx';\nimport handleKey from '../internal/utils/handle-key';\nimport { KeyCode } from '../internal/keycode';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { SegmentedControlProps } from './interfaces';\nimport { Segment } from './segment';\nimport styles from './styles.css.js';\n\nexport default function InternalSegmentedControl({\n selectedId,\n options,\n label,\n ariaLabelledby,\n onChange,\n}: SegmentedControlProps) {\n const segmentByIdRef = useRef<{ [id: string]: HTMLButtonElement }>({});\n const selectedOptions = (options || []).filter(option => {\n return option.id === selectedId;\n });\n const currentSelectedOption = selectedOptions.length ? selectedOptions[0] : null;\n const enabledSegments = (options || []).filter(option => !option.disabled);\n\n const moveHighlight = (event: React.KeyboardEvent, activeIndex: number) => {\n if (event.keyCode !== KeyCode.right && event.keyCode !== KeyCode.left) {\n return;\n }\n\n let nextIndex = activeIndex;\n\n handleKey(event, {\n onInlineStart: () => (nextIndex = activeIndex === 0 ? enabledSegments.length - 1 : activeIndex - 1),\n onInlineEnd: () => (nextIndex = activeIndex + 1 === enabledSegments.length ? 0 : activeIndex + 1),\n });\n\n const nextSegmentId = enabledSegments[nextIndex].id;\n segmentByIdRef.current[nextSegmentId]?.focus();\n };\n\n return (\n \n {options &&\n options.map((option: SegmentedControlProps.Option, index) => {\n const isActive = selectedId === option.id;\n const enabledSegmentIndex = enabledSegments.indexOf(option);\n let tabIndex = isActive ? 0 : -1;\n if (currentSelectedOption === null && enabledSegmentIndex === 0) {\n tabIndex = 0;\n }\n return (\n {\n if (node) {\n segmentByIdRef.current[option.id] = node;\n } else {\n delete segmentByIdRef.current[option.id];\n }\n }}\n onClick={() => {\n if (selectedId !== option.id) {\n fireNonCancelableEvent(onChange, { selectedId: option.id });\n }\n }}\n onKeyDown={event => moveHighlight(event, enabledSegmentIndex)}\n />\n );\n })}\n \n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\nimport { SegmentedControlProps } from './interfaces';\nimport InternalIcon from '../icon/internal';\nimport styles from './styles.css.js';\n\nexport interface SegmentProps extends SegmentedControlProps.Option {\n onClick: (event: React.MouseEvent) => void;\n onKeyDown: (event: React.KeyboardEvent) => void;\n isActive: boolean;\n tabIndex: number;\n}\n\nexport const Segment = React.forwardRef(\n (\n { disabled, text, iconName, iconAlt, iconUrl, iconSvg, isActive, onClick, onKeyDown, tabIndex }: SegmentProps,\n ref: React.Ref\n ) => {\n return (\n \n {(iconName || iconUrl || iconSvg) && (\n \n )}\n {text}\n \n );\n }\n);\n", "\n import './styles.scoped.css';\n export default {\n \"segment\": \"awsui_segment_8cbea_97spt_103\",\n \"disabled\": \"awsui_disabled_8cbea_97spt_183\",\n \"selected\": \"awsui_selected_8cbea_97spt_191\",\n \"icon\": \"awsui_icon_8cbea_97spt_212\",\n \"with-text\": \"awsui_with-text_8cbea_97spt_216\",\n \"with-no-text\": \"awsui_with-no-text_8cbea_97spt_222\",\n \"root\": \"awsui_root_8cbea_97spt_231\",\n \"segment-part\": \"awsui_segment-part_8cbea_97spt_266\",\n \"select\": \"awsui_select_8cbea_97spt_191\",\n \"segment-count-2\": \"awsui_segment-count-2_8cbea_97spt_285\",\n \"segment-count-3\": \"awsui_segment-count-3_8cbea_97spt_290\",\n \"segment-count-4\": \"awsui_segment-count-4_8cbea_97spt_295\",\n \"segment-count-5\": \"awsui_segment-count-5_8cbea_97spt_300\",\n \"segment-count-6\": \"awsui_segment-count-6_8cbea_97spt_305\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { DateRangePickerProps } from './interfaces';\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\nimport { formatTimeOffsetISO, parseTimezoneOffset, shiftTimezoneOffset } from '../internal/utils/date-time';\nimport { addMinutes } from 'date-fns';\n\n/**\n * Appends a time zone offset to an offset-less date string.\n */\nexport function setTimeOffset(\n value: DateRangePickerProps.Value | null,\n timeOffset: { startDate?: number; endDate?: number }\n): DateRangePickerProps.Value | null {\n if (!(value?.type === 'absolute')) {\n return value;\n }\n return {\n type: 'absolute',\n startDate: value.startDate + formatTimeOffsetISO(value.startDate, timeOffset.startDate),\n endDate: value.endDate + formatTimeOffsetISO(value.endDate, timeOffset.endDate),\n };\n}\n\n/**\n * Re-formats an absolute date range so that it is expressed using the\n * target time offset. The returned value still represents the same range\n * in time, but contains no visible offset.\n */\nexport function shiftTimeOffset(\n value: null | DateRangePickerProps.Value,\n timeOffset: { startDate?: number; endDate?: number }\n): DateRangePickerProps.Value | null {\n if (!value || value.type !== 'absolute') {\n return value;\n }\n\n /*\n This regex matches an ISO date-time with\n - optional seconds;\n - optional milliseconds;\n - optional time offset or 'Z'.\n */\n const dateTimeRegex = /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2})?(\\.\\d{1,3})?(((\\+|-)\\d{2}(:\\d{2})?)|Z)?$/;\n\n if (!dateTimeRegex.test(value.startDate) || !dateTimeRegex.test(value.endDate)) {\n warnOnce(\n 'DateRangePicker',\n 'You have provided a misformatted start or end date. The component will fall back to an empty value. ' +\n 'Dates have to be ISO8601-formatted with an optional time zone offset.'\n );\n return null;\n }\n\n return {\n type: 'absolute',\n startDate: shiftTimezoneOffset(value.startDate, timeOffset.startDate),\n endDate: shiftTimezoneOffset(value.endDate, timeOffset.endDate),\n };\n}\n\nexport function normalizeTimeOffset(\n value: null | DateRangePickerProps.Value,\n getTimeOffset?: DateRangePickerProps.GetTimeOffsetFunction,\n timeOffset?: number\n) {\n if (value && value.type === 'absolute') {\n if (getTimeOffset) {\n return {\n startDate: getTimeOffset(parseDateUTC(value.startDate)),\n endDate: getTimeOffset(parseDateUTC(value.endDate)),\n };\n } else if (timeOffset !== undefined) {\n return { startDate: timeOffset, endDate: timeOffset };\n }\n }\n return { startDate: undefined, endDate: undefined };\n}\n\n/*\n Before the getTimeOffset function is used there is no information on the preferred time offset.\n \n Besides, the ISO date string might or might not contain the offset:\n - 2021-02-03T01:02:03\n - 2021-02-03T01:02:03Z\n - 2021-02-03T01:02:03+01:00\n \n For every value above the date is converted to UTC and the following is true:\n date.getUTCFullYear() === 2021\n date.getUTCMonth() === 1\n date.getUTCDate() === 3\n date.getUTCHours() === 1\n date.getUTCMinutes() === 2\n date.getUTCSeconds() === 3\n*/\nfunction parseDateUTC(isoDateString: string): Date {\n const date = new Date(isoDateString);\n return addMinutes(date, parseTimezoneOffset(isoDateString));\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { DateRangePickerProps } from './interfaces';\nimport { setTimeOffset } from './time-offset';\nimport { joinDateTime, splitDateTime } from '../internal/utils/date-time';\nimport { normalizeTimeString } from '../internal/utils/date-time/join-date-time';\n\nexport function formatValue(\n value: null | DateRangePickerProps.Value,\n { timeOffset, dateOnly }: { timeOffset: { startDate?: number; endDate?: number }; dateOnly: boolean }\n): null | DateRangePickerProps.Value {\n if (!value || value.type === 'relative') {\n return value;\n }\n if (dateOnly) {\n return {\n type: 'absolute',\n startDate: value.startDate.split('T')[0],\n endDate: value.endDate.split('T')[0],\n };\n }\n return setTimeOffset(value, timeOffset);\n}\n\nexport function getDefaultMode(\n value: null | DateRangePickerProps.Value,\n relativeOptions: readonly DateRangePickerProps.RelativeOption[],\n rangeSelectorMode: DateRangePickerProps.RangeSelectorMode\n) {\n if (value && value.type) {\n return value.type;\n }\n if (rangeSelectorMode === 'relative-only') {\n return 'relative';\n }\n if (rangeSelectorMode === 'absolute-only') {\n return 'absolute';\n }\n return relativeOptions.length > 0 ? 'relative' : 'absolute';\n}\n\nexport function splitAbsoluteValue(\n value: null | DateRangePickerProps.AbsoluteValue\n): DateRangePickerProps.PendingAbsoluteValue {\n if (!value) {\n return {\n start: { date: '', time: '' },\n end: { date: '', time: '' },\n };\n }\n return { start: splitDateTime(value.startDate), end: splitDateTime(value.endDate) };\n}\n\nexport function joinAbsoluteValue(\n value: DateRangePickerProps.PendingAbsoluteValue\n): DateRangePickerProps.AbsoluteValue {\n const startTime = normalizeTimeString(value.start.time || '00:00:00');\n const endTime = normalizeTimeString(value.end.time || '23:59:59');\n\n return {\n type: 'absolute',\n startDate: joinDateTime(value.start.date, startTime),\n endDate: joinDateTime(value.end.date, endTime),\n };\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React from 'react';\nimport { getBaseProps } from '../internal/base-component';\nimport InternalStatusIndicator from '../status-indicator/internal';\nimport styles from './styles.css.js';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { DrawerProps } from './interfaces';\nimport LiveRegion from '../internal/components/live-region';\nimport { useInternalI18n } from '../i18n/context';\n\nexport { DrawerProps };\n\nexport default function Drawer({ header, children, loading, i18nStrings, ...restProps }: DrawerProps) {\n const { __internalRootRef } = useBaseComponent('Drawer');\n const baseProps = getBaseProps(restProps);\n const i18n = useInternalI18n('drawer');\n const containerProps = {\n ...baseProps,\n className: clsx(baseProps.className, styles.drawer),\n };\n return loading ? (\n
    \n \n {i18n('i18nStrings.loadingText', i18nStrings?.loadingText)}\n \n
    \n ) : (\n
    \n {header &&
    {header}
    }\n
    {children}
    \n
    \n );\n}\n\napplyDisplayName(Drawer, 'Drawer');\n", "\n import './styles.scoped.css';\n export default {\n \"drawer\": \"awsui_drawer_1sxt8_1oeyq_100\",\n \"header\": \"awsui_header_1sxt8_1oeyq_140\",\n \"test-utils-drawer-content\": \"awsui_test-utils-drawer-content_1sxt8_1oeyq_169\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { ExpandableSectionProps } from './interfaces';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport InternalExpandableSection from './internal';\nimport useBaseComponent from '../internal/hooks/use-base-component';\n\nexport { ExpandableSectionProps };\n\nexport default function ExpandableSection({ variant = 'default', ...props }: ExpandableSectionProps) {\n const baseComponentProps = useBaseComponent('ExpandableSection', {\n props: {\n disableContentPaddings: props.disableContentPaddings,\n headingTagOverride: props.headingTagOverride,\n variant,\n },\n });\n\n return ;\n}\n\napplyDisplayName(ExpandableSection, 'ExpandableSection');\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect } from 'react';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { FlashbarProps } from './interfaces';\nimport CollapsibleFlashbar from './collapsible-flashbar';\nimport NonCollapsibleFlashbar from './non-collapsible-flashbar';\n\nimport { sendRenderMetric } from './internal/analytics';\n\nexport { FlashbarProps };\n\nexport default function Flashbar(props: FlashbarProps) {\n useEffect(() => {\n if (props.items.length > 0) {\n sendRenderMetric(props.items);\n }\n }, [props.items]);\n\n if (props.stackItems) {\n return ;\n } else {\n return ;\n }\n}\n\napplyDisplayName(Flashbar, 'Flashbar');\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { ReactNode, useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';\nimport customCssProps from '../internal/generated/custom-css-properties';\nimport { Flash, focusFlashById } from './flash';\nimport { FlashbarProps } from './interfaces';\nimport InternalIcon from '../icon/internal';\nimport { TransitionGroup } from 'react-transition-group';\nimport { Transition } from '../internal/components/transition';\nimport styles from './styles.css.js';\nimport { counterTypes, getFlashTypeCount, getItemColor, getVisibleCollapsedItems, StackableItem } from './utils';\nimport { animate, getDOMRects } from '../internal/animate';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { IconProps } from '../icon/interfaces';\nimport { sendToggleMetric } from './internal/analytics';\nimport { useFlashbar } from './common';\nimport { throttle } from '../internal/utils/throttle';\nimport { scrollElementIntoView } from '../internal/utils/scrollable-containers';\nimport { findUpUntil } from '../internal/utils/dom';\nimport { useInternalI18n } from '../i18n/context';\nimport { getVisualContextClassname } from '../internal/components/visual-context';\nimport { useEffectOnUpdate } from '../internal/hooks/use-effect-on-update';\n\nexport { FlashbarProps };\n\n// If the number of items is equal or less than this value,\n// the toggle element will not be displayed and the Flashbar will look like a regular single-item Flashbar.\nconst maxNonCollapsibleItems = 1;\n\nconst resizeListenerThrottleDelay = 100;\n\nexport default function CollapsibleFlashbar({ items, ...restProps }: FlashbarProps) {\n const [enteringItems, setEnteringItems] = useState>([]);\n const [exitingItems, setExitingItems] = useState>([]);\n const [isFlashbarStackExpanded, setIsFlashbarStackExpanded] = useState(false);\n\n const getElementsToAnimate = useCallback(() => {\n const flashElements = isFlashbarStackExpanded ? expandedItemRefs.current : collapsedItemRefs.current;\n return { ...flashElements, notificationBar: notificationBarRef.current };\n }, [isFlashbarStackExpanded]);\n\n const prepareAnimations = useCallback(() => {\n const rects = getDOMRects(getElementsToAnimate());\n setInitialAnimationState(rects);\n }, [getElementsToAnimate]);\n\n const { baseProps, breakpoint, isReducedMotion, isVisualRefresh, mergedRef, ref } = useFlashbar({\n items,\n ...restProps,\n onItemsAdded: newItems => {\n setEnteringItems([...enteringItems, ...newItems]);\n },\n onItemsChanged: options => {\n // If not all items have ID, we can still animate collapse/expand transitions\n // because we can rely on each item's index in the original array,\n // but we can't do that when elements are added or removed, since the index changes.\n if (options?.allItemsHaveId && !options?.isReducedMotion) {\n prepareAnimations();\n }\n },\n onItemsRemoved: removedItems => {\n setExitingItems([...exitingItems, ...removedItems]);\n },\n });\n\n const collapsedItemRefs = useRef>({});\n const expandedItemRefs = useRef>({});\n const [initialAnimationState, setInitialAnimationState] = useState | null>(null);\n const listElementRef = useRef(null);\n const notificationBarRef = useRef(null);\n const [transitioning, setTransitioning] = useState(false);\n const flashbarElementId = useUniqueId('flashbar');\n const itemCountElementId = useUniqueId('item-count');\n\n if (items.length <= maxNonCollapsibleItems && isFlashbarStackExpanded) {\n setIsFlashbarStackExpanded(false);\n }\n\n const animateFlash = !isReducedMotion;\n\n function toggleCollapseExpand() {\n sendToggleMetric(items.length, !isFlashbarStackExpanded);\n if (!isReducedMotion) {\n prepareAnimations();\n }\n setIsFlashbarStackExpanded(prev => !prev);\n }\n\n useLayoutEffect(() => {\n if (isFlashbarStackExpanded && items?.length) {\n const mostRecentItem = items[0];\n if (mostRecentItem.id !== undefined) {\n focusFlashById(ref.current, mostRecentItem.id);\n }\n }\n // Run this after expanding, but not every time the items change.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isFlashbarStackExpanded]);\n\n // When collapsing, scroll up if necessary to avoid losing track of the focused button\n useEffectOnUpdate(() => {\n if (!isFlashbarStackExpanded && notificationBarRef.current) {\n scrollElementIntoView(notificationBarRef.current);\n }\n }, [isFlashbarStackExpanded]);\n\n const updateBottomSpacing = useMemo(\n () =>\n throttle(() => {\n // Allow vertical space between Flashbar and page bottom only when the Flashbar is reaching the end of the page,\n // otherwise avoid spacing with eventual sticky elements below.\n const listElement = listElementRef?.current;\n const flashbar = listElement?.parentElement;\n if (listElement && flashbar) {\n // Make sure the bottom padding is present when we make the calculations,\n // then we might decide to remove it or not.\n flashbar.classList.remove(styles.floating);\n const windowHeight = window.innerHeight;\n // Take the parent region into account if using the App Layout, because it might have additional margins.\n // Otherwise we use the Flashbar component for this calculation.\n const outerElement = findUpUntil(flashbar, element => element.getAttribute('role') === 'region') || flashbar;\n const applySpacing =\n isFlashbarStackExpanded && Math.ceil(outerElement.getBoundingClientRect().bottom) >= windowHeight;\n if (!applySpacing) {\n flashbar.classList.add(styles.floating);\n }\n }\n }, resizeListenerThrottleDelay),\n [isFlashbarStackExpanded]\n );\n\n useLayoutEffect(() => {\n window.addEventListener('resize', updateBottomSpacing);\n return () => {\n window.removeEventListener('resize', updateBottomSpacing);\n updateBottomSpacing.cancel();\n };\n }, [updateBottomSpacing]);\n\n const { i18nStrings } = restProps;\n\n const i18n = useInternalI18n('flashbar');\n const ariaLabel = i18n('i18nStrings.ariaLabel', i18nStrings?.ariaLabel);\n const notificationBarText = i18n('i18nStrings.notificationBarText', i18nStrings?.notificationBarText);\n const notificationBarAriaLabel = i18n('i18nStrings.notificationBarAriaLabel', i18nStrings?.notificationBarAriaLabel);\n const iconAriaLabels = {\n errorIconAriaLabel: i18n('i18nStrings.errorIconAriaLabel', i18nStrings?.errorIconAriaLabel),\n inProgressIconAriaLabel: i18n('i18nStrings.inProgressIconAriaLabel', i18nStrings?.inProgressIconAriaLabel),\n infoIconAriaLabel: i18n('i18nStrings.infoIconAriaLabel', i18nStrings?.infoIconAriaLabel),\n successIconAriaLabel: i18n('i18nStrings.successIconAriaLabel', i18nStrings?.successIconAriaLabel),\n warningIconAriaLabel: i18n('i18nStrings.warningIconAriaLabel', i18nStrings?.warningIconAriaLabel),\n };\n\n useLayoutEffect(() => {\n // When `useLayoutEffect` is called, the DOM is updated but has not been painted yet,\n // so it's a good moment to trigger animations that will make calculations based on old and new DOM state.\n // The old state is kept in `initialAnimationState`\n // and the new state can be retrieved from the current DOM elements.\n\n if (initialAnimationState) {\n updateBottomSpacing();\n\n animate({\n elements: getElementsToAnimate(),\n oldState: initialAnimationState,\n newElementInitialState: ({ top }) => ({ scale: 0.9, y: -0.2 * top }),\n onTransitionsEnd: () => setTransitioning(false),\n });\n\n setTransitioning(true);\n setInitialAnimationState(null);\n }\n }, [updateBottomSpacing, getElementsToAnimate, initialAnimationState, isFlashbarStackExpanded]);\n\n const isCollapsible = items.length > maxNonCollapsibleItems;\n\n const countByType = getFlashTypeCount(items);\n\n const numberOfColorsInStack = new Set(items.map(getItemColor)).size;\n const maxSlots = Math.max(numberOfColorsInStack, 3);\n const stackDepth = Math.min(maxSlots, items.length);\n\n const itemsToShow = isFlashbarStackExpanded\n ? items.map((item, index) => ({ ...item, expandedIndex: index }))\n : getVisibleCollapsedItems(items, stackDepth).map((item: StackableItem, index: number) => ({\n ...item,\n collapsedIndex: index,\n }));\n\n const getItemId = (item: StackableItem | FlashbarProps.MessageDefinition) =>\n item.id ?? (item as StackableItem).expandedIndex ?? 0;\n\n // This check allows us to use the standard \"enter\" Transition only when the notification was not existing before.\n // If instead it was moved to the top of the stack but was already present in the array\n // (e.g, after dismissing another notification),\n // we need to use different, more custom and more controlled animations.\n const hasEntered = (item: StackableItem | FlashbarProps.MessageDefinition) =>\n enteringItems.some(_item => _item.id && _item.id === item.id);\n const hasLeft = (item: StackableItem | FlashbarProps.MessageDefinition) => !('expandedIndex' in item);\n const hasEnteredOrLeft = (item: StackableItem | FlashbarProps.MessageDefinition) => hasEntered(item) || hasLeft(item);\n\n const showInnerContent = (item: StackableItem | FlashbarProps.MessageDefinition) =>\n isFlashbarStackExpanded || hasLeft(item) || ('expandedIndex' in item && item.expandedIndex === 0);\n\n const shouldUseStandardAnimation = (item: StackableItem, index: number) => index === 0 && hasEnteredOrLeft(item);\n\n const getAnimationElementId = (item: StackableItem) => `flash-${getItemId(item)}`;\n\n const renderList = () => (\n \n \n {itemsToShow.map((item: StackableItem, index: number) => (\n {\n if (status === 'entered') {\n setEnteringItems([]);\n } else if (status === 'exited') {\n setExitingItems([]);\n }\n }}\n >\n {(state: string, transitionRootElement: React.Ref | undefined) => (\n {\n if (isFlashbarStackExpanded) {\n expandedItemRefs.current[getAnimationElementId(item)] = element;\n } else {\n collapsedItemRefs.current[getAnimationElementId(item)] = element;\n }\n }}\n style={\n !isFlashbarStackExpanded || transitioning\n ? {\n [customCssProps.flashbarStackIndex]:\n (item as StackableItem).collapsedIndex ?? (item as StackableItem).expandedIndex ?? index,\n }\n : undefined\n }\n key={getItemId(item)}\n >\n {showInnerContent(item) && (\n \n )}\n \n )}\n
    \n ))}\n \n \n );\n\n return (\n \n {isFlashbarStackExpanded && renderList()}\n {isCollapsible && (\n \n \n {notificationBarText &&

    {notificationBarText}

    }\n \n {counterTypes.map(({ type, labelName, iconName }) => (\n \n ))}\n \n
    \n \n \n \n \n )}\n {!isFlashbarStackExpanded && renderList()}\n \n );\n}\n\nconst NotificationTypeCount = ({\n iconName,\n label,\n count,\n}: {\n iconName: IconProps.Name;\n label?: string;\n count: number;\n}) => {\n return (\n \n \n \n \n \n \n {count}\n \n );\n};\n\nconst ListWrapper = ({ children, withMotion }: { children: ReactNode; withMotion: boolean }) =>\n withMotion ? {children} : <>{children};\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { FlashbarProps } from './interfaces';\nimport React from 'react';\nimport InternalSpinner from '../spinner/internal';\nimport InternalIcon from '../icon/internal';\nimport clsx from 'clsx';\nimport styles from './styles.css.js';\nimport { InternalButton } from '../button/internal';\nimport { useComponentMetadata, warnOnce } from '@cloudscape-design/component-toolkit/internal';\nimport { isDevelopment } from '../internal/is-development';\nimport { throttle } from '../internal/utils/throttle';\nimport LiveRegion from '../internal/components/live-region';\nimport { ButtonProps } from '../button/interfaces';\nimport { getVisualContextClassname } from '../internal/components/visual-context';\n\nimport { sendDismissMetric } from './internal/analytics';\n\nimport { FOCUS_THROTTLE_DELAY } from './utils';\nimport { DATA_ATTR_ANALYTICS_FLASHBAR } from '../internal/analytics/selectors';\nimport { createUseDiscoveredAction } from '../internal/plugins/helpers';\nimport { awsuiPluginsInternal } from '../internal/plugins/api';\nimport { ActionsWrapper } from '../alert/actions-wrapper';\nimport { BasePropsWithAnalyticsMetadata, getAnalyticsMetadataProps } from '../internal/base-component';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { PACKAGE_VERSION } from '../internal/environment';\n\nconst ICON_TYPES = {\n success: 'status-positive',\n warning: 'status-warning',\n info: 'status-info',\n error: 'status-negative',\n 'in-progress': 'status-in-progress',\n} as const;\n\nconst useDiscoveredAction = createUseDiscoveredAction(awsuiPluginsInternal.flashbar.onActionRegistered);\n\nfunction dismissButton(\n dismissLabel: FlashbarProps.MessageDefinition['dismissLabel'],\n onDismiss: FlashbarProps.MessageDefinition['onDismiss']\n) {\n return (\n
    \n \n
    \n );\n}\n\nexport const focusFlashById = throttle(\n (element: HTMLElement | null, itemId: string) => {\n const selector = `[data-itemid=\"${CSS.escape(itemId)}\"] .${styles['flash-focus-container']}`;\n element?.querySelector(selector)?.focus();\n },\n FOCUS_THROTTLE_DELAY,\n { trailing: false }\n);\n\nexport interface FlashProps extends FlashbarProps.MessageDefinition {\n className: string;\n transitionState?: string;\n i18nStrings?: FlashbarProps.I18nStrings;\n}\n\nexport const Flash = React.forwardRef(\n (\n {\n id,\n header,\n content,\n dismissible,\n dismissLabel,\n loading,\n action,\n buttonText,\n onButtonClick,\n onDismiss,\n className,\n transitionState,\n ariaRole,\n i18nStrings,\n type = 'info',\n ...props\n }: FlashProps,\n ref: React.Ref\n ) => {\n if (isDevelopment) {\n if (buttonText && !onButtonClick) {\n warnOnce(\n 'Flashbar',\n `You provided a \\`buttonText\\` prop without an \\`onButtonClick\\` handler. This will render a non-interactive action button.`\n );\n }\n\n if (dismissible && !onDismiss) {\n warnOnce(\n 'Flashbar',\n `You have set the \\`dismissible\\` prop without an \\`onDismiss\\` handler. This will render a non-interactive dismiss button.`\n );\n }\n }\n\n const analyticsMetadata = getAnalyticsMetadataProps(props as BasePropsWithAnalyticsMetadata);\n const elementRef = useComponentMetadata('Flash', PACKAGE_VERSION, { ...analyticsMetadata });\n const mergedRef = useMergeRefs(ref, elementRef);\n const { discoveredActions, headerRef, contentRef } = useDiscoveredAction(type);\n\n const iconType = ICON_TYPES[type];\n\n const icon = loading ? : ;\n\n const effectiveType = loading ? 'info' : type;\n\n const handleDismiss: ButtonProps['onClick'] = event => {\n sendDismissMetric(effectiveType);\n onDismiss && onDismiss(event);\n };\n\n const analyticsAttributes = {\n [DATA_ATTR_ANALYTICS_FLASHBAR]: effectiveType,\n };\n\n const statusIconAriaLabel =\n props.statusIconAriaLabel ||\n i18nStrings?.[`${loading || type === 'in-progress' ? 'inProgress' : type}IconAriaLabel`];\n\n return (\n // We're not using \"polite\" or \"assertive\" here, just turning default behavior off.\n // eslint-disable-next-line @cloudscape-design/prefer-live-region\n \n
    \n
    \n \n {icon}\n
    \n
    \n
    \n {header}\n
    \n
    \n {content}\n
    \n
    \n
    \n \n \n {dismissible && dismissButton(dismissLabel, handleDismiss)}\n {ariaRole === 'status' && }\n \n );\n }\n);\n", "\n import './styles.scoped.css';\n export default {\n \"flash-with-motion\": \"awsui_flash-with-motion_1q84n_pgrle_99\",\n \"enter\": \"awsui_enter_1q84n_pgrle_99\",\n \"flash-body\": \"awsui_flash-body_1q84n_pgrle_113\",\n \"flash-message\": \"awsui_flash-message_1q84n_pgrle_113\",\n \"flash-header\": \"awsui_flash-header_1q84n_pgrle_113\",\n \"flash-content\": \"awsui_flash-content_1q84n_pgrle_114\",\n \"action-button-wrapper\": \"awsui_action-button-wrapper_1q84n_pgrle_115\",\n \"dismiss-button-wrapper\": \"awsui_dismiss-button-wrapper_1q84n_pgrle_116\",\n \"flash-icon\": \"awsui_flash-icon_1q84n_pgrle_139\",\n \"entering\": \"awsui_entering_1q84n_pgrle_152\",\n \"entered\": \"awsui_entered_1q84n_pgrle_173\",\n \"exiting\": \"awsui_exiting_1q84n_pgrle_278\",\n \"stack\": \"awsui_stack_1q84n_pgrle_300\",\n \"animation-running\": \"awsui_animation-running_1q84n_pgrle_300\",\n \"item\": \"awsui_item_1q84n_pgrle_300\",\n \"flash-list-item\": \"awsui_flash-list-item_1q84n_pgrle_301\",\n \"notification-bar\": \"awsui_notification-bar_1q84n_pgrle_302\",\n \"collapsed\": \"awsui_collapsed_1q84n_pgrle_322\",\n \"animation-ready\": \"awsui_animation-ready_1q84n_pgrle_322\",\n \"expanded-only\": \"awsui_expanded-only_1q84n_pgrle_322\",\n \"expanded\": \"awsui_expanded_1q84n_pgrle_322\",\n \"flash\": \"awsui_flash_1q84n_pgrle_99\",\n \"collapsible\": \"awsui_collapsible_1q84n_pgrle_386\",\n \"short-list\": \"awsui_short-list_1q84n_pgrle_392\",\n \"visual-refresh\": \"awsui_visual-refresh_1q84n_pgrle_392\",\n \"status\": \"awsui_status_1q84n_pgrle_605\",\n \"header\": \"awsui_header_1q84n_pgrle_605\",\n \"item-count\": \"awsui_item-count_1q84n_pgrle_606\",\n \"button\": \"awsui_button_1q84n_pgrle_607\",\n \"type-count\": \"awsui_type-count_1q84n_pgrle_640\",\n \"count-number\": \"awsui_count-number_1q84n_pgrle_640\",\n \"icon\": \"awsui_icon_1q84n_pgrle_674\",\n \"floating\": \"awsui_floating_1q84n_pgrle_715\",\n \"flashbar\": \"awsui_flashbar_1q84n_pgrle_723\",\n \"flash-refresh\": \"awsui_flash-refresh_1q84n_pgrle_798\",\n \"flash-list\": \"awsui_flash-list_1q84n_pgrle_301\",\n \"flash-focus-container\": \"awsui_flash-focus-container_1q84n_pgrle_819\",\n \"flash-text\": \"awsui_flash-text_1q84n_pgrle_849\",\n \"dismiss-button\": \"awsui_dismiss-button_1q84n_pgrle_116\",\n \"breakpoint-default\": \"awsui_breakpoint-default_1q84n_pgrle_891\",\n \"action-button\": \"awsui_action-button_1q84n_pgrle_115\",\n \"action-slot\": \"awsui_action-slot_1q84n_pgrle_901\",\n \"flash-type-success\": \"awsui_flash-type-success_1q84n_pgrle_905\",\n \"flash-type-error\": \"awsui_flash-type-error_1q84n_pgrle_909\",\n \"flash-type-info\": \"awsui_flash-type-info_1q84n_pgrle_913\",\n \"flash-type-in-progress\": \"awsui_flash-type-in-progress_1q84n_pgrle_914\",\n \"flash-type-warning\": \"awsui_flash-type-warning_1q84n_pgrle_918\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { FlashbarProps } from './interfaces';\nimport { IconProps } from '../icon/interfaces';\n\nexport const FOCUS_THROTTLE_DELAY = 2000;\n\n// Since the position of a notification changes when the Flashbar is collapsed,\n// it is useful on some situations (e.g, for animating) to know the original position of the item\n// in the non-collapsed state.\nexport interface StackableItem extends FlashbarProps.MessageDefinition {\n expandedIndex: number;\n collapsedIndex?: number;\n}\n\nconst typesToColors: Record = {\n error: 'red',\n info: 'blue',\n 'in-progress': 'blue',\n success: 'green',\n warning: 'yellow',\n};\n\nfunction getColorFromType(type?: FlashbarProps.Type): string {\n const defaultColor = 'blue';\n return type ? typesToColors[type] || defaultColor : defaultColor;\n}\n\nexport function getItemType(item: FlashbarProps.MessageDefinition) {\n if (item.loading) {\n return 'in-progress';\n } else {\n return item.type || 'info';\n }\n}\n\nexport function getItemColor(item: FlashbarProps.MessageDefinition) {\n return getColorFromType(getItemType(item));\n}\n\n/*\n Returns a selection of notifications, preserving the order when possible but making sure that all different colors in\n the stack are represented in the returned array.\n The order corresponds to how they are represented when using the collapsible feature (newest first, oldest last).\n */\nexport function getVisibleCollapsedItems(\n items: ReadonlyArray,\n desiredLength: number\n): ReadonlyArray {\n // First `desiredLength` items in the original array,\n // together with `isColorRepeated` to tell if they can be subject to be replaced later on if necessary\n const itemsOnTop: { item: StackableItem; isColorRepeated: boolean }[] = [];\n\n // Items that fall outside `desiredIndexLength` but need to be \"promoted\" if possible\n // because they are of a different color which otherwise wouldn't be represented\n const itemsToPromote: StackableItem[] = [];\n\n const addedColors: Set = new Set();\n const allPossibleColors = Object.keys(typesToColors).length;\n const finalLength = Math.min(items.length, desiredLength);\n\n for (let i = 0; i < items.length; i++) {\n const item = items[i];\n const color = getItemColor(item);\n const isColorRepeated = addedColors.has(color);\n if (i < finalLength) {\n itemsOnTop.push({ item: { ...item, expandedIndex: i }, isColorRepeated });\n } else {\n if (addedColors.size === allPossibleColors) {\n // No need to keep looking for unrepresented colors, we can stop looping\n break;\n } else if (!isColorRepeated) {\n itemsToPromote.push({ ...item, expandedIndex: i });\n }\n }\n addedColors.add(color);\n }\n // Generate the new array with the selected items, by picking from both arrays.\n // First, from the non-repeated items within the desired length...\n // We loop `itemsOnTop` starting from the end because we prefer to preserve the first ones rather than the old ones\n const reversedInitialSelection = [];\n let slotsReservedForPromotions = 0;\n for (let j = itemsOnTop.length - 1; j >= 0; j--) {\n const item = itemsOnTop[j];\n if (item.isColorRepeated && slotsReservedForPromotions < itemsToPromote.length) {\n slotsReservedForPromotions += 1;\n } else {\n reversedInitialSelection.push(item.item);\n }\n }\n const selectedItems = reversedInitialSelection.reverse();\n // ...and then complete the selection with as many promotable items as we can fit in the rest of the array\n for (let k = 0; selectedItems.length < desiredLength; k++) {\n selectedItems.push(itemsToPromote[k]);\n }\n return selectedItems;\n}\n\nexport function getFlashTypeCount(\n items: readonly FlashbarProps.MessageDefinition[]\n): Record {\n const count = { error: 0, info: 0, 'in-progress': 0, success: 0, warning: 0 };\n for (const item of items) {\n const type = getItemType(item);\n count[type] += 1;\n }\n return count;\n}\n\nexport type LabelName =\n | 'errorIconAriaLabel'\n | 'warningIconAriaLabel'\n | 'successIconAriaLabel'\n | 'infoIconAriaLabel'\n | 'inProgressIconAriaLabel';\n\nexport const counterTypes: {\n type: FlashbarProps.Type;\n labelName: LabelName;\n iconName: IconProps.Name;\n}[] = [\n { type: 'error', labelName: 'errorIconAriaLabel', iconName: 'status-negative' },\n { type: 'warning', labelName: 'warningIconAriaLabel', iconName: 'status-warning' },\n { type: 'success', labelName: 'successIconAriaLabel', iconName: 'status-positive' },\n { type: 'info', labelName: 'infoIconAriaLabel', iconName: 'status-info' },\n { type: 'in-progress', labelName: 'inProgressIconAriaLabel', iconName: 'status-in-progress' },\n];\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { PACKAGE_SOURCE, PACKAGE_VERSION } from '../../internal/environment';\nimport { Metrics } from '@cloudscape-design/component-toolkit/internal';\nimport { FlashbarProps } from '../interfaces';\nimport { getFlashTypeCount } from '../utils';\n\nconst metrics = new Metrics(PACKAGE_SOURCE, PACKAGE_VERSION);\nconst eventContext = 'csa_flashbar';\n\nexport const sendRenderMetric = (items: FlashbarProps['items']) => {\n const countByType = getFlashTypeCount(items);\n\n metrics.sendPanoramaMetric({\n eventContext,\n eventType: 'render',\n eventValue: items.length.toString(),\n eventDetail: countByType,\n });\n};\n\nexport const sendToggleMetric = (itemsCount: number, expanded: boolean) => {\n metrics.sendPanoramaMetric({\n eventContext,\n eventType: expanded ? 'expand' : 'collapse',\n eventValue: itemsCount.toString(),\n });\n};\n\nexport const sendDismissMetric = (itemType: string) => {\n metrics.sendPanoramaMetric({\n eventContext,\n eventType: 'dismiss',\n eventValue: itemType,\n });\n};\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nexport function getDOMRects(elements: Record) {\n const rects: Record = {};\n for (const id in elements) {\n const element = elements[id];\n if (element) {\n rects[id] = element.getBoundingClientRect();\n }\n }\n return rects;\n}\n\n/*\n Animate DOM elements based on the FLIP technique\n - https://aerotwist.com/blog/flip-your-animations/\n - https://css-tricks.com/animating-layouts-with-the-flip-technique/\n\n This can be useful when the initial dimensions or position of the element is not known,\n so the initial offset or scaling needs to be retrieved via JS.\n\n Caveat: this currently does not support elements having CSS transforms in the end state.\n These would be overridden in the animation instead of combined.\n */\nexport function animate({\n oldState,\n elements,\n onTransitionsEnd,\n newElementInitialState,\n}: {\n elements: Record;\n oldState: Record;\n onTransitionsEnd?: () => void;\n newElementInitialState?: (newRect: DOMRect) => { scale?: number; y?: number };\n}) {\n // First, apply the transform that will make the elements \"look like\" in the start position\n for (const id in elements) {\n const element = elements[id];\n const oldRect = oldState[id];\n if (element) {\n const newRect = element.getBoundingClientRect();\n const noOpTransform = { scale: 1, x: 0, y: 0 };\n // Calculate initial position.\n // If the element didn't exist previously, use the newElementInitialState function if provided.\n // If not, default to no transitions (scale: 1, y: 0)\n const calculatedInverseTransform = oldRect\n ? {\n scale: oldRect.width / newRect.width,\n x: (oldRect.left + oldRect.right) / 2 - (newRect.left + newRect.right) / 2,\n y: (oldRect.top + oldRect.bottom) / 2 - (newRect.top + newRect.bottom) / 2,\n }\n : newElementInitialState\n ? newElementInitialState(newRect)\n : {};\n const inverseTransform = { ...noOpTransform, ...calculatedInverseTransform };\n // Apply this initial change, without animating\n element.style.transitionProperty = 'none';\n element.style.transform = `scale(${inverseTransform.scale}) translate(${inverseTransform.x}px, ${inverseTransform.y}px)`;\n if (!oldRect) {\n // If the element didn't exist, then fade it in\n // (besides any other possibly defined transitions based on `newElementInitialState`)\n element.style.opacity = '0';\n }\n }\n }\n\n // Animate from the initial state to the end state\n requestAnimationFrame(() => {\n const ongoingAnimations = new Set();\n for (const id in elements) {\n const element = elements[id];\n if (element) {\n const oldRect = oldState[id];\n if (oldRect) {\n // Animate from here on\n element.style.transitionProperty = `transform`;\n // Unset inline CSS transforms so that the final state is applied\n element.style.transform = '';\n } else {\n // If the element didn't exist previously, fade in as well\n element.style.transitionProperty = `transform, opacity`;\n element.style.transform = '';\n element.style.opacity = '';\n }\n const onTransitionStart = (event: TransitionEvent) => {\n if (event.target === element) {\n ongoingAnimations.add(id);\n element.removeEventListener('transitionstart', onTransitionStart);\n }\n };\n const onTransitionEnd = (event: TransitionEvent) => {\n if (event.target === element) {\n // Clean up remaining inline styles\n element.style.transitionProperty = '';\n element.removeEventListener('transitionstart', onTransitionEnd);\n if (onTransitionsEnd) {\n ongoingAnimations.delete(id);\n if (ongoingAnimations.size === 0) {\n onTransitionsEnd();\n }\n }\n }\n };\n element.addEventListener('transitionstart', onTransitionStart);\n element.addEventListener('transitionend', onTransitionEnd);\n }\n }\n });\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { useEffect, useMemo, useRef, useState } from 'react';\nimport { useContainerBreakpoints } from '../internal/hooks/container-queries';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { getBaseProps } from '../internal/base-component';\nimport { FlashbarProps } from './interfaces';\nimport { focusFlashById } from './flash';\nimport { isDevelopment } from '../internal/is-development';\nimport { useReducedMotion, warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\n// Common logic for collapsible and non-collapsible Flashbar\nexport function useFlashbar({\n items,\n onItemsAdded,\n onItemsChanged,\n onItemsRemoved,\n ...restProps\n}: FlashbarProps & {\n onItemsAdded?: (items: FlashbarProps.MessageDefinition[]) => void;\n onItemsRemoved?: (items: FlashbarProps.MessageDefinition[]) => void;\n onItemsChanged?: (options?: { allItemsHaveId?: boolean; isReducedMotion?: boolean }) => void;\n}) {\n const { __internalRootRef } = useBaseComponent('Flashbar', {\n props: { stackItems: restProps.stackItems },\n });\n const allItemsHaveId = useMemo(() => items.every(item => 'id' in item), [items]);\n const baseProps = getBaseProps(restProps);\n const ref = useRef(null);\n const [breakpoint, breakpointRef] = useContainerBreakpoints(['xs']);\n const mergedRef = useMergeRefs(ref, breakpointRef, __internalRootRef);\n const isReducedMotion = useReducedMotion(ref);\n const isVisualRefresh = useVisualRefresh();\n const [previousItems, setPreviousItems] = useState>(items);\n const [nextFocusId, setNextFocusId] = useState(null);\n\n if (isDevelopment) {\n if (items?.some(item => item.ariaRole === 'alert' && !item.id)) {\n warnOnce(\n 'Flashbar',\n `You provided \\`ariaRole=\"alert\"\\` for a flashbar item without providing an \\`id\\`. Focus will not be moved to the newly added flash message.`\n );\n }\n }\n\n // Track new or removed item IDs in state to only trigger focus changes for newly added items.\n // https://reactjs.org/docs/hooks-faq.html#how-do-i-implement-getderivedstatefromprops\n if (items) {\n const newItems = items.filter(({ id }) => id && !previousItems.some(item => item.id === id));\n const removedItems = previousItems.filter(({ id }) => id && !items.some(item => item.id === id));\n if (newItems.length > 0 || removedItems.length > 0) {\n setPreviousItems(items);\n onItemsAdded?.(newItems);\n onItemsRemoved?.(removedItems);\n onItemsChanged?.({ allItemsHaveId, isReducedMotion });\n\n const newFocusItems = newItems.filter(({ ariaRole }) => ariaRole === 'alert');\n if (newFocusItems.length > 0) {\n setNextFocusId(newFocusItems[0].id!);\n }\n }\n }\n\n useEffect(() => {\n if (nextFocusId) {\n focusFlashById(ref.current, nextFocusId);\n }\n }, [nextFocusId, ref]);\n\n return {\n allItemsHaveId,\n baseProps,\n breakpoint,\n isReducedMotion,\n isVisualRefresh,\n mergedRef,\n ref,\n };\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React from 'react';\nimport { Flash } from './flash';\nimport { FlashbarProps } from './interfaces';\nimport { TIMEOUT_FOR_ENTERING_ANIMATION } from './constant';\nimport { TransitionGroup } from 'react-transition-group';\nimport { Transition } from '../internal/components/transition';\n\nimport styles from './styles.css.js';\nimport { useFlashbar } from './common';\nimport { useInternalI18n } from '../i18n/context';\n\nexport { FlashbarProps };\n\nexport default function NonCollapsibleFlashbar({ items, i18nStrings, ...restProps }: FlashbarProps) {\n const { allItemsHaveId, baseProps, breakpoint, isReducedMotion, isVisualRefresh, mergedRef } = useFlashbar({\n items,\n ...restProps,\n });\n\n const i18n = useInternalI18n('flashbar');\n const ariaLabel = i18n('i18nStrings.ariaLabel', i18nStrings?.ariaLabel);\n const iconAriaLabels = {\n errorIconAriaLabel: i18n('i18nStrings.errorIconAriaLabel', i18nStrings?.errorIconAriaLabel),\n inProgressIconAriaLabel: i18n('i18nStrings.inProgressIconAriaLabel', i18nStrings?.inProgressIconAriaLabel),\n infoIconAriaLabel: i18n('i18nStrings.infoIconAriaLabel', i18nStrings?.infoIconAriaLabel),\n successIconAriaLabel: i18n('i18nStrings.successIconAriaLabel', i18nStrings?.successIconAriaLabel),\n warningIconAriaLabel: i18n('i18nStrings.warningIconAriaLabel', i18nStrings?.warningIconAriaLabel),\n };\n\n /**\n * All the flash items should have ids so we can identify which DOM element is being\n * removed from the DOM to animate it. Motion will be disabled if any of the provided\n * flash messages does not contain an `id`.\n */\n const motionDisabled = isReducedMotion || !isVisualRefresh || !allItemsHaveId;\n\n const animateFlash = !isReducedMotion && isVisualRefresh;\n /**\n * If the flashbar is flat and motion is `enabled` then the adding and removing of items\n * from the flashbar will render with visual transitions.\n */\n function renderFlatItemsWithTransitions() {\n if (motionDisabled || !items) {\n return;\n }\n\n return (\n // This is a proxy for
      , so we're not applying a class to another actual component.\n // eslint-disable-next-line react/forbid-component-props\n \n {items.map((item, index) => (\n \n {(state: string, transitionRootElement: React.Ref | undefined) => (\n
    • \n {renderItem(item, item.id ?? index, transitionRootElement, state)}\n
    • \n )}\n \n ))}\n
      \n );\n }\n\n /**\n * If the flashbar is flat and motion is `disabled` then the adding and removing of items\n * from the flashbar will render without visual transitions.\n */\n function renderFlatItemsWithoutTransitions() {\n if (!motionDisabled || !items) {\n return;\n }\n\n return (\n
        \n {items.map((item, index) => (\n
      • \n {renderItem(item, item.id ?? index)}\n
      • \n ))}\n
      \n );\n }\n\n /**\n * This is a shared render function for a single flashbar item to be used\n * by the stacking, motion, and non-motion item group render functions.\n */\n function renderItem(\n item: FlashbarProps.MessageDefinition,\n key: string | number,\n transitionRootElement?: React.Ref | undefined,\n transitionState?: string | undefined\n ) {\n return (\n \n );\n }\n\n return (\n \n {renderFlatItemsWithTransitions()}\n {renderFlatItemsWithoutTransitions()}\n \n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * This is a delay that delays the `entering` transition state\n * for the flashbar to be executed, this is useful for:\n * - If a flashbar is exiting and another is entering at the same time we'd want to delay the entering to\n * prevent the jumping in the layout\n * The current animation time for the exiting can be found in motion.scss which is equivilant to 115ms,\n * if in the future this value is changed for the exiting animation we'll have to change this as well to match it\n */\nexport const TIMEOUT_FOR_ENTERING_ANIMATION = 115;\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { FormProps } from './interfaces';\nimport InternalForm from './internal';\nimport useBaseComponent from '../internal/hooks/use-base-component';\n\nimport { AnalyticsFunnel, AnalyticsFunnelStep } from '../internal/analytics/components/analytics-funnel';\nimport { ButtonContext, ButtonContextProps } from '../internal/context/button-context';\nimport { useFunnel, useFunnelNameSelector, useFunnelStep } from '../internal/analytics/hooks/use-funnel';\n\nimport formStyles from './styles.css.js';\nimport headerStyles from '../header/styles.css.js';\nimport { BasePropsWithAnalyticsMetadata, getAnalyticsMetadataProps } from '../internal/base-component';\n\nexport { FormProps };\n\nconst FormWithAnalytics = ({ variant = 'full-page', actions, ...props }: FormProps) => {\n const { funnelProps, funnelSubmit, funnelNextOrSubmitAttempt } = useFunnel();\n const { funnelStepProps } = useFunnelStep();\n\n const handleActionButtonClick: ButtonContextProps['onClick'] = ({ variant }) => {\n if (variant === 'primary') {\n funnelNextOrSubmitAttempt();\n funnelSubmit();\n }\n };\n\n return (\n \n \n \n );\n};\n\nexport default function Form({ variant = 'full-page', ...props }: FormProps) {\n const analyticsMetadata = getAnalyticsMetadataProps(props as BasePropsWithAnalyticsMetadata);\n const baseComponentProps = useBaseComponent('Form', { props: { variant } }, analyticsMetadata);\n const inheritedFunnelNameSelector = useFunnelNameSelector();\n const funnelNameSelector = inheritedFunnelNameSelector || `.${headerStyles['heading-text']}`;\n\n return (\n \n \n \n \n \n );\n}\n\napplyDisplayName(Form, 'Form');\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect } from 'react';\nimport clsx from 'clsx';\nimport { getBaseProps } from '../internal/base-component';\nimport InternalAlert from '../alert/internal';\nimport InternalBox from '../box/internal';\nimport InternalContentLayout from '../content-layout/internal';\nimport styles from './styles.css.js';\nimport { FormLayoutProps, FormProps } from './interfaces';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport LiveRegion from '../internal/components/live-region';\nimport { useInternalI18n } from '../i18n/context';\n\nimport { useFunnel } from '../internal/analytics/hooks/use-funnel';\nimport { FunnelMetrics } from '../internal/analytics';\n\ntype InternalFormProps = FormProps & InternalBaseComponentProps;\n\nexport default function InternalForm({\n children,\n header,\n errorText,\n errorIconAriaLabel: errorIconAriaLabelOverride,\n actions,\n secondaryActions,\n variant,\n __internalRootRef,\n ...props\n}: InternalFormProps) {\n const baseProps = getBaseProps(props);\n const i18n = useInternalI18n('form');\n const errorIconAriaLabel = i18n('errorIconAriaLabel', errorIconAriaLabelOverride);\n\n const { funnelInteractionId, submissionAttempt, errorCount } = useFunnel();\n\n useEffect(() => {\n if (funnelInteractionId && errorText) {\n errorCount.current++;\n FunnelMetrics.funnelError({ funnelInteractionId });\n return () => {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n errorCount.current--;\n };\n }\n }, [funnelInteractionId, errorText, submissionAttempt, errorCount]);\n\n return (\n
      \n {header}
      \n }\n variant={variant}\n >\n {children &&
      {children}
      }\n {errorText && (\n \n \n
      {errorText}
      \n
      \n
      \n )}\n {(actions || secondaryActions) && (\n
      \n
      \n {actions &&
      {actions}
      }\n {secondaryActions &&
      {secondaryActions}
      }\n
      \n
      \n )}\n {errorText && (\n \n {errorIconAriaLabel}, {errorText}\n \n )}\n \n \n );\n}\n\nfunction FormLayout({ children, header, variant }: FormLayoutProps) {\n return variant === 'full-page' && header ? (\n {children}\n ) : (\n <>\n {header}\n {children}\n \n );\n}\n", "\n import './styles.scoped.css';\n export default {\n \"root\": \"awsui_root_1i0s3_19kut_99\",\n \"header\": \"awsui_header_1i0s3_19kut_134\",\n \"full-page\": \"awsui_full-page_1i0s3_19kut_134\",\n \"content\": \"awsui_content_1i0s3_19kut_138\",\n \"error\": \"awsui_error_1i0s3_19kut_142\",\n \"footer\": \"awsui_footer_1i0s3_19kut_146\",\n \"actions-section\": \"awsui_actions-section_1i0s3_19kut_150\",\n \"secondary-actions\": \"awsui_secondary-actions_1i0s3_19kut_159\",\n \"actions\": \"awsui_actions_1i0s3_19kut_150\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { getBaseProps } from '../internal/base-component';\nimport InternalGrid from './internal';\nimport { GridProps } from './interfaces';\nimport { useContainerBreakpoints } from '../internal/hooks/container-queries';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport useBaseComponent from '../internal/hooks/use-base-component';\n\nexport { GridProps };\n\nexport default function Grid({ gridDefinition = [], disableGutters = false, children, ...restProps }: GridProps) {\n const baseComponentProps = useBaseComponent('Grid', {\n props: { disableGutters },\n });\n const baseProps = getBaseProps(restProps);\n const [breakpoint, ref] = useContainerBreakpoints(undefined);\n\n return (\n \n {children}\n \n );\n}\n\napplyDisplayName(Grid, 'Grid');\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React from 'react';\nimport { getBaseProps } from '../internal/base-component';\nimport InternalStatusIndicator from '../status-indicator/internal';\nimport styles from './styles.css.js';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { HelpPanelProps } from './interfaces';\nimport LiveRegion from '../internal/components/live-region';\nimport { useInternalI18n } from '../i18n/context';\nimport { LinkDefaultVariantContext } from '../internal/context/link-default-variant-context';\n\nexport { HelpPanelProps };\n\nexport default function HelpPanel({ header, footer, children, loading, loadingText, ...restProps }: HelpPanelProps) {\n const { __internalRootRef } = useBaseComponent('HelpPanel');\n const baseProps = getBaseProps(restProps);\n const i18n = useInternalI18n('help-panel');\n const containerProps = {\n ...baseProps,\n className: clsx(baseProps.className, styles['help-panel']),\n };\n return loading ? (\n
      \n \n {i18n('loadingText', loadingText)}\n \n
      \n ) : (\n
      \n {header &&
      {header}
      }\n \n
      {children}
      \n
      \n {footer &&
      {footer}
      }\n
      \n );\n}\n\napplyDisplayName(HelpPanel, 'HelpPanel');\n", "\n import './styles.scoped.css';\n export default {\n \"help-panel\": \"awsui_help-panel_1d237_xb6zh_100\",\n \"header\": \"awsui_header_1d237_xb6zh_269\",\n \"content\": \"awsui_content_1d237_xb6zh_300\",\n \"footer\": \"awsui_footer_1d237_xb6zh_346\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useContext, useEffect } from 'react';\n\nimport { HotspotProps } from './interfaces';\nimport styles from './styles.css.js';\nimport { hotspotContext as hotspotContextType } from '../annotation-context/context';\nimport clsx from 'clsx';\nimport { getBaseProps } from '../internal/base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport useBaseComponent from '../internal/hooks/use-base-component';\n\nexport { HotspotProps };\n\nexport default function Hotspot({\n children,\n hotspotId,\n side = 'right',\n direction = 'top',\n ...restProps\n}: HotspotProps): JSX.Element {\n const { __internalRootRef } = useBaseComponent('Hotspot', { props: { direction, side } });\n const baseProps = getBaseProps(restProps);\n\n const hotspotContext = useContext(hotspotContextType);\n\n const content = hotspotContext.getContentForId(hotspotId, direction);\n\n const { unregisterHotspot, registerHotspot } = hotspotContext;\n\n useEffect(() => {\n registerHotspot(hotspotId);\n\n return () => unregisterHotspot(hotspotId);\n }, [hotspotId, unregisterHotspot, registerHotspot]);\n\n if (children) {\n return (\n
      \n
      {children}
      \n
      e.stopPropagation()}>\n {content}\n
      \n
      \n );\n }\n\n return (\n e.stopPropagation()}\n >\n {content}\n \n );\n}\n\napplyDisplayName(Hotspot, 'Hotspot');\n", "\n import './styles.scoped.css';\n export default {\n \"root\": \"awsui_root_cqcqk_134pw_99\",\n \"wrapper\": \"awsui_wrapper_cqcqk_134pw_103\",\n \"elementWrapper\": \"awsui_elementWrapper_cqcqk_134pw_107\",\n \"markerWrapper\": \"awsui_markerWrapper_cqcqk_134pw_111\",\n \"placement-right\": \"awsui_placement-right_cqcqk_134pw_116\",\n \"placement-left\": \"awsui_placement-left_cqcqk_134pw_121\",\n \"inlineWrapper\": \"awsui_inlineWrapper_cqcqk_134pw_126\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport InternalIcon from './internal';\nimport { IconProps } from './interfaces';\n\nexport { IconProps };\n\nexport default function Icon({ size = 'normal', variant = 'normal', ...props }: IconProps) {\n const baseComponentProps = useBaseComponent('Icon', { props: { name: props.name, size, variant } });\n return ;\n}\n\napplyDisplayName(Icon, 'Icon');\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { Ref, useImperativeHandle, useRef } from 'react';\nimport { getBaseProps } from '../internal/base-component';\nimport InternalInput from './internal';\nimport { InputProps } from './interfaces';\nimport styles from './styles.css.js';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport useBaseComponent from '../internal/hooks/use-base-component';\n\nexport { InputProps };\n\nconst Input = React.forwardRef(\n (\n {\n value,\n type = 'text',\n step,\n inputMode,\n autoComplete = true,\n spellcheck,\n disabled,\n readOnly,\n disableBrowserAutocorrect,\n onKeyDown,\n onKeyUp,\n onChange,\n onBlur,\n onFocus,\n ariaRequired,\n name,\n placeholder,\n autoFocus,\n ariaLabel,\n ariaLabelledby,\n ariaDescribedby,\n invalid,\n controlId,\n clearAriaLabel,\n ...rest\n }: InputProps,\n ref: Ref\n ) => {\n const baseComponentProps = useBaseComponent('Input', {\n props: { autoComplete, autoFocus, disableBrowserAutocorrect, inputMode, readOnly, spellcheck, type },\n });\n const baseProps = getBaseProps(rest);\n\n const inputRef = useRef(null);\n\n useImperativeHandle(\n ref,\n () => ({\n focus(...args: Parameters) {\n inputRef.current?.focus(...args);\n },\n select() {\n inputRef.current?.select();\n },\n }),\n [inputRef]\n );\n\n return (\n \n );\n }\n);\n\napplyDisplayName(Input, 'Input');\nexport default Input;\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport { LineChartProps } from './interfaces';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { getBaseProps } from '../internal/base-component';\nimport styles from './styles.css.js';\nimport InternalMixedLineBarChart from '../mixed-line-bar-chart/internal';\nimport useBaseComponent from '../internal/hooks/use-base-component';\n\nexport { LineChartProps };\n\nfunction LineChart({\n series = [],\n height = 500,\n xScaleType = 'linear',\n yScaleType = 'linear',\n detailPopoverSize = 'medium',\n statusType = 'finished',\n emphasizeBaselineAxis = true,\n ...props\n}: LineChartProps) {\n const baseComponentProps = useBaseComponent('LineChart', {\n props: {\n detailPopoverSize,\n emphasizeBaselineAxis,\n fitHeight: props.fitHeight,\n hideFilter: props.hideFilter,\n hideLegend: props.hideLegend,\n xScaleType,\n yScaleType,\n },\n });\n const baseProps = getBaseProps(props);\n const className = clsx(baseProps.className, styles.root);\n\n return (\n \n );\n}\n\napplyDisplayName(LineChart, 'LineChart');\n\nexport default LineChart;\n", "\n import './styles.scoped.css';\n export default {\n \"root\": \"awsui_root_g9v3m_im8v7_5\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { LinkProps } from './interfaces';\nimport InternalLink from './internal';\n\nexport { LinkProps };\n\nconst Link = React.forwardRef(\n ({ fontSize = 'body-m', color = 'normal', external = false, ...props }: LinkProps, ref: React.Ref) => {\n const baseComponentProps = useBaseComponent('Link', {\n props: { color, external, fontSize, rel: props.rel, target: props.target, variant: props.variant },\n });\n return (\n \n );\n }\n);\n\napplyDisplayName(Link, 'Link');\nexport default Link;\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\n\nimport { MixedLineBarChartProps } from './interfaces';\nimport InternalMixedLineBarChart from './internal';\nimport useBaseComponent from '../internal/hooks/use-base-component';\n\nexport { MixedLineBarChartProps };\n\nfunction MixedLineBarChart({\n series = [],\n height = 500,\n xScaleType = 'linear',\n yScaleType = 'linear',\n stackedBars = false,\n horizontalBars = false,\n statusType = 'finished',\n detailPopoverSize = 'medium',\n emphasizeBaselineAxis = true,\n ...props\n}: MixedLineBarChartProps) {\n const baseComponentProps = useBaseComponent('MixedLineBarChart', {\n props: {\n detailPopoverSize,\n emphasizeBaselineAxis,\n fitHeight: props.fitHeight,\n hideFilter: props.hideFilter,\n hideLegend: props.hideLegend,\n horizontalBars,\n stackedBars,\n xScaleType,\n yScaleType,\n },\n });\n return (\n \n );\n}\n\napplyDisplayName(MixedLineBarChart, 'MixedLineBarChart');\n\nexport default MixedLineBarChart;\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { ModalProps } from './interfaces';\nimport InternalModal from './internal';\nimport useBaseComponent from '../internal/hooks/use-base-component';\n\nexport { ModalProps };\n\nexport default function Modal({ size = 'medium', ...props }: ModalProps) {\n const baseComponentProps = useBaseComponent('Modal', {\n props: { size, disableContentPaddings: props.disableContentPaddings },\n });\n return ;\n}\n\napplyDisplayName(Modal, 'Modal');\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { MultiselectProps } from './interfaces';\nimport InternalMultiselect from './internal';\n\nexport { MultiselectProps };\n\nconst Multiselect = React.forwardRef(\n (\n {\n options = [],\n filteringType = 'none',\n statusType = 'finished',\n selectedOptions = [],\n keepOpen = true,\n hideTokens = false,\n ...restProps\n }: MultiselectProps,\n ref: React.Ref\n ) => {\n const baseComponentProps = useBaseComponent('Multiselect', {\n props: {\n autoFocus: restProps.autoFocus,\n expandToViewport: restProps.expandToViewport,\n filteringType,\n hideTokens,\n keepOpen,\n tokenLimit: restProps.tokenLimit,\n virtualScroll: restProps.virtualScroll,\n },\n });\n\n // Private API for inline tokens\n const inlineTokens = Boolean((restProps as any).inlineTokens);\n\n return (\n \n );\n }\n);\n\napplyDisplayName(Multiselect, 'Multiselect');\nexport default Multiselect;\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { getBaseProps } from '../internal/base-component';\nimport { useControllable } from '../internal/hooks/use-controllable';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport Legend, { ChartLegendProps } from '../internal/components/chart-legend';\nimport Filter, { ChartFilterProps } from '../internal/components/chart-filter';\nimport { pie } from 'd3-shape';\n\nimport InternalPieChart, { InternalChartDatum } from './pie-chart';\nimport { PieChartProps } from './interfaces';\nimport styles from './styles.css.js';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport createCategoryColorScale from '../internal/utils/create-category-color-scale';\nimport useContainerWidth from '../internal/utils/use-container-width';\nimport { nodeBelongs } from '../internal/utils/node-belongs';\nimport { ChartWrapper } from '../internal/components/chart-wrapper';\nimport ChartStatusContainer, { getChartStatus } from '../internal/components/chart-status-container';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { getDimensionsBySize } from './utils';\n\nexport { PieChartProps };\n\nconst PieChart = function PieChart({\n fitHeight,\n variant = 'pie',\n size = 'medium',\n hideTitles = false,\n hideDescriptions = false,\n hideLegend = false,\n hideFilter = false,\n statusType = 'finished',\n data: externalData = [],\n i18nStrings = {},\n highlightedSegment: controlledHighlightedSegment,\n visibleSegments: controlledVisibleSegments,\n onHighlightChange: controlledOnHighlightChange,\n onFilterChange,\n additionalFilters,\n legendTitle,\n detailPopoverSize = 'medium',\n ...props\n}: PieChartProps) {\n const { __internalRootRef = null } = useBaseComponent('PieChart', {\n props: {\n fitHeight,\n variant,\n size,\n hideTitles,\n hideDescriptions,\n hideLegend,\n hideFilter,\n detailPopoverSize,\n },\n });\n const baseProps = getBaseProps(props);\n const containerRef = useRef(null);\n const [containerWidth, measureRef] = useContainerWidth();\n\n const data: ReadonlyArray> = useMemo(() => {\n const colors = createCategoryColorScale(externalData, undefined, it => it.color || null);\n\n return externalData.map((datum, i) => ({\n index: i,\n color: colors[i],\n datum,\n }));\n }, [externalData]);\n\n const [highlightedSegment = null, setHighlightedSegment] = useControllable(\n controlledHighlightedSegment,\n controlledOnHighlightChange,\n null,\n {\n componentName: 'PieChart',\n controlledProp: 'highlightedSegment',\n changeHandler: 'onHighlightChange',\n }\n );\n const [legendSegment, setLegendSegment] = useState(highlightedSegment);\n useEffect(() => {\n setLegendSegment(controlledHighlightedSegment || null);\n }, [controlledHighlightedSegment]);\n\n const [visibleSegments, setVisibleSegments] = useControllable(\n controlledVisibleSegments,\n onFilterChange,\n externalData,\n {\n componentName: 'PieChart',\n controlledProp: 'visibleSegments',\n changeHandler: 'onFilterChange',\n }\n );\n\n const visibleData = useMemo(\n () => data.filter(d => visibleSegments?.indexOf(d.datum) !== -1),\n [data, visibleSegments]\n );\n\n const filterItems: ChartFilterProps['series'] = data?.map(data => ({\n label: data.datum.title,\n color: data.color,\n type: 'rectangle',\n datum: data.datum,\n }));\n\n const legendItems: ChartLegendProps['series'] = filterItems.filter(d => visibleSegments?.indexOf(d.datum) !== -1);\n\n const filterChange = useCallback(\n (selectedSeries: ReadonlyArray) => {\n setVisibleSegments(selectedSeries);\n fireNonCancelableEvent(onFilterChange, {\n visibleSegments: selectedSeries,\n });\n },\n [setVisibleSegments, onFilterChange]\n );\n\n const onHighlightChange = useCallback(\n (segment: T | null) => {\n setLegendSegment(segment);\n setHighlightedSegment(segment);\n fireNonCancelableEvent(controlledOnHighlightChange, { highlightedSegment: segment });\n },\n [controlledOnHighlightChange, setHighlightedSegment]\n );\n\n const onBlur = (event: React.FocusEvent) => {\n if (event.relatedTarget && !nodeBelongs(containerRef.current, event.relatedTarget)) {\n highlightedSegment && onHighlightChange(null);\n setLegendSegment(null);\n }\n };\n\n const mergedRef = useMergeRefs(containerRef, measureRef, __internalRootRef);\n\n const { pieData, dataSum } = useMemo(() => {\n const dataSum = visibleData.reduce((sum, d) => sum + d.datum.value, 0);\n\n const pieFactory = pie>()\n // Minimum 1% segment size\n .value(d => (d.datum.value < dataSum / 100 ? dataSum / 100 : d.datum.value))\n .sort(null);\n\n // Filter out segments with value of zero or below\n const pieData = pieFactory(visibleData.filter(d => d.datum.value > 0));\n\n return { pieData, dataSum };\n }, [visibleData]);\n\n const hasNoData = !externalData || externalData.length === 0;\n const { isEmpty, showChart } = getChartStatus({ externalData: data, visibleData: pieData, statusType });\n // Pie charts have a special condition for empty/noMatch due to how zero-value segments are handled.\n const isNoMatch = isEmpty && visibleData.length !== data.length;\n const showFilters = statusType === 'finished' && !hasNoData && (additionalFilters || !hideFilter);\n const reserveLegendSpace = !showChart && !hideLegend;\n const reserveFilterSpace = statusType !== 'finished' && !isNoMatch && (!hideFilter || additionalFilters);\n const hasLabels = !(hideTitles && hideDescriptions);\n\n const isRefresh = useVisualRefresh();\n const defaultDimensions = getDimensionsBySize({ size, hasLabels, visualRefresh: isRefresh });\n const radius = defaultDimensions.outerRadius;\n const height = 2 * (radius + defaultDimensions.padding + (hasLabels ? defaultDimensions.paddingLabels : 0));\n\n return (\n \n ) : null\n }\n additionalFilters={showFilters ? additionalFilters : null}\n reserveFilterSpace={!!reserveFilterSpace}\n reserveLegendSpace={!!reserveLegendSpace}\n chartStatus={\n \n }\n chart={\n showChart ? (\n \n ) : null\n }\n legend={\n !hideLegend &&\n !hasNoData &&\n statusType === 'finished' && (\n \n series={legendItems}\n highlightedSeries={legendSegment}\n legendTitle={legendTitle}\n ariaLabel={i18nStrings?.legendAriaLabel}\n onHighlightChange={onHighlightChange}\n plotContainerRef={containerRef}\n />\n )\n }\n onBlur={onBlur}\n />\n );\n};\n\napplyDisplayName(PieChart, 'PieChart');\nexport default PieChart;\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { PieArcDatum } from 'd3-shape';\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { nodeContains } from '@cloudscape-design/component-toolkit/dom';\n\nimport { KeyCode } from '../internal/keycode';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport ChartPopover from '../internal/components/chart-popover';\nimport SeriesDetails from '../internal/components/chart-series-details';\nimport SeriesMarker from '../internal/components/chart-series-marker';\nimport InternalBox from '../box/internal';\n\nimport Labels from './labels';\nimport { PieChartProps, SeriesInfo } from './interfaces';\nimport styles from './styles.css.js';\nimport { defaultDetails, getDimensionsBySize } from './utils';\nimport Segments from './segments';\nimport ChartPlot, { ChartPlotRef } from '../internal/components/chart-plot';\nimport { SomeRequired } from '../internal/types';\nimport { useInternalI18n } from '../i18n/context';\nimport { nodeBelongs } from '../internal/utils/node-belongs';\nimport clsx from 'clsx';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { useHeightMeasure } from '../internal/hooks/container-queries/use-height-measure';\nimport ChartPopoverFooter from '../internal/components/chart-popover-footer';\nimport LiveRegion from '../internal/components/live-region';\n\nexport interface InternalChartDatum {\n index: number;\n color: string;\n datum: Readonly;\n}\n\ninterface InternalPieChartProps\n extends SomeRequired<\n Omit, 'onHighlightChange' | 'statusType'>,\n 'variant' | 'size' | 'i18nStrings' | 'hideTitles' | 'hideDescriptions'\n > {\n width: number;\n height: number;\n\n highlightedSegment: T | null;\n onHighlightChange: (segment: null | T) => void;\n\n legendSegment: T | null;\n\n pieData: PieArcDatum>[];\n dataSum: number;\n}\n\nexport interface PopoverData {\n datum: T;\n trackRef: React.RefObject;\n series: SeriesInfo;\n}\n\nexport default ({\n fitHeight,\n height: explicitHeight,\n variant,\n size,\n width,\n i18nStrings,\n ariaLabel,\n ariaLabelledby,\n ariaDescription,\n innerMetricValue,\n innerMetricDescription,\n hideTitles,\n hideDescriptions,\n detailPopoverContent,\n detailPopoverSize,\n detailPopoverFooter,\n segmentDescription,\n highlightedSegment,\n onHighlightChange,\n legendSegment,\n pieData,\n dataSum,\n}: InternalPieChartProps) => {\n const [pinnedSegment, setPinnedSegment] = useState(null);\n const plotRef = useRef(null);\n const containerRef = useRef(null);\n const focusedSegmentRef = useRef(null);\n const popoverTrackRef = useRef(null);\n const popoverRef = useRef(null);\n\n const hasLabels = !(hideTitles && hideDescriptions);\n const isRefresh = useVisualRefresh();\n\n const height = useHeightMeasure(() => plotRef.current?.svg ?? null, !fitHeight) ?? explicitHeight;\n\n const dimensions = useMemo(\n () =>\n getDimensionsBySize({ size: fitHeight ? Math.min(height, width) : size, hasLabels, visualRefresh: isRefresh }),\n [fitHeight, height, width, size, hasLabels, isRefresh]\n );\n\n // Inner content is only available for donut charts and the inner description is not displayed for small charts\n const hasInnerContent =\n variant === 'donut' && (innerMetricValue || (innerMetricDescription && dimensions.size !== 'small'));\n\n const innerMetricId = useUniqueId('awsui-pie-chart__inner');\n\n const [isPopoverOpen, setPopoverOpen] = useState(false);\n const [popoverData, setPopoverData] = useState>();\n\n const highlightedSegmentIndex = useMemo(() => {\n for (let index = 0; index < pieData.length; index++) {\n if (pieData[index].data.datum === highlightedSegment) {\n return index;\n }\n }\n return null;\n }, [pieData, highlightedSegment]);\n\n const detailPopoverFooterContent = useMemo(\n () => (detailPopoverFooter && highlightedSegment ? detailPopoverFooter(highlightedSegment) : null),\n [detailPopoverFooter, highlightedSegment]\n );\n\n const i18n = useInternalI18n('pie-chart');\n const detailFunction = detailPopoverContent || defaultDetails(i18n, i18nStrings);\n const details = popoverData ? detailFunction(popoverData.datum, dataSum) : [];\n const popoverContentRef = useRef(null);\n const popoverContent = popoverData && ;\n\n const popoverDismissedRecently = useRef(false);\n const escapePressed = useRef(false);\n\n const highlightSegment = useCallback(\n (internalDatum: InternalChartDatum) => {\n const segment = internalDatum.datum;\n if (segment !== highlightedSegment) {\n onHighlightChange(segment);\n }\n\n if (popoverTrackRef.current) {\n setPopoverData({\n datum: internalDatum.datum,\n series: {\n color: internalDatum.color,\n index: internalDatum.index,\n label: internalDatum.datum.title,\n markerType: 'rectangle',\n },\n trackRef: popoverTrackRef,\n });\n setPopoverOpen(true);\n }\n },\n [highlightedSegment, setPopoverOpen, onHighlightChange]\n );\n\n const clearHighlightedSegment = useCallback(() => {\n setPopoverOpen(false);\n onHighlightChange(null);\n }, [onHighlightChange, setPopoverOpen]);\n\n const checkMouseLeave = (event: React.MouseEvent) => {\n if (pinnedSegment !== null) {\n return;\n }\n\n if (\n nodeContains(popoverRef.current, event.relatedTarget) ||\n nodeContains(focusedSegmentRef.current, event.relatedTarget)\n ) {\n return;\n }\n\n clearHighlightedSegment();\n };\n\n useEffect(() => {\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n clearHighlightedSegment();\n escapePressed.current = true;\n }\n };\n document.addEventListener('keydown', onKeyDown);\n return () => document.removeEventListener('keydown', onKeyDown);\n }, [clearHighlightedSegment]);\n\n const onMouseDown = useCallback(\n (internalDatum: InternalChartDatum) => {\n if (pinnedSegment === internalDatum.datum) {\n setPinnedSegment(null);\n clearHighlightedSegment();\n } else {\n setPinnedSegment(internalDatum.datum);\n highlightSegment(internalDatum);\n }\n },\n [pinnedSegment, clearHighlightedSegment, setPinnedSegment, highlightSegment]\n );\n const onMouseOver = useCallback(\n (internalDatum: InternalChartDatum) => {\n if (escapePressed.current) {\n escapePressed.current = false;\n return;\n }\n if (pinnedSegment !== null) {\n return;\n }\n highlightSegment(internalDatum);\n },\n [pinnedSegment, highlightSegment]\n );\n\n const onKeyDown = useCallback(\n (event: React.KeyboardEvent) => {\n const keyCode = event.keyCode;\n if (\n keyCode !== KeyCode.right &&\n keyCode !== KeyCode.left &&\n keyCode !== KeyCode.enter &&\n keyCode !== KeyCode.space\n ) {\n return;\n }\n\n event.preventDefault();\n\n let nextIndex = highlightedSegmentIndex || 0;\n const MAX = pieData.length - 1;\n if (keyCode === KeyCode.right) {\n nextIndex++;\n if (nextIndex > MAX) {\n nextIndex = 0;\n }\n } else if (keyCode === KeyCode.left) {\n nextIndex--;\n if (nextIndex < 0) {\n nextIndex = MAX;\n }\n }\n if (keyCode === KeyCode.enter || keyCode === KeyCode.space) {\n setPinnedSegment(pieData[nextIndex].data.datum);\n }\n highlightSegment(pieData[nextIndex].data);\n },\n [setPinnedSegment, highlightSegment, pieData, highlightedSegmentIndex]\n );\n const onApplicationFocus = useCallback(\n (_event: any, target: 'keyboard' | 'mouse') => {\n // We need to make sure that we do not re-show the popover when we focus the segment after the popover is dismissed.\n // Normally we would check `event.relatedTarget` for the previously focused element,\n // but this is not supported for SVG elements in IE11. The workaround is this `popoverDismissedRecently` ref.\n if (pinnedSegment !== null || popoverDismissedRecently.current || target === 'mouse') {\n return;\n }\n\n const segment = highlightedSegment || legendSegment || pieData[0].data.datum;\n const matched = pieData.filter(d => d.data.datum === segment);\n highlightSegment(matched[0].data);\n },\n [pinnedSegment, pieData, highlightSegment, highlightedSegment, legendSegment]\n );\n\n const onApplicationBlur = useCallback(\n (event: React.FocusEvent) => {\n const blurTarget = event.relatedTarget || event.target;\n if (blurTarget === null || !(blurTarget instanceof Element) || !nodeBelongs(containerRef.current, blurTarget)) {\n // We only need to close the popover and remove the pinned segment so that we keep track of the current\n // highlighted legendSeries. using clearHighlightedSegment() would set the legendSeries to null, in that case\n // using Keyboard Tab will always highlight the first legend item in the legend component.\n setPopoverOpen(false);\n setPinnedSegment(null);\n }\n },\n [setPinnedSegment]\n );\n const onPopoverDismiss = (outsideClick?: boolean) => {\n setPopoverOpen(false);\n setPinnedSegment(null);\n\n if (!outsideClick) {\n // The delay is needed to bypass focus events caused by click or keypress needed to unpin the popover.\n setTimeout(() => {\n popoverDismissedRecently.current = true;\n plotRef.current!.focusApplication();\n popoverDismissedRecently.current = false;\n }, 0);\n } else {\n onHighlightChange(null);\n }\n };\n\n return (\n \n \n \n \n {hasLabels && (\n \n )}\n \n \n\n {hasInnerContent && (\n
      \n {innerMetricValue && (\n \n {innerMetricValue}\n \n )}\n {innerMetricDescription && dimensions.size !== 'small' && (\n \n {innerMetricDescription}\n \n )}\n
      \n )}\n {isPopoverOpen && popoverData && (\n \n {' '}\n {popoverData.series.label}\n \n )\n }\n trackRef={popoverData.trackRef}\n trackKey={popoverData.series.index}\n dismissButton={pinnedSegment !== null}\n dismissAriaLabel={i18nStrings.detailPopoverDismissAriaLabel}\n onDismiss={onPopoverDismiss}\n container={plotRef.current?.svg || null}\n size={detailPopoverSize}\n onMouseLeave={checkMouseLeave}\n onBlur={onApplicationBlur}\n >\n {popoverContent}\n {detailPopoverFooterContent && {detailPopoverFooterContent}}\n \n )}\n \n \n );\n};\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useLayoutEffect, useMemo, useRef, useState } from 'react';\nimport clsx from 'clsx';\nimport { arc, PieArcDatum } from 'd3-shape';\n\nimport { PieChartProps } from './interfaces';\nimport styles from './styles.css.js';\nimport { InternalChartDatum } from './pie-chart';\nimport { Dimension, balanceLabelNodes, computeSmartAngle } from './utils';\nimport ResponsiveText from './responsive-text';\nimport { useResizeObserver } from '@cloudscape-design/component-toolkit/internal';\n\nexport interface LabelsProps {\n pieData: PieArcDatum>[];\n visibleDataSum: number;\n dimensions: Dimension;\n hideTitles: boolean;\n hideDescriptions: boolean;\n highlightedSegment: PieChartProps.Datum | null;\n segmentDescription?: PieChartProps.SegmentDescriptionFunction;\n containerRef: React.RefObject;\n}\n\ninterface LabelElementProps {\n x: number;\n y: number;\n rightSide: boolean;\n hideTitles: boolean;\n hideDescriptions: boolean;\n title: PieChartProps.Datum['title'];\n description?: string;\n containerBoundaries: null | { left: number; right: number };\n}\n\nfunction LabelElement({\n x,\n y,\n hideTitles,\n hideDescriptions,\n rightSide,\n title,\n description,\n containerBoundaries,\n}: LabelElementProps) {\n return (\n // Reset the transform property to prepare for `balanceLabelNodes`.\n // The dataset attributes are also needed in the function for IE11 support.\n \n {!hideTitles && (\n \n {title}\n \n )}\n {!hideDescriptions && description && (\n \n {description}\n \n )}\n \n );\n}\n\nexport default ({\n pieData,\n dimensions,\n highlightedSegment,\n segmentDescription,\n visibleDataSum,\n hideTitles,\n hideDescriptions,\n containerRef,\n}: LabelsProps) => {\n const containerBoundaries = useElementBoundaries(containerRef);\n const shouldOptimizeLabels =\n containerBoundaries.right - containerBoundaries.left - (dimensions.outerRadius + dimensions.innerLabelPadding) * 2 <\n 300;\n const markers = useMemo(() => {\n const { outerRadius: radius, innerLabelPadding } = dimensions;\n\n // More arc factories for the label positioning\n const arcMarkerStart = arc>()\n .innerRadius(radius - 1)\n .outerRadius(radius - 1);\n\n const arcMarkerBreak = arc>()\n .innerRadius(radius + innerLabelPadding)\n .outerRadius(radius + innerLabelPadding);\n\n return pieData.map((datum, i) => {\n const labelDatum = pieData[i];\n const smartAngle = computeSmartAngle(labelDatum.startAngle, labelDatum.endAngle, shouldOptimizeLabels);\n\n // Make the marker line longer if the segment is closer to the top or bottom of the chart\n const lineExtension = 0.5 * Math.cos(2 * smartAngle) + 0.5;\n arcMarkerBreak.outerRadius(radius + 20 * lineExtension);\n arcMarkerBreak.innerRadius(radius + 20 * lineExtension);\n const [startX, startY] = arcMarkerStart.centroid({ ...datum, startAngle: smartAngle, endAngle: smartAngle });\n const [breakX, breakY] = arcMarkerBreak.centroid({ ...datum, startAngle: smartAngle, endAngle: smartAngle });\n\n const rightSide = smartAngle < Math.PI;\n const endX = shouldOptimizeLabels ? breakX + 20 * (rightSide ? 1 : -1) : (radius + 20) * (rightSide ? 1 : -1);\n const textX = endX + 5 * (rightSide ? 1 : -1);\n\n return {\n startX,\n startY,\n breakX,\n breakY,\n endX,\n endY: breakY,\n textX,\n textY: breakY,\n rightSide,\n datum,\n };\n });\n }, [pieData, dimensions, shouldOptimizeLabels]);\n\n const rootRef = useRef(null);\n\n useLayoutEffect(() => {\n if (!rootRef.current) {\n return;\n }\n\n // Relax labels that are overlapping\n const labelNodes = rootRef.current.querySelectorAll(`.${styles['label-text']}`);\n balanceLabelNodes(labelNodes, markers, false, dimensions.outerRadius + dimensions.innerLabelPadding);\n balanceLabelNodes(labelNodes, markers, true, dimensions.outerRadius + dimensions.innerLabelPadding);\n }, [markers, pieData, dimensions]);\n\n return (\n \n {markers.map(({ startX, startY, breakX, breakY, endX, endY, textX, textY, rightSide, datum }) => {\n const segment = datum.data.datum;\n const description = segmentDescription?.(segment, visibleDataSum);\n if ((hideTitles && !description) || (hideDescriptions && !segment.title)) {\n return null;\n }\n return (\n \n \n \n \n \n );\n })}\n \n );\n};\n\nfunction useElementBoundaries(ref: React.RefObject): { left: number; right: number } {\n const [state, setState] = useState({ left: 0, right: 0 });\n useResizeObserver(ref, entry => {\n const elementRect = entry.target.getBoundingClientRect();\n setState({ left: elementRect.left, right: elementRect.right });\n });\n return state;\n}\n", "\n import './styles.scoped.css';\n export default {\n \"segment__path\": \"awsui_segment__path_1edmh_18vxs_103\",\n \"segment\": \"awsui_segment_1edmh_18vxs_103\",\n \"segment__hover\": \"awsui_segment__hover_1edmh_18vxs_130\",\n \"label\": \"awsui_label_1edmh_18vxs_144\",\n \"root\": \"awsui_root_1edmh_18vxs_162\",\n \"content\": \"awsui_content_1edmh_18vxs_166\",\n \"content--small\": \"awsui_content--small_1edmh_18vxs_166\",\n \"content--fit-height\": \"awsui_content--fit-height_1edmh_18vxs_169\",\n \"content--without-labels\": \"awsui_content--without-labels_1edmh_18vxs_172\",\n \"content--medium\": \"awsui_content--medium_1edmh_18vxs_178\",\n \"content--large\": \"awsui_content--large_1edmh_18vxs_190\",\n \"status-container\": \"awsui_status-container_1edmh_18vxs_207\",\n \"chart-container\": \"awsui_chart-container_1edmh_18vxs_211\",\n \"chart-container--fit-height\": \"awsui_chart-container--fit-height_1edmh_18vxs_215\",\n \"chart-container-chart-plot\": \"awsui_chart-container-chart-plot_1edmh_18vxs_220\",\n \"chart-container-chart-plot--fit-height\": \"awsui_chart-container-chart-plot--fit-height_1edmh_18vxs_223\",\n \"inner-content\": \"awsui_inner-content_1edmh_18vxs_229\",\n \"segment__highlight\": \"awsui_segment__highlight_1edmh_18vxs_240\",\n \"segment--dimmed\": \"awsui_segment--dimmed_1edmh_18vxs_255\",\n \"segment--highlighted\": \"awsui_segment--highlighted_1edmh_18vxs_258\",\n \"label--dimmed\": \"awsui_label--dimmed_1edmh_18vxs_275\",\n \"label--align-right\": \"awsui_label--align-right_1edmh_18vxs_278\",\n \"label-text\": \"awsui_label-text_1edmh_18vxs_286\",\n \"label__description\": \"awsui_label__description_1edmh_18vxs_294\",\n \"label-line\": \"awsui_label-line_1edmh_18vxs_301\",\n \"label--highlighted\": \"awsui_label--highlighted_1edmh_18vxs_305\",\n \"popover-header\": \"awsui_popover-header_1edmh_18vxs_309\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ComponentFormatFunction } from '../i18n/context';\nimport { PieChartProps } from './interfaces';\nimport styles from './styles.css.js';\n\nexport interface Dimension {\n innerRadius: number;\n outerRadius: number;\n padding: number;\n paddingLabels: number;\n innerLabelPadding: number;\n cornerRadius?: number;\n}\n\nconst minRadius = 30;\nconst paddingLabels = 44; // = 2 * (size-lineHeight-body-100)\nconst defaultPadding = 12; // = space-s\nconst smallPadding = 8; // = space-xs\nexport const minLabelLineAngularPadding = Math.PI / 20;\n\nexport const dimensionsBySize: Record, Dimension> = {\n small: {\n innerRadius: 33,\n outerRadius: 50,\n innerLabelPadding: smallPadding,\n padding: smallPadding,\n paddingLabels,\n },\n medium: {\n innerRadius: 66,\n outerRadius: 100,\n innerLabelPadding: defaultPadding,\n padding: defaultPadding,\n paddingLabels,\n },\n large: {\n innerRadius: 93,\n outerRadius: 140,\n innerLabelPadding: defaultPadding,\n padding: defaultPadding,\n paddingLabels,\n },\n};\n\nexport const refreshDimensionsBySize: Record, Dimension> = {\n small: {\n ...dimensionsBySize.small,\n innerRadius: 38,\n cornerRadius: 3,\n },\n medium: {\n ...dimensionsBySize.medium,\n innerRadius: 75,\n cornerRadius: 4,\n },\n large: {\n ...dimensionsBySize.large,\n innerRadius: 105,\n cornerRadius: 5,\n },\n};\n\n/**\n * When `size` is a string (\"small\", \"medium\" or \"large\") the predefined pie chart element dimensions for classic and visual refresh are used.\n * When `size` is a number the outer and inner radii are computed and the rest of the dimensions are taken from the closest predefined size.\n */\nexport function getDimensionsBySize({\n size,\n hasLabels,\n visualRefresh,\n}: {\n size: NonNullable | number;\n hasLabels: boolean;\n visualRefresh?: boolean;\n}): Dimension & { size: NonNullable } {\n if (typeof size === 'string') {\n const dimensions = visualRefresh ? refreshDimensionsBySize[size] : dimensionsBySize[size];\n return { ...dimensions, size };\n }\n const sizeSpec = visualRefresh ? refreshDimensionsBySize : dimensionsBySize;\n const getPixelSize = (d: Dimension) => d.outerRadius * 2 + d.padding * 2 + (hasLabels ? d.paddingLabels : 0) * 2;\n\n let matchedSize: NonNullable = 'small';\n if (size > getPixelSize(sizeSpec.medium)) {\n matchedSize = 'medium';\n }\n if (size > getPixelSize(sizeSpec.large)) {\n matchedSize = 'large';\n }\n\n const padding = sizeSpec[matchedSize].padding;\n const paddingLabels = hasLabels ? sizeSpec[matchedSize].paddingLabels : 0;\n const radiiRatio = sizeSpec[matchedSize].outerRadius / sizeSpec[matchedSize].innerRadius;\n const outerRadius = Math.max(minRadius, (size - 2 * paddingLabels - 2 * padding) / 2);\n const innerRadius = outerRadius / radiiRatio;\n\n return { ...sizeSpec[matchedSize], outerRadius, innerRadius, size: matchedSize };\n}\n\nexport const defaultDetails =\n (i18n: ComponentFormatFunction<'pie-chart'>, i18nStrings: PieChartProps.I18nStrings) =>\n (datum: PieChartProps.Datum, dataSum: number) =>\n [\n { key: i18n('i18nStrings.detailsValue', i18nStrings.detailsValue) || '', value: datum.value },\n {\n key: i18n('i18nStrings.detailsPercentage', i18nStrings.detailsPercentage) || '',\n value: `${((datum.value * 100) / dataSum).toFixed(0)}%`,\n },\n ];\n\n/**\n * Adjusts the position of the given label nodes to avoid visual overlapping.\n * @param nodes List of label nodes of the entire chart (both left and right side)\n * @param markers Markers array that was calculated in , but we just need the `endY` values\n * @param leftSide Boolean flag whether we are processing the left or right side of the chart labels\n */\nexport const balanceLabelNodes = (\n nodes: NodeListOf,\n markers: Array<{ endY: number; endX: number }>,\n leftSide: boolean,\n radius: number\n) => {\n const MARGIN = 10;\n\n let previousBBox: { x: number; y: number; height: number } | null = null;\n\n // When traversing the right side of labels, we start at the beginning of the array and go forwards.\n // For the left side, we need to traverse backwards from the end, so that overlapping nodes are pushed down in the right order.\n let i = leftSide ? nodes.length - 1 : 0;\n\n while ((leftSide && i >= 0) || (!leftSide && i < nodes.length)) {\n const node = nodes[i];\n\n // Currently using dataset attributes to determine the base position.\n // This implementation can be changed back to using `getBBox` when we drop IE11 support.\n // Unfortunately, there is no good alternative for `getBBox` that is supported by IE11.\n // `getBoundingClientRect` works for width and height calculations in SVG, but the x/y positions are inaccurate.\n const x = parseFloat(node.getAttribute('data-x') || '0');\n const y = parseFloat(node.getAttribute('data-y') || '0');\n const box = {\n x,\n y,\n height: node.getBoundingClientRect().height,\n };\n\n const marker = markers[i];\n\n if (leftSide) {\n i--;\n } else {\n i++;\n }\n\n if (!previousBBox) {\n previousBBox = box;\n node.setAttribute('transform', '');\n continue;\n }\n\n if ((!leftSide && box.x < 0) || (leftSide && box.x >= 0)) {\n // We have reached a label that is on the other side of the chart, so we're done.\n break;\n }\n\n node.setAttribute('transform', '');\n\n // Calculate how much the current node is overlapping with the previous one.\n const yOffset = previousBBox.y + previousBBox.height + MARGIN - box.y;\n\n if (yOffset > 0) {\n const xOffset = computeXOffset(box, yOffset, radius) * (leftSide ? -1 : 1);\n // Move the label down.\n node.setAttribute('transform', `translate(${xOffset} ${yOffset})`);\n\n // Adjust the attached line accordingly.\n const lineNode = node.parentNode?.querySelector(`.${styles['label-line']}`);\n if (lineNode) {\n const { endY, endX } = marker;\n lineNode.setAttribute('y2', '' + (endY + yOffset));\n lineNode.setAttribute('x2', '' + (endX + xOffset));\n }\n\n // Update the position accordingly to inform the next label\n box.y += yOffset;\n box.x += xOffset;\n }\n\n previousBBox = box;\n }\n};\n\nconst squareDistance = (edge: [number, number]): number => Math.pow(edge[0], 2) + Math.pow(edge[1], 2);\n\nconst computeXOffset = (box: { x: number; y: number; height: number }, yOffset: number, radius: number): number => {\n const upperEdge: [number, number] = [box.x, box.y + yOffset];\n const lowerEdge: [number, number] = [box.x, box.y + box.height + yOffset];\n const closestEdge = squareDistance(upperEdge) < squareDistance(lowerEdge) ? upperEdge : lowerEdge;\n\n if (squareDistance(closestEdge) < Math.pow(radius, 2)) {\n return Math.sqrt(Math.pow(radius, 2) - Math.pow(closestEdge[1], 2)) - Math.abs(closestEdge[0]);\n }\n return 0;\n};\n\nexport const computeSmartAngle = (startAngle: number, endAngle: number, optimize = false): number => {\n if (!optimize || endAngle - startAngle < 2 * minLabelLineAngularPadding) {\n return (endAngle + startAngle) / 2;\n }\n const paddedStartAngle = startAngle + minLabelLineAngularPadding;\n const paddedEndAngle = endAngle - minLabelLineAngularPadding;\n if (paddedStartAngle < 0 && paddedEndAngle > 0) {\n return 0;\n }\n if (paddedStartAngle < Math.PI && paddedEndAngle > Math.PI) {\n return Math.PI;\n }\n\n const endAngleMinDistance = Math.min(\n paddedEndAngle,\n Math.abs(Math.PI - paddedEndAngle),\n 2 * Math.PI - paddedEndAngle\n );\n const startAngleMinDistance = Math.min(\n paddedStartAngle,\n Math.abs(Math.PI - paddedStartAngle),\n 2 * Math.PI - paddedStartAngle\n );\n if (endAngleMinDistance < startAngleMinDistance) {\n return paddedEndAngle;\n }\n return paddedStartAngle;\n};\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { memo, useEffect, useRef } from 'react';\nimport { renderTextContent } from '../internal/components/responsive-text';\n\ninterface ResponsiveTextProps {\n x: number;\n y: number;\n rightSide?: boolean;\n className?: string;\n children: string;\n containerBoundaries: null | { left: number; right: number };\n}\n\nexport default memo(ResponsiveText);\n\nfunction ResponsiveText({ x, y, rightSide, className, children, containerBoundaries }: ResponsiveTextProps) {\n const actualRef = useRef(null);\n const virtualRef = useRef(null);\n\n // Determine the visible width of the text and if necessary truncate it until it fits.\n useEffect(() => {\n // The debouncing is necessary for visual smoothness.\n const timeoutId = setTimeout(() => {\n const groupRect = virtualRef.current!.getBoundingClientRect();\n const visibleWidth = containerBoundaries ? getVisibleWidth(groupRect, containerBoundaries) : 0;\n renderTextContent(actualRef.current!, children, visibleWidth);\n }, 25);\n return () => clearTimeout(timeoutId);\n });\n\n return (\n <>\n {/* Invisible sample text used for measurement */}\n \n {children}\n \n\n {/* Text node to render truncated text into */}\n \n {children}\n \n \n );\n}\n\nfunction getVisibleWidth(element: { left: number; right: number }, container: { left: number; right: number }): number {\n if (element.left < container.left) {\n return element.right - container.left;\n } else if (element.right > container.right) {\n return container.right - element.left;\n } else {\n return container.right - container.left;\n }\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useMemo } from 'react';\nimport { arc, PieArcDatum } from 'd3-shape';\n\nimport { PieChartProps } from './interfaces';\nimport { Dimension } from './utils';\nimport { InternalChartDatum } from './pie-chart';\nimport styles from './styles.css.js';\nimport clsx from 'clsx';\nimport { useInternalI18n } from '../i18n/context';\n\ninterface SegmentsProps {\n pieData: Array>>;\n highlightedSegment: T | null;\n dimensions: Dimension;\n variant: PieChartProps['variant'];\n focusedSegmentRef: React.RefObject;\n popoverTrackRef: React.RefObject;\n segmentAriaRoleDescription?: string;\n onMouseDown: (datum: InternalChartDatum) => void;\n onMouseOver: (datum: InternalChartDatum) => void;\n}\n\nexport default function Segments({\n pieData,\n highlightedSegment,\n dimensions,\n variant,\n focusedSegmentRef,\n popoverTrackRef,\n segmentAriaRoleDescription,\n onMouseDown,\n onMouseOver,\n}: SegmentsProps) {\n const i18n = useInternalI18n('pie-chart');\n\n const { arcFactory, highlightedArcFactory } = useMemo(() => {\n const radius = dimensions.outerRadius;\n const innerRadius = variant === 'pie' ? 0 : dimensions.innerRadius;\n const cornerRadius = dimensions.cornerRadius || 0;\n\n const arcFactory = arc>>()\n .innerRadius(innerRadius)\n .outerRadius(radius)\n .cornerRadius(cornerRadius);\n\n const highlightedArcFactory = arc>>()\n .innerRadius(radius + 4)\n .outerRadius(radius + 6);\n\n return {\n arcFactory,\n highlightedArcFactory,\n };\n }, [dimensions, variant]);\n\n const centroid = useMemo(() => {\n for (const datum of pieData) {\n if (datum.data.datum === highlightedSegment) {\n const [centroidLeft, centroidTop] = arcFactory.centroid(datum);\n return { cx: centroidLeft, cy: centroidTop };\n }\n }\n return null;\n }, [highlightedSegment, pieData, arcFactory]);\n\n return (\n \n {pieData.map(datum => {\n const isHighlighted = highlightedSegment === datum.data.datum;\n const isDimmed = highlightedSegment !== null && !isHighlighted;\n const arcPath = arcFactory(datum) || undefined;\n const highlightedPath = highlightedArcFactory(datum) || undefined;\n return (\n {\n onMouseDown(datum.data);\n e.preventDefault();\n }}\n onMouseOver={() => onMouseOver(datum.data)}\n className={clsx(styles.segment, {\n [styles['segment--highlighted']]: isHighlighted,\n [styles['segment--dimmed']]: isDimmed,\n })}\n ref={isHighlighted ? focusedSegmentRef : undefined}\n aria-label={`${datum.data.datum.title} (${datum.data.datum.value})`}\n role=\"button\"\n aria-roledescription={i18n('i18nStrings.segmentAriaRoleDescription', segmentAriaRoleDescription)}\n >\n \n \n \n );\n })}\n\n \n \n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport InternalPopover from './internal';\nimport { getExternalProps } from '../internal/utils/external-props';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { isDevelopment } from '../internal/is-development';\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\nimport { PopoverProps } from './interfaces';\n\nexport { PopoverProps };\n\nexport default function Popover({\n position = 'right',\n size = 'medium',\n fixedWidth = false,\n triggerType = 'text',\n dismissButton = true,\n renderWithPortal = false,\n header,\n ...rest\n}: PopoverProps) {\n if (isDevelopment) {\n if (dismissButton && !header) {\n warnOnce('Popover', `You should provide a \\`header\\` when \\`dismissButton\\` is true.`);\n }\n }\n\n const baseComponentProps = useBaseComponent('Popover', {\n props: { dismissButton, fixedWidth, position, renderWithPortal, size, triggerType },\n });\n const externalProps = getExternalProps(rest);\n return (\n \n );\n}\n\napplyDisplayName(Popover, 'Popover');\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useMemo, useState } from 'react';\nimport clsx from 'clsx';\n\nimport styles from './styles.css.js';\nimport { getBaseProps } from '../internal/base-component';\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\nimport { ProgressBarProps } from './interfaces';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { Progress, ResultState, SmallText } from './internal';\nimport { joinStrings } from '../internal/utils/strings';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { throttle } from '../internal/utils/throttle';\nimport LiveRegion from '../internal/components/live-region';\n\nconst ASSERTION_FREQUENCY = 5000; // interval in ms between progress announcements\n\nexport { ProgressBarProps };\n\nexport default function ProgressBar({\n value = 0,\n status = 'in-progress',\n variant = 'standalone',\n resultButtonText,\n label,\n ariaLabel,\n ariaLabelledby,\n description,\n additionalInfo,\n resultText,\n onResultButtonClick,\n ...rest\n}: ProgressBarProps) {\n const { __internalRootRef } = useBaseComponent('ProgressBar', {\n props: { variant },\n });\n const baseProps = getBaseProps(rest);\n const generatedName = useUniqueId('awsui-progress-bar-');\n\n const labelId = `${generatedName}-label`;\n const isInFlash = variant === 'flash';\n const isInProgressState = status === 'in-progress';\n\n const [announcedValue, setAnnouncedValue] = useState('');\n const throttledAssertion = useMemo(() => {\n return throttle((value: ProgressBarProps['value']) => {\n setAnnouncedValue(`${value}%`);\n }, ASSERTION_FREQUENCY);\n }, []);\n\n useEffect(() => {\n throttledAssertion(value);\n }, [throttledAssertion, value]);\n\n if (isInFlash && resultButtonText) {\n warnOnce(\n 'ProgressBar',\n 'The `resultButtonText` is ignored if you set `variant=\"flash\"`, and the result button is not displayed. Use the `buttonText` property and the `onButtonClick` event listener of the flashbar item in which the progress bar component is embedded.'\n );\n }\n\n return (\n \n
      \n
      \n {label}\n
      \n {description && {description}}\n
      \n {isInProgressState ? (\n <>\n \n \n {label}\n {label ? ': ' : null}\n {announcedValue}\n \n \n ) : (\n {\n fireNonCancelableEvent(onResultButtonClick);\n }}\n />\n )}\n
      \n
      \n {additionalInfo && {additionalInfo}}\n \n );\n}\n\napplyDisplayName(ProgressBar, 'ProgressBar');\n", "\n import './styles.scoped.css';\n export default {\n \"progress\": \"awsui_progress_11huc_1ah81_197\",\n \"result-state\": \"awsui_result-state_11huc_1ah81_211\",\n \"awsui-motion-fade-in\": \"awsui_awsui-motion-fade-in_11huc_1ah81_1\",\n \"root\": \"awsui_root_11huc_1ah81_233\",\n \"with-result-button\": \"awsui_with-result-button_11huc_1ah81_268\",\n \"result-text\": \"awsui_result-text_11huc_1ah81_272\",\n \"result-container-error\": \"awsui_result-container-error_11huc_1ah81_276\",\n \"result-container-success\": \"awsui_result-container-success_11huc_1ah81_276\",\n \"result-button\": \"awsui_result-button_11huc_1ah81_280\",\n \"word-wrap\": \"awsui_word-wrap_11huc_1ah81_286\",\n \"label-flash\": \"awsui_label-flash_11huc_1ah81_291\",\n \"label-key-value\": \"awsui_label-key-value_11huc_1ah81_295\",\n \"flash\": \"awsui_flash_11huc_1ah81_303\",\n \"progress-container\": \"awsui_progress-container_11huc_1ah81_307\",\n \"percentage-container\": \"awsui_percentage-container_11huc_1ah81_314\",\n \"percentage\": \"awsui_percentage_11huc_1ah81_314\",\n \"complete\": \"awsui_complete_11huc_1ah81_360\",\n \"progress-in-flash\": \"awsui_progress-in-flash_11huc_1ah81_388\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\nimport { BoxProps } from '../box/interfaces';\nimport InternalBox from '../box/internal';\nimport { ButtonProps } from '../button/interfaces';\nimport { InternalButton } from '../button/internal';\nimport InternalStatusIndicator from '../status-indicator/internal';\n\nimport { ProgressBarProps } from './interfaces';\nimport styles from './styles.css.js';\n\nconst MAX_VALUE = 100;\n\nconst clamp = (value: number, lowerLimit: number, upperLimit: number) => {\n return Math.max(Math.min(value, upperLimit), lowerLimit);\n};\n\ninterface ProgressProps {\n value: number;\n isInFlash: boolean;\n ariaLabel?: string;\n ariaLabelledby?: string;\n}\nexport const Progress = ({ value, isInFlash, ariaLabel, ariaLabelledby }: ProgressProps) => {\n const roundedValue = Math.round(value);\n const progressValue = clamp(roundedValue, 0, MAX_VALUE);\n\n return (\n
      \n = MAX_VALUE && styles.complete,\n isInFlash && styles['progress-in-flash']\n )}\n max={MAX_VALUE}\n value={progressValue}\n aria-label={ariaLabel}\n // Ensures aria-label takes precedence over aria-labelledby\n aria-labelledby={!ariaLabel ? ariaLabelledby : undefined}\n />\n \n \n {`${progressValue}%`}\n \n \n
      \n );\n};\n\ninterface SmallTextProps {\n color?: BoxProps.Color;\n children: React.ReactNode;\n}\n\nexport const SmallText = ({ color, children }: SmallTextProps) => {\n return (\n \n {children}\n \n );\n};\n\nconst ResultButton = ({ onClick, children }: ButtonProps) => {\n return (\n
      \n \n {children}\n \n
      \n );\n};\n\ninterface ResultStateProps {\n isInFlash: boolean;\n resultText: React.ReactNode;\n resultButtonText?: string;\n status: ProgressBarProps.Status;\n onClick: () => void;\n}\n\nexport const ResultState = ({ isInFlash, resultText, resultButtonText, status, onClick }: ResultStateProps) => {\n const hasResultButton = !!resultButtonText;\n\n if (isInFlash) {\n return (\n
      \n {resultText}\n
      \n );\n }\n\n return (\n
      \n \n \n {resultText}\n \n \n {hasResultButton && {resultButtonText}}\n
      \n );\n};\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { useRef, useState, useImperativeHandle } from 'react';\n\nimport InternalSpaceBetween from '../space-between/internal';\nimport { InternalButton } from '../button/internal';\nimport { getBaseProps } from '../internal/base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { KeyCode } from '../internal/keycode';\nimport { useUniqueId } from '../internal/hooks/use-unique-id/index';\nimport { fireNonCancelableEvent } from '../internal/events';\n\nimport {\n PropertyFilterProps,\n ParsedText,\n Ref,\n ComparisonOperator,\n Token,\n InternalFilteringProperty,\n InternalFilteringOption,\n FilteringProperty,\n ExtendedOperator,\n InternalQuery,\n InternalFreeTextFiltering,\n} from './interfaces';\nimport { TokenButton } from './token';\nimport { getQueryActions, parseText, getAutosuggestOptions, getAllowedOperators } from './controller';\nimport { useLoadItems } from './use-load-items';\nimport styles from './styles.css.js';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport PropertyFilterAutosuggest, { PropertyFilterAutosuggestProps } from './property-filter-autosuggest';\nimport { PropertyEditor } from './property-editor';\nimport { AutosuggestInputRef } from '../internal/components/autosuggest-input';\nimport { matchTokenValue } from './utils';\nimport { PropertyFilterOperator } from '@cloudscape-design/collection-hooks';\nimport { useInternalI18n } from '../i18n/context';\nimport TokenList from '../internal/components/token-list';\nimport { SearchResults } from '../text-filter/search-results';\n\nexport { PropertyFilterProps };\n\nfunction getOperatorI18nString(operator: ComparisonOperator): string {\n switch (operator) {\n case '=':\n return 'equals';\n case '!=':\n return 'not_equals';\n case '>':\n return 'greater_than';\n case '>=':\n return 'greater_than_equal';\n case '<':\n return 'less_than';\n case '<=':\n return 'less_than_equal';\n case ':':\n return 'contains';\n case '!:':\n return 'not_contains';\n case '^':\n return 'starts_with';\n case '!^':\n return 'not_starts_with';\n // The line is ignored from coverage because it is not reachable.\n // The purpose of it is to prevent TS errors if ComparisonOperator type gets extended.\n /* istanbul ignore next */\n default:\n return operator;\n }\n}\n\nconst PropertyFilter = React.forwardRef(\n (\n {\n disabled,\n countText,\n query,\n hideOperations,\n onChange,\n filteringProperties,\n filteringOptions = [],\n customGroupsText = [],\n disableFreeTextFiltering = false,\n freeTextFiltering,\n onLoadItems,\n virtualScroll,\n customControl,\n customFilterActions,\n filteringPlaceholder,\n filteringAriaLabel,\n filteringEmpty,\n filteringLoadingText,\n filteringFinishedText,\n filteringErrorText,\n filteringRecoveryText,\n filteringStatusType,\n asyncProperties,\n tokenLimit,\n expandToViewport,\n tokenLimitShowFewerAriaLabel,\n tokenLimitShowMoreAriaLabel,\n ...rest\n }: PropertyFilterProps,\n ref: React.Ref\n ) => {\n const { __internalRootRef } = useBaseComponent('PropertyFilter', {\n props: { asyncProperties, disableFreeTextFiltering, expandToViewport, hideOperations, tokenLimit, virtualScroll },\n });\n const [removedTokenIndex, setRemovedTokenIndex] = useState(null);\n\n const inputRef = useRef(null);\n const baseProps = getBaseProps(rest);\n\n const i18n = useInternalI18n('property-filter');\n const i18nStrings: PropertyFilterProps.I18nStrings = {\n ...rest.i18nStrings,\n allPropertiesLabel: i18n('i18nStrings.allPropertiesLabel', rest.i18nStrings?.allPropertiesLabel),\n applyActionText: i18n('i18nStrings.applyActionText', rest.i18nStrings?.applyActionText),\n cancelActionText: i18n('i18nStrings.cancelActionText', rest.i18nStrings?.cancelActionText),\n clearFiltersText: i18n('i18nStrings.clearFiltersText', rest.i18nStrings?.clearFiltersText),\n editTokenHeader: i18n('i18nStrings.editTokenHeader', rest.i18nStrings?.editTokenHeader),\n groupPropertiesText: i18n('i18nStrings.groupPropertiesText', rest.i18nStrings?.groupPropertiesText),\n groupValuesText: i18n('i18nStrings.groupValuesText', rest.i18nStrings?.groupValuesText),\n operationAndText: i18n('i18nStrings.operationAndText', rest.i18nStrings?.operationAndText),\n operationOrText: i18n('i18nStrings.operationOrText', rest.i18nStrings?.operationOrText),\n operatorContainsText: i18n('i18nStrings.operatorContainsText', rest.i18nStrings?.operatorContainsText),\n operatorDoesNotContainText: i18n(\n 'i18nStrings.operatorDoesNotContainText',\n rest.i18nStrings?.operatorDoesNotContainText\n ),\n operatorDoesNotEqualText: i18n(\n 'i18nStrings.operatorDoesNotEqualText',\n rest.i18nStrings?.operatorDoesNotEqualText\n ),\n operatorEqualsText: i18n('i18nStrings.operatorEqualsText', rest.i18nStrings?.operatorEqualsText),\n operatorGreaterOrEqualText: i18n(\n 'i18nStrings.operatorGreaterOrEqualText',\n rest.i18nStrings?.operatorGreaterOrEqualText\n ),\n operatorGreaterText: i18n('i18nStrings.operatorGreaterText', rest.i18nStrings?.operatorGreaterText),\n operatorLessOrEqualText: i18n('i18nStrings.operatorLessOrEqualText', rest.i18nStrings?.operatorLessOrEqualText),\n operatorLessText: i18n('i18nStrings.operatorLessText', rest.i18nStrings?.operatorLessText),\n operatorStartsWithText: i18n('i18nStrings.operatorStartsWithText', rest.i18nStrings?.operatorStartsWithText),\n operatorDoesNotStartWithText: i18n(\n 'i18nStrings.operatorDoesNotStartWithText',\n rest.i18nStrings?.operatorDoesNotStartWithText\n ),\n operatorText: i18n('i18nStrings.operatorText', rest.i18nStrings?.operatorText),\n operatorsText: i18n('i18nStrings.operatorsText', rest.i18nStrings?.operatorsText),\n propertyText: i18n('i18nStrings.propertyText', rest.i18nStrings?.propertyText),\n tokenLimitShowFewer: i18n('i18nStrings.tokenLimitShowFewer', rest.i18nStrings?.tokenLimitShowFewer),\n tokenLimitShowMore: i18n('i18nStrings.tokenLimitShowMore', rest.i18nStrings?.tokenLimitShowMore),\n valueText: i18n('i18nStrings.valueText', rest.i18nStrings?.valueText),\n removeTokenButtonAriaLabel: i18n(\n 'i18nStrings.removeTokenButtonAriaLabel',\n rest.i18nStrings?.removeTokenButtonAriaLabel,\n format => token =>\n format({\n token__operator: getOperatorI18nString(token.operator),\n token__propertyKey: token.propertyKey ?? '',\n token__value: token.value,\n })\n ),\n };\n\n useImperativeHandle(ref, () => ({ focus: () => inputRef.current?.focus() }), []);\n const showResults = !!query.tokens?.length && !disabled && !!countText;\n const { addToken, removeToken, setToken, setOperation, removeAllTokens } = getQueryActions(\n query,\n onChange,\n inputRef\n );\n const [filteringText, setFilteringText] = useState('');\n\n const { internalProperties, internalOptions, internalQuery, internalFreeText } = (() => {\n const propertyByKey = filteringProperties.reduce((acc, property) => {\n const extendedOperators = (property?.operators ?? []).reduce(\n (acc, operator) => (typeof operator === 'object' ? acc.set(operator.operator, operator) : acc),\n new Map>()\n );\n acc.set(property.key, {\n propertyKey: property.key,\n propertyLabel: property?.propertyLabel ?? '',\n groupValuesLabel: property?.groupValuesLabel ?? '',\n propertyGroup: property?.group,\n operators: (property?.operators ?? []).map(op => (typeof op === 'string' ? op : op.operator)),\n defaultOperator: property?.defaultOperator ?? '=',\n getValueFormatter: operator => (operator ? extendedOperators.get(operator)?.format ?? null : null),\n getValueFormRenderer: operator => (operator ? extendedOperators.get(operator)?.form ?? null : null),\n externalProperty: property,\n });\n return acc;\n }, new Map());\n const getProperty = (propertyKey: string): null | InternalFilteringProperty =>\n propertyByKey.get(propertyKey) ?? null;\n\n const internalOptions: readonly InternalFilteringOption[] = filteringOptions.map(option => ({\n property: getProperty(option.propertyKey),\n value: option.value,\n label: option.label ?? option.value ?? '',\n }));\n\n const internalQuery: InternalQuery = {\n operation: query.operation,\n tokens: query.tokens.map(token => ({\n property: token.propertyKey ? getProperty(token.propertyKey) : null,\n operator: token.operator,\n value: token.value,\n })),\n };\n\n const internalFreeText: InternalFreeTextFiltering = {\n disabled: disableFreeTextFiltering,\n operators: freeTextFiltering?.operators ?? [':', '!:'],\n defaultOperator: freeTextFiltering?.defaultOperator ?? ':',\n };\n\n return { internalProperties: [...propertyByKey.values()], internalOptions, internalQuery, internalFreeText };\n })();\n\n const parsedText = parseText(filteringText, internalProperties, internalFreeText);\n const autosuggestOptions = getAutosuggestOptions(\n parsedText,\n internalProperties,\n internalOptions,\n customGroupsText,\n i18nStrings\n );\n\n const createToken = (currentText: string) => {\n const parsedText = parseText(currentText, internalProperties, internalFreeText);\n let newToken: Token;\n switch (parsedText.step) {\n case 'property': {\n newToken = matchTokenValue(\n {\n property: parsedText.property,\n operator: parsedText.operator,\n value: parsedText.value,\n },\n internalOptions\n );\n break;\n }\n case 'free-text': {\n newToken = {\n operator: parsedText.operator || internalFreeText.defaultOperator,\n value: parsedText.value,\n };\n break;\n }\n case 'operator': {\n newToken = {\n operator: internalFreeText.defaultOperator,\n value: currentText,\n };\n break;\n }\n }\n if (internalFreeText.disabled && !('propertyKey' in newToken)) {\n return;\n }\n addToken(newToken);\n setFilteringText('');\n };\n const ignoreKeyDown = useRef(false);\n const handleKeyDown: PropertyFilterAutosuggestProps['onKeyDown'] = event => {\n if (filteringText && !ignoreKeyDown.current && event.detail.keyCode === KeyCode.enter) {\n createToken(filteringText);\n }\n };\n const getLoadMoreDetail = (parsedText: ParsedText, filteringText: string) => {\n const loadMoreDetail: {\n filteringProperty: FilteringProperty | undefined;\n filteringText: string;\n filteringOperator: ComparisonOperator | undefined;\n } = {\n filteringProperty: undefined,\n filteringText,\n filteringOperator: undefined,\n };\n if (parsedText.step === 'property') {\n loadMoreDetail.filteringProperty = parsedText.property.externalProperty;\n loadMoreDetail.filteringText = parsedText.value;\n loadMoreDetail.filteringOperator = parsedText.operator;\n }\n return loadMoreDetail;\n };\n const loadMoreDetail = getLoadMoreDetail(parsedText, filteringText);\n const inputLoadItemsHandlers = useLoadItems(\n onLoadItems,\n loadMoreDetail.filteringText,\n loadMoreDetail.filteringProperty,\n loadMoreDetail.filteringText,\n loadMoreDetail.filteringOperator\n );\n const asyncProps = {\n empty: filteringEmpty,\n loadingText: filteringLoadingText,\n finishedText: filteringFinishedText,\n errorText: filteringErrorText,\n recoveryText: filteringRecoveryText,\n statusType: filteringStatusType,\n };\n const asyncAutosuggestProps =\n !!filteringText.length || asyncProperties\n ? {\n ...inputLoadItemsHandlers,\n ...asyncProps,\n }\n : {};\n const handleSelected: PropertyFilterAutosuggestProps['onOptionClick'] = event => {\n // The ignoreKeyDown flag makes sure `createToken` routine runs only once. Autosuggest's `onKeyDown` fires,\n // when an item is selected from the list using \"enter\" key.\n ignoreKeyDown.current = true;\n setTimeout(() => {\n ignoreKeyDown.current = false;\n }, 0);\n const { detail: option } = event;\n const value = option.value || '';\n\n if (!('keepOpenOnSelect' in option)) {\n createToken(value);\n return;\n }\n\n // stop dropdown from closing\n event.preventDefault();\n\n const parsedText = parseText(value, internalProperties, internalFreeText);\n const loadMoreDetail = getLoadMoreDetail(parsedText, value);\n\n // Insert operator automatically if only one operator is defined for the given property.\n if (parsedText.step === 'operator') {\n const operators = getAllowedOperators(parsedText.property);\n if (value.trim() === parsedText.property.propertyLabel && operators.length === 1) {\n loadMoreDetail.filteringProperty = parsedText.property.externalProperty ?? undefined;\n loadMoreDetail.filteringOperator = operators[0];\n loadMoreDetail.filteringText = '';\n setFilteringText(parsedText.property.propertyLabel + ' ' + operators[0] + ' ');\n }\n }\n\n fireNonCancelableEvent(onLoadItems, { ...loadMoreDetail, firstPage: true, samePage: false });\n };\n\n const operatorForm =\n parsedText.step === 'property' && parsedText.property.getValueFormRenderer(parsedText.operator);\n\n const searchResultsId = useUniqueId('property-filter-search-results');\n\n return (\n
      \n
      \n {customControl &&
      {customControl}
      }\n setFilteringText(event.detail.value)}\n empty={filteringEmpty}\n {...asyncAutosuggestProps}\n expandToViewport={expandToViewport}\n onOptionClick={handleSelected}\n customForm={\n operatorForm && (\n {\n setFilteringText('');\n inputRef.current?.close();\n inputRef.current?.focus({ preventDropdown: true });\n }}\n onSubmit={token => {\n addToken(token);\n setFilteringText('');\n inputRef.current?.focus({ preventDropdown: true });\n inputRef.current?.close();\n }}\n />\n )\n }\n hideEnteredTextOption={internalFreeText.disabled && parsedText.step !== 'property'}\n clearAriaLabel={i18nStrings.clearAriaLabel}\n searchResultsId={showResults ? searchResultsId : undefined}\n />\n {showResults ? (\n
      \n {countText}\n
      \n ) : null}\n
      \n {internalQuery.tokens && internalQuery.tokens.length > 0 && (\n
      \n \n (\n {\n removeToken(tokenIndex);\n setRemovedTokenIndex(tokenIndex);\n }}\n setToken={(newToken: Token) => setToken(tokenIndex, newToken)}\n setOperation={setOperation}\n filteringProperties={internalProperties}\n filteringOptions={internalOptions}\n asyncProps={asyncProps}\n onLoadItems={onLoadItems}\n i18nStrings={i18nStrings}\n asyncProperties={asyncProperties}\n hideOperations={hideOperations}\n customGroupsText={customGroupsText}\n freeTextFiltering={internalFreeText}\n disabled={disabled}\n expandToViewport={expandToViewport}\n />\n )}\n i18nStrings={{\n limitShowFewer: i18nStrings.tokenLimitShowFewer,\n limitShowMore: i18nStrings.tokenLimitShowMore,\n }}\n after={\n customFilterActions ? (\n
      {customFilterActions}
      \n ) : (\n \n {i18nStrings.clearFiltersText}\n \n )\n }\n moveFocusNextToIndex={removedTokenIndex}\n />\n
      \n
      \n )}\n
      \n );\n }\n);\n\napplyDisplayName(PropertyFilter, 'PropertyFilter');\nexport default PropertyFilter;\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport {\n ComparisonOperator,\n GroupText,\n I18nStrings,\n InternalFilteringOption,\n InternalFilteringProperty,\n InternalFreeTextFiltering,\n InternalToken,\n JoinOperation,\n LoadItemsDetail,\n Token,\n} from './interfaces';\nimport styles from './styles.css.js';\nimport { TokenEditor } from './token-editor';\n\nimport FilteringToken from '../internal/components/filtering-token';\nimport { NonCancelableEventHandler } from '../internal/events';\nimport { DropdownStatusProps } from '../internal/components/dropdown-status/interfaces';\nimport { getFormattedToken } from './utils';\n\ninterface TokenProps {\n asyncProperties?: boolean;\n asyncProps: DropdownStatusProps;\n customGroupsText: readonly GroupText[];\n disabled?: boolean;\n freeTextFiltering: InternalFreeTextFiltering;\n expandToViewport?: boolean;\n filteringProperties: readonly InternalFilteringProperty[];\n filteringOptions: readonly InternalFilteringOption[];\n first?: boolean;\n hideOperations?: boolean;\n i18nStrings: I18nStrings;\n onLoadItems?: NonCancelableEventHandler;\n operation: JoinOperation;\n removeToken: () => void;\n setOperation: (newOperation: JoinOperation) => void;\n setToken: (newToken: Token) => void;\n token: InternalToken;\n}\n\nexport const TokenButton = ({\n token,\n operation = 'and',\n first,\n removeToken,\n setToken,\n setOperation,\n filteringProperties,\n filteringOptions,\n asyncProps,\n onLoadItems,\n i18nStrings,\n asyncProperties,\n hideOperations,\n customGroupsText,\n disabled,\n freeTextFiltering,\n expandToViewport,\n}: TokenProps) => {\n const externalToken = { ...token, propertyKey: token.property?.propertyKey };\n const formattedToken = getFormattedToken(token);\n return (\n \n \n \n \n }\n filteringProperties={filteringProperties}\n filteringOptions={filteringOptions}\n token={token}\n asyncProps={asyncProps}\n onLoadItems={onLoadItems}\n i18nStrings={i18nStrings}\n asyncProperties={asyncProperties}\n customGroupsText={customGroupsText}\n freeTextFiltering={freeTextFiltering}\n expandToViewport={expandToViewport}\n />\n \n );\n};\n\nconst TokenTrigger = ({\n property,\n operator,\n value,\n}: {\n property?: string;\n operator?: ComparisonOperator;\n value: string;\n}) => {\n if (property) {\n property += ' ';\n }\n const freeTextContainsToken = operator === ':' && !property;\n const operatorText = freeTextContainsToken ? '' : operator + ' ';\n return (\n <>\n {property}\n {operatorText}\n {value}\n \n );\n};\n", "\n import './styles.scoped.css';\n export default {\n \"root\": \"awsui_root_1wzqe_d6xov_99\",\n \"search-field\": \"awsui_search-field_1wzqe_d6xov_134\",\n \"input-wrapper\": \"awsui_input-wrapper_1wzqe_d6xov_140\",\n \"add-token\": \"awsui_add-token_1wzqe_d6xov_144\",\n \"tokens\": \"awsui_tokens_1wzqe_d6xov_151\",\n \"token-operator\": \"awsui_token-operator_1wzqe_d6xov_156\",\n \"property-editor\": \"awsui_property-editor_1wzqe_d6xov_160\",\n \"token-editor\": \"awsui_token-editor_1wzqe_d6xov_161\",\n \"property-editor-form\": \"awsui_property-editor-form_1wzqe_d6xov_166\",\n \"token-editor-form\": \"awsui_token-editor-form_1wzqe_d6xov_167\",\n \"property-editor-field-property\": \"awsui_property-editor-field-property_1wzqe_d6xov_170\",\n \"token-editor-field-property\": \"awsui_token-editor-field-property_1wzqe_d6xov_171\",\n \"property-editor-field-operator\": \"awsui_property-editor-field-operator_1wzqe_d6xov_174\",\n \"token-editor-field-operator\": \"awsui_token-editor-field-operator_1wzqe_d6xov_175\",\n \"property-editor-field-value\": \"awsui_property-editor-field-value_1wzqe_d6xov_178\",\n \"token-editor-field-value\": \"awsui_token-editor-field-value_1wzqe_d6xov_179\",\n \"property-editor-cancel\": \"awsui_property-editor-cancel_1wzqe_d6xov_182\",\n \"token-editor-cancel\": \"awsui_token-editor-cancel_1wzqe_d6xov_183\",\n \"property-editor-submit\": \"awsui_property-editor-submit_1wzqe_d6xov_186\",\n \"token-editor-submit\": \"awsui_token-editor-submit_1wzqe_d6xov_187\",\n \"property-editor-actions\": \"awsui_property-editor-actions_1wzqe_d6xov_190\",\n \"token-editor-actions\": \"awsui_token-editor-actions_1wzqe_d6xov_191\",\n \"custom-content-wrapper\": \"awsui_custom-content-wrapper_1wzqe_d6xov_209\",\n \"custom-control\": \"awsui_custom-control_1wzqe_d6xov_213\",\n \"input\": \"awsui_input_1wzqe_d6xov_140\",\n \"results\": \"awsui_results_1wzqe_d6xov_221\",\n \"token-trigger\": \"awsui_token-trigger_1wzqe_d6xov_226\",\n \"remove-all\": \"awsui_remove-all_1wzqe_d6xov_231\",\n \"token-label\": \"awsui_token-label_1wzqe_d6xov_232\",\n \"join-operation\": \"awsui_join-operation_1wzqe_d6xov_233\",\n \"custom-filter-actions\": \"awsui_custom-filter-actions_1wzqe_d6xov_234\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useState, useRef } from 'react';\n\nimport { SelectProps } from '../select/interfaces';\nimport InternalSelect from '../select/internal';\nimport InternalAutosuggest from '../autosuggest/internal';\nimport InternalPopover, { InternalPopoverRef } from '../popover/internal';\nimport {\n ComparisonOperator,\n GroupText,\n I18nStrings,\n InternalFilteringOption,\n InternalFilteringProperty,\n InternalFreeTextFiltering,\n InternalToken,\n LoadItemsDetail,\n Token,\n} from './interfaces';\nimport styles from './styles.css.js';\nimport { useLoadItems } from './use-load-items';\nimport {\n createPropertiesCompatibilityMap,\n getAllowedOperators,\n operatorToDescription,\n getPropertySuggestions,\n} from './controller';\nimport { NonCancelableEventHandler } from '../internal/events';\nimport { DropdownStatusProps } from '../internal/components/dropdown-status/interfaces';\nimport InternalButton from '../button/internal';\nimport InternalFormField from '../form-field/internal';\nimport { matchTokenValue } from './utils';\n\ninterface PropertyInputProps {\n asyncProps: null | DropdownStatusProps;\n customGroupsText: readonly GroupText[];\n freeTextFiltering: InternalFreeTextFiltering;\n filteringProperties: readonly InternalFilteringProperty[];\n i18nStrings: I18nStrings;\n onChangePropertyKey: (propertyKey: undefined | string) => void;\n onLoadItems?: NonCancelableEventHandler;\n property: null | InternalFilteringProperty;\n}\n\nfunction PropertyInput({\n property,\n onChangePropertyKey,\n asyncProps,\n filteringProperties,\n onLoadItems,\n customGroupsText,\n i18nStrings,\n freeTextFiltering,\n}: PropertyInputProps) {\n const propertySelectHandlers = useLoadItems(onLoadItems);\n const asyncPropertySelectProps = asyncProps ? { ...asyncProps, ...propertySelectHandlers } : {};\n const propertyOptions: (SelectProps.Option | SelectProps.OptionGroup)[] = getPropertySuggestions(\n filteringProperties,\n customGroupsText,\n i18nStrings,\n ({ propertyKey, propertyLabel }) => ({\n value: propertyKey,\n label: propertyLabel,\n dontCloseOnSelect: true,\n })\n );\n\n // Disallow selecting properties that have different representation.\n const checkPropertiesCompatible = createPropertiesCompatibilityMap(filteringProperties);\n propertyOptions.forEach(optionGroup => {\n if ('options' in optionGroup) {\n optionGroup.options.forEach(option => {\n if (property?.propertyKey && option.value) {\n option.disabled = !checkPropertiesCompatible(option.value, property.propertyKey);\n }\n });\n }\n });\n\n const allPropertiesOption = {\n label: i18nStrings.allPropertiesLabel,\n value: undefined,\n };\n if (!freeTextFiltering.disabled) {\n propertyOptions.unshift(allPropertiesOption);\n }\n return (\n onChangePropertyKey(e.detail.selectedOption.value)}\n {...asyncPropertySelectProps}\n />\n );\n}\n\ninterface OperatorInputProps {\n i18nStrings: I18nStrings;\n onChangeOperator: (operator: ComparisonOperator) => void;\n operator: undefined | ComparisonOperator;\n property: null | InternalFilteringProperty;\n freeTextFiltering: InternalFreeTextFiltering;\n}\n\nfunction OperatorInput({ property, operator, onChangeOperator, i18nStrings, freeTextFiltering }: OperatorInputProps) {\n const operatorOptions = (property ? getAllowedOperators(property) : freeTextFiltering.operators).map(operator => ({\n value: operator,\n label: operator,\n description: operatorToDescription(operator, i18nStrings),\n }));\n return (\n onChangeOperator(e.detail.selectedOption.value as ComparisonOperator)}\n />\n );\n}\n\ninterface ValueInputProps {\n asyncProps: DropdownStatusProps;\n filteringOptions: readonly InternalFilteringOption[];\n i18nStrings: I18nStrings;\n onChangeValue: (value: string) => void;\n onLoadItems?: NonCancelableEventHandler;\n operator: undefined | ComparisonOperator;\n property: null | InternalFilteringProperty;\n value: undefined | string;\n}\n\nfunction ValueInput({\n property,\n operator,\n value,\n onChangeValue,\n asyncProps,\n filteringOptions,\n onLoadItems,\n i18nStrings,\n}: ValueInputProps) {\n const valueOptions = property\n ? filteringOptions\n .filter(option => option.property?.propertyKey === property.propertyKey)\n .map(({ label, value }) => ({ label, value }))\n : [];\n\n const valueAutosuggestHandlers = useLoadItems(onLoadItems, '', property?.externalProperty);\n const asyncValueAutosuggestProps = property?.propertyKey\n ? { ...valueAutosuggestHandlers, ...asyncProps }\n : { empty: asyncProps.empty };\n const [matchedOption] = valueOptions.filter(option => option.value === value);\n\n const OperatorForm = property?.propertyKey && operator && property?.getValueFormRenderer(operator);\n\n return OperatorForm ? (\n \n ) : (\n value)}\n value={matchedOption?.label ?? value ?? ''}\n clearAriaLabel={i18nStrings.clearAriaLabel}\n onChange={e => onChangeValue(e.detail.value)}\n disabled={!operator}\n options={valueOptions}\n {...asyncValueAutosuggestProps}\n virtualScroll={true}\n />\n );\n}\n\ninterface TokenEditorProps {\n asyncProperties?: boolean;\n asyncProps: DropdownStatusProps;\n customGroupsText: readonly GroupText[];\n disabled?: boolean;\n freeTextFiltering: InternalFreeTextFiltering;\n expandToViewport?: boolean;\n filteringProperties: readonly InternalFilteringProperty[];\n filteringOptions: readonly InternalFilteringOption[];\n i18nStrings: I18nStrings;\n onLoadItems?: NonCancelableEventHandler;\n setToken: (newToken: Token) => void;\n token: InternalToken;\n triggerComponent?: React.ReactNode;\n}\n\nexport function TokenEditor({\n asyncProperties,\n asyncProps,\n customGroupsText,\n freeTextFiltering,\n expandToViewport,\n filteringProperties,\n filteringOptions,\n i18nStrings,\n onLoadItems,\n setToken,\n token,\n triggerComponent,\n}: TokenEditorProps) {\n const [temporaryToken, setTemporaryToken] = useState(token);\n const popoverRef = useRef(null);\n const closePopover = () => {\n popoverRef.current && popoverRef.current.dismissPopover();\n };\n\n const property = temporaryToken.property;\n const onChangePropertyKey = (newPropertyKey: undefined | string) => {\n const filteringProperty = filteringProperties.reduce(\n (acc, property) => (property.propertyKey === newPropertyKey ? property : acc),\n undefined\n );\n const allowedOperators = filteringProperty ? getAllowedOperators(filteringProperty) : freeTextFiltering.operators;\n const operator =\n temporaryToken.operator && allowedOperators.indexOf(temporaryToken.operator) !== -1\n ? temporaryToken.operator\n : allowedOperators[0];\n const matchedProperty = filteringProperties.find(property => property.propertyKey === newPropertyKey) ?? null;\n setTemporaryToken({ ...temporaryToken, property: matchedProperty, operator });\n };\n\n const operator = temporaryToken.operator;\n const onChangeOperator = (newOperator: ComparisonOperator) => {\n setTemporaryToken({ ...temporaryToken, operator: newOperator });\n };\n\n const value = temporaryToken.value;\n const onChangeValue = (newValue: string) => {\n setTemporaryToken({ ...temporaryToken, value: newValue });\n };\n\n return (\n setTemporaryToken(token)}\n renderWithPortal={expandToViewport}\n content={\n
      \n
      \n \n \n \n\n \n \n \n\n \n \n \n
      \n\n
      \n \n {i18nStrings.cancelActionText}\n \n {\n setToken(matchTokenValue(temporaryToken, filteringOptions));\n closePopover();\n }}\n >\n {i18nStrings.applyActionText}\n \n
      \n
      \n }\n >\n {triggerComponent}\n \n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useRef } from 'react';\n\nimport { fireNonCancelableEvent, NonCancelableEventHandler } from '../internal/events/index';\nimport { AutosuggestProps } from '../autosuggest/interfaces';\n\nimport { ComparisonOperator, FilteringProperty, LoadItemsDetail } from './interfaces';\n\n/**\n * This hook generates `onBlur`, `onFocus` and `onLoadItems` handlers that make sure an `onLoadItems` event\n * fires exactly once every time control they are used on gets focused.\n * It is necessary to do this because Autosuggest and Select dedupe their `onLoadItems` events stopping\n * the same event from firing twice in a row. This means, refocusing the control sometimes results in\n * `onLoadItems` firing, but sometimes not.\n */\nexport const useLoadItems = (\n onLoadItems?: NonCancelableEventHandler,\n focusFilteringText?: string,\n currentFilteringProperty?: FilteringProperty,\n currentFilteringText?: string,\n currentFilteringOperator?: ComparisonOperator\n) => {\n const focusIn = useRef(false);\n const handleBlur = () => {\n focusIn.current = true;\n };\n const fireLoadItems = (detail: { firstPage: boolean; samePage: boolean; filteringText?: string }) => {\n fireNonCancelableEvent(onLoadItems, {\n ...detail,\n filteringText: currentFilteringText ?? detail.filteringText ?? '',\n filteringProperty: currentFilteringProperty,\n filteringOperator: currentFilteringOperator,\n });\n focusIn.current = false;\n };\n const handleFocus = () => {\n if (focusIn.current) {\n fireLoadItems({ firstPage: true, samePage: false, filteringText: focusFilteringText });\n }\n };\n const handleLoadItems: NonCancelableEventHandler = ({ detail }) =>\n fireLoadItems(detail);\n return {\n onBlur: handleBlur,\n onFocus: handleFocus,\n onLoadItems: handleLoadItems,\n };\n};\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n ComparisonOperator,\n InternalFilteringOption,\n InternalFilteringProperty,\n InternalToken,\n Token,\n} from './interfaces';\n\n// Finds the longest property the filtering text starts from.\nexport function matchFilteringProperty(\n filteringProperties: readonly InternalFilteringProperty[],\n filteringText: string\n): null | InternalFilteringProperty {\n let maxLength = 0;\n let matchedProperty: null | InternalFilteringProperty = null;\n\n for (const property of filteringProperties) {\n if (\n (property.propertyLabel.length >= maxLength && startsWith(filteringText, property.propertyLabel)) ||\n (property.propertyLabel.length > maxLength &&\n startsWith(filteringText.toLowerCase(), property.propertyLabel.toLowerCase()))\n ) {\n maxLength = property.propertyLabel.length;\n matchedProperty = property;\n }\n }\n\n return matchedProperty;\n}\n\n// Finds the longest operator the filtering text starts from.\nexport function matchOperator(\n allowedOperators: readonly ComparisonOperator[],\n filteringText: string\n): null | ComparisonOperator {\n filteringText = filteringText.toLowerCase();\n\n let maxLength = 0;\n let matchedOperator: null | ComparisonOperator = null;\n\n for (const operator of allowedOperators) {\n if (operator.length > maxLength && startsWith(filteringText, operator.toLowerCase())) {\n maxLength = operator.length;\n matchedOperator = operator;\n }\n }\n\n return matchedOperator;\n}\n\n// Finds if the filtering text matches any operator prefix.\nexport function matchOperatorPrefix(\n allowedOperators: readonly ComparisonOperator[],\n filteringText: string\n): null | string {\n if (filteringText.trim().length === 0) {\n return '';\n }\n for (const operator of allowedOperators) {\n if (startsWith(operator.toLowerCase(), filteringText.toLowerCase())) {\n return filteringText;\n }\n }\n return null;\n}\n\nexport function matchTokenValue(\n { property, operator, value }: InternalToken,\n filteringOptions: readonly InternalFilteringOption[]\n): Token {\n const propertyOptions = filteringOptions.filter(option => option.property === property);\n const bestMatch: Token = { propertyKey: property?.propertyKey, operator, value };\n for (const option of propertyOptions) {\n if ((option.label && option.label === value) || (!option.label && option.value === value)) {\n // exact match found: return it\n return { propertyKey: property?.propertyKey, operator, value: option.value };\n }\n\n // By default, the token value is a string, but when a custom property is used,\n // the token value can be any, therefore we need to check for its type before calling toLowerCase()\n if (typeof value === 'string' && value.toLowerCase() === (option.label ?? option.value ?? '').toLowerCase()) {\n // non-exact match: save and keep running in case exact match found later\n bestMatch.value = option.value;\n }\n }\n\n return bestMatch;\n}\n\nexport function getFormattedToken(token: InternalToken) {\n const valueFormatter = token.property?.getValueFormatter(token.operator);\n const propertyLabel = token.property && token.property.propertyLabel;\n const tokenValue = valueFormatter ? valueFormatter(token.value) : token.value;\n const label = `${propertyLabel ?? ''} ${token.operator} ${tokenValue}`;\n return { property: propertyLabel ?? '', operator: token.operator, value: tokenValue, label };\n}\n\nexport function trimStart(source: string): string {\n let spacesLength = 0;\n for (let i = 0; i < source.length; i++) {\n if (source[i] === ' ') {\n spacesLength++;\n } else {\n break;\n }\n }\n return source.slice(spacesLength);\n}\n\nexport function trimFirstSpace(source: string): string {\n return source[0] === ' ' ? source.slice(1) : source;\n}\n\nexport function removeOperator(source: string, operator: string) {\n const operatorLastIndex = source.indexOf(operator) + operator.length;\n const textWithoutOperator = source.slice(operatorLastIndex);\n // We need to remove the first leading space in case the user presses space\n // after the operator, for example: Owner: admin, will result in value of ` admin`\n // and we need to remove the first space, if the user added any more spaces only the\n // first one will be removed.\n return trimFirstSpace(textWithoutOperator);\n}\n\nfunction startsWith(source: string, target: string): boolean {\n return source.indexOf(target) === 0;\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n ComparisonOperator,\n ExtendedOperatorForm,\n GroupText,\n I18nStrings,\n InternalFilteringOption,\n InternalFilteringProperty,\n InternalFreeTextFiltering,\n JoinOperation,\n ParsedText,\n Query,\n Token,\n} from './interfaces';\nimport { fireNonCancelableEvent, NonCancelableEventHandler } from '../internal/events';\nimport { AutosuggestProps } from '../autosuggest/interfaces';\nimport { matchFilteringProperty, matchOperator, matchOperatorPrefix, removeOperator, trimStart } from './utils';\nimport { AutosuggestInputRef } from '../internal/components/autosuggest-input';\n\nexport const getQueryActions = (\n query: Query,\n onChange: NonCancelableEventHandler,\n inputRef: React.RefObject\n) => {\n const { tokens, operation } = query;\n const fireOnChange = (tokens: readonly Token[], operation: JoinOperation) =>\n fireNonCancelableEvent(onChange, { tokens, operation });\n const setToken = (index: number, newToken: Token) => {\n const newTokens = [...tokens];\n if (newTokens && index < newTokens.length) {\n newTokens[index] = newToken;\n }\n fireOnChange(newTokens, operation);\n };\n const removeToken = (index: number) => {\n const newTokens = tokens.filter((_, i) => i !== index);\n fireOnChange(newTokens, operation);\n inputRef.current?.focus({ preventDropdown: true });\n };\n const removeAllTokens = () => {\n fireOnChange([], operation);\n inputRef.current?.focus({ preventDropdown: true });\n };\n const addToken = (newToken: Token) => {\n const newTokens = [...tokens];\n newTokens.push(newToken);\n fireOnChange(newTokens, operation);\n };\n const setOperation = (newOperation: JoinOperation) => {\n fireOnChange(tokens, newOperation);\n };\n return {\n setToken,\n removeToken,\n removeAllTokens,\n addToken,\n setOperation,\n };\n};\n\nexport const getAllowedOperators = (property: InternalFilteringProperty): ComparisonOperator[] => {\n const { operators = [], defaultOperator } = property;\n const operatorOrder = ['=', '!=', ':', '!:', '^', '!^', '>=', '<=', '<', '>'] as const;\n const operatorSet = new Set([defaultOperator, ...operators]);\n return operatorOrder.filter(op => operatorSet.has(op));\n};\n\n/*\n * parses the value of the filtering input to figure out the current step of entering the token:\n * - \"property\": means that a filter on a particular column is being added, with operator already finalized\n * - \"operator\": means that a filter on a particular column is being added, with operator not yet finalized\n * - \"free-text\": means that a \"free text\" token is being added\n */\nexport const parseText = (\n filteringText: string,\n filteringProperties: readonly InternalFilteringProperty[],\n freeTextFiltering: InternalFreeTextFiltering\n): ParsedText => {\n const property = matchFilteringProperty(filteringProperties, filteringText);\n if (!property) {\n if (!freeTextFiltering.disabled) {\n // For free text filtering, we allow ! as a shortcut for !:\n const freeTextOperators =\n freeTextFiltering.operators.indexOf('!:') >= 0\n ? ['!', ...freeTextFiltering.operators]\n : freeTextFiltering.operators;\n const operator = matchOperator(freeTextOperators, filteringText);\n if (operator) {\n return {\n step: 'free-text',\n operator: operator === '!' ? '!:' : operator,\n value: removeOperator(filteringText, operator),\n };\n }\n }\n\n return {\n step: 'free-text',\n value: filteringText,\n };\n }\n\n const allowedOps = getAllowedOperators(property);\n\n const textWithoutProperty = filteringText.substring(property.propertyLabel.length);\n const operator = matchOperator(allowedOps, trimStart(textWithoutProperty));\n if (operator) {\n return {\n step: 'property',\n property,\n operator,\n value: removeOperator(textWithoutProperty, operator),\n };\n }\n\n const operatorPrefix = matchOperatorPrefix(allowedOps, trimStart(textWithoutProperty));\n if (operatorPrefix !== null) {\n return { step: 'operator', property, operatorPrefix };\n }\n\n return {\n step: 'free-text',\n value: filteringText,\n };\n};\n\ninterface OptionGroup {\n label: string;\n options: T[];\n}\n\nexport const getAllValueSuggestions = (\n filteringOptions: readonly InternalFilteringOption[],\n operator: ComparisonOperator | undefined = '=',\n i18nStrings: I18nStrings,\n customGroupsText: readonly GroupText[]\n) => {\n const defaultGroup: OptionGroup = {\n label: i18nStrings.groupValuesText ?? '',\n options: [],\n };\n const customGroups: { [K in string]: OptionGroup } = {};\n filteringOptions.forEach(filteringOption => {\n const property = filteringOption.property;\n // given option refers to a non-existent filtering property\n if (!property) {\n return;\n }\n // this option's filtering property does not support current operator\n if (getAllowedOperators(property).indexOf(operator) === -1) {\n return;\n }\n if (property.propertyGroup && !customGroups[property.propertyGroup]) {\n const label = customGroupsText.reduce(\n (acc, customGroup) => (customGroup.group === property.propertyGroup ? customGroup.values : acc),\n ''\n );\n customGroups[property.propertyGroup] = {\n label,\n options: [],\n };\n }\n const propertyGroup = property.propertyGroup ? customGroups[property.propertyGroup] : defaultGroup;\n propertyGroup.options.push({\n value: property.propertyLabel + ' ' + (operator || '=') + ' ' + filteringOption.value,\n label: filteringOption.label,\n __labelPrefix: property.propertyLabel + ' ' + (operator || '='),\n });\n });\n return [defaultGroup, ...Object.keys(customGroups).map(group => customGroups[group])];\n};\n\nexport function createPropertiesCompatibilityMap(\n filteringProperties: readonly InternalFilteringProperty[]\n): (propertyA: string, propertyB: string) => boolean {\n const lookup: {\n [propertyKey: string]: { operator: string; form: ExtendedOperatorForm | null }[];\n } = {};\n\n for (const property of filteringProperties) {\n lookup[property.propertyKey] = (property.operators || [])\n .map(operator => ({ operator, form: property.getValueFormRenderer(operator) }))\n .sort((a, b) => a.operator.localeCompare(b.operator));\n }\n\n return (propertyA: string, propertyB: string) => {\n if (lookup[propertyA].length !== lookup[propertyB].length) {\n return false;\n }\n for (let i = 0; i < lookup[propertyA].length; i++) {\n if (lookup[propertyA][i].operator !== lookup[propertyB][i].operator) {\n return false;\n }\n if (lookup[propertyA][i].form !== lookup[propertyB][i].form) {\n return false;\n }\n }\n return true;\n };\n}\n\nconst filteringPropertyToAutosuggestOption = (filteringProperty: InternalFilteringProperty) => ({\n value: filteringProperty.propertyLabel,\n label: filteringProperty.propertyLabel,\n keepOpenOnSelect: true,\n});\n\nexport function getPropertySuggestions(\n filteringProperties: readonly InternalFilteringProperty[],\n customGroupsText: readonly GroupText[],\n i18nStrings: I18nStrings,\n filteringPropertyToOption: (filteringProperty: InternalFilteringProperty) => T\n) {\n const defaultGroup: OptionGroup = {\n label: i18nStrings.groupPropertiesText ?? '',\n options: [],\n };\n const customGroups: { [K in string]: OptionGroup } = {};\n\n filteringProperties.forEach(filteringProperty => {\n const { propertyGroup } = filteringProperty;\n let optionsGroup = defaultGroup;\n if (propertyGroup) {\n if (!customGroups[propertyGroup]) {\n const label = customGroupsText.reduce(\n (acc, customGroup) => (customGroup.group === propertyGroup ? customGroup.properties : acc),\n ''\n );\n customGroups[propertyGroup] = { options: [], label };\n }\n optionsGroup = customGroups[propertyGroup];\n }\n optionsGroup.options.push(filteringPropertyToOption(filteringProperty));\n });\n const defaultGroupArray = defaultGroup.options.length ? [defaultGroup] : [];\n const customGroupsArray = Object.keys(customGroups).map(groupKey => customGroups[groupKey]);\n return [...defaultGroupArray, ...customGroupsArray];\n}\n\nexport const getAutosuggestOptions = (\n parsedText: ParsedText,\n filteringProperties: readonly InternalFilteringProperty[],\n filteringOptions: readonly InternalFilteringOption[],\n customGroupsText: readonly GroupText[],\n i18nStrings: I18nStrings\n) => {\n switch (parsedText.step) {\n case 'property': {\n const { propertyLabel, groupValuesLabel } = parsedText.property;\n const options = filteringOptions.filter(o => o.property === parsedText.property);\n return {\n filterText: parsedText.value,\n options: [\n {\n options: options.map(({ label, value }) => ({\n value: propertyLabel + ' ' + parsedText.operator + ' ' + value,\n label: label,\n __labelPrefix: propertyLabel + ' ' + parsedText.operator,\n })),\n label: groupValuesLabel,\n },\n ],\n };\n }\n case 'operator': {\n return {\n filterText: parsedText.property.propertyLabel + ' ' + parsedText.operatorPrefix,\n options: [\n ...getPropertySuggestions(\n filteringProperties,\n customGroupsText,\n i18nStrings,\n filteringPropertyToAutosuggestOption\n ),\n {\n options: getAllowedOperators(parsedText.property).map(value => ({\n value: parsedText.property.propertyLabel + ' ' + value + ' ',\n label: parsedText.property.propertyLabel + ' ' + value,\n description: operatorToDescription(value, i18nStrings),\n keepOpenOnSelect: true,\n })),\n label: i18nStrings.operatorsText,\n },\n ],\n };\n }\n case 'free-text': {\n const needsValueSuggestions = !!parsedText.value;\n const needsPropertySuggestions = !(parsedText.step === 'free-text' && parsedText.operator === '!:');\n return {\n filterText: parsedText.value,\n options: [\n ...(needsPropertySuggestions\n ? getPropertySuggestions(\n filteringProperties,\n customGroupsText,\n i18nStrings,\n filteringPropertyToAutosuggestOption\n )\n : []),\n ...(needsValueSuggestions\n ? getAllValueSuggestions(filteringOptions, parsedText.operator, i18nStrings, customGroupsText)\n : []),\n ],\n };\n }\n }\n};\n\nexport const operatorToDescription = (operator: ComparisonOperator, i18nStrings: I18nStrings) => {\n switch (operator) {\n case '<':\n return i18nStrings.operatorLessText;\n case '<=':\n return i18nStrings.operatorLessOrEqualText;\n case '>':\n return i18nStrings.operatorGreaterText;\n case '>=':\n return i18nStrings.operatorGreaterOrEqualText;\n case ':':\n return i18nStrings.operatorContainsText;\n case '!:':\n return i18nStrings.operatorDoesNotContainText;\n case '=':\n return i18nStrings.operatorEqualsText;\n case '!=':\n return i18nStrings.operatorDoesNotEqualText;\n case '^':\n return i18nStrings.operatorStartsWithText;\n case '!^':\n return i18nStrings.operatorDoesNotStartWithText;\n // The line is ignored from coverage because it is not reachable.\n // The purpose of it is to prevent TS errors if ComparisonOperator type gets extended.\n /* istanbul ignore next */\n default:\n return '';\n }\n};\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport InternalSelect from '../../../select/internal';\nimport InternalIcon from '../../../icon/internal';\n\nimport styles from './styles.css.js';\n\nexport namespace FilteringTokenProps {\n export type Operation = 'and' | 'or';\n}\n\nexport interface FilteringTokenProps {\n ariaLabel?: string;\n showOperation: boolean;\n operation: FilteringTokenProps.Operation;\n andText: string;\n orText: string;\n dismissAriaLabel?: string;\n operatorAriaLabel?: string;\n disabled?: boolean;\n\n children: React.ReactNode;\n\n onChange: (op: FilteringTokenProps.Operation) => void;\n onDismiss: () => void;\n}\n\nexport default function FilteringToken({\n ariaLabel,\n showOperation,\n operation,\n andText,\n orText,\n dismissAriaLabel,\n operatorAriaLabel,\n disabled,\n children,\n onChange,\n onDismiss,\n}: FilteringTokenProps) {\n return (\n
      \n {showOperation && (\n onChange(e.detail.selectedOption.value as FilteringTokenProps.Operation)}\n disabled={disabled}\n ariaLabel={operatorAriaLabel}\n />\n )}\n \n
      {children}
      \n \n \n \n
      \n \n );\n}\n", "\n import './styles.scoped.css';\n export default {\n \"root\": \"awsui_root_10m3l_ilcbp_103\",\n \"token\": \"awsui_token_10m3l_ilcbp_108\",\n \"show-operation\": \"awsui_show-operation_10m3l_ilcbp_123\",\n \"select\": \"awsui_select_10m3l_ilcbp_129\",\n \"token-content\": \"awsui_token-content_10m3l_ilcbp_133\",\n \"dismiss-button\": \"awsui_dismiss-button_10m3l_ilcbp_138\",\n \"token-disabled\": \"awsui_token-disabled_10m3l_ilcbp_180\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { Ref, useMemo, useRef } from 'react';\n\nimport { useAutosuggestItems } from '../autosuggest/options-controller';\nimport { AutosuggestItem, AutosuggestProps } from '../autosuggest/interfaces';\n\nimport { useDropdownStatus } from '../internal/components/dropdown-status';\nimport DropdownFooter from '../internal/components/dropdown-footer';\n\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport {\n fireNonCancelableEvent,\n CancelableEventHandler,\n NonCancelableCustomEvent,\n BaseKeyDetail,\n} from '../internal/events';\nimport { BaseChangeDetail } from '../input/interfaces';\nimport autosuggestStyles from '../autosuggest/styles.css.js';\nimport styles from './styles.css.js';\nimport { fireCancelableEvent } from '../internal/events/index';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport AutosuggestOptionsList from '../autosuggest/options-list';\nimport { useAutosuggestLoadMore } from '../autosuggest/load-more-controller';\nimport { OptionsLoadItemsDetail } from '../internal/components/dropdown/interfaces';\nimport AutosuggestInput, { AutosuggestInputRef } from '../internal/components/autosuggest-input';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport clsx from 'clsx';\nimport { getFirstFocusable } from '../internal/components/focus-lock/utils';\nimport { filterOptions } from './filter-options';\nimport { joinStrings } from '../internal/utils/strings';\n\nconst DROPDOWN_WIDTH_OPTIONS_LIST = 300;\nconst DROPDOWN_WIDTH_CUSTOM_FORM = 200;\n\nexport interface PropertyFilterAutosuggestProps\n extends Omit,\n InternalBaseComponentProps {\n customForm?: React.ReactNode;\n filterText?: string;\n onOptionClick?: CancelableEventHandler;\n hideEnteredTextOption?: boolean;\n searchResultsId?: string;\n}\n\nconst PropertyFilterAutosuggest = React.forwardRef(\n (props: PropertyFilterAutosuggestProps, ref: Ref) => {\n const {\n value,\n onChange,\n onFocus,\n onBlur,\n onLoadItems,\n options,\n statusType = 'finished',\n placeholder,\n disabled,\n ariaLabel,\n enteredTextLabel,\n onKeyDown,\n virtualScroll,\n expandToViewport,\n customForm,\n filterText,\n onOptionClick,\n hideEnteredTextOption,\n searchResultsId,\n ...rest\n } = props;\n const highlightText = filterText === undefined ? value : filterText;\n\n const customFormRef = useRef(null);\n const autosuggestInputRef = useRef(null);\n const mergedRef = useMergeRefs(autosuggestInputRef, ref);\n\n const filteredOptions = useMemo(() => filterOptions(options || [], highlightText), [options, highlightText]);\n const [autosuggestItemsState, autosuggestItemsHandlers] = useAutosuggestItems({\n options: filteredOptions,\n filterValue: value,\n filterText: highlightText,\n filteringType: 'manual',\n enteredTextLabel,\n hideEnteredTextLabel: hideEnteredTextOption,\n onSelectItem: (option: AutosuggestItem) => {\n const value = option.value || '';\n fireNonCancelableEvent(onChange, { value });\n const selectedCancelled = fireCancelableEvent(onOptionClick, option);\n if (!selectedCancelled) {\n autosuggestInputRef.current?.close();\n } else {\n autosuggestItemsHandlers.resetHighlightWithKeyboard();\n }\n },\n });\n\n const autosuggestLoadMoreHandlers = useAutosuggestLoadMore({\n options,\n statusType,\n onLoadItems: (detail: OptionsLoadItemsDetail) => fireNonCancelableEvent(onLoadItems, detail),\n });\n\n const handleChange = (event: NonCancelableCustomEvent) => {\n autosuggestItemsHandlers.resetHighlightWithKeyboard();\n fireNonCancelableEvent(onChange, event.detail);\n };\n\n const handleDelayedInput = (event: NonCancelableCustomEvent) => {\n autosuggestLoadMoreHandlers.fireLoadMoreOnInputChange(event.detail.value);\n };\n\n const handleFocus = () => {\n autosuggestLoadMoreHandlers.fireLoadMoreOnInputFocus();\n fireCancelableEvent(onFocus, null);\n };\n\n const handleBlur = () => {\n fireCancelableEvent(onBlur, null);\n };\n\n const handleKeyDown = (e: CustomEvent) => {\n fireCancelableEvent(onKeyDown, e.detail);\n };\n\n const handlePressArrowDown = () => {\n autosuggestItemsHandlers.moveHighlightWithKeyboard(1);\n if (customFormRef.current) {\n getFirstFocusable(customFormRef.current)?.focus();\n }\n };\n\n const handlePressArrowUp = () => {\n autosuggestItemsHandlers.moveHighlightWithKeyboard(-1);\n };\n\n const handlePressEnter = () => {\n return autosuggestItemsHandlers.selectHighlightedOptionWithKeyboard();\n };\n\n const handleCloseDropdown = () => {\n autosuggestItemsHandlers.resetHighlightWithKeyboard();\n };\n\n const handleRecoveryClick = () => {\n autosuggestLoadMoreHandlers.fireLoadMoreOnRecoveryClick();\n autosuggestInputRef.current?.focus();\n };\n\n const selfControlId = useUniqueId('input');\n const controlId = rest.controlId ?? selfControlId;\n const listId = useUniqueId('list');\n const footerId = useUniqueId('footer');\n const highlightedOptionIdSource = useUniqueId();\n const highlightedOptionId = autosuggestItemsState.highlightedOption ? highlightedOptionIdSource : undefined;\n\n const isEmpty = !value && !autosuggestItemsState.items.length;\n const dropdownStatus = useDropdownStatus({\n ...props,\n isEmpty,\n onRecoveryClick: handleRecoveryClick,\n hasRecoveryCallback: !!onLoadItems,\n });\n\n let content = null;\n if (customForm) {\n content = (\n
      \n {customForm}\n
      \n );\n } else if (autosuggestItemsState.items.length > 0) {\n content = (\n : null\n }\n ariaDescribedby={dropdownStatus.content ? footerId : undefined}\n />\n );\n }\n\n return (\n 1 || dropdownStatus.content !== null || !!customForm}\n dropdownContentKey={customForm ? 'custom' : 'options'}\n dropdownContent={content}\n dropdownFooter={\n dropdownStatus.isSticky && dropdownStatus.content ? (\n = 1}\n id={footerId}\n />\n ) : null\n }\n dropdownWidth={customForm ? DROPDOWN_WIDTH_CUSTOM_FORM : DROPDOWN_WIDTH_OPTIONS_LIST}\n dropdownContentFocusable={!!customForm}\n onCloseDropdown={handleCloseDropdown}\n onDelayedInput={handleDelayedInput}\n onPressArrowDown={handlePressArrowDown}\n onPressArrowUp={handlePressArrowUp}\n onPressEnter={handlePressEnter}\n />\n );\n }\n);\n\nexport default PropertyFilterAutosuggest;\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { AutosuggestProps } from '../autosuggest/interfaces';\nimport { OptionDefinition } from '../internal/components/option/interfaces';\n\nexport function filterOptions(\n options: readonly (AutosuggestProps.Option | AutosuggestProps.OptionGroup)[],\n searchText = ''\n): readonly (AutosuggestProps.Option | AutosuggestProps.OptionGroup)[] {\n if (!searchText) {\n return options;\n }\n\n const filtered: (AutosuggestProps.Option | AutosuggestProps.OptionGroup)[] = [];\n for (const option of options) {\n if (isGroup(option)) {\n const childOptions = filterOptions(option.options, searchText);\n if (childOptions.length > 0) {\n filtered.push({ ...option, options: childOptions });\n }\n } else if (matchSingleOption(option, searchText)) {\n filtered.push(option);\n }\n }\n return filtered;\n}\n\nfunction isGroup(optionOrGroup: AutosuggestProps.Option): optionOrGroup is AutosuggestProps.OptionGroup {\n return 'options' in optionOrGroup;\n}\n\nfunction matchSingleOption(option: OptionDefinition, searchText: string): boolean {\n searchText = searchText.toLowerCase();\n\n const label = (option.label ?? '').toLowerCase();\n const labelPrefix = option.__labelPrefix ?? '';\n const value = (option.value ? option.value.slice(labelPrefix.length) : '').toLowerCase();\n return label.indexOf(searchText) !== -1 || value.indexOf(searchText) !== -1;\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { useState } from 'react';\nimport { I18nStrings, Token, ExtendedOperatorForm, ComparisonOperator, InternalFilteringProperty } from './interfaces';\nimport styles from './styles.css.js';\nimport InternalButton from '../button/internal';\nimport InternalFormField from '../form-field/internal';\n\ninterface PropertyEditorProps {\n property: InternalFilteringProperty;\n operator: ComparisonOperator;\n filter: string;\n operatorForm: ExtendedOperatorForm;\n onCancel: () => void;\n onSubmit: (value: Token) => void;\n i18nStrings: I18nStrings;\n}\n\nexport function PropertyEditor({\n property,\n operator,\n filter,\n operatorForm,\n onCancel,\n onSubmit,\n i18nStrings,\n}: PropertyEditorProps) {\n const [value, onChange] = useState(null);\n const submitToken = () => onSubmit({ propertyKey: property.propertyKey, operator, value });\n return (\n
      \n
      \n \n {operatorForm({ value, onChange, operator, filter })}\n \n
      \n\n
      \n \n {i18nStrings.cancelActionText}\n \n \n {i18nStrings.applyActionText}\n \n
      \n
      \n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { RadioGroupProps } from './interfaces';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport InternalRadioGroup from './internal';\n\nexport { RadioGroupProps };\n\nconst RadioGroup = React.forwardRef((props: RadioGroupProps, ref: React.Ref) => {\n const baseComponentProps = useBaseComponent('RadioGroup');\n return ;\n});\n\napplyDisplayName(RadioGroup, 'RadioGroup');\nexport default RadioGroup;\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { useState, useRef, useEffect } from 'react';\nimport InternalBox from '../box/internal';\nimport { getBaseProps } from '../internal/base-component';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport useForwardFocus from '../internal/hooks/forward-focus';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { S3InContext, S3InContextRef } from './s3-in-context';\nimport { S3ResourceSelectorProps } from './interfaces';\nimport { S3Modal, S3ModalProps } from './s3-modal';\nimport styles from './styles.css.js';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { checkSafeUrl } from '../internal/utils/check-safe-url';\nimport { useFormFieldContext } from '../contexts/form-field';\n\nexport { S3ResourceSelectorProps };\n\nconst S3ResourceSelector = React.forwardRef(\n (\n {\n i18nStrings,\n inputPlaceholder,\n alert,\n resource,\n viewHref,\n invalid,\n selectableItemsTypes = [],\n inputAriaDescribedby,\n bucketsVisibleColumns = ['Name', 'CreationDate'],\n bucketsIsItemDisabled,\n fetchBuckets,\n fetchObjects,\n objectsVisibleColumns = ['Key', 'LastModified', 'Size'],\n objectsIsItemDisabled,\n fetchVersions,\n versionsVisibleColumns = ['ID', 'LastModified', 'Size'],\n versionsIsItemDisabled,\n onChange,\n ariaLabel,\n getModalRoot,\n removeModalRoot,\n ...rest\n }: S3ResourceSelectorProps,\n ref: React.Ref\n ) => {\n checkSafeUrl('S3ResourceSelector', viewHref);\n const { __internalRootRef } = useBaseComponent('S3ResourceSelector');\n const [modalOpen, setModalOpen] = useState(false);\n const inContextRef = useRef(null);\n const modalWasSubmitted = useRef(false);\n useForwardFocus(ref, inContextRef);\n const { ariaLabelledby, ariaDescribedby } = useFormFieldContext(rest);\n\n useEffect(() => {\n // Focus uriInput only when modal was submitted.\n // When it was dismissed, the focus naturally goes to previously focused element (browse button)\n if (!modalOpen && modalWasSubmitted.current) {\n modalWasSubmitted.current = false;\n inContextRef.current?.focus();\n }\n }, [modalOpen]);\n\n const baseProps = getBaseProps(rest);\n const modalProps: S3ModalProps = {\n alert,\n i18nStrings,\n fetchBuckets,\n selectableItemsTypes,\n bucketsVisibleColumns,\n bucketsIsItemDisabled,\n fetchObjects,\n objectsVisibleColumns,\n objectsIsItemDisabled,\n fetchVersions,\n versionsVisibleColumns,\n versionsIsItemDisabled,\n getModalRoot,\n removeModalRoot,\n onSubmit: resource => {\n fireNonCancelableEvent(onChange, { resource });\n setModalOpen(false);\n modalWasSubmitted.current = true;\n },\n onDismiss: () => setModalOpen(false),\n };\n return (\n \n setModalOpen(true)}\n onChange={(resource, errorText) => fireNonCancelableEvent(onChange, { resource, errorText })}\n />\n {!modalOpen && alert && (\n \n {alert}\n \n )}\n {modalOpen && }\n \n );\n }\n);\n\napplyDisplayName(S3ResourceSelector, 'S3ResourceSelector');\nexport default S3ResourceSelector;\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useState, useEffect, useRef } from 'react';\nimport InternalBox from '../../box/internal';\nimport { InternalButton } from '../../button/internal';\nimport InternalFormField from '../../form-field/internal';\nimport { InputProps } from '../../input/interfaces';\nimport InternalSelect from '../../select/internal';\nimport InternalStatusIndicator from '../../status-indicator/internal';\nimport { NonCancelableCustomEvent } from '../../internal/events';\nimport useForwardFocus from '../../internal/hooks/forward-focus';\nimport { useVersionsFetch } from './use-versions-fetch';\nimport { S3ResourceSelectorProps } from '../interfaces';\nimport { validate, getErrorText } from './validation';\nimport styles from './styles.css.js';\nimport { SearchInput } from './search-input';\nimport LiveRegion from '../../internal/components/live-region';\nimport { useInternalI18n } from '../../i18n/context';\n\ninterface S3InContextProps {\n i18nStrings: S3ResourceSelectorProps.I18nStrings | undefined;\n inputPlaceholder: string | undefined;\n resource: S3ResourceSelectorProps.Resource;\n viewHref: string | undefined;\n invalid: boolean | undefined;\n inputAriaDescribedby: string | undefined;\n selectableItemsTypes: S3ResourceSelectorProps['selectableItemsTypes'];\n fetchVersions: S3ResourceSelectorProps['fetchVersions'];\n onBrowse: () => void;\n onChange: (newResource: S3ResourceSelectorProps.Resource, errorText: string | undefined) => void;\n}\n\nexport interface S3InContextRef {\n focus(): void;\n}\n\nexport const S3InContext = React.forwardRef(\n (\n {\n i18nStrings,\n inputPlaceholder,\n resource,\n viewHref,\n invalid,\n inputAriaDescribedby,\n selectableItemsTypes,\n fetchVersions,\n onChange,\n onBrowse,\n }: S3InContextProps,\n ref: React.Ref\n ) => {\n const i18n = useInternalI18n('s3-resource-selector');\n const isInputBlurredRef = useRef(true);\n const [isInputTouched, setInputTouched] = useState(false);\n const { versions, loading, loadVersions, resetVersions } = useVersionsFetch(fetchVersions);\n const inputRef = useRef(null);\n\n useForwardFocus(ref, inputRef);\n\n const uri = resource.uri;\n const supportsVersions = selectableItemsTypes && selectableItemsTypes.indexOf('versions') > -1;\n const selectedVersion = versions.filter(version => version.value === resource.versionId)[0] || null;\n\n function handleUriChange(event: NonCancelableCustomEvent) {\n const uri = event.detail.value;\n const errorCode = isInputTouched ? validate(uri) : undefined;\n resetVersions();\n onChange({ uri }, getErrorText(i18n, i18nStrings, errorCode));\n }\n\n function handleUriBlur() {\n isInputBlurredRef.current = true;\n setInputTouched(true);\n const errorCode = validate(resource.uri);\n onChange(resource, getErrorText(i18n, i18nStrings, errorCode));\n if (supportsVersions) {\n loadVersions(resource.uri);\n }\n }\n\n useEffect(() => {\n if (!isInputBlurredRef.current || !supportsVersions) {\n return;\n }\n const { cancel } = loadVersions(uri) ?? {};\n return cancel;\n }, [uri, supportsVersions, loadVersions]);\n\n return (\n
      \n
      \n \n (isInputBlurredRef.current = false)}\n onBlur={handleUriBlur}\n />\n \n {supportsVersions && (\n \n onChange({ ...resource, versionId: event.detail.selectedOption.value }, undefined)}\n invalid={false} // invalid state should not highlight the select, only the text input\n />\n \n )}\n
      \n \n {i18n('i18nStrings.inContextViewButton', i18nStrings?.inContextViewButton)}\n \n
      \n
      \n
      \n \n {i18n('i18nStrings.inContextBrowseButton', i18nStrings?.inContextBrowseButton)}\n \n
      \n
      \n\n
      \n {loading && (\n \n \n \n {i18n('i18nStrings.inContextLoadingText', i18nStrings?.inContextLoadingText)}\n \n \n \n )}\n
      \n
      \n );\n }\n);\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { useState } from 'react';\nimport { makeCancellable, PromiseCancelledSignal } from '../../internal/utils/promises';\nimport { SelectProps } from '../../select/interfaces';\nimport { extractBucketName, validate } from './validation';\nimport { S3ResourceSelectorProps } from '../interfaces';\nimport { useStableCallback } from '@cloudscape-design/component-toolkit/internal';\n\nexport function useVersionsFetch(fetchVersions: S3ResourceSelectorProps['fetchVersions']) {\n const [loading, setLoading] = useState(false);\n const [lastFetchedValue, setLastFetched] = useState('');\n const [versions, setVersions] = useState>([]);\n\n const loadVersions = (uri: string) => {\n if (uri === lastFetchedValue) {\n return;\n }\n setLastFetched(uri);\n const errorCode = validate(uri);\n const [bucketName, prefix] = extractBucketName(uri);\n if (errorCode || !bucketName || !prefix || prefix.slice(-1) === '/') {\n return;\n }\n setLoading(true);\n const result = makeCancellable(fetchVersions(bucketName, prefix));\n result.promise.then(\n versions => {\n setLoading(false);\n setVersions(\n versions.map(version => ({\n value: version.VersionId,\n label: version.LastModified,\n }))\n );\n },\n err => {\n if (!(err instanceof PromiseCancelledSignal)) {\n setLoading(false);\n }\n }\n );\n return result;\n };\n\n return {\n loading,\n versions,\n resetVersions: () => setVersions([]),\n // this function is a dependency of useEffect\n loadVersions: useStableCallback(loadVersions),\n };\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nexport class PromiseCancelledSignal {}\n\n/**\n * Wrap and provide a handle for a promise to provide cancellation information inside\n * callbacks. Takes a similar approach to how an AbortController works in modern fetch.\n *\n * @see https://reactjs.org/blog/2015/12/16/ismounted-antipattern.html\n */\nexport function makeCancellable(promise: Promise): {\n promise: Promise;\n cancel: () => void;\n isCancelled: () => boolean;\n} {\n let cancelled = false;\n const wrapped = promise.then(\n value => {\n if (cancelled) {\n throw new PromiseCancelledSignal();\n }\n return value;\n },\n err => {\n if (cancelled) {\n throw new PromiseCancelledSignal();\n }\n throw err;\n }\n );\n\n return {\n promise: wrapped,\n cancel: () => {\n cancelled = true;\n },\n isCancelled: () => cancelled,\n };\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ComponentFormatFunction } from '../../i18n/context';\nimport { S3ResourceSelectorProps } from '../interfaces';\n\n// https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html\nconst SCHEME = 's3://';\nconst BUCKET_FIRST_CHAR = /^[a-z0-9]{1}/;\nconst CAPITAL_LETTER = /[A-Z]/;\nconst DNS_NAME = /^(([a-z0-9]|[a-z0-9][a-z0-9-]*[a-z0-9])\\.)*([a-z0-9]|[a-z0-9][a-z0-9-]*[a-z0-9])$/;\n\nfunction checkBucketNameLength(bucketName: string) {\n return 3 <= bucketName.length && bucketName.length <= 63;\n}\n\nexport function extractBucketName(uri: string) {\n const [bucketName, ...rest] = uri.replace(SCHEME, '').split('/');\n return [bucketName, rest.join('/')];\n}\n\nexport function validate(uri: string) {\n if (uri === '') {\n return undefined;\n }\n if (uri.slice(0, SCHEME.length) !== SCHEME) {\n return 'validationPathMustBegin' as const;\n }\n const [bucketName] = extractBucketName(uri);\n if (!BUCKET_FIRST_CHAR.test(bucketName)) {\n return 'validationBucketLowerCase' as const;\n }\n if (CAPITAL_LETTER.test(bucketName)) {\n return 'validationBucketMustNotContain' as const;\n }\n if (!checkBucketNameLength(bucketName)) {\n return 'validationBucketLength' as const;\n }\n if (!DNS_NAME.test(bucketName)) {\n return 'validationBucketMustComplyDns' as const;\n }\n return undefined;\n}\n\nexport function getErrorText(\n i18n: ComponentFormatFunction<'s3-resource-selector'>,\n i18nStrings: S3ResourceSelectorProps.I18nStrings | undefined,\n errorCode: ReturnType\n) {\n return errorCode ? i18n(`i18nStrings.${errorCode}`, i18nStrings?.[errorCode]) : undefined;\n}\n", "\n import './styles.scoped.css';\n export default {\n \"root\": \"awsui_root_1vtzr_19vlz_9\",\n \"view-button\": \"awsui_view-button_1vtzr_19vlz_13\",\n \"browse-button\": \"awsui_browse-button_1vtzr_19vlz_17\",\n \"layout\": \"awsui_layout_1vtzr_19vlz_21\",\n \"layout-uri\": \"awsui_layout-uri_1vtzr_19vlz_33\",\n \"layout-version\": \"awsui_layout-version_1vtzr_19vlz_37\",\n \"layout-divider\": \"awsui_layout-divider_1vtzr_19vlz_42\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { useFormFieldContext } from '../../internal/context/form-field-context';\nimport InternalInput, { InternalInputProps } from '../../input/internal';\n\nexport const SearchInput = React.forwardRef((props: InternalInputProps, ref: React.Ref) => {\n const formFieldContext = useFormFieldContext(props);\n return ;\n});\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useReducer, useRef } from 'react';\nimport InternalBreadcrumbGroup from '../../breadcrumb-group/internal';\nimport { InternalButton } from '../../button/internal';\nimport InternalModal from '../../modal/internal';\nimport InternalSpaceBetween from '../../space-between/internal';\nimport { ForwardFocusRef } from '../../internal/hooks/forward-focus';\nimport { useEffectOnUpdate } from '../../internal/hooks/use-effect-on-update';\nimport { useVisualRefresh } from '../../internal/hooks/use-visual-mode';\nimport { S3ResourceSelectorProps } from '../interfaces';\nimport { BucketsTable } from './buckets-table';\nimport { ObjectsTable } from './objects-table';\nimport { VersionsTable } from './versions-table';\nimport styles from './styles.css.js';\nimport { joinObjectPath } from '../utils';\nimport { useInternalI18n } from '../../i18n/context';\n\nexport interface S3ModalProps {\n alert: React.ReactNode;\n selectableItemsTypes: S3ResourceSelectorProps['selectableItemsTypes'];\n fetchBuckets: S3ResourceSelectorProps['fetchBuckets'];\n bucketsVisibleColumns: ReadonlyArray;\n bucketsIsItemDisabled: S3ResourceSelectorProps['bucketsIsItemDisabled'];\n fetchObjects: S3ResourceSelectorProps['fetchObjects'];\n objectsVisibleColumns: ReadonlyArray;\n objectsIsItemDisabled: S3ResourceSelectorProps['objectsIsItemDisabled'];\n fetchVersions: S3ResourceSelectorProps['fetchVersions'];\n versionsVisibleColumns: ReadonlyArray;\n versionsIsItemDisabled: S3ResourceSelectorProps['versionsIsItemDisabled'];\n i18nStrings: S3ResourceSelectorProps.I18nStrings | undefined;\n getModalRoot: S3ResourceSelectorProps['getModalRoot'];\n removeModalRoot: S3ResourceSelectorProps['removeModalRoot'];\n onDismiss: () => void;\n onSubmit: (resource: S3ResourceSelectorProps.Resource) => void;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction assertNever(_value: never) {\n return null;\n}\n\ninterface S3BrowseState {\n selectedItem: string | null;\n currentView: 'buckets' | 'objects' | 'versions';\n breadcrumbs: ReadonlyArray;\n}\n\ntype S3BrowseActions =\n | { type: 'browse-buckets' }\n | { type: 'browse-objects' | 'browse-versions'; breadcrumbs: S3BrowseState['breadcrumbs'] }\n | { type: 'select-item'; item: string };\n\nconst initialBrowseState: S3BrowseState = {\n selectedItem: null,\n currentView: 'buckets',\n breadcrumbs: [],\n};\n\nfunction s3BrowseReducer(state: S3BrowseState, action: S3BrowseActions) {\n switch (action.type) {\n case 'browse-buckets':\n return initialBrowseState;\n case 'browse-objects':\n return {\n selectedItem: null,\n currentView: 'objects' as const,\n breadcrumbs: action.breadcrumbs,\n };\n case 'browse-versions':\n return {\n selectedItem: null,\n currentView: 'versions' as const,\n breadcrumbs: action.breadcrumbs,\n };\n case 'select-item':\n return {\n ...state,\n selectedItem: action.item,\n };\n default:\n assertNever(action);\n }\n return state;\n}\n\nfunction createResourceInfo({ currentView, breadcrumbs, selectedItem }: S3BrowseState) {\n const prefix = 's3://';\n if (currentView === 'versions') {\n return { uri: prefix + joinObjectPath(breadcrumbs), versionId: selectedItem ?? undefined };\n }\n return { uri: prefix + joinObjectPath([...breadcrumbs, selectedItem!]) };\n}\n\nexport function S3Modal({\n i18nStrings,\n alert,\n selectableItemsTypes,\n fetchBuckets,\n bucketsVisibleColumns,\n bucketsIsItemDisabled,\n fetchObjects,\n objectsVisibleColumns,\n objectsIsItemDisabled,\n fetchVersions,\n versionsVisibleColumns,\n versionsIsItemDisabled,\n getModalRoot,\n removeModalRoot,\n onSubmit,\n onDismiss,\n}: S3ModalProps) {\n const [{ currentView, breadcrumbs, selectedItem }, dispatch] = useReducer(s3BrowseReducer, initialBrowseState);\n const forwardFocusRef = useRef(null);\n const i18n = useInternalI18n('s3-resource-selector');\n\n const isVisualRefresh = useVisualRefresh();\n\n useEffectOnUpdate(() => {\n forwardFocusRef.current?.focus();\n }, [breadcrumbs]);\n\n return (\n
      \n \n \n {i18n('i18nStrings.modalCancelButton', i18nStrings?.modalCancelButton)}\n \n onSubmit(createResourceInfo({ currentView, breadcrumbs, selectedItem }))}\n >\n {i18n('i18nStrings.modalSubmitButton', i18nStrings?.modalSubmitButton)}\n \n \n }\n >\n \n {\n event.preventDefault();\n event.detail.item.meta.onClick();\n }}\n items={[\n {\n text: i18n('i18nStrings.modalBreadcrumbRootItem', i18nStrings?.modalBreadcrumbRootItem) ?? '',\n href: '',\n meta: { onClick: () => dispatch({ type: 'browse-buckets' }) },\n },\n ...breadcrumbs.map((segment, index) => ({\n text: segment,\n href: '',\n meta: {\n onClick: () =>\n dispatch({\n type: 'browse-objects',\n breadcrumbs: breadcrumbs.slice(0, index + 1),\n }),\n },\n })),\n ]}\n />\n {alert}\n {currentView === 'buckets' ? (\n \n dispatch({\n type: 'browse-objects',\n breadcrumbs: [path],\n })\n }\n onSelect={item => dispatch({ type: 'select-item', item })}\n />\n ) : currentView === 'objects' ? (\n {\n dispatch({\n type: item.IsFolder ? 'browse-objects' : 'browse-versions',\n breadcrumbs: [...breadcrumbs, item.Key!],\n });\n }}\n onSelect={item => dispatch({ type: 'select-item', item })}\n />\n ) : currentView === 'versions' ? (\n dispatch({ type: 'select-item', item })}\n />\n ) : (\n assertNever(currentView)\n )}\n \n \n
      \n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport InternalLink from '../../link/internal';\nimport { TableProps } from '../../table/interfaces';\nimport { ForwardFocusRef } from '../../internal/hooks/forward-focus';\nimport { S3ResourceSelectorProps } from '../interfaces';\nimport { compareDates, getColumnAriaLabel, includes } from './table-utils';\nimport { formatDefault } from './column-formats';\nimport { BasicS3Table, getSharedI18Strings } from './basic-table';\nimport { useInternalI18n } from '../../i18n/context';\n\ninterface BucketsTableProps {\n forwardFocusRef: React.Ref;\n visibleColumns: ReadonlyArray;\n isItemDisabled: TableProps.IsItemDisabled | undefined;\n selectableItemsTypes: S3ResourceSelectorProps['selectableItemsTypes'];\n fetchData: S3ResourceSelectorProps['fetchBuckets'];\n i18nStrings: S3ResourceSelectorProps.I18nStrings | undefined;\n isVisualRefresh?: boolean;\n onDrilldown: (path: string) => void;\n onSelect: (uri: string) => void;\n}\n\nexport function BucketsTable({\n forwardFocusRef,\n i18nStrings,\n isVisualRefresh,\n isItemDisabled,\n selectableItemsTypes,\n fetchData,\n visibleColumns,\n onDrilldown,\n onSelect,\n}: BucketsTableProps) {\n const i18n = useInternalI18n('s3-resource-selector');\n\n return (\n \n forwardFocusRef={forwardFocusRef}\n trackBy=\"Name\"\n fetchData={fetchData}\n visibleColumns={visibleColumns}\n isItemDisabled={isItemDisabled || (() => !includes(selectableItemsTypes, 'buckets'))}\n i18nStrings={{\n ...getSharedI18Strings(i18n, i18nStrings),\n header: i18n('i18nStrings.selectionBuckets', i18nStrings?.selectionBuckets),\n loadingText: i18n('i18nStrings.selectionBucketsLoading', i18nStrings?.selectionBucketsLoading),\n filteringAriaLabel: i18n(\n 'i18nStrings.labelFiltering',\n i18nStrings?.labelFiltering,\n format => itemsType => format({ itemsType })\n )?.(i18n('i18nStrings.selectionBuckets', i18nStrings?.selectionBuckets) ?? ''),\n filteringPlaceholder: i18n(\n 'i18nStrings.selectionBucketsSearchPlaceholder',\n i18nStrings?.selectionBucketsSearchPlaceholder\n ),\n emptyText: i18n('i18nStrings.selectionBucketsNoItems', i18nStrings?.selectionBucketsNoItems),\n selectionLabels: {\n ...i18nStrings?.labelsBucketsSelection,\n selectionGroupLabel: i18n(\n 'i18nStrings.labelsBucketsSelection.selectionGroupLabel',\n i18nStrings?.labelsBucketsSelection?.selectionGroupLabel\n ),\n itemSelectionLabel: i18n(\n 'i18nStrings.labelsBucketsSelection.itemSelectionLabel',\n i18nStrings?.labelsBucketsSelection?.itemSelectionLabel,\n format => (data, item) => format({ item__Name: item.Name ?? '' })\n ),\n },\n }}\n isVisualRefresh={isVisualRefresh}\n columnDefinitions={[\n {\n id: 'Name',\n header: i18n('i18nStrings.columnBucketName', i18nStrings?.columnBucketName),\n ariaLabel: getColumnAriaLabel(\n i18n,\n i18nStrings,\n i18n('i18nStrings.columnBucketName', i18nStrings?.columnBucketName)\n ),\n sortingField: 'Name',\n cell: item => {\n const isClickable = includes(selectableItemsTypes, 'objects') || includes(selectableItemsTypes, 'versions');\n return isClickable ? (\n item.Name && onDrilldown(item.Name)} variant=\"link\">\n {item.Name}\n \n ) : (\n item.Name\n );\n },\n minWidth: '250px',\n },\n {\n id: 'CreationDate',\n header: i18n('i18nStrings.columnBucketCreationDate', i18nStrings?.columnBucketCreationDate),\n ariaLabel: getColumnAriaLabel(\n i18n,\n i18nStrings,\n i18n('i18nStrings.columnBucketCreationDate', i18nStrings?.columnBucketCreationDate)\n ),\n sortingComparator: (a, b) => compareDates(a.CreationDate, b.CreationDate),\n cell: item => formatDefault(item.CreationDate),\n },\n {\n id: 'Region',\n header: i18n('i18nStrings.columnBucketRegion', i18nStrings?.columnBucketRegion),\n ariaLabel: getColumnAriaLabel(\n i18n,\n i18nStrings,\n i18n('i18nStrings.columnBucketRegion', i18nStrings?.columnBucketRegion)\n ),\n sortingField: 'Region',\n cell: item => formatDefault(item.Region),\n minWidth: '150px',\n },\n ]}\n onSelect={item => onSelect(item?.Name ?? '')}\n />\n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { S3ResourceSelectorProps } from '../interfaces';\nimport { TableProps } from '../../table/interfaces';\nimport { ComponentFormatFunction } from '../../i18n/context';\n\nexport function includes(array: ReadonlyArray | undefined, item: T) {\n return !!array && array.indexOf(item) > -1;\n}\n\nexport const compareDates = (itemA: string | undefined, itemB: string | undefined) => {\n const timeA = itemA ? new Date(itemA).getTime() : 0;\n const timeB = itemB ? new Date(itemB).getTime() : 0;\n return timeA - timeB;\n};\n\nexport function getColumnAriaLabel(\n i18n: ComponentFormatFunction<'s3-resource-selector'>,\n i18nStrings?: Pick<\n S3ResourceSelectorProps.I18nStrings,\n 'labelNotSorted' | 'labelSortedDescending' | 'labelSortedAscending'\n >,\n columnName = ''\n) {\n return ({ sorted, descending }: TableProps.LabelData) => {\n if (!sorted) {\n return (\n i18n('i18nStrings.labelNotSorted', i18nStrings?.labelNotSorted?.(columnName), format =>\n format({ columnName })\n ) ?? ''\n );\n }\n if (descending) {\n return (\n i18n('i18nStrings.labelSortedDescending', i18nStrings?.labelSortedDescending?.(columnName), format =>\n format({ columnName })\n ) ?? ''\n );\n }\n return (\n i18n('i18nStrings.labelSortedAscending', i18nStrings?.labelSortedAscending?.(columnName), format =>\n format({ columnName })\n ) ?? ''\n );\n };\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst BYTES_BASE = 1024;\nconst BYTES_DECIMALS = 2;\nconst BYTES_SIZES = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];\n\nexport function formatDefault(value: string | undefined) {\n return value ? value : '-';\n}\n\nexport function formatSize(bytes: number | undefined) {\n if (bytes === undefined) {\n return '-';\n }\n if (bytes === 0) {\n return `0 ${BYTES_SIZES[0]}`;\n }\n const i = Math.floor(Math.log(bytes) / Math.log(BYTES_BASE));\n return parseFloat((bytes / Math.pow(BYTES_BASE, i)).toFixed(BYTES_DECIMALS)) + ' ' + BYTES_SIZES[i];\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useState, useRef } from 'react';\nimport { useCollection } from '@cloudscape-design/collection-hooks';\nimport { InternalButton } from '../../button/internal';\nimport InternalHeader from '../../header/internal';\nimport { PaginationProps } from '../../pagination/interfaces';\nimport InternalPagination from '../../pagination/internal';\nimport { TableProps } from '../../table/interfaces';\nimport InternalTable from '../../table/internal';\nimport { TextFilterProps } from '../../text-filter/interfaces';\nimport InternalTextFilter from '../../text-filter/internal';\nimport useForwardFocus, { ForwardFocusRef } from '../../internal/hooks/forward-focus';\nimport { S3ResourceSelectorProps } from '../interfaces';\nimport { EmptyState } from './empty-state';\nimport { ComponentFormatFunction } from '../../i18n/context';\nimport { useStableCallback } from '@cloudscape-design/component-toolkit/internal';\n\ninterface BasicS3TableStrings {\n labelRefresh?: string;\n labelsPagination?: PaginationProps.Labels;\n header?: string;\n loadingText?: string;\n filteringPlaceholder?: string;\n filteringAriaLabel?: string;\n filteringClearAriaLabel?: string;\n filteringCounterText?: S3ResourceSelectorProps.I18nStrings['filteringCounterText'];\n emptyText?: string;\n noMatchTitle?: string;\n noMatchSubtitle?: string;\n clearFilterButtonText?: string;\n selectionLabels?: TableProps.AriaLabels;\n}\n\ninterface BasicS3TableProps {\n // We do not use idiomatic `ref` prop because it does not allow generics.\n // Option 3 from this solution: https://stackoverflow.com/a/58473012/1297743\n forwardFocusRef: React.Ref;\n columnDefinitions: ReadonlyArray>;\n fetchData: () => Promise>;\n trackBy: TableProps.TrackBy;\n i18nStrings: BasicS3TableStrings;\n isVisualRefresh?: boolean;\n visibleColumns: ReadonlyArray;\n isItemDisabled: TableProps.IsItemDisabled | undefined;\n onSelect: (item: T | undefined) => void;\n}\n\nexport function getSharedI18Strings(\n i18n: ComponentFormatFunction<'s3-resource-selector'>,\n i18nStrings: S3ResourceSelectorProps.I18nStrings | undefined\n) {\n return {\n filteringCounterText: i18n(\n 'i18nStrings.filteringCounterText',\n i18nStrings?.filteringCounterText,\n format => count => format({ count })\n ),\n labelRefresh: i18n('i18nStrings.labelRefresh', i18nStrings?.labelRefresh),\n labelsPagination: i18nStrings?.labelsPagination,\n noMatchTitle: i18n('i18nStrings.filteringNoMatches', i18nStrings?.filteringNoMatches),\n noMatchSubtitle: i18n('i18nStrings.filteringCantFindMatch', i18nStrings?.filteringCantFindMatch),\n clearFilterButtonText: i18n('i18nStrings.clearFilterButtonText', i18nStrings?.clearFilterButtonText),\n filteringClearAriaLabel: i18nStrings?.labelClearFilter,\n };\n}\n\nexport function BasicS3Table({\n forwardFocusRef,\n columnDefinitions,\n fetchData,\n trackBy,\n i18nStrings = {},\n isVisualRefresh,\n visibleColumns,\n isItemDisabled,\n onSelect,\n}: BasicS3TableProps) {\n const [loading, setLoading] = useState(false);\n const [allItems, setAllItems] = useState>([]);\n const textFilterRef = useRef(null);\n const onSelectLatest = useStableCallback(onSelect);\n\n function loadData() {\n setLoading(true);\n fetchData()\n .then(items => {\n setAllItems(items);\n setLoading(false);\n })\n .catch(() => {\n // error handling should happen on the customer side, outside of this component\n setLoading(false);\n });\n }\n\n useEffect(() => {\n loadData();\n // Data loading is only happening on initial render, or via refresh button\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useForwardFocus(forwardFocusRef, textFilterRef);\n\n const { items, filteredItemsCount, collectionProps, filterProps, paginationProps, actions } = useCollection(\n allItems,\n {\n selection: { trackBy },\n filtering: {\n empty: i18nStrings.emptyText,\n noMatch: (\n actions.setFiltering('')}>\n {i18nStrings.clearFilterButtonText}\n \n }\n />\n ),\n },\n pagination: {},\n sorting: {},\n }\n );\n const selectedItem = collectionProps.selectedItems?.[0];\n\n // selectedItem can change internally inside the hook after pagination or filtering\n // useEffect will capture all possible changes\n useEffect(() => {\n onSelectLatest(selectedItem);\n }, [selectedItem, onSelectLatest]);\n\n return (\n \n variant={isVisualRefresh ? 'borderless' : 'container'}\n {...collectionProps}\n header={\n }\n counter={selectedItem ? `(1/${allItems.length})` : `(${allItems.length})`}\n >\n {i18nStrings.header}\n \n }\n trackBy={trackBy}\n filter={\n \n }\n pagination={}\n selectionType=\"single\"\n ariaLabels={i18nStrings.selectionLabels}\n loading={loading}\n loadingText={i18nStrings.loadingText}\n items={items}\n visibleColumns={visibleColumns}\n isItemDisabled={isItemDisabled}\n columnDefinitions={columnDefinitions}\n enableKeyboardNavigation={true}\n />\n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport InternalBox from '../../box/internal';\n\ninterface EmptyStateProps {\n title?: string;\n subtitle?: string;\n action?: React.ReactNode;\n}\n\nexport function EmptyState({ title, subtitle, action }: EmptyStateProps) {\n return (\n \n \n {title}\n \n \n {subtitle}\n \n {action}\n \n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { S3ResourceSelectorProps } from '../interfaces';\nimport { compareDates, getColumnAriaLabel, includes } from './table-utils';\nimport InternalIcon from '../../icon/internal';\nimport InternalLink from '../../link/internal';\nimport { TableProps } from '../../table/interfaces';\nimport { ForwardFocusRef } from '../../internal/hooks/forward-focus';\nimport { formatSize, formatDefault } from './column-formats';\nimport { BasicS3Table, getSharedI18Strings } from './basic-table';\nimport { joinObjectPath } from '../utils';\nimport { useInternalI18n } from '../../i18n/context';\n\ninterface ObjectsTableProps {\n forwardFocusRef: React.Ref;\n pathSegments: ReadonlyArray;\n visibleColumns: ReadonlyArray;\n isItemDisabled: TableProps.IsItemDisabled | undefined;\n selectableItemsTypes: S3ResourceSelectorProps['selectableItemsTypes'];\n fetchData: S3ResourceSelectorProps['fetchObjects'];\n i18nStrings: S3ResourceSelectorProps.I18nStrings | undefined;\n isVisualRefresh?: boolean;\n onDrilldown: (path: S3ResourceSelectorProps.Object) => void;\n onSelect: (uri: string) => void;\n}\n\nexport function ObjectsTable({\n forwardFocusRef,\n pathSegments,\n i18nStrings,\n isVisualRefresh,\n isItemDisabled,\n selectableItemsTypes,\n fetchData,\n visibleColumns,\n onDrilldown,\n onSelect,\n}: ObjectsTableProps) {\n const i18n = useInternalI18n('s3-resource-selector');\n\n return (\n \n // remount fresh component every we change the path to reset the inner state (e.g. selection/filtering)\n key={pathSegments.join('/')}\n forwardFocusRef={forwardFocusRef}\n trackBy=\"Key\"\n fetchData={() => {\n const [bucketName, ...rest] = pathSegments;\n return fetchData(bucketName, joinObjectPath(rest));\n }}\n i18nStrings={{\n ...getSharedI18Strings(i18n, i18nStrings),\n header: i18n('i18nStrings.selectionObjects', i18nStrings?.selectionObjects),\n loadingText: i18n('i18nStrings.selectionObjectsLoading', i18nStrings?.selectionObjectsLoading),\n filteringAriaLabel: i18n(\n 'i18nStrings.labelFiltering',\n i18nStrings?.labelFiltering,\n format => itemsType => format({ itemsType })\n )?.(i18n('i18nStrings.selectionObjects', i18nStrings?.selectionObjects) ?? ''),\n filteringPlaceholder: i18n(\n 'i18nStrings.selectionObjectsSearchPlaceholder',\n i18nStrings?.selectionObjectsSearchPlaceholder\n ),\n emptyText: i18n('i18nStrings.selectionObjectsNoItems', i18nStrings?.selectionObjectsNoItems),\n selectionLabels: {\n ...i18nStrings?.labelsObjectsSelection,\n selectionGroupLabel: i18n(\n 'i18nStrings.labelsObjectsSelection.selectionGroupLabel',\n i18nStrings?.labelsObjectsSelection?.selectionGroupLabel\n ),\n itemSelectionLabel: i18n(\n 'i18nStrings.labelsObjectsSelection.itemSelectionLabel',\n i18nStrings?.labelsObjectsSelection?.itemSelectionLabel,\n format => (data, item) => format({ item__Key: item.Key ?? '' })\n ),\n },\n }}\n isVisualRefresh={isVisualRefresh}\n visibleColumns={visibleColumns}\n isItemDisabled={isItemDisabled || (() => !includes(selectableItemsTypes, 'objects'))}\n columnDefinitions={[\n {\n id: 'Key',\n header: i18n('i18nStrings.columnObjectKey', i18nStrings?.columnObjectKey),\n ariaLabel: getColumnAriaLabel(\n i18n,\n i18nStrings,\n i18n('i18nStrings.columnObjectKey', i18nStrings?.columnObjectKey)\n ),\n sortingField: 'Key',\n cell: item => {\n const isClickable = item.IsFolder || includes(selectableItemsTypes, 'versions');\n return (\n <>\n {' '}\n {isClickable ? (\n item.Key && onDrilldown(item)} variant=\"link\">\n {item.Key}\n \n ) : (\n item.Key\n )}\n \n );\n },\n minWidth: '250px',\n },\n {\n id: 'LastModified',\n header: i18n('i18nStrings.columnObjectLastModified', i18nStrings?.columnObjectLastModified),\n ariaLabel: getColumnAriaLabel(\n i18n,\n i18nStrings,\n i18n('i18nStrings.columnObjectLastModified', i18nStrings?.columnObjectLastModified)\n ),\n sortingComparator: (a, b) => compareDates(a.LastModified, b.LastModified),\n cell: item => formatDefault(item.LastModified),\n },\n {\n id: 'Size',\n header: i18n('i18nStrings.columnObjectSize', i18nStrings?.columnObjectSize),\n ariaLabel: getColumnAriaLabel(\n i18n,\n i18nStrings,\n i18n('i18nStrings.columnObjectSize', i18nStrings?.columnObjectSize)\n ),\n sortingField: 'Size',\n cell: item => formatSize(item.Size),\n },\n ]}\n onSelect={item => onSelect(item?.Key ?? '')}\n />\n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nexport function joinObjectPath(segments: ReadonlyArray) {\n return segments.reduce((prev, next) => {\n if (prev && prev[prev.length - 1] !== '/') {\n prev = prev + '/';\n }\n return prev + next;\n }, '');\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { S3ResourceSelectorProps } from '../interfaces';\nimport { getColumnAriaLabel, compareDates } from './table-utils';\nimport { TableProps } from '../../table/interfaces';\nimport { ForwardFocusRef } from '../../internal/hooks/forward-focus';\nimport { formatSize, formatDefault } from './column-formats';\nimport { BasicS3Table, getSharedI18Strings } from './basic-table';\nimport { joinObjectPath } from '../utils';\nimport { useInternalI18n } from '../../i18n/context';\n\ninterface VersionsTableProps {\n forwardFocusRef: React.Ref;\n pathSegments: ReadonlyArray;\n visibleColumns: ReadonlyArray;\n isItemDisabled: TableProps.IsItemDisabled | undefined;\n fetchData: S3ResourceSelectorProps['fetchVersions'];\n i18nStrings: S3ResourceSelectorProps.I18nStrings | undefined;\n isVisualRefresh?: boolean;\n onSelect: (versionId: string) => void;\n}\n\nexport function VersionsTable({\n forwardFocusRef,\n pathSegments,\n i18nStrings,\n isVisualRefresh,\n isItemDisabled,\n fetchData,\n visibleColumns,\n onSelect,\n}: VersionsTableProps) {\n const i18n = useInternalI18n('s3-resource-selector');\n\n return (\n \n forwardFocusRef={forwardFocusRef}\n trackBy=\"VersionId\"\n fetchData={() => {\n const [bucketName, ...rest] = pathSegments;\n return fetchData(bucketName, joinObjectPath(rest));\n }}\n i18nStrings={{\n ...getSharedI18Strings(i18n, i18nStrings),\n header: i18n('i18nStrings.selectionVersions', i18nStrings?.selectionVersions),\n loadingText: i18n('i18nStrings.selectionVersionsLoading', i18nStrings?.selectionVersionsLoading),\n filteringAriaLabel: i18n(\n 'i18nStrings.labelFiltering',\n i18nStrings?.labelFiltering,\n format => itemsType => format({ itemsType })\n )?.(i18n('i18nStrings.selectionVersions', i18nStrings?.selectionVersions) ?? ''),\n filteringPlaceholder: i18n(\n 'i18nStrings.selectionVersionsSearchPlaceholder',\n i18nStrings?.selectionVersionsSearchPlaceholder\n ),\n emptyText: i18n('i18nStrings.selectionVersionsNoItems', i18nStrings?.selectionVersionsNoItems),\n selectionLabels: {\n ...i18nStrings?.labelsVersionsSelection,\n selectionGroupLabel: i18n(\n 'i18nStrings.labelsVersionsSelection.selectionGroupLabel',\n i18nStrings?.labelsVersionsSelection?.selectionGroupLabel\n ),\n itemSelectionLabel: i18n(\n 'i18nStrings.labelsVersionsSelection.itemSelectionLabel',\n i18nStrings?.labelsVersionsSelection?.itemSelectionLabel,\n format => (data, item) => format({ item__VersionId: item.VersionId ?? '' })\n ),\n },\n }}\n isVisualRefresh={isVisualRefresh}\n visibleColumns={visibleColumns}\n isItemDisabled={isItemDisabled}\n columnDefinitions={[\n {\n id: 'ID',\n header: i18n('i18nStrings.columnVersionID', i18nStrings?.columnVersionID),\n ariaLabel: getColumnAriaLabel(\n i18n,\n i18nStrings,\n i18n('i18nStrings.columnVersionID', i18nStrings?.columnVersionID)\n ),\n sortingField: 'VersionId',\n cell: item => item.VersionId,\n minWidth: '250px',\n },\n {\n id: 'LastModified',\n header: i18n('i18nStrings.columnVersionLastModified', i18nStrings?.columnVersionLastModified),\n ariaLabel: getColumnAriaLabel(\n i18n,\n i18nStrings,\n i18n('i18nStrings.columnVersionLastModified', i18nStrings?.columnVersionLastModified)\n ),\n sortingComparator: (a, b) => compareDates(a.LastModified, b.LastModified),\n cell: item => formatDefault(item.LastModified),\n },\n {\n id: 'Size',\n header: i18n('i18nStrings.columnVersionSize', i18nStrings?.columnVersionSize),\n ariaLabel: getColumnAriaLabel(\n i18n,\n i18nStrings,\n i18n('i18nStrings.columnVersionSize', i18nStrings?.columnVersionSize)\n ),\n sortingField: 'Size',\n cell: item => formatSize(item.Size),\n },\n ]}\n onSelect={item => onSelect(item?.VersionId ?? '')}\n />\n );\n}\n", "\n import './styles.scoped.css';\n export default {\n \"modal-actions\": \"awsui_modal-actions_12hyz_1p88p_5\",\n \"submit-button\": \"awsui_submit-button_12hyz_1p88p_9\"\n};\n ", "\n import './styles.scoped.css';\n export default {\n \"root\": \"awsui_root_1u0yw_rfo7y_5\",\n \"alert\": \"awsui_alert_1u0yw_rfo7y_9\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { SegmentedControlProps } from './interfaces';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport InternalSegmentedControl from './internal';\n\nexport { SegmentedControlProps };\n\nexport default function SegmentedControl(props: SegmentedControlProps) {\n const baseComponentProps = useBaseComponent('SegmentedControl');\n return ;\n}\n\napplyDisplayName(SegmentedControl, 'SegmentedControl');\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { SelectProps } from './interfaces';\nimport InternalSelect from './internal';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { getExternalProps } from '../internal/utils/external-props';\n\nexport { SelectProps };\n\nconst Select = React.forwardRef(\n (\n {\n options = [],\n filteringType = 'none',\n statusType = 'finished',\n triggerVariant = 'label',\n ...restProps\n }: SelectProps,\n ref: React.Ref\n ) => {\n const baseComponentProps = useBaseComponent('Select', {\n props: {\n autoFocus: restProps.autoFocus,\n expandToViewport: restProps.expandToViewport,\n filteringType,\n triggerVariant,\n virtualScroll: restProps.virtualScroll,\n },\n });\n const externalProps = getExternalProps(restProps);\n return (\n \n );\n }\n);\n\napplyDisplayName(Select, 'Select');\nexport default Select;\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useMemo, useCallback, useEffect } from 'react';\nimport clsx from 'clsx';\nimport { getBaseProps } from '../internal/base-component';\nimport { fireNonCancelableEvent, fireCancelableEvent } from '../internal/events';\nimport { SideNavigationProps } from './interfaces';\nimport { Header, NavigationItemsList } from './internal';\nimport { generateExpandableItemsMapping, checkDuplicateHrefs } from './util';\nimport styles from './styles.css.js';\nimport { isDevelopment } from '../internal/is-development';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport useBaseComponent from '../internal/hooks/use-base-component';\n\nexport { SideNavigationProps };\n\nexport default function SideNavigation({\n header,\n activeHref,\n items = [],\n onFollow,\n onChange,\n ...props\n}: SideNavigationProps) {\n const { __internalRootRef } = useBaseComponent('SideNavigation');\n const baseProps = getBaseProps(props);\n const parentMap = useMemo(() => generateExpandableItemsMapping(items), [items]);\n\n if (isDevelopment) {\n // This code should be wiped in production anyway.\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useEffect(() => checkDuplicateHrefs(items), [items]);\n }\n\n const onChangeHandler = useCallback(\n (item: SideNavigationProps.Section | SideNavigationProps.ExpandableLinkGroup, expanded: boolean) => {\n // generateExpandableItemsMapping walks through the entire tree, so we're certain about getting a value.\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n fireNonCancelableEvent(onChange, { item, expanded: expanded, expandableParents: parentMap.get(item)! });\n },\n [onChange, parentMap]\n );\n\n const onFollowHandler = useCallback(\n (\n item:\n | SideNavigationProps.Link\n | SideNavigationProps.Header\n | SideNavigationProps.LinkGroup\n | SideNavigationProps.ExpandableLinkGroup,\n sourceEvent: React.SyntheticEvent | Event\n ) => {\n fireCancelableEvent(onFollow, item, sourceEvent);\n },\n [onFollow]\n );\n\n return (\n
      \n {header && (\n
      \n )}\n {items && (\n
      \n \n
      \n )}\n
      \n );\n}\n\napplyDisplayName(SideNavigation, 'SideNavigation');\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useCallback, useState, useEffect, useMemo, ReactNode } from 'react';\nimport clsx from 'clsx';\nimport { ExpandableSectionProps } from '../expandable-section/interfaces';\nimport InternalExpandableSection from '../expandable-section/internal';\nimport InternalIcon from '../icon/internal';\nimport InternalBox from '../box/internal';\nimport { SideNavigationProps } from './interfaces';\nimport styles from './styles.css.js';\nimport { NonCancelableCustomEvent, isPlainLeftClick } from '../internal/events';\nimport { hasActiveLink } from './util';\nimport { checkSafeUrl } from '../internal/utils/check-safe-url';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\n\ninterface BaseItemComponentProps {\n activeHref?: string;\n fireChange: (item: SideNavigationProps.Section | SideNavigationProps.ExpandableLinkGroup, expanded: boolean) => void;\n fireFollow: (\n item:\n | SideNavigationProps.Link\n | SideNavigationProps.Header\n | SideNavigationProps.LinkGroup\n | SideNavigationProps.ExpandableLinkGroup,\n event: React.SyntheticEvent | Event\n ) => void;\n}\n\nexport interface HeaderProps extends BaseItemComponentProps {\n definition: SideNavigationProps.Header;\n}\n\nexport function Header({ definition, activeHref, fireFollow }: HeaderProps) {\n checkSafeUrl('SideNavigation', definition.href);\n const onClick = useCallback(\n (event: React.MouseEvent) => {\n if (isPlainLeftClick(event)) {\n fireFollow(definition, event);\n }\n },\n [fireFollow, definition]\n );\n\n return (\n <>\n

      \n \n {definition.logo && (\n \n )}\n {definition.text}\n \n

      \n \n \n );\n}\n\nexport interface NavigationItemsListProps extends BaseItemComponentProps {\n items: ReadonlyArray;\n variant: 'section' | 'section-group' | 'link-group' | 'expandable-link-group' | 'root';\n}\n\ninterface Item {\n element?: ReactNode;\n listVariant?: 'section' | 'section-group' | 'link-group' | 'expandable-link-group' | 'root';\n items?: Array;\n}\n\nexport function NavigationItemsList({ items, variant, activeHref, fireChange, fireFollow }: NavigationItemsListProps) {\n const lists: Array = [];\n let currentListIndex = 0;\n lists[currentListIndex] = {\n listVariant: variant,\n items: [],\n };\n\n items.forEach((item, index) => {\n const itemid = index + 1;\n switch (item.type) {\n case 'divider': {\n const dividerIndex = lists.length;\n lists[dividerIndex] = {\n element: (\n
      \n \n
      \n ),\n };\n currentListIndex = lists.length;\n lists[currentListIndex] = {\n listVariant: variant,\n items: [],\n };\n return;\n }\n case 'link': {\n lists[currentListIndex].items?.push({\n element: (\n
    • \n \n
    • \n ),\n });\n return;\n }\n case 'section': {\n lists[currentListIndex].items?.push({\n element: (\n
    • \n \n
    • \n ),\n });\n return;\n }\n case 'section-group': {\n lists[currentListIndex].items?.push({\n element: (\n
    • \n \n
    • \n ),\n });\n return;\n }\n case 'link-group': {\n lists[currentListIndex].items?.push({\n element: (\n
    • \n \n
    • \n ),\n });\n return;\n }\n case 'expandable-link-group': {\n lists[currentListIndex].items?.push({\n element: (\n
    • \n \n
    • \n ),\n });\n return;\n }\n }\n });\n\n const lastListIndex = lists.length - 1;\n\n return (\n <>\n {lists.map((list, index) => {\n if (!list.items || list.items.length === 0) {\n return (\n \n {list.element}\n
      \n );\n } else {\n return (\n \n {list.items.map(item => item.element)}\n
    \n );\n }\n })}\n \n );\n}\n\ninterface DividerProps {\n variant: 'default' | 'header';\n isPresentational?: boolean;\n}\n\nfunction Divider({ variant = 'default', isPresentational = false }: DividerProps) {\n return (\n \n );\n}\n\ninterface LinkProps extends BaseItemComponentProps {\n definition: SideNavigationProps.Link;\n expanded?: boolean;\n}\n\nfunction Link({ definition, expanded, activeHref, fireFollow }: LinkProps) {\n checkSafeUrl('SideNavigation', definition.href);\n const isActive = definition.href === activeHref;\n\n const onClick = useCallback(\n (event: React.MouseEvent) => {\n if (isPlainLeftClick(event)) {\n fireFollow(definition, event);\n }\n },\n [fireFollow, definition]\n );\n\n return (\n <>\n \n {definition.text}\n {definition.external && (\n \n \n \n )}\n \n {definition.info && {definition.info}}\n \n );\n}\n\ninterface SectionProps extends BaseItemComponentProps {\n definition: SideNavigationProps.Section;\n variant: 'section' | 'section-group' | 'link-group' | 'expandable-link-group' | 'root';\n}\n\nfunction Section({ definition, activeHref, fireFollow, fireChange, variant }: SectionProps) {\n const [expanded, setExpanded] = useState(definition.defaultExpanded ?? true);\n const isVisualRefresh = useVisualRefresh();\n\n const onExpandedChange = useCallback(\n (e: NonCancelableCustomEvent) => {\n fireChange(definition, e.detail.expanded);\n setExpanded(e.detail.expanded);\n },\n [definition, fireChange]\n );\n\n useEffect(() => {\n setExpanded(definition.defaultExpanded ?? true);\n }, [definition]);\n\n return (\n \n \n \n );\n}\n\ninterface SectionGroupProps extends BaseItemComponentProps {\n definition: SideNavigationProps.SectionGroup;\n}\n\nfunction SectionGroup({ definition, activeHref, fireFollow, fireChange }: SectionGroupProps) {\n return (\n
    \n \n {definition.title}\n \n \n
    \n );\n}\n\ninterface LinkGroupProps extends BaseItemComponentProps {\n definition: SideNavigationProps.LinkGroup;\n}\n\nfunction LinkGroup({ definition, activeHref, fireFollow, fireChange }: LinkGroupProps) {\n checkSafeUrl('SideNavigation', definition.href);\n\n return (\n <>\n fireFollow(definition, event)}\n fireChange={fireChange}\n activeHref={activeHref}\n />\n \n \n );\n}\n\ninterface ExpandableLinkGroupProps extends BaseItemComponentProps {\n definition: SideNavigationProps.ExpandableLinkGroup;\n variant: 'section' | 'section-group' | 'link-group' | 'expandable-link-group' | 'root';\n}\n\nfunction ExpandableLinkGroup({ definition, fireFollow, fireChange, activeHref, variant }: ExpandableLinkGroupProps) {\n // Check whether the definition contains an active link and memoize it to avoid\n // rechecking every time.\n const containsActiveLink = useMemo(() => {\n return activeHref ? hasActiveLink(definition.items, activeHref) : false;\n }, [activeHref, definition.items]);\n\n const [expanded, setExpanded] = useState(() => {\n return definition.defaultExpanded ?? (definition.href === activeHref || containsActiveLink);\n });\n\n const [userExpanded, setUserExpanded] = useState();\n\n // Reset user expansion status when the items property is updated.\n useEffect(() => setUserExpanded(undefined), [definition]);\n\n // By default, the expandable section is open when there's an active link inside.\n useEffect(() => {\n setExpanded(definition.href === activeHref || containsActiveLink);\n }, [definition.href, containsActiveLink, activeHref]);\n\n // If the definition object itself is updated, reset the expansion state to default.\n useEffect(() => {\n if (definition.defaultExpanded !== undefined) {\n setExpanded(definition.defaultExpanded);\n }\n }, [definition]);\n\n const onExpandedChange = useCallback(\n (e: NonCancelableCustomEvent) => {\n fireChange(definition, e.detail.expanded);\n setUserExpanded(e.detail.expanded);\n },\n [definition, fireChange]\n );\n\n const onHeaderFollow: LinkProps['fireFollow'] = (_, event) => {\n fireFollow(definition, event);\n setUserExpanded(true);\n if (!expanded) {\n fireChange(definition, true);\n }\n };\n\n return (\n \n }\n >\n \n \n );\n}\n", "\n import './styles.scoped.css';\n export default {\n \"root\": \"awsui_root_l0dv0_s3klw_99\",\n \"header\": \"awsui_header_l0dv0_s3klw_136\",\n \"header-link\": \"awsui_header-link_l0dv0_s3klw_149\",\n \"header-link--has-logo\": \"awsui_header-link--has-logo_l0dv0_s3klw_159\",\n \"header-link-text\": \"awsui_header-link-text_l0dv0_s3klw_159\",\n \"header-logo\": \"awsui_header-logo_l0dv0_s3klw_164\",\n \"header-logo--stretched\": \"awsui_header-logo--stretched_l0dv0_s3klw_170\",\n \"list-container\": \"awsui_list-container_l0dv0_s3klw_175\",\n \"list\": \"awsui_list_l0dv0_s3klw_175\",\n \"list-variant-root\": \"awsui_list-variant-root_l0dv0_s3klw_187\",\n \"list-variant-root--last\": \"awsui_list-variant-root--last_l0dv0_s3klw_194\",\n \"list-variant-expandable-link-group\": \"awsui_list-variant-expandable-link-group_l0dv0_s3klw_198\",\n \"list-item\": \"awsui_list-item_l0dv0_s3klw_202\",\n \"section\": \"awsui_section_l0dv0_s3klw_210\",\n \"expandable-link-group\": \"awsui_expandable-link-group_l0dv0_s3klw_211\",\n \"section--no-ident\": \"awsui_section--no-ident_l0dv0_s3klw_214\",\n \"expandable-link-group--no-ident\": \"awsui_expandable-link-group--no-ident_l0dv0_s3klw_215\",\n \"refresh\": \"awsui_refresh_l0dv0_s3klw_223\",\n \"list-variant-section-group\": \"awsui_list-variant-section-group_l0dv0_s3klw_231\",\n \"section-group\": \"awsui_section-group_l0dv0_s3klw_238\",\n \"section-group-title\": \"awsui_section-group-title_l0dv0_s3klw_249\",\n \"link\": \"awsui_link_l0dv0_s3klw_253\",\n \"link-active\": \"awsui_link-active_l0dv0_s3klw_262\",\n \"info\": \"awsui_info_l0dv0_s3klw_299\",\n \"external-icon\": \"awsui_external-icon_l0dv0_s3klw_303\",\n \"divider\": \"awsui_divider_l0dv0_s3klw_307\",\n \"divider-default\": \"awsui_divider-default_l0dv0_s3klw_313\",\n \"divider-header\": \"awsui_divider-header_l0dv0_s3klw_318\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { SideNavigationProps } from './interfaces';\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\ntype ExpandableItem = SideNavigationProps.Section | SideNavigationProps.ExpandableLinkGroup;\n\nexport function hasActiveLink(items: ReadonlyArray, activeHref: string): boolean {\n for (const item of items) {\n if (\n (item.type === 'link' || item.type === 'link-group' || item.type === 'expandable-link-group') &&\n item.href === activeHref\n ) {\n return true;\n }\n if (\n (item.type === 'section' || item.type === 'link-group' || item.type === 'expandable-link-group') &&\n hasActiveLink(item.items, activeHref)\n ) {\n return true;\n }\n }\n return false;\n}\n\nexport function generateExpandableItemsMapping(\n items: ReadonlyArray,\n mapping: WeakMap> = new WeakMap(),\n expandableParents: ReadonlyArray = []\n): WeakMap> {\n items.forEach(item => {\n const nextLevelParents = expandableParents.slice();\n if (item.type === 'section' || item.type === 'expandable-link-group') {\n mapping.set(item, expandableParents);\n nextLevelParents.unshift(item);\n }\n if (item.type === 'section' || item.type === 'link-group' || item.type === 'expandable-link-group') {\n generateExpandableItemsMapping(item.items, mapping, nextLevelParents);\n }\n });\n return mapping;\n}\n\nexport function checkDuplicateHrefs(items: ReadonlyArray) {\n const hrefs = new Set();\n const queue = items.slice();\n while (queue.length > 0) {\n // We just checked that there's items in the queue.\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const item = queue.shift()!;\n\n // Check duplicated hrefs\n if ('href' in item) {\n if (hrefs.has(item.href)) {\n warnOnce('SideNavigation', `duplicate href in \"${item.text}\": ${item.href}`);\n }\n hrefs.add(item.href);\n }\n\n if ('items' in item) {\n queue.push(...item.items);\n }\n }\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { SpinnerProps } from './interfaces';\nimport InternalSpinner from './internal';\nimport useBaseComponent from '../internal/hooks/use-base-component';\n\nexport { SpinnerProps };\n\nexport default function Spinner({ size = 'normal', variant = 'normal', ...props }: SpinnerProps) {\n const baseComponentProps = useBaseComponent('Spinner', {\n props: { size, variant },\n });\n return ;\n}\n\napplyDisplayName(Spinner, 'Spinner');\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { SplitPanelInternal } from './internal';\nimport { SplitPanelProps } from './interfaces';\n\nexport { SplitPanelProps };\n\nexport default function SplitPanel({\n hidePreferencesButton = false,\n closeBehavior = 'collapse',\n ...restProps\n}: SplitPanelProps) {\n const { __internalRootRef } = useBaseComponent('SplitPanel', {\n props: { closeBehavior, hidePreferencesButton },\n });\n return (\n \n );\n}\n\napplyDisplayName(SplitPanel, 'SplitPanel');\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { getGlobalFlag } from '../internal/utils/global-flags';\nimport { SplitPanelProps } from './interfaces';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { SplitPanelImplementation } from './implementation';\n\ntype SplitPanelType = React.ForwardRefExoticComponent>;\n\nexport function createWidgetizedSplitPanel(SplitPanelLoader?: SplitPanelType): SplitPanelType {\n return React.forwardRef((props, ref) => {\n const isRefresh = useVisualRefresh();\n if (isRefresh && getGlobalFlag('appLayoutWidget') && SplitPanelLoader) {\n return ;\n }\n\n return ;\n });\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useState, useEffect, useLayoutEffect, useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { InternalButton } from '../button/internal';\nimport { getBaseProps } from '../internal/base-component';\nimport { useSplitPanelContext } from '../internal/context/split-panel-context';\n\nimport { SplitPanelProps } from './interfaces';\nimport ResizeHandler from './icons/resize-handler';\nimport PreferencesModal from './preferences-modal';\nimport { usePointerEvents } from '../app-layout/utils/use-pointer-events';\nimport { useKeyboardEvents } from '../app-layout/utils/use-keyboard-events';\nimport { SizeControlProps } from '../app-layout/utils/interfaces';\n\nimport styles from './styles.css.js';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { AppLayoutContext } from '../internal/context/app-layout-context';\nimport { Transition } from '../internal/components/transition';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { SplitPanelContentSide } from './side';\nimport { SplitPanelContentBottom } from './bottom';\nimport { useInternalI18n } from '../i18n/context';\n\nexport { SplitPanelProps };\n\nexport const SplitPanelImplementation = React.forwardRef(\n (\n { header, children, hidePreferencesButton = false, closeBehavior = 'collapse', i18nStrings, ...restProps },\n __internalRootRef\n ) => {\n const isRefresh = useVisualRefresh();\n\n const {\n position,\n topOffset,\n bottomOffset,\n rightOffset,\n contentWidthStyles,\n isOpen,\n isForcedPosition,\n onPreferencesChange,\n onResize,\n onToggle,\n size,\n relativeSize,\n setSplitPanelToggle,\n refs,\n } = useSplitPanelContext();\n const baseProps = getBaseProps(restProps);\n const i18n = useInternalI18n('split-panel');\n const [isPreferencesOpen, setPreferencesOpen] = useState(false);\n\n const appLayoutMaxWidth = isRefresh && position === 'bottom' ? contentWidthStyles : undefined;\n\n const openButtonAriaLabel = i18n('i18nStrings.openButtonAriaLabel', i18nStrings?.openButtonAriaLabel);\n useEffect(() => {\n setSplitPanelToggle({ displayed: closeBehavior === 'collapse', ariaLabel: openButtonAriaLabel });\n }, [setSplitPanelToggle, openButtonAriaLabel, closeBehavior]);\n\n const splitPanelRefObject = useRef(null);\n\n const sizeControlProps: SizeControlProps = {\n position,\n panelRef: splitPanelRefObject,\n handleRef: refs.slider,\n onResize,\n };\n const onSliderPointerDown = usePointerEvents(sizeControlProps);\n const onKeyDown = useKeyboardEvents(sizeControlProps);\n\n const wrappedChildren = (\n \n {children}\n \n );\n\n const panelHeaderId = useUniqueId('split-panel-header');\n\n const wrappedHeader = (\n
    \n

    \n {header}\n

    \n
    \n {!hidePreferencesButton && isOpen && (\n <>\n setPreferencesOpen(true)}\n formAction=\"none\"\n ariaLabel={i18n('i18nStrings.preferencesTitle', i18nStrings?.preferencesTitle)}\n ref={refs.preferences}\n />\n \n \n )}\n\n {isOpen ? (\n \n ) : position === 'side' ? null : (\n \n )}\n
    \n
    \n );\n\n const resizeHandle = (\n \n \n \n );\n\n /*\n This effect forces the browser to recalculate the layout\n whenever the split panel might have moved.\n\n This is needed as a workaround for a bug in Safari, which does\n not automatically calculate the new position of the split panel\n _content_ when the split panel moves.\n */\n useLayoutEffect(() => {\n const root = splitPanelRefObject.current;\n\n if (root) {\n const property = 'transform';\n const temporaryValue = 'translateZ(0)';\n\n const valueBefore = root.style[property];\n root.style[property] = temporaryValue;\n\n // This line forces the browser to recalculate the layout\n void root.offsetHeight;\n\n root.style[property] = valueBefore;\n }\n }, [rightOffset, __internalRootRef]);\n\n const mergedRef = useMergeRefs(splitPanelRefObject, __internalRootRef);\n\n if (closeBehavior === 'hide' && !isOpen) {\n return <>;\n }\n\n /**\n * The AppLayout factor moved the circular buttons out of the\n * SplitPanel and into the Tools component. This conditional\n * is still needed for the early return to prevent execution\n * of the following code.\n */\n if (isRefresh && !isOpen && position === 'side') {\n return <>;\n }\n\n return (\n \n {(state, transitioningElementRef) => (\n <>\n {position === 'side' && (\n \n {wrappedChildren}\n \n )}\n\n {position === 'bottom' && (\n \n {wrappedChildren}\n \n )}\n {isPreferencesOpen && (\n {\n onPreferencesChange({ ...preferences });\n setPreferencesOpen(false);\n }}\n onDismiss={() => {\n setPreferencesOpen(false);\n }}\n />\n )}\n \n )}\n \n );\n }\n);\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useState } from 'react';\n\nimport InternalBox from '../box/internal';\nimport { InternalButton } from '../button/internal';\nimport InternalFormField from '../form-field/internal';\nimport InternalModal from '../modal/internal';\nimport InternalTiles from '../tiles/internal';\nimport InternalSpaceBetween from '../space-between/internal';\n\nimport sidePositionIconClassic from './icons/side-position';\nimport bottomPositionIconClassic from './icons/bottom-icon';\nimport sidePositionIconRefresh from './icons/side-position-refresh';\nimport bottomPositionIconRefresh from './icons/bottom-icon-refresh';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\n\ninterface PreferencesModali18nStrings {\n header?: string;\n cancel?: string;\n confirm?: string;\n positionLabel?: string;\n positionDescription?: string;\n positionBottom?: string;\n positionSide?: string;\n}\n\ninterface PreferencesModalProps extends InternalBaseComponentProps {\n visible: boolean;\n\n preferences: { position: 'side' | 'bottom' };\n\n i18nStrings: PreferencesModali18nStrings;\n\n disabledSidePosition?: boolean;\n isRefresh: boolean;\n\n onConfirm: (preferences: { position: 'side' | 'bottom' }) => void;\n onDismiss: () => void;\n}\n\nexport default (props: PreferencesModalProps) => {\n const [position, setPosition] = useState<'side' | 'bottom'>(props.preferences.position);\n\n const onCancel = () => {\n setPosition(props.preferences.position);\n props.onDismiss();\n };\n\n const onConfirm = () => {\n props.onConfirm({ position });\n };\n\n return (\n \n \n \n {props.i18nStrings.cancel}\n \n \n {props.i18nStrings.confirm}\n \n \n \n }\n __internalRootRef={props.__internalRootRef}\n >\n \n setPosition(e.detail.value as any)}\n value={position}\n columns={2}\n items={[\n {\n label: props.i18nStrings.positionBottom,\n image: props.isRefresh ? bottomPositionIconRefresh : bottomPositionIconClassic,\n value: 'bottom',\n },\n {\n label: props.i18nStrings.positionSide,\n image: props.isRefresh ? sidePositionIconRefresh : sidePositionIconClassic,\n value: 'side',\n disabled: props.disabledSidePosition,\n },\n ]}\n />\n \n \n );\n};\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React from 'react';\n\nimport { getBaseProps } from '../internal/base-component';\nimport { TilesProps } from './interfaces';\nimport styles from './styles.css.js';\n\nimport { useFormFieldContext } from '../internal/context/form-field-context';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { useContainerBreakpoints } from '../internal/hooks/container-queries';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { Tile } from './tile';\nimport useRadioGroupForwardFocus from '../internal/hooks/forward-focus/radio-group';\n\nconst COLUMN_TRIGGERS: TilesProps.Breakpoint[] = ['default', 'xxs', 'xs'];\n\ntype InternalTilesProps = TilesProps & InternalBaseComponentProps;\n\nconst InternalTiles = React.forwardRef(\n (\n {\n name,\n value,\n items,\n ariaLabel,\n ariaRequired,\n ariaControls,\n columns,\n onChange,\n __internalRootRef = null,\n ...rest\n }: InternalTilesProps,\n ref: React.Ref\n ) => {\n const baseProps = getBaseProps(rest);\n const { ariaDescribedby, ariaLabelledby } = useFormFieldContext(rest);\n const generatedName = useUniqueId('awsui-tiles-');\n\n const [tileRef, tileRefIndex] = useRadioGroupForwardFocus(ref, items, value);\n const [breakpoint, breakpointRef] = useContainerBreakpoints(COLUMN_TRIGGERS);\n const mergedRef = useMergeRefs(breakpointRef, __internalRootRef);\n\n const columnCount = getColumnCount(items, columns);\n\n return (\n \n
    \n {items &&\n items.map((item, index) => (\n \n ))}\n
    \n \n );\n }\n);\n\nfunction getColumnCount(\n items: ReadonlyArray | undefined,\n columns: number | undefined\n): number {\n if (columns) {\n return columns;\n }\n\n const nItems = items ? items.length : 0;\n const columnsLookup: Record = {\n 0: 1,\n 1: 1,\n 2: 2,\n 4: 2,\n 8: 2,\n };\n return columnsLookup[nItems] || 3;\n}\n\nexport default InternalTiles;\n", "\n import './styles.scoped.css';\n export default {\n \"column-layout\": \"awsui_column-layout_vj6p7_147sx_99\",\n \"grid\": \"awsui_grid_vj6p7_147sx_134\",\n \"grid-no-gutters\": \"awsui_grid-no-gutters_vj6p7_147sx_140\",\n \"grid-variant-text-grid\": \"awsui_grid-variant-text-grid_vj6p7_147sx_144\",\n \"grid-breakpoint-default\": \"awsui_grid-breakpoint-default_vj6p7_147sx_152\",\n \"grid-columns-1\": \"awsui_grid-columns-1_vj6p7_147sx_155\",\n \"grid-breakpoint-xxs\": \"awsui_grid-breakpoint-xxs_vj6p7_147sx_155\",\n \"grid-breakpoint-xs\": \"awsui_grid-breakpoint-xs_vj6p7_147sx_158\",\n \"grid-columns-2\": \"awsui_grid-columns-2_vj6p7_147sx_161\",\n \"grid-columns-3\": \"awsui_grid-columns-3_vj6p7_147sx_167\",\n \"grid-columns-4\": \"awsui_grid-columns-4_vj6p7_147sx_173\",\n \"grid-vertical-borders\": \"awsui_grid-vertical-borders_vj6p7_147sx_189\",\n \"grid-horizontal-borders\": \"awsui_grid-horizontal-borders_vj6p7_147sx_222\",\n \"root\": \"awsui_root_vj6p7_147sx_276\",\n \"tile-container\": \"awsui_tile-container_vj6p7_147sx_314\",\n \"refresh\": \"awsui_refresh_vj6p7_147sx_329\",\n \"has-metadata\": \"awsui_has-metadata_vj6p7_147sx_333\",\n \"selected\": \"awsui_selected_vj6p7_147sx_339\",\n \"disabled\": \"awsui_disabled_vj6p7_147sx_344\",\n \"columns\": \"awsui_columns_vj6p7_147sx_360\",\n \"column-1\": \"awsui_column-1_vj6p7_147sx_366\",\n \"breakpoint-xs\": \"awsui_breakpoint-xs_vj6p7_147sx_374\",\n \"breakpoint-xxs\": \"awsui_breakpoint-xxs_vj6p7_147sx_379\",\n \"column-2\": \"awsui_column-2_vj6p7_147sx_384\",\n \"column-3\": \"awsui_column-3_vj6p7_147sx_402\",\n \"column-4\": \"awsui_column-4_vj6p7_147sx_420\",\n \"control\": \"awsui_control_vj6p7_147sx_439\",\n \"no-image\": \"awsui_no-image_vj6p7_147sx_443\",\n \"image\": \"awsui_image_vj6p7_147sx_447\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { useRef } from 'react';\n\nimport { TilesProps } from './interfaces';\nimport RadioButton from '../radio-group/radio-button';\nimport styles from './styles.css.js';\n\nimport { useContainerBreakpoints } from '../internal/hooks/container-queries';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\n\ninterface TileProps {\n item: TilesProps.TilesDefinition;\n selected: boolean;\n name: string;\n breakpoint: ReturnType[0];\n onChange: TilesProps['onChange'];\n}\n\nexport const Tile = React.forwardRef(\n ({ item, selected, name, breakpoint, onChange }: TileProps, forwardedRef: React.Ref) => {\n const internalRef = useRef(null);\n const isVisualRefresh = useVisualRefresh();\n\n const mergedRef = useMergeRefs(internalRef, forwardedRef);\n\n return (\n {\n if (item.disabled) {\n return;\n }\n internalRef.current?.focus();\n if (!selected) {\n fireNonCancelableEvent(onChange, { value: item.value });\n }\n }}\n >\n
    \n \n
    \n {item.image &&
    {item.image}
    }\n \n );\n }\n);\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport styles from '../styles.css.js';\n\nconst sidePositionIcon = (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n);\n\nexport default sidePositionIcon;\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport styles from '../styles.css.js';\n\nconst bottomPositionIcon = (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n);\n\nexport default bottomPositionIcon;\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { getContentHeaderClassName } from '../../internal/utils/content-header-utils';\nimport styles from '../styles.css.js';\n\nexport interface SVGTableRowProps {\n offset: number;\n separator?: boolean;\n isHeader?: boolean;\n}\n\nexport const getClassName = (suffix: string) => styles[`preference-icon-refresh--${suffix}`];\n\nconst TableRow = ({ offset, separator = true, isHeader }: SVGTableRowProps) => {\n const offsetTop = 0.4482;\n const offsetBottom = 3.4482;\n return (\n \n \n \n \n \n {separator && }\n \n );\n};\n\nconst SidePanelRow = ({ offset }: SVGTableRowProps) => {\n return (\n \n \n \n \n );\n};\n\nconst bottomPositionIcon = (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n);\n\nexport default bottomPositionIcon;\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { getContentHeaderClassName } from '../../internal/utils/content-header-utils';\nimport { getClassName, SVGTableRowProps } from './side-position-refresh';\n\nconst TableRow = ({ offset, isHeader }: SVGTableRowProps) => {\n const offsetTop = 0.4482;\n const offsetBottom = 3.4482;\n return (\n \n \n \n \n \n \n \n );\n};\n\nconst SidePanelRow = ({ offset }: SVGTableRowProps) => {\n return (\n \n \n \n \n \n \n );\n};\n\nconst bottomPositionIcon = (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n);\n\nexport default bottomPositionIcon;\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\nimport { ButtonProps } from '../button/interfaces';\nimport InternalButton from '../button/internal';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { SplitPanelContentProps } from './interfaces';\nimport styles from './styles.css.js';\nimport { useSplitPanelContext } from '../internal/context/split-panel-context';\n\ninterface SplitPanelContentSideProps extends SplitPanelContentProps {\n openButtonAriaLabel?: string;\n toggleRef: React.RefObject;\n}\n\nexport function SplitPanelContentSide({\n baseProps,\n splitPanelRef,\n toggleRef,\n header,\n children,\n resizeHandle,\n isOpen,\n cappedSize,\n openButtonAriaLabel,\n panelHeaderId,\n onToggle,\n}: SplitPanelContentSideProps) {\n const { topOffset, bottomOffset } = useSplitPanelContext();\n const isRefresh = useVisualRefresh();\n return (\n \n !isOpen && onToggle()}\n aria-labelledby={panelHeaderId}\n role=\"region\"\n >\n {isOpen ? (\n
    {resizeHandle}
    \n ) : (\n \n )}\n
    \n
    {header}
    \n
    {children}
    \n
    \n \n \n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { useEffect, useRef } from 'react';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { useMobile } from '../internal/hooks/use-mobile';\nimport { TransitionStatus } from '../internal/components/transition';\nimport { SplitPanelContentProps } from './interfaces';\nimport styles from './styles.css.js';\nimport { useSplitPanelContext } from '../internal/context/split-panel-context';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { useResizeObserver } from '@cloudscape-design/component-toolkit/internal';\n\ninterface SplitPanelContentBottomProps extends SplitPanelContentProps {\n state: TransitionStatus;\n transitioningElementRef: React.Ref;\n appLayoutMaxWidth: React.CSSProperties | undefined;\n}\n\nexport function SplitPanelContentBottom({\n baseProps,\n isOpen,\n state,\n transitioningElementRef,\n splitPanelRef,\n cappedSize,\n header,\n resizeHandle,\n children,\n appLayoutMaxWidth,\n panelHeaderId,\n onToggle,\n}: SplitPanelContentBottomProps) {\n const isRefresh = useVisualRefresh();\n const { bottomOffset, leftOffset, rightOffset, disableContentPaddings, contentWrapperPaddings, reportHeaderHeight } =\n useSplitPanelContext();\n const transitionContentBottomRef = useMergeRefs(splitPanelRef || null, transitioningElementRef);\n const isMobile = useMobile();\n\n const headerRef = useRef(null);\n useResizeObserver(headerRef, entry => reportHeaderHeight(entry.borderBoxHeight));\n useEffect(() => {\n // report empty height when unmounting the panel\n return () => reportHeaderHeight(0);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const centeredMaxWidthClasses = clsx({\n [styles['pane-bottom-center-align']]: isRefresh,\n [styles['pane-bottom-content-nav-padding']]: contentWrapperPaddings?.closedNav,\n [styles['pane-bottom-content-tools-padding']]: contentWrapperPaddings?.closedTools,\n });\n\n return (\n !isOpen && onToggle()}\n style={{\n bottom: bottomOffset,\n left: leftOffset,\n right: rightOffset,\n height: isOpen ? cappedSize : undefined,\n }}\n ref={transitionContentBottomRef}\n >\n {isOpen &&
    {resizeHandle}
    }\n
    \n
    \n {header}\n
    \n
    \n
    \n {children}\n
    \n
    \n
    \n \n );\n}\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { createWidgetizedSplitPanel } from './widget';\n\nexport const SplitPanelInternal = createWidgetizedSplitPanel();\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport InternalStatusIndicator, { StatusIndicatorProps } from './internal';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport useBaseComponent from '../internal/hooks/use-base-component';\n\nexport { StatusIndicatorProps };\n\nexport default function StatusIndicator({ type = 'success', wrapText = true, ...props }: StatusIndicatorProps) {\n const baseComponentProps = useBaseComponent('StatusIndicator', {\n props: { colorOverride: props.colorOverride, type, wrapText },\n });\n return ;\n}\n\napplyDisplayName(StatusIndicator, 'StatusIndicator');\n", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { getBaseProps } from '../internal/base-component';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport InternalContainer from '../container/internal';\nimport { TabsProps } from './interfaces';\nimport clsx from 'clsx';\nimport styles from './styles.css.js';\nimport { getTabElementId, TabHeaderBar } from './tab-header-bar';\nimport { useControllable } from '../internal/hooks/use-controllable';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { checkSafeUrl } from '../internal/utils/check-safe-url';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\n\nexport { TabsProps };\n\nfunction firstEnabledTab(tabs: ReadonlyArray) {\n const enabledTabs = tabs.filter(tab => !tab.disabled);\n if (enabledTabs.length > 0) {\n return enabledTabs[0];\n }\n return null;\n}\n\nexport default function Tabs({\n tabs,\n variant = 'default',\n onChange,\n activeTabId: controlledTabId,\n ariaLabel,\n ariaLabelledby,\n disableContentPaddings = false,\n i18nStrings,\n fitHeight,\n ...rest\n}: TabsProps) {\n for (const tab of tabs) {\n checkSafeUrl('Tabs', tab.href);\n }\n const { __internalRootRef } = useBaseComponent('Tabs', {\n props: { disableContentPaddings, variant },\n });\n const idNamespace = useUniqueId('awsui-tabs-');\n\n const [activeTabId, setActiveTabId] = useControllable(controlledTabId, onChange, firstEnabledTab(tabs)?.id ?? '', {\n componentName: 'Tabs',\n controlledProp: 'activeTabId',\n changeHandler: 'onChange',\n });\n\n const baseProps = getBaseProps(rest);\n\n const content = () => {\n const selectedTab = tabs.filter(tab => tab.id === activeTabId)[0];\n const renderContent = (tab: TabsProps.Tab) => {\n const isTabSelected = tab === selectedTab;\n\n const classes = clsx({\n [styles['tabs-content']]: true,\n [styles['tabs-content-active']]: isTabSelected,\n });\n\n const contentAttributes: JSX.IntrinsicElements['div'] = {\n className: classes,\n role: 'tabpanel',\n id: `${idNamespace}-${tab.id}-panel`,\n key: `${idNamespace}-${tab.id}-panel`,\n tabIndex: 0,\n 'aria-labelledby': getTabElementId({ namespace: idNamespace, tabId: tab.id }),\n };\n\n const isContentShown = isTabSelected && !selectedTab.disabled;\n return
    {isContentShown && selectedTab.content}
    ;\n };\n\n return (\n \n {tabs.map(renderContent)}\n \n );\n };\n\n const header = (\n {\n setActiveTabId(changeDetail.activeTabId);\n fireNonCancelableEvent(onChange, changeDetail);\n }}\n i18nStrings={i18nStrings}\n />\n );\n\n if (variant === 'container' || variant === 'stacked') {\n return (\n \n {content()}\n \n );\n }\n\n return (\n \n {header}\n {content()}\n \n );\n}\n\napplyDisplayName(Tabs, 'Tabs');\n", "\n import './styles.scoped.css';\n export default {\n \"tabs-header\": \"awsui_tabs-header_14rmt_n8497_198\",\n \"tabs-header-list\": \"awsui_tabs-header-list_14rmt_n8497_206\",\n \"pagination-button\": \"awsui_pagination-button_14rmt_n8497_223\",\n \"pagination-button-left\": \"awsui_pagination-button-left_14rmt_n8497_230\",\n \"pagination-button-left-scrollable\": \"awsui_pagination-button-left-scrollable_14rmt_n8497_233\",\n \"pagination-button-right\": \"awsui_pagination-button-right_14rmt_n8497_237\",\n \"pagination-button-right-scrollable\": \"awsui_pagination-button-right-scrollable_14rmt_n8497_240\",\n \"tabs-tab\": \"awsui_tabs-tab_14rmt_n8497_245\",\n \"tabs-tab-label\": \"awsui_tabs-tab-label_14rmt_n8497_257\",\n \"tabs-tab-link\": \"awsui_tabs-tab-link_14rmt_n8497_273\",\n \"refresh\": \"awsui_refresh_14rmt_n8497_292\",\n \"tabs-tab-disabled\": \"awsui_tabs-tab-disabled_14rmt_n8497_343\",\n \"tabs-tab-active\": \"awsui_tabs-tab-active_14rmt_n8497_378\",\n \"tabs-header-with-divider\": \"awsui_tabs-header-with-divider_14rmt_n8497_385\",\n \"root\": \"awsui_root_14rmt_n8497_389\",\n \"tabs\": \"awsui_tabs_14rmt_n8497_198\",\n \"tabs-content\": \"awsui_tabs-content_14rmt_n8497_430\",\n \"fit-height\": \"awsui_fit-height_14rmt_n8497_434\",\n \"tabs-content-active\": \"awsui_tabs-content-active_14rmt_n8497_440\",\n \"tabs-content-wrapper\": \"awsui_tabs-content-wrapper_14rmt_n8497_454\",\n \"with-paddings\": \"awsui_with-paddings_14rmt_n8497_454\",\n \"tabs-container-content-wrapper\": \"awsui_tabs-container-content-wrapper_14rmt_n8497_465\"\n};\n ", "// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef, useState, useEffect } from 'react';\nimport { TabsProps } from './interfaces';\nimport clsx from 'clsx';\nimport styles from './styles.css.js';\nimport { InternalButton } from '../button/internal';\nimport handleKey from '../internal/utils/handle-key';\nimport { KeyCode } from '../internal/keycode';\nimport {\n onPaginationClick,\n hasHorizontalOverflow,\n hasInlineStartOverflow,\n hasInlineEndOverflow,\n scrollIntoView,\n} from './scroll-utils';\nimport { hasModifierKeys, isPlainLeftClick } from '../internal/events';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { useInternalI18n } from '../i18n/context';\nimport { useContainerQuery } from '@cloudscape-design/component-toolkit';\n\nexport interface TabHeaderBarProps {\n onChange: (changeDetail: TabsProps.ChangeDetail) => void;\n activeTabId: TabsProps['activeTabId'];\n tabs: TabsProps['tabs'];\n variant: TabsProps['variant'];\n idNamespace: string;\n ariaLabel?: string;\n ariaLabelledby?: string;\n i18nStrings?: TabsProps.I18nStrings;\n}\n\nexport function TabHeaderBar({\n onChange,\n activeTabId,\n tabs,\n variant,\n idNamespace,\n ariaLabel,\n ariaLabelledby,\n i18nStrings,\n}: TabHeaderBarProps) {\n const headerBarRef = useRef(null);\n const activeTabHeaderRef = useRef(null);\n const inlineStartOverflowButton = useRef(null);\n const i18n = useInternalI18n('tabs');\n\n const isVisualRefresh = useVisualRefresh();\n\n const [widthChange, containerRef] = useContainerQuery(rect => rect.contentBoxWidth);\n const tabRefs = useRef>(new Map());\n const [horizontalOverflow, setHorizontalOverflow] = useState(false);\n const [inlineStartOverflow, setInlineStartOverflow] = useState(false);\n const [inlineEndOverflow, setInlineEndOverflow] = useState(false);\n\n useEffect(() => {\n if (headerBarRef.current) {\n setHorizontalOverflow(hasHorizontalOverflow(headerBarRef.current, inlineStartOverflowButton));\n setInlineStartOverflow(hasInlineStartOverflow(headerBarRef.current));\n setInlineEndOverflow(hasInlineEndOverflow(headerBarRef.current));\n }\n }, [widthChange, tabs]);\n\n const scrollIntoViewIfPossible = (smooth: boolean) => {\n if (!activeTabId) {\n return;\n }\n const activeTabRef = tabRefs.current.get(activeTabId);\n if (activeTabRef && headerBarRef.current) {\n scrollIntoView(activeTabRef, headerBarRef.current, smooth);\n }\n };\n\n useEffect(() => {\n // Delay scrollIntoView as the position is depending on parent elements\n // (effects are called inside-out in the component tree).\n // Wait one frame to allow parents to complete it's calculation.\n requestAnimationFrame(() => {\n scrollIntoViewIfPossible(false);\n });\n // Non-smooth scrolling should not be called upon activeId change\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [horizontalOverflow, widthChange, tabs.length]);\n\n useEffect(() => {\n scrollIntoViewIfPossible(true);\n // Smooth scrolling should only be called upon activeId change\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [activeTabId]);\n\n useEffect(() => {\n /*\n When the selected tab changes and we are currently already focused on a tab,\n move the focus to the newly selected tab.\n */\n if (headerBarRef.current?.contains(document.activeElement)) {\n if (document.activeElement !== activeTabHeaderRef.current) {\n activeTabHeaderRef.current?.focus({ preventScroll: true });\n }\n }\n }, [activeTabId]);\n\n const onScroll = () => {\n if (headerBarRef.current) {\n setInlineStartOverflow(hasInlineStartOverflow(headerBarRef.current));\n setInlineEndOverflow(hasInlineEndOverflow(headerBarRef.current));\n }\n };\n\n const classes = clsx({\n [styles['tabs-header']]: true,\n [styles['tabs-header-with-divider']]: variant === 'default' || isVisualRefresh,\n });\n\n const leftButtonClasses = clsx({\n [styles['pagination-button']]: true,\n [styles['pagination-button-left']]: true,\n [styles['pagination-button-left-scrollable']]: inlineStartOverflow,\n });\n\n const rightButtonClasses = clsx({\n [styles['pagination-button']]: true,\n [styles['pagination-button-right']]: true,\n [styles['pagination-button-right-scrollable']]: inlineEndOverflow,\n });\n\n return (\n //converted span to div as list should not be a child of span for HTML validation\n
    \n {horizontalOverflow && (\n \n onPaginationClick(headerBarRef, 'backward')}\n ariaLabel={i18n('i18nStrings.scrollLeftAriaLabel', i18nStrings?.scrollLeftAriaLabel)}\n />\n \n )}\n \n {tabs.map(renderTabHeader)}\n \n {horizontalOverflow && (\n \n onPaginationClick(headerBarRef, 'forward')}\n ariaLabel={i18n('i18nStrings.scrollRightAriaLabel', i18nStrings?.scrollRightAriaLabel)}\n />\n \n )}\n
    \n );\n\n function renderTabHeader(tab: TabsProps.Tab) {\n const enabledTabsWithCurrentTab = tabs.filter(tab => !tab.disabled || tab.id === activeTabId);\n\n const highlightTab = function (enabledTabIndex: number) {\n const tab = enabledTabsWithCurrentTab[enabledTabIndex];\n if (tab.id === activeTabId) {\n return;\n }\n\n onChange({ activeTabId: tab.id, activeTabHref: tab.href });\n };\n\n const onKeyDown = function (\n event: React.KeyboardEvent | React.KeyboardEvent\n ) {\n const { keyCode } = event;\n const specialKeys = [KeyCode.right, KeyCode.left, KeyCode.end, KeyCode.home, KeyCode.pageUp, KeyCode.pageDown];\n if (hasModifierKeys(event) || specialKeys.indexOf(keyCode) === -1) {\n return;\n }\n event.preventDefault();\n const activeIndex = enabledTabsWithCurrentTab.indexOf(tab);\n\n handleKey(event, {\n onEnd: () => highlightTab(enabledTabsWithCurrentTab.length - 1),\n onHome: () => highlightTab(0),\n onInlineEnd: () =>\n activeIndex + 1 === enabledTabsWithCurrentTab.length ? highlightTab(0) : highlightTab(activeIndex + 1),\n onInlineStart: () =>\n activeIndex === 0 ? highlightTab(enabledTabsWithCurrentTab.length - 1) : highlightTab(activeIndex - 1),\n onPageDown: () => inlineEndOverflow && onPaginationClick(headerBarRef, 'forward'),\n onPageUp: () => inlineStartOverflow && onPaginationClick(headerBarRef, 'backward'),\n });\n };\n\n const clickTab = (event: React.MouseEvent) => {\n if (tab.disabled) {\n event.preventDefault();\n return;\n }\n\n // if the primary mouse button is clicked with a modifier key, the browser will handle opening a new tab\n const specialKey = !isPlainLeftClick(event);\n if (specialKey && tab.href) {\n return;\n }\n\n event.preventDefault();\n // for browsers that do not focus buttons on button click\n if (!tab.href) {\n const clickedTabRef = tabRefs.current.get(tab.id);\n if (clickedTabRef) {\n const childElement = clickedTabRef.firstChild as HTMLButtonElement;\n if (childElement && childElement !== document.activeElement) {\n childElement.focus({ preventScroll: true });\n }\n }\n }\n\n if (tab.id === activeTabId) {\n return;\n }\n\n onChange({ activeTabId: tab.id, activeTabHref: tab.href });\n };\n\n const classes = clsx({\n [styles['tabs-tab-link']]: true,\n [styles.refresh]: isVisualRefresh,\n [styles['tabs-tab-active']]: activeTabId === tab.id && !tab.disabled,\n [styles['tabs-tab-disabled']]: tab.disabled,\n });\n\n const commonProps: (JSX.IntrinsicElements['a'] | JSX.IntrinsicElements['button']) & { 'data-testid': string } = {\n className: classes,\n role: 'tab',\n 'aria-selected': tab.id === activeTabId,\n 'aria-controls': `${idNamespace}-${tab.id}-panel`,\n 'data-testid': tab.id,\n id: getTabElementId({ namespace: idNamespace, tabId: tab.id }),\n children: {tab.label},\n };\n\n if (tab.disabled) {\n commonProps['aria-disabled'] = 'true';\n } else {\n commonProps.onClick = clickTab;\n }\n\n if (tab.id === activeTabId) {\n commonProps.ref = activeTabHeaderRef;\n commonProps.tabIndex = 0;\n commonProps.onKeyDown = (\n event: React.KeyboardEvent | React.KeyboardEvent\n ) => onKeyDown(event);\n } else {\n commonProps.tabIndex = -1;\n }\n\n let trigger = null;\n if (tab.href) {\n const anchorProps = commonProps as JSX.IntrinsicElements['a'];\n anchorProps.href = tab.href;\n trigger = ;\n } else {\n const buttonProps = commonProps as JSX.IntrinsicElements['button'];\n buttonProps.type = 'button';\n if (tab.disabled) {\n buttonProps.disabled = true;\n }\n trigger =