{"version":3,"file":"index-e1b9767b.js","sources":["../../node_modules/webfontloader/webfontloader.js","../../node_modules/object-assign/index.js","../../node_modules/react/cjs/react.production.min.js","../../node_modules/react/index.js","../../node_modules/react/cjs/react-jsx-runtime.production.min.js","../../node_modules/react/jsx-runtime.js","../../node_modules/@babel/runtime/helpers/esm/extends.js","../../node_modules/@mui/base/utils/isHostComponent.js","../../node_modules/@mui/base/utils/appendOwnerState.js","../../node_modules/@mui/base/utils/ClassNameConfigurator.js","../../node_modules/@mui/base/utils/extractEventHandlers.js","../../node_modules/@mui/base/utils/resolveComponentProps.js","../../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","../../node_modules/@mui/utils/esm/deepmerge.js","../../node_modules/prop-types/lib/ReactPropTypesSecret.js","../../node_modules/prop-types/factoryWithThrowingShims.js","../../node_modules/prop-types/index.js","../../node_modules/@mui/utils/esm/formatMuiErrorMessage.js","../../node_modules/react-is/cjs/react-is.production.min.js","../../node_modules/@mui/utils/esm/capitalize/capitalize.js","../../node_modules/@mui/utils/esm/createChainedFunction.js","../../node_modules/@mui/utils/esm/debounce/debounce.js","../../node_modules/@mui/utils/esm/isMuiElement.js","../../node_modules/@mui/utils/esm/ownerDocument/ownerDocument.js","../../node_modules/@mui/utils/esm/ownerWindow/ownerWindow.js","../../node_modules/@mui/utils/esm/setRef.js","../../node_modules/@mui/utils/esm/useEnhancedEffect/useEnhancedEffect.js","../../node_modules/@mui/utils/esm/useId/useId.js","../../node_modules/@mui/utils/esm/useControlled/useControlled.js","../../node_modules/@mui/utils/esm/useEventCallback/useEventCallback.js","../../node_modules/@mui/utils/esm/useForkRef/useForkRef.js","../../node_modules/@mui/utils/esm/useIsFocusVisible.js","../../node_modules/@mui/utils/esm/getScrollbarSize.js","../../node_modules/@mui/utils/esm/scrollLeft.js","../../node_modules/@mui/utils/esm/usePreviousProps.js","../../node_modules/@mui/utils/esm/visuallyHidden.js","../../node_modules/@mui/utils/esm/resolveProps.js","../../node_modules/@mui/utils/esm/composeClasses/composeClasses.js","../../node_modules/@mui/utils/esm/ClassNameGenerator/ClassNameGenerator.js","../../node_modules/@mui/utils/esm/generateUtilityClass/generateUtilityClass.js","../../node_modules/@mui/utils/esm/generateUtilityClasses/generateUtilityClasses.js","../../node_modules/clsx/dist/clsx.mjs","../../node_modules/@mui/base/utils/omitEventHandlers.js","../../node_modules/@mui/base/utils/mergeSlotProps.js","../../node_modules/@mui/base/utils/useSlotProps.js","../../node_modules/@mui/base/useBadge/useBadge.js","../../node_modules/@mui/base/ClickAwayListener/ClickAwayListener.js","../../node_modules/@mui/base/FocusTrap/FocusTrap.js","../../node_modules/@popperjs/core/lib/enums.js","../../node_modules/@popperjs/core/lib/dom-utils/getNodeName.js","../../node_modules/@popperjs/core/lib/dom-utils/getWindow.js","../../node_modules/@popperjs/core/lib/dom-utils/instanceOf.js","../../node_modules/@popperjs/core/lib/modifiers/applyStyles.js","../../node_modules/@popperjs/core/lib/utils/getBasePlacement.js","../../node_modules/@popperjs/core/lib/utils/math.js","../../node_modules/@popperjs/core/lib/utils/userAgent.js","../../node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js","../../node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js","../../node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js","../../node_modules/@popperjs/core/lib/dom-utils/contains.js","../../node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js","../../node_modules/@popperjs/core/lib/dom-utils/isTableElement.js","../../node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js","../../node_modules/@popperjs/core/lib/dom-utils/getParentNode.js","../../node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js","../../node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js","../../node_modules/@popperjs/core/lib/utils/within.js","../../node_modules/@popperjs/core/lib/utils/getFreshSideObject.js","../../node_modules/@popperjs/core/lib/utils/mergePaddingObject.js","../../node_modules/@popperjs/core/lib/utils/expandToHashMap.js","../../node_modules/@popperjs/core/lib/modifiers/arrow.js","../../node_modules/@popperjs/core/lib/utils/getVariation.js","../../node_modules/@popperjs/core/lib/modifiers/computeStyles.js","../../node_modules/@popperjs/core/lib/modifiers/eventListeners.js","../../node_modules/@popperjs/core/lib/utils/getOppositePlacement.js","../../node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js","../../node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js","../../node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js","../../node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js","../../node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js","../../node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js","../../node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js","../../node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js","../../node_modules/@popperjs/core/lib/utils/rectToClientRect.js","../../node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js","../../node_modules/@popperjs/core/lib/utils/computeOffsets.js","../../node_modules/@popperjs/core/lib/utils/detectOverflow.js","../../node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js","../../node_modules/@popperjs/core/lib/modifiers/flip.js","../../node_modules/@popperjs/core/lib/modifiers/hide.js","../../node_modules/@popperjs/core/lib/modifiers/offset.js","../../node_modules/@popperjs/core/lib/modifiers/popperOffsets.js","../../node_modules/@popperjs/core/lib/utils/getAltAxis.js","../../node_modules/@popperjs/core/lib/modifiers/preventOverflow.js","../../node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js","../../node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js","../../node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js","../../node_modules/@popperjs/core/lib/utils/orderModifiers.js","../../node_modules/@popperjs/core/lib/utils/debounce.js","../../node_modules/@popperjs/core/lib/utils/mergeByName.js","../../node_modules/@popperjs/core/lib/createPopper.js","../../node_modules/@popperjs/core/lib/popper.js","../../node_modules/scheduler/cjs/scheduler.production.min.js","../../node_modules/scheduler/index.js","../../node_modules/react-dom/cjs/react-dom.production.min.js","../../node_modules/react-dom/index.js","../../node_modules/@mui/base/Portal/Portal.js","../../node_modules/@mui/base/Popper/popperClasses.js","../../node_modules/@mui/base/Popper/Popper.js","../../node_modules/@mui/base/unstable_useModal/ModalManager.js","../../node_modules/@mui/base/unstable_useModal/useModal.js","../../node_modules/@mui/base/useSnackbar/useSnackbar.js","../../node_modules/@mui/base/TextareaAutosize/TextareaAutosize.js","../../node_modules/@mui/base/useAutocomplete/useAutocomplete.js","../../node_modules/@mui/material/colors/common.js","../../node_modules/@mui/material/colors/red.js","../../node_modules/@mui/material/colors/purple.js","../../node_modules/@mui/material/colors/blue.js","../../node_modules/@mui/material/colors/lightBlue.js","../../node_modules/@mui/material/colors/green.js","../../node_modules/@mui/material/colors/lightGreen.js","../../node_modules/@mui/material/colors/orange.js","../../node_modules/@mui/material/colors/grey.js","../../node_modules/@mui/material/colors/blueGrey.js","../../node_modules/@mui/material/styles/identifier.js","../../node_modules/@emotion/memoize/dist/emotion-memoize.esm.js","../../node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js","../../node_modules/@emotion/sheet/dist/emotion-sheet.browser.esm.js","../../node_modules/stylis/src/Enum.js","../../node_modules/stylis/src/Utility.js","../../node_modules/stylis/src/Tokenizer.js","../../node_modules/stylis/src/Parser.js","../../node_modules/stylis/src/Serializer.js","../../node_modules/stylis/src/Middleware.js","../../node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js","../../node_modules/hoist-non-react-statics/node_modules/react-is/cjs/react-is.production.min.js","../../node_modules/hoist-non-react-statics/node_modules/react-is/index.js","../../node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js","../../node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js","../../node_modules/@emotion/hash/dist/emotion-hash.esm.js","../../node_modules/@emotion/unitless/dist/emotion-unitless.esm.js","../../node_modules/@emotion/serialize/dist/emotion-serialize.browser.esm.js","../../node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.browser.esm.js","../../node_modules/@emotion/react/dist/emotion-element-c39617d8.browser.esm.js","../../node_modules/@emotion/react/dist/emotion-react.browser.esm.js","../../node_modules/@emotion/styled/base/dist/emotion-styled-base.browser.esm.js","../../node_modules/@emotion/styled/dist/emotion-styled.browser.esm.js","../../node_modules/@mui/styled-engine/StyledEngineProvider/StyledEngineProvider.js","../../node_modules/@mui/styled-engine/GlobalStyles/GlobalStyles.js","../../node_modules/@mui/styled-engine/index.js","../../node_modules/@mui/system/esm/createTheme/createBreakpoints.js","../../node_modules/@mui/system/esm/createTheme/shape.js","../../node_modules/@mui/system/esm/merge.js","../../node_modules/@mui/system/esm/breakpoints.js","../../node_modules/@mui/system/esm/style.js","../../node_modules/@mui/system/esm/memoize.js","../../node_modules/@mui/system/esm/spacing.js","../../node_modules/@mui/system/esm/createTheme/createSpacing.js","../../node_modules/@mui/system/esm/compose.js","../../node_modules/@mui/system/esm/borders.js","../../node_modules/@mui/system/esm/cssGrid.js","../../node_modules/@mui/system/esm/palette.js","../../node_modules/@mui/system/esm/sizing.js","../../node_modules/@mui/system/esm/styleFunctionSx/defaultSxConfig.js","../../node_modules/@mui/system/esm/styleFunctionSx/styleFunctionSx.js","../../node_modules/@mui/system/esm/createTheme/createTheme.js","../../node_modules/@mui/system/esm/useThemeWithoutDefault.js","../../node_modules/@mui/system/esm/useTheme.js","../../node_modules/@mui/system/esm/GlobalStyles/GlobalStyles.js","../../node_modules/@mui/system/esm/styleFunctionSx/extendSxProp.js","../../node_modules/@mui/system/esm/createBox.js","../../node_modules/@mui/system/esm/propsToClassKey.js","../../node_modules/@mui/system/esm/createStyled.js","../../node_modules/@mui/system/esm/styled.js","../../node_modules/@mui/system/esm/useThemeProps/getThemeProps.js","../../node_modules/@mui/system/esm/useThemeProps/useThemeProps.js","../../node_modules/@mui/system/esm/colorManipulator.js","../../node_modules/@mui/private-theming/useTheme/ThemeContext.js","../../node_modules/@mui/private-theming/useTheme/useTheme.js","../../node_modules/@mui/private-theming/ThemeProvider/nested.js","../../node_modules/@mui/private-theming/ThemeProvider/ThemeProvider.js","../../node_modules/@mui/system/esm/ThemeProvider/ThemeProvider.js","../../node_modules/@mui/system/esm/Stack/createStack.js","../../node_modules/@mui/material/styles/createMixins.js","../../node_modules/@mui/material/styles/createPalette.js","../../node_modules/@mui/material/styles/createTypography.js","../../node_modules/@mui/material/styles/shadows.js","../../node_modules/@mui/material/styles/createTransitions.js","../../node_modules/@mui/material/styles/zIndex.js","../../node_modules/@mui/material/styles/createTheme.js","../../node_modules/@mui/material/styles/defaultTheme.js","../../node_modules/@mui/material/styles/useTheme.js","../../node_modules/@mui/material/styles/useThemeProps.js","../../node_modules/@mui/material/styles/styled.js","../../node_modules/@mui/material/styles/ThemeProvider.js","../../node_modules/@mui/material/styles/getOverlayAlpha.js","../../node_modules/@mui/material/SvgIcon/svgIconClasses.js","../../node_modules/@mui/material/SvgIcon/SvgIcon.js","../../node_modules/@mui/material/utils/createSvgIcon.js","../../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","../../node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","../../node_modules/react-transition-group/esm/config.js","../../node_modules/react-transition-group/esm/TransitionGroupContext.js","../../node_modules/react-transition-group/esm/utils/reflow.js","../../node_modules/react-transition-group/esm/Transition.js","../../node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js","../../node_modules/react-transition-group/esm/utils/ChildMapping.js","../../node_modules/react-transition-group/esm/TransitionGroup.js","../../node_modules/@mui/material/transitions/utils.js","../../node_modules/@mui/material/Collapse/collapseClasses.js","../../node_modules/@mui/material/Collapse/Collapse.js","../../node_modules/@mui/material/Paper/paperClasses.js","../../node_modules/@mui/material/Paper/Paper.js","../../node_modules/@mui/material/Accordion/AccordionContext.js","../../node_modules/@mui/material/Accordion/accordionClasses.js","../../node_modules/@mui/material/Accordion/Accordion.js","../../node_modules/@mui/material/ButtonBase/Ripple.js","../../node_modules/@mui/material/ButtonBase/touchRippleClasses.js","../../node_modules/@mui/material/ButtonBase/TouchRipple.js","../../node_modules/@mui/material/ButtonBase/buttonBaseClasses.js","../../node_modules/@mui/material/ButtonBase/ButtonBase.js","../../node_modules/@mui/material/AccordionSummary/accordionSummaryClasses.js","../../node_modules/@mui/material/AccordionSummary/AccordionSummary.js","../../node_modules/@mui/material/IconButton/iconButtonClasses.js","../../node_modules/@mui/material/IconButton/IconButton.js","../../node_modules/@mui/material/internal/svg-icons/Close.js","../../node_modules/@mui/material/Typography/typographyClasses.js","../../node_modules/@mui/material/Typography/Typography.js","../../node_modules/@mui/material/Popper/Popper.js","../../node_modules/@mui/material/ListSubheader/listSubheaderClasses.js","../../node_modules/@mui/material/ListSubheader/ListSubheader.js","../../node_modules/@mui/material/internal/svg-icons/Cancel.js","../../node_modules/@mui/material/Chip/chipClasses.js","../../node_modules/@mui/material/Chip/Chip.js","../../node_modules/@mui/material/FormControl/formControlState.js","../../node_modules/@mui/material/FormControl/FormControlContext.js","../../node_modules/@mui/material/FormControl/useFormControl.js","../../node_modules/@mui/material/GlobalStyles/GlobalStyles.js","../../node_modules/@mui/material/InputBase/utils.js","../../node_modules/@mui/material/InputBase/inputBaseClasses.js","../../node_modules/@mui/material/InputBase/InputBase.js","../../node_modules/@mui/material/Input/inputClasses.js","../../node_modules/@mui/material/OutlinedInput/outlinedInputClasses.js","../../node_modules/@mui/material/FilledInput/filledInputClasses.js","../../node_modules/@mui/material/internal/svg-icons/ArrowDropDown.js","../../node_modules/@mui/material/Autocomplete/autocompleteClasses.js","../../node_modules/@mui/material/Autocomplete/Autocomplete.js","../../node_modules/@mui/material/Fade/Fade.js","../../node_modules/@mui/material/Backdrop/backdropClasses.js","../../node_modules/@mui/material/Backdrop/Backdrop.js","../../node_modules/@mui/material/Badge/badgeClasses.js","../../node_modules/@mui/material/Badge/Badge.js","../../node_modules/@mui/material/Box/Box.js","../../node_modules/@mui/material/Button/buttonClasses.js","../../node_modules/@mui/material/ButtonGroup/ButtonGroupContext.js","../../node_modules/@mui/material/Button/Button.js","../../node_modules/@mui/material/internal/switchBaseClasses.js","../../node_modules/@mui/material/internal/SwitchBase.js","../../node_modules/@mui/material/internal/svg-icons/CheckBoxOutlineBlank.js","../../node_modules/@mui/material/internal/svg-icons/CheckBox.js","../../node_modules/@mui/material/internal/svg-icons/IndeterminateCheckBox.js","../../node_modules/@mui/material/Checkbox/checkboxClasses.js","../../node_modules/@mui/material/Checkbox/Checkbox.js","../../node_modules/@mui/material/CircularProgress/circularProgressClasses.js","../../node_modules/@mui/material/CircularProgress/CircularProgress.js","../../node_modules/@mui/material/Modal/modalClasses.js","../../node_modules/@mui/material/Modal/Modal.js","../../node_modules/@mui/material/Dialog/dialogClasses.js","../../node_modules/@mui/material/Dialog/DialogContext.js","../../node_modules/@mui/material/Dialog/Dialog.js","../../node_modules/@mui/material/DialogActions/dialogActionsClasses.js","../../node_modules/@mui/material/DialogActions/DialogActions.js","../../node_modules/@mui/material/DialogContent/dialogContentClasses.js","../../node_modules/@mui/material/DialogTitle/dialogTitleClasses.js","../../node_modules/@mui/material/DialogContent/DialogContent.js","../../node_modules/@mui/material/Divider/dividerClasses.js","../../node_modules/@mui/material/Divider/Divider.js","../../node_modules/@mui/material/Slide/Slide.js","../../node_modules/@mui/material/Drawer/drawerClasses.js","../../node_modules/@mui/material/Drawer/Drawer.js","../../node_modules/@mui/material/Fab/fabClasses.js","../../node_modules/@mui/material/Fab/Fab.js","../../node_modules/@mui/material/FilledInput/FilledInput.js","../../node_modules/@mui/material/FormControl/formControlClasses.js","../../node_modules/@mui/material/FormControl/FormControl.js","../../node_modules/@mui/material/Stack/Stack.js","../../node_modules/@mui/material/FormControlLabel/formControlLabelClasses.js","../../node_modules/@mui/material/FormControlLabel/FormControlLabel.js","../../node_modules/@mui/material/FormGroup/formGroupClasses.js","../../node_modules/@mui/material/FormGroup/FormGroup.js","../../node_modules/@mui/material/FormHelperText/formHelperTextClasses.js","../../node_modules/@mui/material/FormHelperText/FormHelperText.js","../../node_modules/@mui/material/FormLabel/formLabelClasses.js","../../node_modules/@mui/material/FormLabel/FormLabel.js","../../node_modules/@mui/material/Grid/GridContext.js","../../node_modules/@mui/material/Grid/gridClasses.js","../../node_modules/@mui/material/Grid/Grid.js","../../node_modules/@mui/material/Grow/Grow.js","../../node_modules/@mui/material/useMediaQuery/useMediaQuery.js","../../node_modules/@mui/material/Hidden/withWidth.js","../../node_modules/@mui/material/Hidden/HiddenJs.js","../../node_modules/@mui/material/Hidden/hiddenCssClasses.js","../../node_modules/@mui/material/Hidden/HiddenCss.js","../../node_modules/@mui/material/Hidden/Hidden.js","../../node_modules/@mui/material/Icon/iconClasses.js","../../node_modules/@mui/material/Icon/Icon.js","../../node_modules/@mui/material/Input/Input.js","../../node_modules/@mui/material/InputAdornment/inputAdornmentClasses.js","../../node_modules/@mui/material/InputAdornment/InputAdornment.js","../../node_modules/@mui/material/InputLabel/inputLabelClasses.js","../../node_modules/@mui/material/InputLabel/InputLabel.js","../../node_modules/@mui/material/LinearProgress/linearProgressClasses.js","../../node_modules/@mui/material/LinearProgress/LinearProgress.js","../../node_modules/@mui/material/List/ListContext.js","../../node_modules/@mui/material/List/listClasses.js","../../node_modules/@mui/material/List/List.js","../../node_modules/@mui/material/ListItemIcon/listItemIconClasses.js","../../node_modules/@mui/material/ListItemText/listItemTextClasses.js","../../node_modules/@mui/material/MenuList/MenuList.js","../../node_modules/@mui/material/Popover/popoverClasses.js","../../node_modules/@mui/material/Popover/Popover.js","../../node_modules/@mui/material/Menu/menuClasses.js","../../node_modules/@mui/material/Menu/Menu.js","../../node_modules/@mui/material/MenuItem/menuItemClasses.js","../../node_modules/@mui/material/MenuItem/MenuItem.js","../../node_modules/@mui/material/NativeSelect/nativeSelectClasses.js","../../node_modules/@mui/material/NativeSelect/NativeSelectInput.js","../../node_modules/@mui/material/OutlinedInput/NotchedOutline.js","../../node_modules/@mui/material/OutlinedInput/OutlinedInput.js","../../node_modules/@mui/material/internal/svg-icons/RadioButtonUnchecked.js","../../node_modules/@mui/material/internal/svg-icons/RadioButtonChecked.js","../../node_modules/@mui/material/Radio/RadioButtonIcon.js","../../node_modules/@mui/material/RadioGroup/RadioGroupContext.js","../../node_modules/@mui/material/RadioGroup/useRadioGroup.js","../../node_modules/@mui/material/Radio/radioClasses.js","../../node_modules/@mui/material/Radio/Radio.js","../../node_modules/@mui/material/RadioGroup/RadioGroup.js","../../node_modules/@mui/material/Select/selectClasses.js","../../node_modules/@mui/material/Select/SelectInput.js","../../node_modules/@mui/material/Select/Select.js","../../node_modules/@mui/material/SnackbarContent/snackbarContentClasses.js","../../node_modules/@mui/material/SnackbarContent/SnackbarContent.js","../../node_modules/@mui/material/Snackbar/snackbarClasses.js","../../node_modules/@mui/material/Snackbar/Snackbar.js","../../node_modules/@mui/material/Zoom/Zoom.js","../../node_modules/@mui/material/Tooltip/tooltipClasses.js","../../node_modules/@mui/material/Tooltip/Tooltip.js","../../node_modules/@mui/material/Tab/tabClasses.js","../../node_modules/@mui/material/Tab/Tab.js","../../node_modules/@mui/material/internal/svg-icons/KeyboardArrowLeft.js","../../node_modules/@mui/material/internal/svg-icons/KeyboardArrowRight.js","../../node_modules/@mui/material/internal/animate.js","../../node_modules/@mui/material/Tabs/ScrollbarSize.js","../../node_modules/@mui/material/TabScrollButton/tabScrollButtonClasses.js","../../node_modules/@mui/material/TabScrollButton/TabScrollButton.js","../../node_modules/@mui/material/Tabs/tabsClasses.js","../../node_modules/@mui/material/Tabs/Tabs.js","../../node_modules/@mui/material/TextField/textFieldClasses.js","../../node_modules/@mui/material/TextField/TextField.js","../../node_modules/@mui/styles/createGenerateClassName/createGenerateClassName.js","../../node_modules/@mui/styles/getThemeProps/getThemeProps.js","../../node_modules/is-in-browser/dist/module.js","../../node_modules/@babel/runtime/helpers/esm/typeof.js","../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js","../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","../../node_modules/@babel/runtime/helpers/esm/createClass.js","../../node_modules/jss/dist/jss.esm.js","../../node_modules/jss-plugin-rule-value-function/dist/jss-plugin-rule-value-function.esm.js","../../node_modules/jss-plugin-global/dist/jss-plugin-global.esm.js","../../node_modules/jss-plugin-nested/dist/jss-plugin-nested.esm.js","../../node_modules/hyphenate-style-name/index.js","../../node_modules/jss-plugin-camel-case/dist/jss-plugin-camel-case.esm.js","../../node_modules/jss-plugin-default-unit/dist/jss-plugin-default-unit.esm.js","../../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js","../../node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js","../../node_modules/@babel/runtime/helpers/esm/iterableToArray.js","../../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js","../../node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js","../../node_modules/@babel/runtime/helpers/esm/toConsumableArray.js","../../node_modules/css-vendor/dist/css-vendor.esm.js","../../node_modules/jss-plugin-vendor-prefixer/dist/jss-plugin-vendor-prefixer.esm.js","../../node_modules/jss-plugin-props-sort/dist/jss-plugin-props-sort.esm.js","../../node_modules/@mui/styles/jssPreset/jssPreset.js","../../node_modules/@mui/styles/mergeClasses/mergeClasses.js","../../node_modules/@mui/styles/makeStyles/multiKeyStore.js","../../node_modules/@mui/styles/useTheme/index.js","../../node_modules/@mui/styles/StylesProvider/StylesProvider.js","../../node_modules/@mui/styles/makeStyles/indexCounter.js","../../node_modules/@mui/styles/propsToClassKey/propsToClassKey.js","../../node_modules/@mui/styles/getStylesCreator/noopTheme.js","../../node_modules/@mui/styles/getStylesCreator/getStylesCreator.js","../../node_modules/@mui/styles/makeStyles/makeStyles.js","../../node_modules/@mui/styles/withStyles/withStyles.js","../../node_modules/@mui/styles/withTheme/withTheme.js","../../node_modules/mobx/dist/mobx.esm.js","../../node_modules/mobx-react-lite/es/utils/assertEnvironment.js","../../node_modules/mobx-react-lite/es/utils/observerBatching.js","../../node_modules/mobx-react-lite/es/utils/printDebugValue.js","../../node_modules/mobx-react-lite/es/utils/UniversalFinalizationRegistry.js","../../node_modules/mobx-react-lite/es/utils/observerFinalizationRegistry.js","../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.js","../../node_modules/use-sync-external-store/shim/index.js","../../node_modules/mobx-react-lite/es/useObserver.js","../../node_modules/mobx-react-lite/es/observer.js","../../node_modules/mobx-react-lite/es/ObserverComponent.js","../../node_modules/mobx-react-lite/es/useAsObservableSource.js","../../node_modules/mobx-react-lite/es/index.js","../../node_modules/mobx-react/dist/mobxreact.esm.js","../../src/core/AppServer.ts","../../src/coreui/MultiClassName.ts","../../src/core/TrackableModel.ts","../../src/mustangui/AccessLevel.ts","../../src/models/PaneRow.ts","../../src/stores/LayoutStateStore.ts","../../node_modules/moment/dist/moment.js","../../src/core/TrackableCollection.ts","../../src/stores/PaneDataStore.ts","../../src/core/Localization.ts","../../src/core/Logging.ts","../../src/core/RequestPromise.ts","../../src/core/Responsive/useWidth.ts","../../node_modules/@fortawesome/fontawesome-svg-core/index.mjs","../../node_modules/@fortawesome/free-brands-svg-icons/index.mjs","../../node_modules/@fortawesome/pro-duotone-svg-icons/index.mjs","../../node_modules/@fortawesome/pro-regular-svg-icons/index.mjs","../../node_modules/@fortawesome/pro-solid-svg-icons/index.mjs","../../node_modules/@fortawesome/react-fontawesome/index.es.js","../../src/services/CustomIconService.ts","../../src/stores/CustomIconStore.ts","../../src/coreui/Icon.tsx","../../src/coreui/Button.tsx","../../src/theme/ForegroundColorType.ts","../../src/theme/Palette.ts","../../src/theme/PanelMeasurements.ts","../../src/theme/MustangTheme.ts","../../src/theme/ThemeProvider.tsx","../../src/coreui/ButtonLink.tsx","../../src/coreui/FocusRipple.tsx","../../src/coreui/DisabledHelpBadge.tsx","../../src/mustangui/ApiButton.tsx","../../src/mustangui/ActionButtons/ClearCriteriaButton.tsx","../../src/core/WithForwardedRef.tsx","../../src/coreui/Typography.tsx","../../src/coreui/MenuItem.tsx","../../src/mustangui/CaptchaControl.tsx","../../src/mustangui/EmbeddedAddOn.tsx","../../src/stores/ErrorsStore.ts","../../src/stores/RequestsStore.ts","../../src/stores/SessionMessagesStore.ts","../../src/services/NewObjectService.ts","../../src/services/ActionButtonService.ts","../../src/stores/MaskingStore.ts","../../src/coreui/Dialog.tsx","../../src/coreui/DialogActions.tsx","../../src/coreui/DialogContent.tsx","../../src/mustangui/Grid.tsx","../../src/mustangui/GridItem.tsx","../../src/mustangui/ActionButtons/ConfirmationDialog.tsx","../../src/mustangui/ActionButtons/CustomActionButton.tsx","../../src/mustangui/ActionButtons/DeletePresentationButton.tsx","../../src/mustangui/ActionButtons/DeleteRowButton.tsx","../../src/mustangui/ActionButtons/ExecuteSearchButton.tsx","../../src/core/AriaHiddenManager.ts","../../src/core/FocusManager.ts","../../src/mustangui/ActionButtons/NewRowButton.tsx","../../src/mustangui/ActionButtons/SavePresentationButton.tsx","../../src/mustangui/ActionButtons/SelectButton.tsx","../../src/mustangui/ActionButtons/SignInButton.tsx","../../src/services/UserService.ts","../../src/mustangui/ActionButtons/SignOutButton.tsx","../../src/services/RoundTripService.ts","../../src/coreui/ErrorMessage.tsx","../../src/mustangui/ErrorBoundary.tsx","../../src/coreui/Paper.tsx","../../src/mustangui/WizardStepPane.tsx","../../src/mustangui/WizardControl.tsx","../../src/mustangui/ActionButtons/WizardNextButton.tsx","../../src/mustangui/ActionButtons/WizardPreviousButton.tsx","../../src/mustangui/ActionButton.tsx","../../src/coreui/ErrorList.tsx","../../src/coreui/FieldHelperText.tsx","../../src/coreui/TextField.tsx","../../src/services/AddressSearchService.ts","../../src/mustangui/AddressSearch.tsx","../../src/mustangui/AddressSearchCriteria.tsx","../../src/coreui/ContentsExistBadge.tsx","../../src/coreui/Collapse.tsx","../../node_modules/react-day-picker/lib/react-day-picker.min.js","../../node_modules/react-day-picker/build/addons/MomentLocaleUtils.js","../../node_modules/react-day-picker/moment/index.js","../../src/coreui/CalendarDialog.tsx","../../src/coreui/DatePicker.tsx","../../src/coreui/Menu.tsx","../../src/coreui/SelectInput.tsx","../../src/coreui/Select.tsx","../../src/mustangui/DateRangeCriteria.tsx","../../src/core/Navigation/useNavigation.ts","../../src/coreui/CheckBoxGroup.tsx","../../src/mustangui/DomainCheckBoxCriteria.tsx","../../src/mustangui/AdvancedSearch.tsx","../../src/mustangui/BooleanCriteria.tsx","../../src/mustangui/BrandingImageDisplay.tsx","../../src/stores/SubPaneControlStore.ts","../../src/mustangui/Checkbox.tsx","../../src/mustangui/CheckBoxGroup.tsx","../../src/coreui/FocusTracker.tsx","../../node_modules/ag-grid-community/dist/ag-grid-community.auto.esm.js","../../node_modules/ag-grid-react/lib/shared/reactComponent.js","../../node_modules/react-dom/cjs/react-dom-server.browser.production.min.js","../../node_modules/react-dom/server.browser.js","../../node_modules/ag-grid-react/lib/shared/keyGenerator.js","../../node_modules/ag-grid-react/lib/legacy/legacyReactComponent.js","../../node_modules/ag-grid-react/lib/shared/newReactComponent.js","../../node_modules/ag-grid-react/lib/shared/portalManager.js","../../node_modules/ag-grid-react/lib/reactUi/beansContext.js","../../node_modules/ag-grid-react/lib/reactUi/jsComp.js","../../node_modules/ag-grid-react/lib/reactUi/utils.js","../../node_modules/ag-grid-react/lib/reactUi/cellRenderer/groupCellRenderer.js","../../node_modules/ag-grid-react/lib/reactUi/header/headerCellComp.js","../../node_modules/ag-grid-react/lib/reactUi/header/headerGroupCellComp.js","../../node_modules/ag-grid-react/lib/reactUi/header/headerFilterCellComp.js","../../node_modules/ag-grid-react/lib/reactUi/header/headerRowComp.js","../../node_modules/ag-grid-react/lib/reactUi/header/headerRowContainerComp.js","../../node_modules/ag-grid-react/lib/reactUi/header/gridHeaderComp.js","../../node_modules/ag-grid-react/lib/reactUi/reactComment.js","../../node_modules/ag-grid-react/lib/reactUi/useEffectOnce.js","../../node_modules/ag-grid-react/lib/reactUi/cells/popupEditorComp.js","../../node_modules/ag-grid-react/lib/reactUi/cells/showJsRenderer.js","../../node_modules/ag-grid-react/lib/reactUi/cells/cellComp.js","../../node_modules/ag-grid-react/lib/reactUi/rows/rowComp.js","../../node_modules/ag-grid-react/lib/reactUi/rows/rowContainerComp.js","../../node_modules/ag-grid-react/lib/reactUi/gridBodyComp.js","../../node_modules/ag-grid-react/lib/reactUi/tabGuardComp.js","../../node_modules/ag-grid-react/lib/reactUi/gridComp.js","../../node_modules/ag-grid-react/lib/reactUi/agGridReactUi.js","../../node_modules/ag-grid-react/lib/reactUi/cellRenderer/detailCellRenderer.js","../../node_modules/ag-grid-react/lib/shared/reactFrameworkOverrides.js","../../node_modules/ag-grid-react/lib/legacy/agGridReactLegacy.js","../../node_modules/ag-grid-react/lib/agGridReact.js","../../node_modules/ag-grid-react/lib/shared/interfaces.js","../../node_modules/ag-grid-react/lib/main.js","../../src/core/SubscribeEvent.ts","../../src/mustangui/GridNewRowChip.tsx","../../src/coreui/KeyboardNavigationGroup.tsx","../../src/mustangui/ToolbarInputWrapper.tsx","../../src/mustangui/Toolbar.tsx","../../src/coreui/ErrorTooltip.tsx","../../src/coreui/RowErrorBadge.tsx","../../src/coreui/table/NoPrint.tsx","../../src/coreui/table/FullWidthRenderer.tsx","../../src/coreui/table/SelectionHeader.tsx","../../src/coreui/table/CellUtil.tsx","../../src/coreui/table/SelectionRenderer.tsx","../../src/coreui/Table.tsx","../../src/coreui/CircularProgress.tsx","../../src/coreui/ProcessingMask.tsx","../../src/coreui/table/AsyncData.tsx","../../src/services/ComplexGridControlService.ts","../../src/services/DialogService.ts","../../node_modules/imask/esm/core/utils.js","../../node_modules/imask/esm/core/action-details.js","../../node_modules/imask/esm/core/holder.js","../../node_modules/imask/esm/masked/factory.js","../../node_modules/imask/esm/controls/mask-element.js","../../node_modules/imask/esm/controls/html-mask-element.js","../../node_modules/imask/esm/controls/html-input-mask-element.js","../../node_modules/imask/esm/controls/html-contenteditable-mask-element.js","../../node_modules/imask/esm/controls/input.js","../../node_modules/imask/esm/core/change-details.js","../../node_modules/imask/esm/core/continuous-tail-details.js","../../node_modules/imask/esm/masked/base.js","../../node_modules/imask/esm/masked/pattern/chunk-tail-details.js","../../node_modules/imask/esm/masked/pattern/cursor.js","../../node_modules/imask/esm/masked/pattern/fixed-definition.js","../../node_modules/imask/esm/masked/pattern/input-definition.js","../../node_modules/imask/esm/masked/regexp.js","../../node_modules/imask/esm/masked/pattern.js","../../node_modules/imask/esm/masked/range.js","../../node_modules/imask/esm/masked/date.js","../../node_modules/imask/esm/masked/dynamic.js","../../node_modules/imask/esm/masked/enum.js","../../node_modules/imask/esm/masked/function.js","../../node_modules/imask/esm/masked/number.js","../../node_modules/imask/esm/masked/pipe.js","../../node_modules/imask/esm/index.js","../../node_modules/react-imask/esm/mixin.js","../../node_modules/react-imask/esm/input.js","../../src/coreui/EditMask.tsx","../../src/services/DocumentService.ts","../../src/mustangui/DateEdit.tsx","../../src/mustangui/FilterStandardization.tsx","../../src/mustangui/NumericEdit.tsx","../../src/coreui/ErrorBadge.tsx","../../src/coreui/table/CellFocusUtil.tsx","../../src/mustangui/Columns/CheckBoxColumn.tsx","../../src/mustangui/Columns/ComponentTypeDisplayColumn.tsx","../../src/coreui/IconWithLink.tsx","../../src/coreui/ImageWithLink.tsx","../../src/coreui/Thumbnail.tsx","../../src/mustangui/Columns/DataImageDisplayColumn.tsx","../../src/mustangui/Columns/DataLinkColumn.tsx","../../src/mustangui/Columns/DateEditColumnEdit.tsx","../../src/coreui/MultilineTextFieldDialog.tsx","../../src/mustangui/Columns/TextColumn.tsx","../../src/mustangui/Columns/DateEditColumn.tsx","../../src/mustangui/DomainComboBox.tsx","../../src/mustangui/Columns/DomainComboBoxColumnDisplay.tsx","../../src/mustangui/Columns/DomainComboBoxColumnEdit.tsx","../../src/mustangui/Columns/HierarchyDisplayColumn.tsx","../../src/mustangui/Columns/IconDisplayColumn.tsx","../../src/mustangui/Columns/ManualLinkColumn.tsx","../../src/mustangui/Columns/MLTextEditColumn.tsx","../../src/mustangui/Columns/MLTextEditColumnEdit.tsx","../../src/mustangui/Columns/NumericEditColumn.tsx","../../src/mustangui/Columns/NumericEditColumnEdit.tsx","../../src/mustangui/Columns/RelationshipComboBoxColumnDisplay.tsx","../../src/mustangui/Columns/RelationshipComboBoxColumnEdit.tsx","../../src/mustangui/Columns/SLTextEditColumn.tsx","../../src/mustangui/Columns/SLTextEditColumnEdit.tsx","../../src/mustangui/Columns/TextDisplayColumn.tsx","../../src/mustangui/Columns/GridColumn.tsx","../../src/mustangui/Columns/TableDisplayDialog.tsx","../../src/mustangui/GridRelatedEditButton.tsx","../../src/mustangui/Panel.tsx","../../src/mustangui/ComplexGridControl.tsx","../../src/services/ComplexResultsGridControlService.ts","../../src/mustangui/ComplexResultsGridControl.tsx","../../src/coreui/FormData.tsx","../../src/mustangui/ComponentTypeDisplay.tsx","../../src/mustangui/DashboardCriteria.tsx","../../src/mustangui/DashboardGridControl.tsx","../../src/mustangui/DataImageDisplay.tsx","../../src/mustangui/DataLink.tsx","../../src/mustangui/DividerDisplay.tsx","../../src/services/DocumentEditService.ts","../../src/mustangui/DocumentEdit.tsx","../../src/mustangui/DomainComboBoxCriteria.tsx","../../src/mustangui/FreeflowContainerItem.tsx","../../src/mustangui/FreeflowContainerGroup.tsx","../../src/mustangui/FreeflowContainerSection.tsx","../../src/mustangui/Freeflow.tsx","../../src/mustangui/GridFilter.tsx","../../src/mustangui/GridPager.tsx","../../src/mustangui/GridPrint.tsx","../../src/mustangui/GridSelectedCount.tsx","../../src/mustangui/GroupHeading.tsx","../../src/mustangui/IconDisplay.tsx","../../src/mustangui/IconDisplayVerticalLayout.tsx","../../src/coreui/MenuItemDisplay.tsx","../../src/mustangui/ManualLink.tsx","../../src/services/PresentationButtonService.ts","../../src/mustangui/PresentationButton.tsx","../../src/mustangui/MenuItem.tsx","../../src/mustangui/MenuButton.tsx","../../src/mustangui/LanguageSelect.tsx","../../src/mustangui/Media.tsx","../../src/coreui/MultilineTextField.tsx","../../src/mustangui/MLTextEdit.tsx","../../src/mustangui/ProjectCurrentJobIndicator.tsx","../../src/mustangui/Columns/ProjectCurrentJobColumn.tsx","../../src/mustangui/ProjectGridVerticalHierarchy.tsx","../../src/mustangui/ProjectGrid.tsx","../../src/mustangui/ProjectGridContainerItem.tsx","../../src/mustangui/ProjectGridContainer.tsx","../../src/mustangui/ProjectGridControl.tsx","../../src/coreui/Radio.tsx","../../src/mustangui/RadioSelect.tsx","../../src/mustangui/RelationshipComboBox.tsx","../../src/mustangui/ResponsiveGrid.tsx","../../src/mustangui/ResultsCountDisplay.tsx","../../src/services/SelectControlService.ts","../../src/mustangui/SelectControl.tsx","../../src/mustangui/SelectControlSelectedGrid.tsx","../../src/mustangui/SelectDialogResultsGrid.tsx","../../src/coreui/table/UploadDialog.tsx","../../src/coreui/table/DocumentDropArea.tsx","../../src/services/SimpleGridControlService.ts","../../src/stores/DocumentStore.ts","../../src/mustangui/Columns/TableEditDialog.tsx","../../src/mustangui/SimpleGridControl.tsx","../../src/services/SimpleResultsGridControlService.ts","../../src/mustangui/SimpleResultsGridControl.tsx","../../src/mustangui/SiteCriteria.tsx","../../src/mustangui/SiteCriteriaLink.tsx","../../src/coreui/PasswordField.tsx","../../src/mustangui/SLTextEdit.tsx","../../src/mustangui/SubPaneControl.tsx","../../src/coreui/Accordion.tsx","../../src/coreui/Tab.tsx","../../src/coreui/TabScrollButton.tsx","../../src/coreui/Tabs.tsx","../../src/mustangui/TabPane.tsx","../../src/mustangui/TabControl.tsx","../../src/mustangui/TableSummary.tsx","../../src/mustangui/TableSummarySection.tsx","../../src/mustangui/TextCriteria.tsx","../../src/mustangui/TextDisplay.tsx","../../src/mustangui/ThumbnailDisplay.tsx","../../src/mustangui/ToolbarContainerGroup.tsx","../../src/mustangui/ToolbarContainerItem.tsx","../../src/coreui/Drawer.tsx","../../src/mustangui/ToolbarContainerOverflowItem.tsx","../../src/mustangui/ToolbarContainerOverflowSection.tsx","../../src/mustangui/ToolbarContainerSection.tsx","../../src/mustangui/WizardStepNumberDisplay.tsx","../../src/coreui/Step.tsx","../../src/mustangui/WizardStepsDisplay.tsx","../../src/coreui/Presentation.tsx","../../src/pages/Logon.tsx","../../src/services/PresentationService.ts","../../src/services/SearchService.ts","../../src/templates/components/Logo.tsx","../../src/mustangui/SessionMessageDisplay.tsx","../../src/stores/ConfirmContinueStore.ts","../../src/templates/components/ConfirmContinueDialog.tsx","../../src/templates/components/MessagesSnackbar.tsx","../../src/templates/components/PageProcessing.tsx","../../src/templates/components/BackgroundImage.tsx","../../src/templates/components/Container.tsx","../../src/templates/components/EnvironmentBanner.tsx","../../src/templates/components/ErrorDisplay.tsx","../../src/templates/components/Footer.tsx","../../src/templates/components/SiteCriteria.tsx","../../src/templates/components/Header.tsx","../../src/templates/components/LandingPageGreeting.tsx","../../src/templates/BasePageTemplate.tsx","../../src/templates/ErrorPageTemplate.tsx","../../src/templates/LandingPageTemplate.tsx","../../src/pages/AuthenticatedPage.tsx","../../src/pages/ErrorPage.tsx","../../src/pages/GuestPage.tsx","../../src/pages/LandingPage.tsx","../../src/core/Routing.ts","../../src/services/BaseService.ts","../../src/services/EmbeddedAddOnService.ts","../../src/config/AddOnHost.tsx","../../src/config/Layout.tsx","../../src/config/Dialog.tsx","../../src/config/PaneUse.tsx","../../src/config/Presentation.tsx","../../src/config/SearchPresentation.tsx","../../src/services/SystemConfigService.ts","../../src/core/TraceKey.ts","../../src/core/Sys.ts","../../src/main.tsx"],"sourcesContent":["/* Web Font Loader v1.6.28 - (c) Adobe Systems, Google. License: Apache 2.0 */(function(){function aa(a,b,c){return a.call.apply(a.bind,arguments)}function ba(a,b,c){if(!a)throw Error();if(2=b.f?e():a.fonts.load(fa(b.a),b.h).then(function(a){1<=a.length?d():setTimeout(f,25)},function(){e()})}f()}),e=null,f=new Promise(function(a,d){e=setTimeout(d,b.f)});Promise.race([f,d]).then(function(){e&&(clearTimeout(e),e=null);b.g(b.a)},function(){b.j(b.a)})};function Q(a,b,c,d,e,f,g){this.v=a;this.B=b;this.c=c;this.a=d;this.s=g||\"BESbswy\";this.f={};this.w=e||3E3;this.u=f||null;this.m=this.j=this.h=this.g=null;this.g=new M(this.c,this.s);this.h=new M(this.c,this.s);this.j=new M(this.c,this.s);this.m=new M(this.c,this.s);a=new G(this.a.c+\",serif\",J(this.a));a=O(a);this.g.a.style.cssText=a;a=new G(this.a.c+\",sans-serif\",J(this.a));a=O(a);this.h.a.style.cssText=a;a=new G(\"serif\",J(this.a));a=O(a);this.j.a.style.cssText=a;a=new G(\"sans-serif\",J(this.a));a=\nO(a);this.m.a.style.cssText=a;N(this.g);N(this.h);N(this.j);N(this.m)}var R={D:\"serif\",C:\"sans-serif\"},S=null;function T(){if(null===S){var a=/AppleWebKit\\/([0-9]+)(?:\\.([0-9]+))/.exec(window.navigator.userAgent);S=!!a&&(536>parseInt(a[1],10)||536===parseInt(a[1],10)&&11>=parseInt(a[2],10))}return S}Q.prototype.start=function(){this.f.serif=this.j.a.offsetWidth;this.f[\"sans-serif\"]=this.m.a.offsetWidth;this.A=q();U(this)};\nfunction la(a,b,c){for(var d in R)if(R.hasOwnProperty(d)&&b===a.f[R[d]]&&c===a.f[R[d]])return!0;return!1}function U(a){var b=a.g.a.offsetWidth,c=a.h.a.offsetWidth,d;(d=b===a.f.serif&&c===a.f[\"sans-serif\"])||(d=T()&&la(a,b,c));d?q()-a.A>=a.w?T()&&la(a,b,c)&&(null===a.u||a.u.hasOwnProperty(a.a.c))?V(a,a.v):V(a,a.B):ma(a):V(a,a.v)}function ma(a){setTimeout(p(function(){U(this)},a),50)}function V(a,b){setTimeout(p(function(){v(this.g.a);v(this.h.a);v(this.j.a);v(this.m.a);b(this.a)},a),0)};function W(a,b,c){this.c=a;this.a=b;this.f=0;this.m=this.j=!1;this.s=c}var X=null;W.prototype.g=function(a){var b=this.a;b.g&&w(b.f,[b.a.c(\"wf\",a.c,J(a).toString(),\"active\")],[b.a.c(\"wf\",a.c,J(a).toString(),\"loading\"),b.a.c(\"wf\",a.c,J(a).toString(),\"inactive\")]);K(b,\"fontactive\",a);this.m=!0;na(this)};\nW.prototype.h=function(a){var b=this.a;if(b.g){var c=y(b.f,b.a.c(\"wf\",a.c,J(a).toString(),\"active\")),d=[],e=[b.a.c(\"wf\",a.c,J(a).toString(),\"loading\")];c||d.push(b.a.c(\"wf\",a.c,J(a).toString(),\"inactive\"));w(b.f,d,e)}K(b,\"fontinactive\",a);na(this)};function na(a){0==--a.f&&a.j&&(a.m?(a=a.a,a.g&&w(a.f,[a.a.c(\"wf\",\"active\")],[a.a.c(\"wf\",\"loading\"),a.a.c(\"wf\",\"inactive\")]),K(a,\"active\")):L(a.a))};function oa(a){this.j=a;this.a=new ja;this.h=0;this.f=this.g=!0}oa.prototype.load=function(a){this.c=new ca(this.j,a.context||this.j);this.g=!1!==a.events;this.f=!1!==a.classes;pa(this,new ha(this.c,a),a)};\nfunction qa(a,b,c,d,e){var f=0==--a.h;(a.f||a.g)&&setTimeout(function(){var a=e||null,m=d||null||{};if(0===c.length&&f)L(b.a);else{b.f+=c.length;f&&(b.j=f);var h,l=[];for(h=0;h {\n if (disableDefaultClasses) {\n return '';\n }\n return generateUtilityClass(slot);\n };\n}\n\n/**\n * Allows to configure the components within to not apply any built-in classes.\n */\nexport function ClassNameConfigurator(props) {\n const {\n disableDefaultClasses,\n children\n } = props;\n const contextValue = React.useMemo(() => ({\n disableDefaultClasses: disableDefaultClasses != null ? disableDefaultClasses : false\n }), [disableDefaultClasses]);\n return /*#__PURE__*/_jsx(ClassNameConfiguratorContext.Provider, {\n value: contextValue,\n children: children\n });\n}","/**\n * Extracts event handlers from a given object.\n * A prop is considered an event handler if it is a function and its name starts with `on`.\n *\n * @param object An object to extract event handlers from.\n * @param excludeKeys An array of keys to exclude from the returned object.\n */\nexport function extractEventHandlers(object, excludeKeys = []) {\n if (object === undefined) {\n return {};\n }\n const result = {};\n Object.keys(object).filter(prop => prop.match(/^on[A-Z]/) && typeof object[prop] === 'function' && !excludeKeys.includes(prop)).forEach(prop => {\n result[prop] = object[prop];\n });\n return result;\n}","/**\n * If `componentProps` is a function, calls it with the provided `ownerState`.\n * Otherwise, just returns `componentProps`.\n */\nexport function resolveComponentProps(componentProps, ownerState, slotState) {\n if (typeof componentProps === 'function') {\n return componentProps(ownerState, slotState);\n }\n return componentProps;\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 _extends from \"@babel/runtime/helpers/esm/extends\";\nexport function isPlainObject(item) {\n return item !== null && typeof item === 'object' && item.constructor === Object;\n}\nfunction deepClone(source) {\n if (!isPlainObject(source)) {\n return source;\n }\n const output = {};\n Object.keys(source).forEach(key => {\n output[key] = deepClone(source[key]);\n });\n return output;\n}\nexport default function deepmerge(target, source, options = {\n clone: true\n}) {\n const output = options.clone ? _extends({}, target) : target;\n if (isPlainObject(target) && isPlainObject(source)) {\n Object.keys(source).forEach(key => {\n // Avoid prototype pollution\n if (key === '__proto__') {\n return;\n }\n if (isPlainObject(source[key]) && key in target && isPlainObject(target[key])) {\n // Since `output` is a clone of `target` and we have narrowed `target` in this block we can cast to the same type.\n output[key] = deepmerge(target[key], source[key], options);\n } else if (options.clone) {\n output[key] = isPlainObject(source[key]) ? deepClone(source[key]) : source[key];\n } else {\n output[key] = source[key];\n }\n });\n }\n return output;\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","/**\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 = require('./lib/ReactPropTypesSecret');\n\nfunction emptyFunction() {}\nfunction emptyFunctionWithReset() {}\nemptyFunctionWithReset.resetWarningCache = emptyFunction;\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\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 };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bigint: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n elementType: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim,\n\n checkPropTypes: emptyFunctionWithReset,\n resetWarningCache: emptyFunction\n };\n\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","/**\n * WARNING: Don't import this directly.\n * Use `MuiError` from `@mui/utils/macros/MuiError.macro` instead.\n * @param {number} code\n */\nexport default function formatMuiErrorMessage(code) {\n // Apply babel-plugin-transform-template-literals in loose mode\n // loose mode is safe iff we're concatenating primitives\n // see https://babeljs.io/docs/en/babel-plugin-transform-template-literals#loose\n /* eslint-disable prefer-template */\n let url = 'https://mui.com/production-error/?code=' + code;\n for (let i = 1; i < arguments.length; i += 1) {\n // rest params over-transpile for this case\n // eslint-disable-next-line prefer-rest-params\n url += '&args[]=' + encodeURIComponent(arguments[i]);\n }\n return 'Minified MUI error #' + code + '; visit ' + url + ' for the full message.';\n /* eslint-enable prefer-template */\n}","/**\n * @license React\n * react-is.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\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'use strict';var b=Symbol.for(\"react.element\"),c=Symbol.for(\"react.portal\"),d=Symbol.for(\"react.fragment\"),e=Symbol.for(\"react.strict_mode\"),f=Symbol.for(\"react.profiler\"),g=Symbol.for(\"react.provider\"),h=Symbol.for(\"react.context\"),k=Symbol.for(\"react.server_context\"),l=Symbol.for(\"react.forward_ref\"),m=Symbol.for(\"react.suspense\"),n=Symbol.for(\"react.suspense_list\"),p=Symbol.for(\"react.memo\"),q=Symbol.for(\"react.lazy\"),t=Symbol.for(\"react.offscreen\"),u;u=Symbol.for(\"react.module.reference\");\nfunction v(a){if(\"object\"===typeof a&&null!==a){var r=a.$$typeof;switch(r){case b:switch(a=a.type,a){case d:case f:case e:case m:case n:return a;default:switch(a=a&&a.$$typeof,a){case k:case h:case l:case q:case p:case g:return a;default:return r}}case c:return r}}}exports.ContextConsumer=h;exports.ContextProvider=g;exports.Element=b;exports.ForwardRef=l;exports.Fragment=d;exports.Lazy=q;exports.Memo=p;exports.Portal=c;exports.Profiler=f;exports.StrictMode=e;exports.Suspense=m;\nexports.SuspenseList=n;exports.isAsyncMode=function(){return!1};exports.isConcurrentMode=function(){return!1};exports.isContextConsumer=function(a){return v(a)===h};exports.isContextProvider=function(a){return v(a)===g};exports.isElement=function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===b};exports.isForwardRef=function(a){return v(a)===l};exports.isFragment=function(a){return v(a)===d};exports.isLazy=function(a){return v(a)===q};exports.isMemo=function(a){return v(a)===p};\nexports.isPortal=function(a){return v(a)===c};exports.isProfiler=function(a){return v(a)===f};exports.isStrictMode=function(a){return v(a)===e};exports.isSuspense=function(a){return v(a)===m};exports.isSuspenseList=function(a){return v(a)===n};\nexports.isValidElementType=function(a){return\"string\"===typeof a||\"function\"===typeof a||a===d||a===f||a===e||a===m||a===n||a===t||\"object\"===typeof a&&null!==a&&(a.$$typeof===q||a.$$typeof===p||a.$$typeof===g||a.$$typeof===h||a.$$typeof===l||a.$$typeof===u||void 0!==a.getModuleId)?!0:!1};exports.typeOf=v;\n","import _formatMuiErrorMessage from \"../formatMuiErrorMessage\";\n// It should to be noted that this function isn't equivalent to `text-transform: capitalize`.\n//\n// A strict capitalization should uppercase the first letter of each word in the sentence.\n// We only handle the first word.\nexport default function capitalize(string) {\n if (typeof string !== 'string') {\n throw new Error(process.env.NODE_ENV !== \"production\" ? `MUI: \\`capitalize(string)\\` expects a string argument.` : _formatMuiErrorMessage(7));\n }\n return string.charAt(0).toUpperCase() + string.slice(1);\n}","/**\n * Safe chained function.\n *\n * Will only create a new function if needed,\n * otherwise will pass back existing functions or null.\n */\nexport default function createChainedFunction(...funcs) {\n return funcs.reduce((acc, func) => {\n if (func == null) {\n return acc;\n }\n return function chainedFunction(...args) {\n acc.apply(this, args);\n func.apply(this, args);\n };\n }, () => {});\n}","// Corresponds to 10 frames at 60 Hz.\n// A few bytes payload overhead when lodash/debounce is ~3 kB and debounce ~300 B.\nexport default function debounce(func, wait = 166) {\n let timeout;\n function debounced(...args) {\n const later = () => {\n // @ts-ignore\n func.apply(this, args);\n };\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n }\n debounced.clear = () => {\n clearTimeout(timeout);\n };\n return debounced;\n}","import * as React from 'react';\nexport default function isMuiElement(element, muiNames) {\n return /*#__PURE__*/React.isValidElement(element) && muiNames.indexOf(element.type.muiName) !== -1;\n}","export default function ownerDocument(node) {\n return node && node.ownerDocument || document;\n}","import ownerDocument from '../ownerDocument';\nexport default function ownerWindow(node) {\n const doc = ownerDocument(node);\n return doc.defaultView || window;\n}","/**\n * TODO v5: consider making it private\n *\n * passes {value} to {ref}\n *\n * WARNING: Be sure to only call this inside a callback that is passed as a ref.\n * Otherwise, make sure to cleanup the previous {ref} if it changes. See\n * https://github.com/mui/material-ui/issues/13539\n *\n * Useful if you want to expose the ref of an inner component to the public API\n * while still using it inside the component.\n * @param ref A ref callback or ref object. If anything falsy, this is a no-op.\n */\nexport default function setRef(ref, value) {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref) {\n ref.current = value;\n }\n}","'use client';\n\nimport * as React from 'react';\nconst useEnhancedEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;\nexport default useEnhancedEffect;","'use client';\n\nimport * as React from 'react';\nlet globalId = 0;\nfunction useGlobalId(idOverride) {\n const [defaultId, setDefaultId] = React.useState(idOverride);\n const id = idOverride || defaultId;\n React.useEffect(() => {\n if (defaultId == null) {\n // Fallback to this default id when possible.\n // Use the incrementing value for client-side rendering only.\n // We can't use it server-side.\n // If you want to use random values please consider the Birthday Problem: https://en.wikipedia.org/wiki/Birthday_problem\n globalId += 1;\n setDefaultId(`mui-${globalId}`);\n }\n }, [defaultId]);\n return id;\n}\n\n// downstream bundlers may remove unnecessary concatenation, but won't remove toString call -- Workaround for https://github.com/webpack/webpack/issues/14814\nconst maybeReactUseId = React['useId'.toString()];\n/**\n *\n * @example
\n * @param idOverride\n * @returns {string}\n */\nexport default function useId(idOverride) {\n if (maybeReactUseId !== undefined) {\n const reactId = maybeReactUseId();\n return idOverride != null ? idOverride : reactId;\n }\n // eslint-disable-next-line react-hooks/rules-of-hooks -- `React.useId` is invariant at runtime.\n return useGlobalId(idOverride);\n}","'use client';\n\n/* eslint-disable react-hooks/rules-of-hooks, react-hooks/exhaustive-deps */\nimport * as React from 'react';\nexport default function useControlled({\n controlled,\n default: defaultProp,\n name,\n state = 'value'\n}) {\n // isControlled is ignored in the hook dependency lists as it should never change.\n const {\n current: isControlled\n } = React.useRef(controlled !== undefined);\n const [valueState, setValue] = React.useState(defaultProp);\n const value = isControlled ? controlled : valueState;\n if (process.env.NODE_ENV !== 'production') {\n React.useEffect(() => {\n if (isControlled !== (controlled !== undefined)) {\n console.error([`MUI: A component is changing the ${isControlled ? '' : 'un'}controlled ${state} state of ${name} to be ${isControlled ? 'un' : ''}controlled.`, 'Elements should not switch from uncontrolled to controlled (or vice versa).', `Decide between using a controlled or uncontrolled ${name} ` + 'element for the lifetime of the component.', \"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.\", 'More info: https://fb.me/react-controlled-components'].join('\\n'));\n }\n }, [state, name, controlled]);\n const {\n current: defaultValue\n } = React.useRef(defaultProp);\n React.useEffect(() => {\n if (!isControlled && defaultValue !== defaultProp) {\n console.error([`MUI: A component is changing the default ${state} state of an uncontrolled ${name} after being initialized. ` + `To suppress this warning opt to use a controlled ${name}.`].join('\\n'));\n }\n }, [JSON.stringify(defaultProp)]);\n }\n const setValueIfUncontrolled = React.useCallback(newValue => {\n if (!isControlled) {\n setValue(newValue);\n }\n }, []);\n return [value, setValueIfUncontrolled];\n}","'use client';\n\nimport * as React from 'react';\nimport useEnhancedEffect from '../useEnhancedEffect';\n\n/**\n * Inspired by https://github.com/facebook/react/issues/14099#issuecomment-440013892\n * See RFC in https://github.com/reactjs/rfcs/pull/220\n */\n\nfunction useEventCallback(fn) {\n const ref = React.useRef(fn);\n useEnhancedEffect(() => {\n ref.current = fn;\n });\n return React.useCallback((...args) =>\n // @ts-expect-error hide `this`\n // tslint:disable-next-line:ban-comma-operator\n (0, ref.current)(...args), []);\n}\nexport default useEventCallback;","'use client';\n\nimport * as React from 'react';\nimport setRef from '../setRef';\nexport default function useForkRef(...refs) {\n /**\n * This will create a new function if the refs passed to this hook change and are all defined.\n * This means react will call the old forkRef with `null` and the new forkRef\n * with the ref. Cleanup naturally emerges from this behavior.\n */\n return React.useMemo(() => {\n if (refs.every(ref => ref == null)) {\n return null;\n }\n return instance => {\n refs.forEach(ref => {\n setRef(ref, instance);\n });\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, refs);\n}","'use client';\n\n// based on https://github.com/WICG/focus-visible/blob/v4.1.5/src/focus-visible.js\nimport * as React from 'react';\nlet hadKeyboardEvent = true;\nlet hadFocusVisibleRecently = false;\nlet hadFocusVisibleRecentlyTimeout;\nconst inputTypesWhitelist = {\n text: true,\n search: true,\n url: true,\n tel: true,\n email: true,\n password: true,\n number: true,\n date: true,\n month: true,\n week: true,\n time: true,\n datetime: true,\n 'datetime-local': true\n};\n\n/**\n * Computes whether the given element should automatically trigger the\n * `focus-visible` class being added, i.e. whether it should always match\n * `:focus-visible` when focused.\n * @param {Element} node\n * @returns {boolean}\n */\nfunction focusTriggersKeyboardModality(node) {\n const {\n type,\n tagName\n } = node;\n if (tagName === 'INPUT' && inputTypesWhitelist[type] && !node.readOnly) {\n return true;\n }\n if (tagName === 'TEXTAREA' && !node.readOnly) {\n return true;\n }\n if (node.isContentEditable) {\n return true;\n }\n return false;\n}\n\n/**\n * Keep track of our keyboard modality state with `hadKeyboardEvent`.\n * If the most recent user interaction was via the keyboard;\n * and the key press did not include a meta, alt/option, or control key;\n * then the modality is keyboard. Otherwise, the modality is not keyboard.\n * @param {KeyboardEvent} event\n */\nfunction handleKeyDown(event) {\n if (event.metaKey || event.altKey || event.ctrlKey) {\n return;\n }\n hadKeyboardEvent = true;\n}\n\n/**\n * If at any point a user clicks with a pointing device, ensure that we change\n * the modality away from keyboard.\n * This avoids the situation where a user presses a key on an already focused\n * element, and then clicks on a different element, focusing it with a\n * pointing device, while we still think we're in keyboard modality.\n */\nfunction handlePointerDown() {\n hadKeyboardEvent = false;\n}\nfunction handleVisibilityChange() {\n if (this.visibilityState === 'hidden') {\n // If the tab becomes active again, the browser will handle calling focus\n // on the element (Safari actually calls it twice).\n // If this tab change caused a blur on an element with focus-visible,\n // re-apply the class when the user switches back to the tab.\n if (hadFocusVisibleRecently) {\n hadKeyboardEvent = true;\n }\n }\n}\nfunction prepare(doc) {\n doc.addEventListener('keydown', handleKeyDown, true);\n doc.addEventListener('mousedown', handlePointerDown, true);\n doc.addEventListener('pointerdown', handlePointerDown, true);\n doc.addEventListener('touchstart', handlePointerDown, true);\n doc.addEventListener('visibilitychange', handleVisibilityChange, true);\n}\nexport function teardown(doc) {\n doc.removeEventListener('keydown', handleKeyDown, true);\n doc.removeEventListener('mousedown', handlePointerDown, true);\n doc.removeEventListener('pointerdown', handlePointerDown, true);\n doc.removeEventListener('touchstart', handlePointerDown, true);\n doc.removeEventListener('visibilitychange', handleVisibilityChange, true);\n}\nfunction isFocusVisible(event) {\n const {\n target\n } = event;\n try {\n return target.matches(':focus-visible');\n } catch (error) {\n // Browsers not implementing :focus-visible will throw a SyntaxError.\n // We use our own heuristic for those browsers.\n // Rethrow might be better if it's not the expected error but do we really\n // want to crash if focus-visible malfunctioned?\n }\n\n // No need for validFocusTarget check. The user does that by attaching it to\n // focusable events only.\n return hadKeyboardEvent || focusTriggersKeyboardModality(target);\n}\nexport default function useIsFocusVisible() {\n const ref = React.useCallback(node => {\n if (node != null) {\n prepare(node.ownerDocument);\n }\n }, []);\n const isFocusVisibleRef = React.useRef(false);\n\n /**\n * Should be called if a blur event is fired\n */\n function handleBlurVisible() {\n // checking against potential state variable does not suffice if we focus and blur synchronously.\n // React wouldn't have time to trigger a re-render so `focusVisible` would be stale.\n // Ideally we would adjust `isFocusVisible(event)` to look at `relatedTarget` for blur events.\n // This doesn't work in IE11 due to https://github.com/facebook/react/issues/3751\n // TODO: check again if React releases their internal changes to focus event handling (https://github.com/facebook/react/pull/19186).\n if (isFocusVisibleRef.current) {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n hadFocusVisibleRecentlyTimeout = window.setTimeout(() => {\n hadFocusVisibleRecently = false;\n }, 100);\n isFocusVisibleRef.current = false;\n return true;\n }\n return false;\n }\n\n /**\n * Should be called if a blur event is fired\n */\n function handleFocusVisible(event) {\n if (isFocusVisible(event)) {\n isFocusVisibleRef.current = true;\n return true;\n }\n return false;\n }\n return {\n isFocusVisibleRef,\n onFocus: handleFocusVisible,\n onBlur: handleBlurVisible,\n ref\n };\n}","// A change of the browser zoom change the scrollbar size.\n// Credit https://github.com/twbs/bootstrap/blob/488fd8afc535ca3a6ad4dc581f5e89217b6a36ac/js/src/util/scrollbar.js#L14-L18\nexport default function getScrollbarSize(doc) {\n // https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes\n const documentWidth = doc.documentElement.clientWidth;\n return Math.abs(window.innerWidth - documentWidth);\n}","// Source from https://github.com/alitaheri/normalize-scroll-left\nlet cachedType;\n\n/**\n * Based on the jquery plugin https://github.com/othree/jquery.rtl-scroll-type\n *\n * Types of scrollLeft, assuming scrollWidth=100 and direction is rtl.\n *\n * Type | <- Most Left | Most Right -> | Initial\n * ---------------- | ------------ | ------------- | -------\n * default | 0 | 100 | 100\n * negative (spec*) | -100 | 0 | 0\n * reverse | 100 | 0 | 0\n *\n * Edge 85: default\n * Safari 14: negative\n * Chrome 85: negative\n * Firefox 81: negative\n * IE11: reverse\n *\n * spec* https://drafts.csswg.org/cssom-view/#dom-window-scroll\n */\nexport function detectScrollType() {\n if (cachedType) {\n return cachedType;\n }\n const dummy = document.createElement('div');\n const container = document.createElement('div');\n container.style.width = '10px';\n container.style.height = '1px';\n dummy.appendChild(container);\n dummy.dir = 'rtl';\n dummy.style.fontSize = '14px';\n dummy.style.width = '4px';\n dummy.style.height = '1px';\n dummy.style.position = 'absolute';\n dummy.style.top = '-1000px';\n dummy.style.overflow = 'scroll';\n document.body.appendChild(dummy);\n cachedType = 'reverse';\n if (dummy.scrollLeft > 0) {\n cachedType = 'default';\n } else {\n dummy.scrollLeft = 1;\n if (dummy.scrollLeft === 0) {\n cachedType = 'negative';\n }\n }\n document.body.removeChild(dummy);\n return cachedType;\n}\n\n// Based on https://stackoverflow.com/a/24394376\nexport function getNormalizedScrollLeft(element, direction) {\n const scrollLeft = element.scrollLeft;\n\n // Perform the calculations only when direction is rtl to avoid messing up the ltr behavior\n if (direction !== 'rtl') {\n return scrollLeft;\n }\n const type = detectScrollType();\n switch (type) {\n case 'negative':\n return element.scrollWidth - element.clientWidth + scrollLeft;\n case 'reverse':\n return element.scrollWidth - element.clientWidth - scrollLeft;\n default:\n return scrollLeft;\n }\n}","'use client';\n\nimport * as React from 'react';\nconst usePreviousProps = value => {\n const ref = React.useRef({});\n React.useEffect(() => {\n ref.current = value;\n });\n return ref.current;\n};\nexport default usePreviousProps;","const visuallyHidden = {\n border: 0,\n clip: 'rect(0 0 0 0)',\n height: '1px',\n margin: -1,\n overflow: 'hidden',\n padding: 0,\n position: 'absolute',\n whiteSpace: 'nowrap',\n width: '1px'\n};\nexport default visuallyHidden;","import _extends from \"@babel/runtime/helpers/esm/extends\";\n/**\n * Add keys, values of `defaultProps` that does not exist in `props`\n * @param {object} defaultProps\n * @param {object} props\n * @returns {object} resolved props\n */\nexport default function resolveProps(defaultProps, props) {\n const output = _extends({}, props);\n Object.keys(defaultProps).forEach(propName => {\n if (propName.toString().match(/^(components|slots)$/)) {\n output[propName] = _extends({}, defaultProps[propName], output[propName]);\n } else if (propName.toString().match(/^(componentsProps|slotProps)$/)) {\n const defaultSlotProps = defaultProps[propName] || {};\n const slotProps = props[propName];\n output[propName] = {};\n if (!slotProps || !Object.keys(slotProps)) {\n // Reduce the iteration if the slot props is empty\n output[propName] = defaultSlotProps;\n } else if (!defaultSlotProps || !Object.keys(defaultSlotProps)) {\n // Reduce the iteration if the default slot props is empty\n output[propName] = slotProps;\n } else {\n output[propName] = _extends({}, slotProps);\n Object.keys(defaultSlotProps).forEach(slotPropName => {\n output[propName][slotPropName] = resolveProps(defaultSlotProps[slotPropName], slotProps[slotPropName]);\n });\n }\n } else if (output[propName] === undefined) {\n output[propName] = defaultProps[propName];\n }\n });\n return output;\n}","export default function composeClasses(slots, getUtilityClass, classes = undefined) {\n const output = {};\n Object.keys(slots).forEach(\n // `Object.keys(slots)` can't be wider than `T` because we infer `T` from `slots`.\n // @ts-expect-error https://github.com/microsoft/TypeScript/pull/12253#issuecomment-263132208\n slot => {\n output[slot] = slots[slot].reduce((acc, key) => {\n if (key) {\n const utilityClass = getUtilityClass(key);\n if (utilityClass !== '') {\n acc.push(utilityClass);\n }\n if (classes && classes[key]) {\n acc.push(classes[key]);\n }\n }\n return acc;\n }, []).join(' ');\n });\n return output;\n}","const defaultGenerator = componentName => componentName;\nconst createClassNameGenerator = () => {\n let generate = defaultGenerator;\n return {\n configure(generator) {\n generate = generator;\n },\n generate(componentName) {\n return generate(componentName);\n },\n reset() {\n generate = defaultGenerator;\n }\n };\n};\nconst ClassNameGenerator = createClassNameGenerator();\nexport default ClassNameGenerator;","import ClassNameGenerator from '../ClassNameGenerator';\n\n// If GlobalStateSlot is changed, GLOBAL_STATE_CLASSES in\n// \\packages\\api-docs-builder\\utils\\parseSlotsAndClasses.ts must be updated accordingly.\nconst globalStateClassesMapping = {\n active: 'active',\n checked: 'checked',\n completed: 'completed',\n disabled: 'disabled',\n error: 'error',\n expanded: 'expanded',\n focused: 'focused',\n focusVisible: 'focusVisible',\n open: 'open',\n readOnly: 'readOnly',\n required: 'required',\n selected: 'selected'\n};\nexport default function generateUtilityClass(componentName, slot, globalStatePrefix = 'Mui') {\n const globalStateClass = globalStateClassesMapping[slot];\n return globalStateClass ? `${globalStatePrefix}-${globalStateClass}` : `${ClassNameGenerator.generate(componentName)}-${slot}`;\n}","import generateUtilityClass from '../generateUtilityClass';\nexport default function generateUtilityClasses(componentName, slots, globalStatePrefix = 'Mui') {\n const result = {};\n slots.forEach(slot => {\n result[slot] = generateUtilityClass(componentName, slot, globalStatePrefix);\n });\n return result;\n}","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e))for(t=0;t !(prop.match(/^on[A-Z]/) && typeof object[prop] === 'function')).forEach(prop => {\n result[prop] = object[prop];\n });\n return result;\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport clsx from 'clsx';\nimport { extractEventHandlers } from './extractEventHandlers';\nimport { omitEventHandlers } from './omitEventHandlers';\n/**\n * Merges the slot component internal props (usually coming from a hook)\n * with the externally provided ones.\n *\n * The merge order is (the latter overrides the former):\n * 1. The internal props (specified as a getter function to work with get*Props hook result)\n * 2. Additional props (specified internally on a Base UI component)\n * 3. External props specified on the owner component. These should only be used on a root slot.\n * 4. External props specified in the `slotProps.*` prop.\n * 5. The `className` prop - combined from all the above.\n * @param parameters\n * @returns\n */\nexport function mergeSlotProps(parameters) {\n const {\n getSlotProps,\n additionalProps,\n externalSlotProps,\n externalForwardedProps,\n className\n } = parameters;\n if (!getSlotProps) {\n // The simpler case - getSlotProps is not defined, so no internal event handlers are defined,\n // so we can simply merge all the props without having to worry about extracting event handlers.\n const joinedClasses = clsx(externalForwardedProps == null ? void 0 : externalForwardedProps.className, externalSlotProps == null ? void 0 : externalSlotProps.className, className, additionalProps == null ? void 0 : additionalProps.className);\n const mergedStyle = _extends({}, additionalProps == null ? void 0 : additionalProps.style, externalForwardedProps == null ? void 0 : externalForwardedProps.style, externalSlotProps == null ? void 0 : externalSlotProps.style);\n const props = _extends({}, additionalProps, externalForwardedProps, externalSlotProps);\n if (joinedClasses.length > 0) {\n props.className = joinedClasses;\n }\n if (Object.keys(mergedStyle).length > 0) {\n props.style = mergedStyle;\n }\n return {\n props,\n internalRef: undefined\n };\n }\n\n // In this case, getSlotProps is responsible for calling the external event handlers.\n // We don't need to include them in the merged props because of this.\n\n const eventHandlers = extractEventHandlers(_extends({}, externalForwardedProps, externalSlotProps));\n const componentsPropsWithoutEventHandlers = omitEventHandlers(externalSlotProps);\n const otherPropsWithoutEventHandlers = omitEventHandlers(externalForwardedProps);\n const internalSlotProps = getSlotProps(eventHandlers);\n\n // The order of classes is important here.\n // Emotion (that we use in libraries consuming Base UI) depends on this order\n // to properly override style. It requires the most important classes to be last\n // (see https://github.com/mui/material-ui/pull/33205) for the related discussion.\n const joinedClasses = clsx(internalSlotProps == null ? void 0 : internalSlotProps.className, additionalProps == null ? void 0 : additionalProps.className, className, externalForwardedProps == null ? void 0 : externalForwardedProps.className, externalSlotProps == null ? void 0 : externalSlotProps.className);\n const mergedStyle = _extends({}, internalSlotProps == null ? void 0 : internalSlotProps.style, additionalProps == null ? void 0 : additionalProps.style, externalForwardedProps == null ? void 0 : externalForwardedProps.style, externalSlotProps == null ? void 0 : externalSlotProps.style);\n const props = _extends({}, internalSlotProps, additionalProps, otherPropsWithoutEventHandlers, componentsPropsWithoutEventHandlers);\n if (joinedClasses.length > 0) {\n props.className = joinedClasses;\n }\n if (Object.keys(mergedStyle).length > 0) {\n props.style = mergedStyle;\n }\n return {\n props,\n internalRef: internalSlotProps.ref\n };\n}","'use client';\n\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"elementType\", \"externalSlotProps\", \"ownerState\", \"skipResolvingSlotProps\"];\nimport { unstable_useForkRef as useForkRef } from '@mui/utils';\nimport { appendOwnerState } from './appendOwnerState';\nimport { mergeSlotProps } from './mergeSlotProps';\nimport { resolveComponentProps } from './resolveComponentProps';\n/**\n * @ignore - do not document.\n * Builds the props to be passed into the slot of an unstyled component.\n * It merges the internal props of the component with the ones supplied by the user, allowing to customize the behavior.\n * If the slot component is not a host component, it also merges in the `ownerState`.\n *\n * @param parameters.getSlotProps - A function that returns the props to be passed to the slot component.\n */\nexport function useSlotProps(parameters) {\n var _parameters$additiona;\n const {\n elementType,\n externalSlotProps,\n ownerState,\n skipResolvingSlotProps = false\n } = parameters,\n rest = _objectWithoutPropertiesLoose(parameters, _excluded);\n const resolvedComponentsProps = skipResolvingSlotProps ? {} : resolveComponentProps(externalSlotProps, ownerState);\n const {\n props: mergedProps,\n internalRef\n } = mergeSlotProps(_extends({}, rest, {\n externalSlotProps: resolvedComponentsProps\n }));\n const ref = useForkRef(internalRef, resolvedComponentsProps == null ? void 0 : resolvedComponentsProps.ref, (_parameters$additiona = parameters.additionalProps) == null ? void 0 : _parameters$additiona.ref);\n const props = appendOwnerState(elementType, _extends({}, mergedProps, {\n ref\n }), ownerState);\n return props;\n}","'use client';\n\nimport { usePreviousProps } from '@mui/utils';\n/**\n *\n * Demos:\n *\n * - [Badge](https://mui.com/base-ui/react-badge/#hook)\n *\n * API:\n *\n * - [useBadge API](https://mui.com/base-ui/react-badge/hooks-api/#use-badge)\n */\nexport function useBadge(parameters) {\n const {\n badgeContent: badgeContentProp,\n invisible: invisibleProp = false,\n max: maxProp = 99,\n showZero = false\n } = parameters;\n const prevProps = usePreviousProps({\n badgeContent: badgeContentProp,\n max: maxProp\n });\n let invisible = invisibleProp;\n if (invisibleProp === false && badgeContentProp === 0 && !showZero) {\n invisible = true;\n }\n const {\n badgeContent,\n max = maxProp\n } = invisible ? prevProps : parameters;\n const displayValue = badgeContent && Number(badgeContent) > max ? `${max}+` : badgeContent;\n return {\n badgeContent,\n invisible,\n max,\n displayValue\n };\n}","'use client';\n\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { elementAcceptingRef, exactProp, unstable_ownerDocument as ownerDocument, unstable_useForkRef as useForkRef, unstable_useEventCallback as useEventCallback } from '@mui/utils';\n\n// TODO: return `EventHandlerName extends `on${infer EventName}` ? Lowercase : never` once generatePropTypes runs with TS 4.1\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction mapEventPropToEvent(eventProp) {\n return eventProp.substring(2).toLowerCase();\n}\nfunction clickedRootScrollbar(event, doc) {\n return doc.documentElement.clientWidth < event.clientX || doc.documentElement.clientHeight < event.clientY;\n}\n/**\n * Listen for click events that occur somewhere in the document, outside of the element itself.\n * For instance, if you need to hide a menu when people click anywhere else on your page.\n *\n * Demos:\n *\n * - [Click-Away Listener](https://mui.com/base-ui/react-click-away-listener/)\n *\n * API:\n *\n * - [ClickAwayListener API](https://mui.com/base-ui/react-click-away-listener/components-api/#click-away-listener)\n */\nfunction ClickAwayListener(props) {\n const {\n children,\n disableReactTree = false,\n mouseEvent = 'onClick',\n onClickAway,\n touchEvent = 'onTouchEnd'\n } = props;\n const movedRef = React.useRef(false);\n const nodeRef = React.useRef(null);\n const activatedRef = React.useRef(false);\n const syntheticEventRef = React.useRef(false);\n React.useEffect(() => {\n // Ensure that this component is not \"activated\" synchronously.\n // https://github.com/facebook/react/issues/20074\n setTimeout(() => {\n activatedRef.current = true;\n }, 0);\n return () => {\n activatedRef.current = false;\n };\n }, []);\n const handleRef = useForkRef(\n // @ts-expect-error TODO upstream fix\n children.ref, nodeRef);\n\n // The handler doesn't take event.defaultPrevented into account:\n //\n // event.preventDefault() is meant to stop default behaviors like\n // clicking a checkbox to check it, hitting a button to submit a form,\n // and hitting left arrow to move the cursor in a text input etc.\n // Only special HTML elements have these default behaviors.\n const handleClickAway = useEventCallback(event => {\n // Given developers can stop the propagation of the synthetic event,\n // we can only be confident with a positive value.\n const insideReactTree = syntheticEventRef.current;\n syntheticEventRef.current = false;\n const doc = ownerDocument(nodeRef.current);\n\n // 1. IE11 support, which trigger the handleClickAway even after the unbind\n // 2. The child might render null.\n // 3. Behave like a blur listener.\n if (!activatedRef.current || !nodeRef.current || 'clientX' in event && clickedRootScrollbar(event, doc)) {\n return;\n }\n\n // Do not act if user performed touchmove\n if (movedRef.current) {\n movedRef.current = false;\n return;\n }\n let insideDOM;\n\n // If not enough, can use https://github.com/DieterHolvoet/event-propagation-path/blob/master/propagationPath.js\n if (event.composedPath) {\n insideDOM = event.composedPath().indexOf(nodeRef.current) > -1;\n } else {\n insideDOM = !doc.documentElement.contains(\n // @ts-expect-error returns `false` as intended when not dispatched from a Node\n event.target) || nodeRef.current.contains(\n // @ts-expect-error returns `false` as intended when not dispatched from a Node\n event.target);\n }\n if (!insideDOM && (disableReactTree || !insideReactTree)) {\n onClickAway(event);\n }\n });\n\n // Keep track of mouse/touch events that bubbled up through the portal.\n const createHandleSynthetic = handlerName => event => {\n syntheticEventRef.current = true;\n const childrenPropsHandler = children.props[handlerName];\n if (childrenPropsHandler) {\n childrenPropsHandler(event);\n }\n };\n const childrenProps = {\n ref: handleRef\n };\n if (touchEvent !== false) {\n childrenProps[touchEvent] = createHandleSynthetic(touchEvent);\n }\n React.useEffect(() => {\n if (touchEvent !== false) {\n const mappedTouchEvent = mapEventPropToEvent(touchEvent);\n const doc = ownerDocument(nodeRef.current);\n const handleTouchMove = () => {\n movedRef.current = true;\n };\n doc.addEventListener(mappedTouchEvent, handleClickAway);\n doc.addEventListener('touchmove', handleTouchMove);\n return () => {\n doc.removeEventListener(mappedTouchEvent, handleClickAway);\n doc.removeEventListener('touchmove', handleTouchMove);\n };\n }\n return undefined;\n }, [handleClickAway, touchEvent]);\n if (mouseEvent !== false) {\n childrenProps[mouseEvent] = createHandleSynthetic(mouseEvent);\n }\n React.useEffect(() => {\n if (mouseEvent !== false) {\n const mappedMouseEvent = mapEventPropToEvent(mouseEvent);\n const doc = ownerDocument(nodeRef.current);\n doc.addEventListener(mappedMouseEvent, handleClickAway);\n return () => {\n doc.removeEventListener(mappedMouseEvent, handleClickAway);\n };\n }\n return undefined;\n }, [handleClickAway, mouseEvent]);\n return /*#__PURE__*/_jsx(React.Fragment, {\n children: /*#__PURE__*/React.cloneElement(children, childrenProps)\n });\n}\nprocess.env.NODE_ENV !== \"production\" ? ClickAwayListener.propTypes /* remove-proptypes */ = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit TypeScript types and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * The wrapped element.\n */\n children: elementAcceptingRef.isRequired,\n /**\n * If `true`, the React tree is ignored and only the DOM tree is considered.\n * This prop changes how portaled elements are handled.\n * @default false\n */\n disableReactTree: PropTypes.bool,\n /**\n * The mouse event to listen to. You can disable the listener by providing `false`.\n * @default 'onClick'\n */\n mouseEvent: PropTypes.oneOf(['onClick', 'onMouseDown', 'onMouseUp', 'onPointerDown', 'onPointerUp', false]),\n /**\n * Callback fired when a \"click away\" event is detected.\n */\n onClickAway: PropTypes.func.isRequired,\n /**\n * The touch event to listen to. You can disable the listener by providing `false`.\n * @default 'onTouchEnd'\n */\n touchEvent: PropTypes.oneOf(['onTouchEnd', 'onTouchStart', false])\n} : void 0;\nif (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line\n ClickAwayListener['propTypes' + ''] = exactProp(ClickAwayListener.propTypes);\n}\nexport { ClickAwayListener };","'use client';\n\n/* eslint-disable consistent-return, jsx-a11y/no-noninteractive-tabindex */\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { exactProp, elementAcceptingRef, unstable_useForkRef as useForkRef, unstable_ownerDocument as ownerDocument } from '@mui/utils';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\n// Inspired by https://github.com/focus-trap/tabbable\nconst candidatesSelector = ['input', 'select', 'textarea', 'a[href]', 'button', '[tabindex]', 'audio[controls]', 'video[controls]', '[contenteditable]:not([contenteditable=\"false\"])'].join(',');\nfunction getTabIndex(node) {\n const tabindexAttr = parseInt(node.getAttribute('tabindex') || '', 10);\n if (!Number.isNaN(tabindexAttr)) {\n return tabindexAttr;\n }\n\n // Browsers do not return `tabIndex` correctly for contentEditable nodes;\n // https://bugs.chromium.org/p/chromium/issues/detail?id=661108&q=contenteditable%20tabindex&can=2\n // so if they don't have a tabindex attribute specifically set, assume it's 0.\n // in Chrome,
,
\r\n ) : null}\r\n this.props.onCancel()}\r\n style={{ marginLeft: 40 }}\r\n >\r\n {this.props.cancelButtonText}\r\n \r\n \r\n \r\n );\r\n }\r\n}\r\n\r\nexport default ConfirmationDialog;\r\n","import { IRowNode } from \"ag-grid-community\";\r\nimport { observer, Observer } from \"mobx-react\";\r\nimport * as React from \"react\";\r\nimport { DialogChildProps } from \"../../config\";\r\nimport Localization from \"../../core/Localization\";\r\nimport RequestPromise from \"../../core/RequestPromise\";\r\nimport Sys from \"../../core/Sys\";\r\nimport MenuItem from \"../../coreui/MenuItem\";\r\nimport { TableChildProps } from \"../../coreui/Table\";\r\nimport PaneRow from \"../../models/PaneRow\";\r\nimport ActionButtonService, {\r\n OnRoundTripResponse,\r\n} from \"../../services/ActionButtonService\";\r\nimport ErrorsStore from \"../../stores/ErrorsStore\";\r\nimport RequestsStore from \"../../stores/RequestsStore\";\r\nimport { AccessLevel } from \"../AccessLevel\";\r\nimport { ActionButtonProps, ActionButtonRuntimeProps } from \"../ActionButton\";\r\nimport ApiButton from \"../ApiButton\";\r\nimport { CaptchaControl as CaptchaControlBase } from \"../CaptchaControl\";\r\nimport { MenuItemProps } from \"../MenuItem\";\r\nimport ConfirmationDialog from \"./ConfirmationDialog\";\r\n\r\ninterface Props extends ActionButtonProps {}\r\n\r\ninterface State {\r\n isConfirmDialogOpen?: boolean;\r\n}\r\n\r\nexport class CustomActionButton extends React.Component {\r\n private onClickPromise: RequestPromise;\r\n\r\n private static getLabel = (\r\n runtimeProperties: ActionButtonRuntimeProps\r\n ): string => {\r\n const label = !!runtimeProperties.label\r\n ? runtimeProperties.label\r\n : Localization.getBuiltInMessage(\"Button.customActionLabel\");\r\n\r\n return label;\r\n };\r\n\r\n private static onClick(config: {\r\n dataId: string;\r\n iconName?: string;\r\n name: string;\r\n propagated?: DialogChildProps & TableChildProps;\r\n }): RequestPromise {\r\n let selectedRowKeys: string[] | null = null;\r\n if (config.propagated && config.propagated.parentTable) {\r\n selectedRowKeys = [];\r\n\r\n if (config.propagated.parentRowKey) {\r\n selectedRowKeys.push(config.propagated.parentRowKey);\r\n } else {\r\n const gridApi = config.propagated.parentTable.getApi();\r\n\r\n const rows = config.propagated.parentTable.selection.getSelectedRows();\r\n if (rows.length <= 0) {\r\n gridApi.forEachNode((r) => rows.push(r.data!));\r\n for (let i = 0; i < gridApi.getPinnedTopRowCount(); i++) {\r\n const rowNode: IRowNode = gridApi.getPinnedTopRow(i)!;\r\n rows.push(rowNode.data!);\r\n }\r\n }\r\n\r\n for (const selectedRow of rows) {\r\n selectedRowKeys!.push(selectedRow.rowKey);\r\n }\r\n }\r\n }\r\n\r\n const row = PaneRow.get(config.dataId)!;\r\n const widget = row.getWidgetT(config.name);\r\n const labelBeforeReload = CustomActionButton.getLabel(widget.properties);\r\n\r\n return ActionButtonService.onRoundTrip(\r\n row,\r\n config.name,\r\n selectedRowKeys,\r\n config.propagated?.parentDialog?.rowKey\r\n )\r\n .then((response: OnRoundTripResponse) => {\r\n if (\r\n response.businessErrors.length === 0 &&\r\n response.validationErrors.length === 0\r\n ) {\r\n Sys.announce(\r\n Localization.getBuiltInMessage(\"Button.succeeded\", {\r\n label: labelBeforeReload,\r\n })\r\n );\r\n }\r\n\r\n if (response.saved && !response.url) {\r\n ErrorsStore.clearErrors();\r\n RequestsStore.instance.setSaved(config.iconName);\r\n }\r\n\r\n if (widget.properties.validateCaptcha) {\r\n CaptchaControlBase.reset();\r\n }\r\n })\r\n .catch((reason) => {\r\n if (reason) {\r\n throw reason;\r\n }\r\n });\r\n }\r\n\r\n public static renderMenuItem(props: MenuItemProps): JSX.Element {\r\n const { config, runtime, ...otherProps } = props;\r\n const configProps = config as unknown as Props;\r\n const runtimeProps = runtime as ActionButtonRuntimeProps;\r\n\r\n const [isConfirmDialogOpen, setIsConfirmDialogOpen] =\r\n React.useState(false);\r\n\r\n const onClick = () => {\r\n if (runtimeProps.accessLevel >= AccessLevel.actionable) {\r\n if (runtimeProps.confirmMessage) {\r\n setIsConfirmDialogOpen(true);\r\n } else {\r\n CustomActionButton.onClick(configProps);\r\n configProps.propagated.onItemClicked!();\r\n }\r\n }\r\n };\r\n\r\n const onAcceptConfirm = () => {\r\n setIsConfirmDialogOpen(false);\r\n CustomActionButton.onClick(configProps);\r\n configProps.propagated.onItemClicked!();\r\n };\r\n\r\n const onCancelConfirm = () => {\r\n setIsConfirmDialogOpen(false);\r\n };\r\n\r\n return (\r\n \r\n {() => (\r\n \r\n {runtimeProps.confirmMessage ? (\r\n \r\n ) : null}\r\n \r\n {runtimeProps.label}\r\n \r\n \r\n )}\r\n \r\n );\r\n }\r\n\r\n public constructor(props: Props) {\r\n super(props);\r\n\r\n this.state = { isConfirmDialogOpen: false };\r\n }\r\n\r\n private onAcceptConfirm = () => {\r\n this.setState({ isConfirmDialogOpen: false });\r\n CustomActionButton.onClick(this.props);\r\n };\r\n\r\n private onCancelConfirm = () => {\r\n this.setState({ isConfirmDialogOpen: false });\r\n };\r\n\r\n private onClick = () => {\r\n const row = PaneRow.get(this.props.dataId)!;\r\n const widget = row.getWidgetT(\r\n this.props.name\r\n );\r\n\r\n if (widget.properties.confirmMessage) {\r\n this.setState({ isConfirmDialogOpen: true });\r\n } else {\r\n this.onClickPromise = CustomActionButton.onClick(this.props);\r\n }\r\n };\r\n\r\n public componentWillUnmount() {\r\n if (this.onClickPromise) {\r\n this.onClickPromise.abort();\r\n }\r\n }\r\n\r\n public render() {\r\n const row = PaneRow.get(this.props.dataId);\r\n if (!row) {\r\n return null;\r\n }\r\n\r\n const widget = row.getWidgetT(\r\n this.props.name\r\n );\r\n\r\n if (widget.properties.accessLevel === AccessLevel.hidden) {\r\n return null;\r\n }\r\n\r\n return (\r\n \r\n {widget.properties.confirmMessage ? (\r\n \r\n ) : null}\r\n \r\n \r\n );\r\n }\r\n}\r\n\r\nexport default observer(CustomActionButton);\r\n","import { observer, Observer } from \"mobx-react\";\r\nimport * as React from \"react\";\r\nimport Localization from \"../../core/Localization\";\r\nimport RequestPromise from \"../../core/RequestPromise\";\r\nimport Sys from \"../../core/Sys\";\r\nimport MenuItem from \"../../coreui/MenuItem\";\r\nimport PaneRow from \"../../models/PaneRow\";\r\nimport ActionButtonService, {\r\n OnRoundTripResponse,\r\n RoundTripProps,\r\n} from \"../../services/ActionButtonService\";\r\nimport { AccessLevel } from \"../AccessLevel\";\r\nimport { ActionButtonProps, ActionButtonRuntimeProps } from \"../ActionButton\";\r\nimport ApiButton from \"../ApiButton\";\r\nimport { CaptchaControl as CaptchaControlBase } from \"../CaptchaControl\";\r\nimport { MenuItemProps } from \"../MenuItem\";\r\nimport ConfirmationDialog from \"./ConfirmationDialog\";\r\n\r\ninterface Props extends ActionButtonProps {}\r\n\r\ninterface State {\r\n isConfirmDialogOpen?: boolean;\r\n}\r\n\r\nexport class DeletePresentationButton extends React.Component {\r\n private onClickPromise: RequestPromise;\r\n\r\n private static getLabel(runtimeProperties: ActionButtonRuntimeProps): string {\r\n const label = !!runtimeProperties.label\r\n ? runtimeProperties.label\r\n : Localization.getBuiltInMessage(\"Button.deleteLabel\");\r\n\r\n return label;\r\n }\r\n\r\n private static onClick(props: RoundTripProps): RequestPromise {\r\n const row = PaneRow.get(props.dataId)!;\r\n const widget = row.getWidgetT(props.name);\r\n\r\n const onClickPromise = ActionButtonService.onRoundTrip(row, props.name)\r\n .then((response: OnRoundTripResponse) => {\r\n if (\r\n response.businessErrors.length === 0 &&\r\n response.validationErrors.length === 0\r\n ) {\r\n Sys.announce(\r\n Localization.getBuiltInMessage(\"Button.succeeded\", {\r\n label: DeletePresentationButton.getLabel(widget.properties),\r\n })\r\n );\r\n }\r\n\r\n if (widget.properties.validateCaptcha) {\r\n CaptchaControlBase.reset();\r\n }\r\n })\r\n .catch((reason) => {\r\n if (reason) {\r\n throw reason;\r\n }\r\n });\r\n\r\n return onClickPromise;\r\n }\r\n\r\n public static renderMenuItem(props: MenuItemProps): JSX.Element {\r\n const { config, runtime, ...otherProps } = props;\r\n const configProps = config as unknown as Props;\r\n const runtimeProps = runtime as ActionButtonRuntimeProps;\r\n\r\n const [isConfirmDialogOpen, setIsConfirmDialogOpen] =\r\n React.useState(false);\r\n\r\n const onClick = () => {\r\n if (props.runtime.accessLevel >= AccessLevel.actionable) {\r\n if (runtimeProps.confirmMessage) {\r\n setIsConfirmDialogOpen(true);\r\n } else {\r\n DeletePresentationButton.onClick(configProps);\r\n configProps.propagated.onItemClicked!();\r\n }\r\n }\r\n };\r\n\r\n const onAcceptConfirm = () => {\r\n setIsConfirmDialogOpen(false);\r\n DeletePresentationButton.onClick(configProps);\r\n configProps.propagated.onItemClicked!();\r\n };\r\n\r\n const onCancelConfirm = () => {\r\n setIsConfirmDialogOpen(false);\r\n };\r\n\r\n return (\r\n \r\n {() => (\r\n \r\n {runtimeProps.confirmMessage ? (\r\n \r\n ) : null}\r\n \r\n {runtimeProps.label}\r\n \r\n \r\n )}\r\n \r\n );\r\n }\r\n\r\n public constructor(props: Props) {\r\n super(props);\r\n\r\n this.state = { isConfirmDialogOpen: false };\r\n }\r\n\r\n private onAcceptConfirm = () => {\r\n this.setState({ isConfirmDialogOpen: false });\r\n this.onClickPromise = DeletePresentationButton.onClick(this.props);\r\n };\r\n\r\n private onCancelConfirm = () => {\r\n this.setState({ isConfirmDialogOpen: false });\r\n };\r\n\r\n private onClick = () => {\r\n const row = PaneRow.get(this.props.dataId)!;\r\n const widget = row.getWidgetT(\r\n this.props.name\r\n );\r\n\r\n if (widget.properties.confirmMessage) {\r\n this.setState({ isConfirmDialogOpen: true });\r\n } else {\r\n this.onClickPromise = DeletePresentationButton.onClick(this.props);\r\n }\r\n };\r\n\r\n public componentWillUnmount() {\r\n if (this.onClickPromise) {\r\n this.onClickPromise.abort();\r\n }\r\n }\r\n\r\n public render() {\r\n const row = PaneRow.get(this.props.dataId);\r\n\r\n if (!row) {\r\n return;\r\n }\r\n\r\n const widget = row.getWidgetT(\r\n this.props.name\r\n );\r\n\r\n if (widget.properties.accessLevel === AccessLevel.hidden) {\r\n return null;\r\n }\r\n\r\n return (\r\n \r\n {widget.properties.confirmMessage ? (\r\n \r\n ) : null}\r\n \r\n \r\n );\r\n }\r\n}\r\n\r\nexport default observer(DeletePresentationButton);\r\n","import { observer } from \"mobx-react\";\r\nimport * as React from \"react\";\r\nimport Localization from \"../../core/Localization\";\r\nimport Sys from \"../../core/Sys\";\r\nimport TrackableCollection from \"../../core/TrackableCollection\";\r\nimport TrackableModel from \"../../core/TrackableModel\";\r\nimport MenuItem from \"../../coreui/MenuItem\";\r\nimport { TableChildProps } from \"../../coreui/Table\";\r\nimport PaneRow from \"../../models/PaneRow\";\r\nimport { RoundTripProps } from \"../../services/ActionButtonService\";\r\nimport { AccessLevel } from \"../AccessLevel\";\r\nimport { ActionButtonProps, ActionButtonRuntimeProps } from \"../ActionButton\";\r\nimport ApiButton from \"../ApiButton\";\r\nimport { MenuItemProps } from \"../MenuItem\";\r\nimport { SelectChildProps } from \"../SelectControl\";\r\nimport ConfirmationDialog from \"./ConfirmationDialog\";\r\n\r\ninterface Props extends ActionButtonProps {}\r\n\r\ninterface State {\r\n isConfirmDialogOpen?: boolean;\r\n}\r\n\r\nexport class DeleteRowButton extends React.Component {\r\n private static getLabel(runtimeProperties: ActionButtonRuntimeProps): string {\r\n const label = !!runtimeProperties.label\r\n ? runtimeProperties.label\r\n : Localization.getBuiltInMessage(\"DataTable.deleteRowLabel\");\r\n\r\n return label;\r\n }\r\n\r\n private static onClick(\r\n props: RoundTripProps & {\r\n propagated: TableChildProps & SelectChildProps;\r\n }\r\n ): void {\r\n const parentTable = props.propagated.parentTable;\r\n\r\n const row = PaneRow.get(props.dataId)!;\r\n const widget = row.getWidgetT(props.name);\r\n const deleteAnnouncement = Localization.getBuiltInMessage(\r\n \"Button.succeeded\",\r\n {\r\n label: DeleteRowButton.getLabel(widget.properties),\r\n }\r\n );\r\n\r\n if (props.propagated.parentSelect) {\r\n let objectHandles: string[];\r\n if (parentTable.isVerticalLayout) {\r\n objectHandles = [props.propagated.parentRowObjectHandle!];\r\n } else {\r\n objectHandles = parentTable.selection\r\n .getSelectedRows()\r\n .map((r) => r.objectHandle);\r\n }\r\n\r\n parentTable.getTable().focusHeaderToolbar();\r\n props.propagated.parentSelect.onRowsRemoved(objectHandles);\r\n Sys.announce(deleteAnnouncement);\r\n\r\n return;\r\n }\r\n\r\n // Do not need to call focusHeaderToolbar() for grids with columns\r\n // because focus is retained by the toolbar when the toolbars switch.\r\n if (parentTable.isVerticalLayout) {\r\n TrackableCollection.deleteRow(\r\n parentTable.configProps.contentDataId!,\r\n props.propagated.parentRowKey!\r\n );\r\n\r\n parentTable.getTable().focusHeaderToolbar();\r\n } else {\r\n const collection = TrackableModel.models.get(\r\n parentTable.configProps.contentDataId!\r\n ) as TrackableCollection;\r\n\r\n collection.delete(parentTable.selection.getSelectedRows());\r\n }\r\n\r\n Sys.announce(deleteAnnouncement);\r\n parentTable.populateData();\r\n }\r\n\r\n public static renderMenuItem(props: MenuItemProps): JSX.Element {\r\n const { config, runtime, ...otherProps } = props;\r\n const configProps = config as unknown as Props;\r\n const runtimeProps = runtime as ActionButtonRuntimeProps;\r\n\r\n const [isConfirmDialogOpen, setIsConfirmDialogOpen] =\r\n React.useState(false);\r\n\r\n const onClick = () => {\r\n if (props.runtime.accessLevel >= AccessLevel.actionable) {\r\n if (runtimeProps.confirmMessage) {\r\n setIsConfirmDialogOpen(true);\r\n } else {\r\n DeleteRowButton.onClick(configProps);\r\n configProps.propagated.onItemClicked!();\r\n }\r\n }\r\n };\r\n\r\n const onAcceptConfirm = () => {\r\n setIsConfirmDialogOpen(false);\r\n DeleteRowButton.onClick(configProps);\r\n configProps.propagated.onItemClicked!();\r\n };\r\n\r\n const onCancelConfirm = () => {\r\n setIsConfirmDialogOpen(false);\r\n };\r\n\r\n return (\r\n \r\n {runtimeProps.confirmMessage ? (\r\n \r\n ) : null}\r\n \r\n {runtimeProps.label}\r\n \r\n \r\n );\r\n }\r\n\r\n public constructor(props: Props) {\r\n super(props);\r\n\r\n this.state = { isConfirmDialogOpen: false };\r\n }\r\n\r\n private onAcceptConfirm = () => {\r\n this.setState({ isConfirmDialogOpen: false });\r\n DeleteRowButton.onClick(this.props);\r\n };\r\n\r\n private onCancelConfirm = () => {\r\n this.setState({ isConfirmDialogOpen: false });\r\n };\r\n\r\n private onClick = () => {\r\n const row = PaneRow.get(this.props.dataId)!;\r\n const widget = row.getWidgetT(\r\n this.props.name\r\n );\r\n\r\n if (widget.properties.confirmMessage) {\r\n this.setState({ isConfirmDialogOpen: true });\r\n } else {\r\n DeleteRowButton.onClick(this.props);\r\n }\r\n };\r\n\r\n public render() {\r\n const row = PaneRow.get(this.props.dataId);\r\n if (!row) {\r\n return null;\r\n }\r\n\r\n const widget = row.getWidgetT(\r\n this.props.name\r\n );\r\n\r\n if (widget.properties.accessLevel === AccessLevel.hidden) {\r\n return null;\r\n }\r\n\r\n return (\r\n \r\n {widget.properties.confirmMessage ? (\r\n \r\n ) : null}\r\n \r\n \r\n );\r\n }\r\n}\r\n\r\nexport default observer(DeleteRowButton);\r\n","import { observer } from \"mobx-react\";\r\nimport * as React from \"react\";\r\nimport Localization from \"../../core/Localization\";\r\nimport PaneRow from \"../../models/PaneRow\";\r\nimport { AccessLevel } from \"../AccessLevel\";\r\nimport { ActionButtonProps, ActionButtonRuntimeProps } from \"../ActionButton\";\r\nimport ApiButton from \"../ApiButton\";\r\n\r\ninterface Props extends ActionButtonProps {}\r\n\r\nexport class ExecuteSearchButton extends React.Component {\r\n private onClick = (): void => {\r\n this.props.propagated.parentSearch.search();\r\n };\r\n\r\n public render(): React.ReactNode {\r\n const row = PaneRow.get(this.props.dataId);\r\n if (!row) {\r\n return null;\r\n }\r\n\r\n const widget = row.getWidgetT(\r\n this.props.name\r\n );\r\n\r\n if (widget.properties.accessLevel === AccessLevel.hidden) {\r\n return null;\r\n }\r\n\r\n const isIconOnly = !widget.properties.label;\r\n const label = isIconOnly\r\n ? Localization.getBuiltInMessage(\"SearchButton.executeSearchLabel\")\r\n : widget.properties.label;\r\n\r\n return (\r\n \r\n );\r\n }\r\n}\r\n\r\nexport default observer(ExecuteSearchButton);\r\n","export default class AriaHiddenManager {\r\n /**\r\n * Keep aria-hidden set to false until the returned callback is triggered.\r\n * At that time, set it back to the last value the framework intended it to\r\n * be.\r\n */\r\n public static supressAriaHidden(elementToObserve: HTMLElement): () => void {\r\n let lastAriaState: string | null | undefined = null;\r\n\r\n const observer = new MutationObserver(() => {\r\n lastAriaState = elementToObserve.getAttribute(\"aria-hidden\");\r\n\r\n if (lastAriaState === \"true\") {\r\n // Disconnect the observer while aria-hidden is reverted to false\r\n // to prevent the observer from triggering.\r\n observer.disconnect();\r\n elementToObserve.setAttribute(\"aria-hidden\", \"false\");\r\n observer.observe(elementToObserve, {\r\n attributes: true,\r\n });\r\n }\r\n });\r\n\r\n observer.observe(elementToObserve, {\r\n attributes: true,\r\n });\r\n\r\n return (): void => {\r\n observer.disconnect();\r\n if (lastAriaState === \"true\") {\r\n elementToObserve.setAttribute(\"aria-hidden\", \"true\");\r\n }\r\n };\r\n }\r\n}\r\n","import RequestsStore from \"../stores/RequestsStore\";\r\n\r\nexport default class FocusManager {\r\n public static readonly selectors = {\r\n focusable: [\r\n \"a[href]\",\r\n \"button\",\r\n \"details\",\r\n \"input\",\r\n \"select\",\r\n \"textarea\",\r\n '[tabindex]:not([tabindex=\"-1\"])',\r\n ].join(\", \"),\r\n\r\n headings: [\r\n 'h1[tabindex=\"-1\"]',\r\n 'h2[tabindex=\"-1\"]',\r\n 'h3[tabindex=\"-1\"]',\r\n 'h4[tabindex=\"-1\"]',\r\n 'h5[tabindex=\"-1\"]',\r\n 'h6[tabindex=\"-1\"]',\r\n ].join(\", \"),\r\n };\r\n\r\n private static elementIsVisible(element: HTMLElement): boolean {\r\n return !!(\r\n element.offsetWidth ||\r\n element.offsetHeight ||\r\n element.getClientRects().length\r\n );\r\n }\r\n\r\n /**\r\n * Attempts to set focus on the given element. Waits until the requests store\r\n * is no longer processing anything before setting focus so the Processing\r\n * Mask doesn't steal focus from the element. As a safety valve, this method\r\n * will give up and not set focus on the element if more than ~15 seconds\r\n * elapse while waiting on the requests store.\r\n */\r\n public static grabFocus(element: HTMLElement): void {\r\n const numberOfRetries: number = 150;\r\n const renderDelay: number = 100;\r\n const timeBetweenRetries: number = 100;\r\n\r\n function tryGrabFocus(retriesLeft: number): void {\r\n if (retriesLeft <= 0) {\r\n return;\r\n }\r\n\r\n if (RequestsStore.instance.processingInfo.isProcessing) {\r\n setTimeout(() => tryGrabFocus(retriesLeft - 1), timeBetweenRetries);\r\n return;\r\n }\r\n\r\n // Wait just a little bit longer because the ProcessingMask may still be\r\n // up after the RequestsStore instructs it to close because it stays up\r\n // for a minimum amount of time once it's opened to reduce the appearance\r\n // of it flashing into and out of existence.\r\n const waitTime = Math.max(\r\n 500 - timeBetweenRetries * (numberOfRetries - retriesLeft),\r\n 100\r\n );\r\n setTimeout(() => element.focus(), waitTime);\r\n }\r\n\r\n // Give screen readers time to catch up if the focusable element was just\r\n // recently rendered. If focus is set immediately, the screen reader's own\r\n // internal model of the DOM may not be fully set up by the time the screen\r\n // reader announces the focused element. This can lead to incomplete context\r\n // being announced - e.g. the element is announced, but not the dialog or\r\n // form that it is a part of.\r\n setTimeout(() => tryGrabFocus(numberOfRetries), renderDelay);\r\n }\r\n\r\n /**\r\n * Attempts to set focus on the first visible element that is a child of the\r\n * given root element which matches the given query selector. See grabFocus()\r\n * for details on how focus gets set.\r\n */\r\n public static grabFocusForChild(\r\n rootElement: HTMLElement,\r\n selector: string\r\n ): void {\r\n const focusCandidates = Array.from(rootElement.querySelectorAll(selector));\r\n for (const e of focusCandidates) {\r\n const focusCandidate = e as HTMLElement;\r\n if (FocusManager.elementIsVisible(focusCandidate)) {\r\n FocusManager.grabFocus(focusCandidate);\r\n break;\r\n }\r\n }\r\n }\r\n}\r\n","import { Theme } from \"@mui/material\";\r\nimport {\r\n createStyles,\r\n CSSProperties,\r\n makeStyles,\r\n WithStyles,\r\n withStyles,\r\n} from \"@mui/styles\";\r\nimport { observer } from \"mobx-react\";\r\nimport * as React from \"react\";\r\nimport AriaHiddenManager from \"../../core/AriaHiddenManager\";\r\nimport FocusManager from \"../../core/FocusManager\";\r\nimport Localization from \"../../core/Localization\";\r\nimport RequestPromise from \"../../core/RequestPromise\";\r\nimport Sys from \"../../core/Sys\";\r\nimport Button from \"../../coreui/Button\";\r\nimport FocusRipple from \"../../coreui/FocusRipple\";\r\nimport Icon from \"../../coreui/Icon\";\r\nimport MenuItem from \"../../coreui/MenuItem\";\r\nimport { TableChildProps } from \"../../coreui/Table\";\r\nimport PaneRow from \"../../models/PaneRow\";\r\nimport ActionButtonService, {\r\n OnNewRowResponse,\r\n RoundTripProps,\r\n} from \"../../services/ActionButtonService\";\r\nimport { AccessLevel } from \"../AccessLevel\";\r\nimport { ActionButtonProps, ActionButtonRuntimeProps } from \"../ActionButton\";\r\nimport ApiButton from \"../ApiButton\";\r\nimport { MenuItemProps } from \"../MenuItem\";\r\n\r\ninterface Props extends ActionButtonProps {}\r\n\r\nconst styles = (theme: Theme) =>\r\n createStyles({\r\n fabIcon: {\r\n width: \"100%\",\r\n },\r\n input: {\r\n \"&::-webkit-file-upload-button\": {\r\n cursor: \"pointer\",\r\n },\r\n cursor: \"pointer\",\r\n height: \"100%\",\r\n left: 0,\r\n opacity: 0,\r\n position: \"absolute\",\r\n top: 0,\r\n width: \"100%\",\r\n },\r\n });\r\n\r\nconst menuStyles = makeStyles((theme: Theme) => ({\r\n input: {\r\n \"&::-webkit-file-upload-button\": {\r\n cursor: \"pointer\",\r\n },\r\n cursor: \"pointer\",\r\n height: \"100%\",\r\n left: 0,\r\n opacity: 0,\r\n position: \"absolute\",\r\n top: 0,\r\n width: \"100%\",\r\n } as CSSProperties,\r\n}));\r\n\r\ninterface State {\r\n isUploadButtonFocused: boolean;\r\n}\r\n\r\nexport class NewRowButton extends React.Component<\r\n Props & WithStyles,\r\n State\r\n> {\r\n private readonly uploadInputId: string;\r\n private onClickPromise: RequestPromise;\r\n private uploadButtonRef = React.createRef();\r\n\r\n private static getLabel = (\r\n runtimeProperties: ActionButtonRuntimeProps\r\n ): string => {\r\n const label = !!runtimeProperties.label\r\n ? runtimeProperties.label\r\n : Localization.getBuiltInMessage(\"DataTable.newRowLabel\");\r\n\r\n return label;\r\n };\r\n\r\n private static onChange(\r\n propagated: TableChildProps,\r\n input: HTMLInputElement,\r\n restoreFocusElement: HTMLElement | null = null\r\n ) {\r\n if (!input.files || input.files.length <= 0) {\r\n return;\r\n }\r\n\r\n propagated.parentTable.uploadFiles(input.files).then(() => {\r\n input.value = \"\";\r\n // We must explicitly restore focus for mobile screen readers, otherwise\r\n // they lose focus after uploading a document\r\n if (restoreFocusElement) {\r\n FocusManager.grabFocus(restoreFocusElement);\r\n }\r\n });\r\n }\r\n\r\n private static onClick(\r\n config: RoundTripProps & { propagated: TableChildProps }\r\n ): RequestPromise {\r\n if (config.propagated.parentTable.isVerticalLayout) {\r\n config.propagated.parentTable.getApi().paginationGoToFirstPage();\r\n }\r\n\r\n // VoiceOver on iOS bug: the mask that appears when editing in a related\r\n // edit dialog sets aria-hidden to true when it is created. This causes\r\n // VoiceOver on iOS to ignore the creation of the edit row button so that\r\n // when the dialog is dismissed, the button isn't in the accessibility tree.\r\n // Use AriaHiddenManager to prevent this behavior until after the button\r\n // is created.\r\n const endAriaHiddenSuppression = AriaHiddenManager.supressAriaHidden(\r\n document.getElementById(\"root\")!\r\n );\r\n\r\n const row = PaneRow.get(config.dataId)!;\r\n const widget = row.getWidgetT(config.name);\r\n\r\n // FUTURE\r\n // ActionButtonService.onNewRow() handles too much of the response, the\r\n // scope of what it handles should consist only of necessary plumbing to\r\n // handle the web interface. What needs to happen in the browser as a result\r\n // of the new row is more appropriately handled by the caller (this widget).\r\n // This change wasn't made now because it was found during system test.\r\n const newRowPromise = ActionButtonService.onNewRow(\r\n row.rowKey,\r\n config.dataId,\r\n config.name,\r\n config.propagated\r\n ).then((response: OnNewRowResponse) => {\r\n if (!config.propagated.parentTable.hasRelatedEditDialog) {\r\n if (\r\n response.businessErrors.length === 0 &&\r\n response.validationErrors.length === 0\r\n ) {\r\n setTimeout(() => {\r\n Sys.announce(\r\n Localization.getBuiltInMessage(\"Button.succeeded\", {\r\n label: NewRowButton.getLabel(widget.properties),\r\n })\r\n );\r\n }, 2000);\r\n }\r\n\r\n // Give the table a chance to redraw.\r\n setTimeout(() => {\r\n config.propagated.parentTable.getTable().focusNewRow();\r\n endAriaHiddenSuppression();\r\n }, 500);\r\n }\r\n });\r\n\r\n return newRowPromise;\r\n }\r\n\r\n public static renderMenuItem(props: MenuItemProps): JSX.Element {\r\n const { config, runtime, ...otherProps } = props;\r\n const configProps = config as unknown as Props;\r\n const runtimeProps = runtime as ActionButtonRuntimeProps;\r\n\r\n if (props.runtime.accessLevel <= AccessLevel.readOnly) {\r\n return (\r\n \r\n {runtimeProps.label}\r\n \r\n );\r\n }\r\n\r\n if (configProps.uploadOnNew) {\r\n const classes = menuStyles();\r\n\r\n const onChange = (event: React.ChangeEvent) => {\r\n NewRowButton.onChange(configProps.propagated, event.target);\r\n configProps.propagated.onItemClicked!();\r\n };\r\n\r\n const extensions: string | undefined =\r\n configProps.propagated.parentTable.validExtensions\r\n ?.map((extension) => `.${extension}`)\r\n .join(\",\");\r\n\r\n return (\r\n ) => {\r\n if (e.target.nodeName !== \"INPUT\") {\r\n const input: HTMLInputElement = e.target.querySelector(\"input\")!;\r\n input.focus();\r\n }\r\n }}\r\n tabIndex={-1}\r\n {...otherProps}\r\n >\r\n \r\n {runtimeProps.label}\r\n \r\n \r\n \r\n );\r\n }\r\n\r\n return (\r\n {\r\n NewRowButton.onClick(configProps);\r\n configProps.propagated.onItemClicked!();\r\n }}\r\n {...otherProps}\r\n >\r\n {runtimeProps.label}\r\n \r\n );\r\n }\r\n\r\n public constructor(props: Props & WithStyles) {\r\n super(props);\r\n\r\n this.uploadInputId = `upload-new-button-${Sys.nextId}`;\r\n\r\n this.state = {\r\n isUploadButtonFocused: false,\r\n };\r\n }\r\n\r\n private onChange = (event: React.ChangeEvent) => {\r\n NewRowButton.onChange(\r\n this.props.propagated,\r\n event.target,\r\n this.uploadButtonRef.current\r\n );\r\n };\r\n\r\n private onClick = () => {\r\n this.onClickPromise = NewRowButton.onClick(this.props);\r\n };\r\n\r\n public componentWillUnmount() {\r\n if (this.onClickPromise) {\r\n this.onClickPromise.abort();\r\n }\r\n }\r\n\r\n public render(): React.ReactNode {\r\n const row = PaneRow.get(this.props.dataId);\r\n if (!row) {\r\n return null;\r\n }\r\n\r\n const widget = row.getWidgetT(\r\n this.props.name\r\n );\r\n\r\n if (widget.properties.accessLevel === AccessLevel.hidden) {\r\n return null;\r\n }\r\n\r\n if (\r\n this.props.uploadOnNew &&\r\n widget.properties.accessLevel >= AccessLevel.actionable\r\n ) {\r\n const extensions: string | undefined =\r\n this.props.propagated.parentTable.validExtensions\r\n ?.map((extension) => `.${extension}`)\r\n .join(\",\");\r\n\r\n const uploadInput = (\r\n {\r\n this.setState({ isUploadButtonFocused: false });\r\n }}\r\n onChange={this.onChange}\r\n onFocus={() => {\r\n this.setState({ isUploadButtonFocused: true });\r\n }}\r\n title={Localization.getBuiltInMessage(\"chooseFile\")}\r\n type=\"file\"\r\n />\r\n );\r\n\r\n if (widget.properties.label) {\r\n return (\r\n \r\n \r\n {widget.properties.label}\r\n \r\n \r\n {uploadInput}\r\n \r\n );\r\n }\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n {uploadInput}\r\n \r\n );\r\n }\r\n\r\n const isIconOnly = !widget.properties.label;\r\n const label = isIconOnly\r\n ? Localization.getBuiltInMessage(\"DataTable.newRowLabel\")\r\n : widget.properties.label;\r\n\r\n return (\r\n \r\n );\r\n }\r\n}\r\n\r\nexport default withStyles(styles)(observer(NewRowButton));\r\n","import { observer, Observer } from \"mobx-react\";\r\nimport * as React from \"react\";\r\nimport Localization from \"../../core/Localization\";\r\nimport RequestPromise from \"../../core/RequestPromise\";\r\nimport MenuItem from \"../../coreui/MenuItem\";\r\nimport PaneRow from \"../../models/PaneRow\";\r\nimport ActionButtonService, {\r\n OnRoundTripResponse,\r\n} from \"../../services/ActionButtonService\";\r\nimport ErrorsStore from \"../../stores/ErrorsStore\";\r\nimport RequestsStore from \"../../stores/RequestsStore\";\r\nimport { AccessLevel } from \"../AccessLevel\";\r\nimport { ActionButtonProps, ActionButtonRuntimeProps } from \"../ActionButton\";\r\nimport ApiButton from \"../ApiButton\";\r\nimport { CaptchaControl as CaptchaControlBase } from \"../CaptchaControl\";\r\nimport { MenuItemProps } from \"../MenuItem\";\r\n\r\ninterface Props extends ActionButtonProps {}\r\n\r\nexport class SavePresentationButton extends React.Component {\r\n private onClickPromise: RequestPromise;\r\n\r\n private static onClick(props: {\r\n dataId: string;\r\n iconName?: string;\r\n name: string;\r\n }): RequestPromise {\r\n const row: PaneRow = PaneRow.get(props.dataId)!;\r\n\r\n return ActionButtonService.onRoundTrip(row, props.name)\r\n .then((response: OnRoundTripResponse) => {\r\n if (response.saved && !response.url) {\r\n ErrorsStore.clearErrors();\r\n RequestsStore.instance.setSaved(props.iconName);\r\n }\r\n\r\n const responseRow = PaneRow.get(props.dataId)!;\r\n const widget = responseRow.getWidgetT(\r\n props.name\r\n );\r\n if (widget.properties.validateCaptcha) {\r\n CaptchaControlBase.reset();\r\n }\r\n })\r\n .catch((reason) => {\r\n if (reason) {\r\n throw reason;\r\n }\r\n });\r\n }\r\n\r\n public static renderMenuItem(props: MenuItemProps): JSX.Element {\r\n const { config, runtime, ...otherProps } = props;\r\n const configProps = config as unknown as Props;\r\n const runtimeProps = runtime as ActionButtonRuntimeProps;\r\n\r\n const onClick = () => {\r\n if (props.runtime.accessLevel >= AccessLevel.actionable) {\r\n SavePresentationButton.onClick(configProps);\r\n configProps.propagated.onItemClicked!();\r\n }\r\n };\r\n\r\n return (\r\n \r\n {() => (\r\n \r\n {runtimeProps.label}\r\n \r\n )}\r\n \r\n );\r\n }\r\n\r\n private onClick = () => {\r\n this.onClickPromise = SavePresentationButton.onClick(this.props);\r\n };\r\n\r\n public componentWillUnmount() {\r\n if (this.onClickPromise) {\r\n this.onClickPromise.abort();\r\n }\r\n }\r\n\r\n public render() {\r\n const row = PaneRow.get(this.props.dataId);\r\n if (!row) {\r\n return null;\r\n }\r\n\r\n const widget = row.getWidgetT(\r\n this.props.name\r\n );\r\n\r\n if (widget.properties.accessLevel === AccessLevel.hidden) {\r\n return null;\r\n }\r\n\r\n const isIconOnly = !widget.properties.label;\r\n const label = isIconOnly\r\n ? Localization.getBuiltInMessage(\"Button.saveLabel\")\r\n : widget.properties.label;\r\n\r\n return (\r\n \r\n );\r\n }\r\n}\r\n\r\nexport default observer(SavePresentationButton);\r\n","import { observer } from \"mobx-react\";\r\nimport * as React from \"react\";\r\nimport Localization from \"../../core/Localization\";\r\nimport MenuItem from \"../../coreui/MenuItem\";\r\nimport PaneRow from \"../../models/PaneRow\";\r\nimport PaneDataStore from \"../../stores/PaneDataStore\";\r\nimport { AccessLevel } from \"../AccessLevel\";\r\nimport { ActionButtonProps, ActionButtonRuntimeProps } from \"../ActionButton\";\r\nimport ApiButton from \"../ApiButton\";\r\nimport { MenuItemProps } from \"../MenuItem\";\r\nimport { SelectChildProps } from \"../SelectControl\";\r\n\r\ninterface Props extends ActionButtonProps {}\r\n\r\nexport class SelectButton extends React.Component {\r\n private static onClick(propagated: SelectChildProps): void {\r\n propagated.parentSelect!.search(null);\r\n }\r\n\r\n public static renderMenuItem(props: MenuItemProps): JSX.Element {\r\n const { config, runtime, ...otherProps } = props;\r\n const configProps = config as unknown as Props;\r\n const runtimeProps = runtime as ActionButtonRuntimeProps;\r\n\r\n const onClick = (): void => {\r\n if (runtimeProps.accessLevel >= AccessLevel.actionable) {\r\n SelectButton.onClick(configProps.propagated);\r\n configProps.propagated.onItemClicked!();\r\n }\r\n };\r\n\r\n return (\r\n \r\n {runtimeProps.label}\r\n \r\n );\r\n }\r\n\r\n private onClick = (): void => {\r\n SelectButton.onClick(this.props.propagated);\r\n };\r\n\r\n public render(): React.ReactNode {\r\n const row = PaneRow.get(this.props.dataId);\r\n if (!row) {\r\n return null;\r\n }\r\n\r\n const widget = row.getWidgetT(\r\n this.props.name\r\n );\r\n\r\n if (widget.properties.accessLevel === AccessLevel.hidden) {\r\n return null;\r\n }\r\n\r\n const isIconOnly = !widget.properties.label;\r\n const label = isIconOnly\r\n ? Localization.getBuiltInMessage(\"SelectControl.selectButtonLabel\")\r\n : widget.properties.label;\r\n\r\n // Find how many rows are in the select grid and report it out for users\r\n // needing accessible descriptions.\r\n let alternateText: string = \"\";\r\n if (widget.properties.alternateText) {\r\n alternateText = widget.properties.alternateText.endsWith(\".\")\r\n ? `${widget.properties.alternateText} `\r\n : `${widget.properties.alternateText}. `;\r\n }\r\n\r\n const selectGridRows: PaneRow[] = PaneDataStore.getPaneCollection(\r\n this.props.propagated.parentSelect.selectedDataId\r\n );\r\n\r\n if (selectGridRows.length === 1) {\r\n alternateText += Localization.getBuiltInMessage(\r\n \"DataTable.selectCriteriaOneRowInTable\"\r\n );\r\n } else if (selectGridRows.length > 1) {\r\n alternateText += Localization.getBuiltInMessage(\r\n \"DataTable.selectCriteriaMultipleRowsInTable\",\r\n { count: selectGridRows.length }\r\n );\r\n }\r\n\r\n return (\r\n \r\n );\r\n }\r\n}\r\n\r\nexport default observer(SelectButton);\r\n","import { observer } from \"mobx-react\";\r\nimport * as React from \"react\";\r\nimport Localization from \"../../core/Localization\";\r\nimport Routing from \"../../core/Routing\";\r\nimport Sys from \"../../core/Sys\";\r\nimport MenuItem from \"../../coreui/MenuItem\";\r\nimport PaneRow from \"../../models/PaneRow\";\r\nimport { AccessLevel } from \"../AccessLevel\";\r\nimport { ActionButtonProps, ActionButtonRuntimeProps } from \"../ActionButton\";\r\nimport ApiButton from \"../ApiButton\";\r\nimport { MenuItemProps } from \"../MenuItem\";\r\n\r\ninterface Props extends ActionButtonProps {}\r\n\r\nexport class SignInButton extends React.Component {\r\n private static signInError(): void {\r\n Routing.goToErrorPage(\r\n \"Use configured authentication must be enabled for sign in \" +\r\n \"functionality\"\r\n );\r\n }\r\n\r\n public static renderMenuItem(props: MenuItemProps): JSX.Element {\r\n const { config, runtime, ...otherProps } = props;\r\n const configProps = config as unknown as Props;\r\n const runtimeProps = runtime as ActionButtonRuntimeProps;\r\n\r\n let url: string | undefined;\r\n if (Sys.settings.useConfiguredAuthentication) {\r\n url = \"#/signin\";\r\n }\r\n\r\n return (\r\n \r\n {runtimeProps.label}\r\n \r\n );\r\n }\r\n\r\n public render(): React.ReactNode {\r\n const row = PaneRow.get(this.props.dataId);\r\n if (!row) {\r\n return null;\r\n }\r\n\r\n const widget = row.getWidgetT(\r\n this.props.name\r\n );\r\n\r\n if (widget.properties.accessLevel === AccessLevel.hidden) {\r\n return null;\r\n }\r\n\r\n let url: string | undefined;\r\n if (Sys.settings.useConfiguredAuthentication) {\r\n url = \"#/signin\";\r\n }\r\n\r\n const isIconOnly = !widget.properties.label;\r\n const label = isIconOnly\r\n ? Localization.getBuiltInMessage(\"signIn\")\r\n : widget.properties.label;\r\n\r\n return (\r\n \r\n );\r\n }\r\n}\r\n\r\nexport default observer(SignInButton);\r\n","import Localization from \"../core/Localization\";\r\nimport Routing from \"../core/Routing\";\r\nimport Sys from \"../core/Sys\";\r\nimport ErrorsStore, { BusinessError } from \"../stores/ErrorsStore\";\r\nimport SessionMessagesStore, {\r\n SessionMessage,\r\n} from \"../stores/SessionMessagesStore\";\r\nimport BaseService from \"./BaseService\";\r\n\r\nexport interface AccountActivationResponse {\r\n succeeded: boolean;\r\n}\r\n\r\nexport interface CompleteAuthenticationResponse {\r\n businessErrors: BusinessError[];\r\n expirationSeconds?: number;\r\n sessionMessages?: SessionMessage[];\r\n userAccountObjectHandle?: string;\r\n}\r\n\r\nexport interface ExternalAuthenticator {\r\n description: string;\r\n iconName: string;\r\n providerName: string;\r\n url: string;\r\n}\r\n\r\nexport interface NewSessionResponse {\r\n expirationSeconds?: number;\r\n sessionMessages?: SessionMessage[];\r\n userAccountObjectHandle?: string;\r\n}\r\n\r\nexport interface PasswordResetResponse {\r\n succeeded: boolean;\r\n}\r\n\r\nexport interface UserInfoResponse {\r\n sessionMessages: SessionMessage[];\r\n userAccountObjectHandle: string;\r\n}\r\n\r\nexport default class UserService {\r\n public static accountObjectHandle: string;\r\n\r\n public static get isAuthenticated(): boolean {\r\n return !!Sys.getCookie(Sys.sessionTokenCookie);\r\n }\r\n\r\n public static get isGuest(): boolean {\r\n return !!Sys.getCookie(Sys.guestSessionTokenCookie);\r\n }\r\n\r\n public static async checkSession(): Promise {\r\n return new Promise((resolve, reject) => {\r\n BaseService.requestObject(\"User/Session\", null, null, null, \"GET\")\r\n .then((response) => {\r\n if (response && response > 0) {\r\n resolve(response);\r\n } else {\r\n reject(null);\r\n }\r\n })\r\n .catch(() => reject(null));\r\n });\r\n }\r\n\r\n public static async completeAuthentication(\r\n parameters: string | null\r\n ): Promise {\r\n return new Promise((resolve, reject) => {\r\n const providerName = Sys.getCookie(\"authenticatorProviderName\");\r\n\r\n BaseService.requestObject(\r\n `User/CompleteAuthentication/${providerName}`,\r\n null,\r\n null,\r\n {\r\n parameters,\r\n },\r\n \"POST\",\r\n true\r\n )\r\n .then((response: CompleteAuthenticationResponse) => {\r\n if (response.businessErrors.length) {\r\n if (Sys.settings.useConfiguredAuthentication) {\r\n Routing.renderSignIn().then(() => {\r\n Sys.deleteCookie(\"authenticatorProviderName\");\r\n Sys.deleteCookie(\"authenticatorHref\");\r\n setTimeout(() => {\r\n ErrorsStore.setBusinessErrors(response.businessErrors);\r\n }, 200);\r\n });\r\n } else {\r\n Sys.deleteCookie(\"authenticatorProviderName\");\r\n Sys.deleteCookie(\"authenticatorHref\");\r\n Routing.goToErrorPage(response.businessErrors[0].message);\r\n }\r\n } else {\r\n window.location.replace(Sys.getCookie(\"authenticatorHref\")!);\r\n\r\n Sys.deleteCookie(\"authenticatorProviderName\");\r\n Sys.deleteCookie(\"authenticatorHref\");\r\n }\r\n\r\n if (response.userAccountObjectHandle) {\r\n UserService.accountObjectHandle = response.userAccountObjectHandle;\r\n SessionMessagesStore.setMessages(response.sessionMessages!);\r\n }\r\n\r\n resolve(response.expirationSeconds);\r\n })\r\n .catch((response) => {\r\n Sys.deleteCookie(\"authenticatorProviderName\");\r\n Sys.deleteCookie(\"authenticatorHref\");\r\n\r\n reject(null);\r\n });\r\n });\r\n }\r\n\r\n public static async getExternalAuthenticators(): Promise<\r\n ExternalAuthenticator[]\r\n > {\r\n return await BaseService.requestObject(\r\n \"User/GetExternalAuthenticators\",\r\n null,\r\n null,\r\n null,\r\n \"GET\"\r\n );\r\n }\r\n\r\n public static async getUserInfo(): Promise {\r\n return new Promise((resolve, reject) => {\r\n BaseService.requestObject(\r\n \"User/UserInfo\",\r\n null,\r\n null,\r\n null,\r\n \"GET\"\r\n )\r\n .then((response) => {\r\n UserService.accountObjectHandle = response.userAccountObjectHandle;\r\n SessionMessagesStore.setMessages(response.sessionMessages);\r\n resolve();\r\n })\r\n .catch(() => reject());\r\n });\r\n }\r\n\r\n public static logonAsGuest(): Promise {\r\n return new Promise((resolve, reject) => {\r\n BaseService.requestObject(\"User/GuestSession\")\r\n .then((response) => {\r\n if (response.expirationSeconds && response.expirationSeconds > 0) {\r\n if (response.userAccountObjectHandle) {\r\n UserService.accountObjectHandle =\r\n response.userAccountObjectHandle;\r\n SessionMessagesStore.setMessages(response.sessionMessages!);\r\n }\r\n\r\n resolve(response.expirationSeconds);\r\n } else {\r\n reject(null);\r\n }\r\n })\r\n .catch(() => {\r\n reject(null);\r\n });\r\n });\r\n }\r\n\r\n public static async logout(navigate: boolean = true): Promise {\r\n if (navigate) {\r\n Sys.setHash(\"\", false, true);\r\n }\r\n\r\n await BaseService.request(\"User/Session\", undefined, \"DELETE\");\r\n Sys.deleteCookie(Sys.sessionTokenCookie);\r\n\r\n if (Sys.settings.signOutUrl) {\r\n window.location.href = Sys.settings.signOutUrl;\r\n } else {\r\n window.location.reload();\r\n }\r\n }\r\n\r\n public static async validateCredentials(\r\n userName: string,\r\n password: string\r\n ): Promise {\r\n return new Promise((resolve, reject) => {\r\n BaseService.requestObject(\r\n \"User/Session\",\r\n null,\r\n {\r\n password,\r\n userName,\r\n },\r\n null,\r\n \"POST\",\r\n true\r\n )\r\n .then((response: NewSessionResponse) => {\r\n if (response.userAccountObjectHandle) {\r\n UserService.accountObjectHandle = response.userAccountObjectHandle;\r\n SessionMessagesStore.setMessages(response.sessionMessages!);\r\n }\r\n\r\n resolve(null);\r\n })\r\n .catch((response) => {\r\n reject(null);\r\n });\r\n });\r\n }\r\n}\r\n","import { observer } from \"mobx-react\";\r\nimport * as React from \"react\";\r\nimport Localization from \"../../core/Localization\";\r\nimport Routing from \"../../core/Routing\";\r\nimport MenuItem from \"../../coreui/MenuItem\";\r\nimport PaneRow from \"../../models/PaneRow\";\r\nimport UserService from \"../../services/UserService\";\r\nimport { AccessLevel } from \"../AccessLevel\";\r\nimport { ActionButtonProps, ActionButtonRuntimeProps } from \"../ActionButton\";\r\nimport ApiButton from \"../ApiButton\";\r\nimport { MenuItemProps } from \"../MenuItem\";\r\n\r\ninterface Props extends ActionButtonProps {}\r\n\r\nexport class SignOutButton extends React.Component {\r\n private static signOutError(): void {\r\n Routing.goToErrorPage(\"Only signed in users can sign out\");\r\n }\r\n\r\n public static renderMenuItem(props: MenuItemProps): JSX.Element {\r\n const { config, runtime, ...otherProps } = props;\r\n const configProps = config as unknown as Props;\r\n const runtimeProps = runtime as ActionButtonRuntimeProps;\r\n\r\n let url: string | undefined;\r\n if (!UserService.isGuest) {\r\n url = \"#/signout\";\r\n }\r\n\r\n return (\r\n \r\n {runtimeProps.label}\r\n \r\n );\r\n }\r\n\r\n public render(): React.ReactNode {\r\n const row = PaneRow.get(this.props.dataId);\r\n if (!row) {\r\n return null;\r\n }\r\n\r\n const widget = row.getWidgetT(\r\n this.props.name\r\n );\r\n\r\n if (widget.properties.accessLevel === AccessLevel.hidden) {\r\n return null;\r\n }\r\n\r\n let url: string | undefined;\r\n if (!UserService.isGuest) {\r\n url = \"#/signout\";\r\n }\r\n\r\n const isIconOnly = !widget.properties.label;\r\n const label = isIconOnly\r\n ? Localization.getBuiltInMessage(\"signOut\")\r\n : widget.properties.label;\r\n\r\n return (\r\n \r\n );\r\n }\r\n}\r\n\r\nexport default observer(SignOutButton);\r\n","import AppServer, { State as AppServerState } from \"../core/AppServer\";\r\nimport RequestPromise from \"../core/RequestPromise\";\r\nimport PaneRow from \"../models/PaneRow\";\r\nimport { EmbeddedAddOn as EmbeddedAddOnBase } from \"../mustangui/EmbeddedAddOn\";\r\nimport ErrorsStore, { BusinessError } from \"../stores/ErrorsStore\";\r\nimport LayoutStateStore from \"../stores/LayoutStateStore\";\r\nimport PaneDataStore, { PaneDataByDataId } from \"../stores/PaneDataStore\";\r\nimport RequestsStore from \"../stores/RequestsStore\";\r\nimport BaseService, { Response } from \"./BaseService\";\r\n\r\nexport interface RoundTripResponse {\r\n appServerState: AppServerState;\r\n businessErrors: BusinessError[];\r\n layoutId?: string;\r\n newObjectId?: string;\r\n paneDataByDataId: PaneDataByDataId;\r\n url?: string;\r\n validationErrors: string[];\r\n}\r\n\r\nexport default class RoundTripService {\r\n public static partialDataRetrevial(\r\n url: string,\r\n urlParams?: object,\r\n postArgs?: object\r\n ): RequestPromise {\r\n const args = {\r\n jsonData: JSON.stringify({\r\n appServerState: AppServer.getState(),\r\n dataChanges: PaneDataStore.getChanges(),\r\n ...postArgs,\r\n }),\r\n };\r\n\r\n let request: RequestPromise;\r\n\r\n return new RequestPromise(\r\n (resolve, reject) => {\r\n request = BaseService.request(\r\n BaseService.getUrl(url, urlParams),\r\n args,\r\n \"POST\",\r\n false\r\n );\r\n request\r\n .then((response) => resolve(JSON.parse(response.responseText)))\r\n .catch((response) => reject(response));\r\n },\r\n () => {\r\n request.abort();\r\n }\r\n );\r\n }\r\n\r\n public static standardRoundTrip(\r\n url: string,\r\n props: {\r\n dataId?: string;\r\n name?: string;\r\n },\r\n jsonData?: object,\r\n disableMask: boolean = false\r\n ): Promise {\r\n if (!props.dataId || !props.name) {\r\n throw new Error(\"Invalid round trip properties\");\r\n }\r\n\r\n if (!disableMask) {\r\n RequestsStore.instance.processingStarted();\r\n }\r\n\r\n EmbeddedAddOnBase.roundTripStarting();\r\n\r\n const paneRow = PaneRow.get(props.dataId)!;\r\n return BaseService.requestObject(\r\n `${url}/${paneRow.rowKey}/${props.dataId}/${props.name}`,\r\n null,\r\n null,\r\n {\r\n appServerState: AppServer.getState(),\r\n dataChanges: PaneDataStore.getChanges(),\r\n layoutState: LayoutStateStore.getCurrentState(),\r\n ...jsonData,\r\n },\r\n \"POST\"\r\n )\r\n .then((response: RoundTripResponse) => {\r\n if (response.validationErrors.length > 0) {\r\n ErrorsStore.clearErrors();\r\n ErrorsStore.showErrors(response.validationErrors);\r\n EmbeddedAddOnBase.rejectRoundTrip();\r\n\r\n return Promise.reject();\r\n }\r\n\r\n AppServer.setState(response.appServerState);\r\n\r\n if (response.businessErrors.length > 0) {\r\n ErrorsStore.clearBusinessErrors();\r\n }\r\n\r\n PaneDataStore.loadResponse(response.paneDataByDataId);\r\n if (ErrorsStore.setBusinessErrors(response.businessErrors, false)) {\r\n EmbeddedAddOnBase.rejectRoundTrip();\r\n\r\n return response;\r\n }\r\n\r\n EmbeddedAddOnBase.resolveRoundTrip();\r\n\r\n return response;\r\n })\r\n .finally(() => {\r\n if (!disableMask) {\r\n RequestsStore.instance.processingStopped();\r\n }\r\n });\r\n }\r\n}\r\n","import { styled } from \"@mui/material\";\r\nimport * as React from \"react\";\r\nimport Icon from \"./Icon\";\r\n\r\ninterface Props {\r\n message: string;\r\n style?: object;\r\n}\r\n\r\nconst ErrorIcon = styled(Icon)({\r\n display: \"block\",\r\n float: \"left\",\r\n overflow: \"visible\",\r\n});\r\n\r\nconst MessageContainer = styled(\"div\")({\r\n marginLeft: \"1.4em\",\r\n});\r\n\r\nexport const ErrorMessage = (props: Props): JSX.Element => {\r\n return (\r\n
\r\n \r\n {props.message}\r\n
\r\n );\r\n};\r\n","import { styled } from \"@mui/material\";\r\nimport * as React from \"react\";\r\nimport { ErrorMessage } from \"../coreui/ErrorMessage\";\r\nimport Typography from \"../coreui/Typography\";\r\n\r\ninterface Props {\r\n children?: React.ReactNode;\r\n title?: string;\r\n}\r\n\r\ninterface State {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n error: any;\r\n}\r\n\r\nconst Root = styled(\"div\")(({ theme }) => ({\r\n borderColor: theme.palette.error.main,\r\n borderStyle: \"solid\",\r\n borderWidth: 1,\r\n display: \"grid\",\r\n padding: 8,\r\n rowGap: 8,\r\n}));\r\n\r\nexport class ErrorBoundary extends React.PureComponent {\r\n private childrenWithError: React.ReactNode;\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n static getDerivedStateFromError(error: any) {\r\n // Update state so the next render will show the fallback UI.\r\n return { error };\r\n }\r\n\r\n public constructor(props: Props) {\r\n super(props);\r\n this.state = { error: null };\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n public componentDidCatch(error: any, errorInfo: any) {\r\n this.childrenWithError = this.props.children;\r\n }\r\n\r\n public componentDidUpdate() {\r\n if (this.props.children !== this.childrenWithError) {\r\n this.childrenWithError = null;\r\n this.setState({ error: null });\r\n }\r\n }\r\n\r\n public render() {\r\n if (!this.state.error) {\r\n return this.props.children;\r\n }\r\n\r\n let message: string = \"An unexpected error occurred\";\r\n let title: React.ReactNode = null;\r\n\r\n if (process.env.NODE_ENV !== \"production\") {\r\n if (this.props.title) {\r\n title = {this.props.title};\r\n }\r\n\r\n message =\r\n this.state.error instanceof Error\r\n ? this.state.error.message\r\n : this.state.error.toString();\r\n }\r\n\r\n return (\r\n \r\n {title}\r\n \r\n \r\n \r\n \r\n );\r\n }\r\n}\r\n\r\nexport default ErrorBoundary;\r\n","import {\r\n Paper as MuiPaper,\r\n PaperProps as MuiPaperProps,\r\n Theme,\r\n} from \"@mui/material\";\r\nimport { createStyles, WithStyles, withStyles } from \"@mui/styles\";\r\nimport * as React from \"react\";\r\nimport Logging from \"../core/Logging\";\r\nimport WithForwardedRef, {\r\n WithForwardedRefProps,\r\n} from \"../core/WithForwardedRef\";\r\n\r\nexport interface PaperProps extends MuiPaperProps, WithForwardedRefProps {\r\n blended?: boolean;\r\n card?: boolean;\r\n cardDepth?: number;\r\n margin?: boolean;\r\n}\r\n\r\nconst styles = (theme: Theme) =>\r\n createStyles({\r\n blended: {\r\n backgroundColor: \"transparent\",\r\n },\r\n card: {\r\n backgroundColor: theme.palette.grey[100],\r\n },\r\n cardAlternate: {\r\n backgroundColor: theme.palette.common.white,\r\n },\r\n margin: {\r\n [theme.breakpoints.only(\"xs\")]: {\r\n padding: theme.paper.padding.xs,\r\n },\r\n [theme.breakpoints.only(\"sm\")]: {\r\n padding: theme.paper.padding.sm,\r\n },\r\n [theme.breakpoints.only(\"md\")]: {\r\n padding: theme.paper.padding.md,\r\n },\r\n [theme.breakpoints.up(\"lg\")]: {\r\n padding: theme.paper.padding.lg,\r\n },\r\n },\r\n });\r\n\r\nexport class Paper extends React.PureComponent<\r\n PaperProps & WithStyles\r\n> {\r\n public render(): React.ReactNode {\r\n const {\r\n blended,\r\n card,\r\n cardDepth,\r\n children,\r\n classes,\r\n forwardedRef,\r\n margin,\r\n ...paperProps\r\n } = this.props;\r\n\r\n paperProps.className =\r\n `${classes.root} ` +\r\n `${paperProps.className ? paperProps.className : \"\"} `;\r\n\r\n if (blended) {\r\n paperProps.className += `${classes.blended} `;\r\n }\r\n\r\n if (card) {\r\n if (cardDepth === undefined) {\r\n Logging.log(this.props);\r\n throw new Error(`Card depth is required on ${name}`);\r\n }\r\n\r\n if (cardDepth % 2 === 0) {\r\n paperProps.className += `${classes.card} `;\r\n } else {\r\n paperProps.className += `${classes.cardAlternate} `;\r\n }\r\n }\r\n\r\n if (margin) {\r\n paperProps.className += `${classes.margin} `;\r\n } else {\r\n paperProps.elevation = 0;\r\n }\r\n\r\n return (\r\n \r\n {children}\r\n \r\n );\r\n }\r\n}\r\n\r\nexport default withStyles(styles)(WithForwardedRef(Paper));\r\n","import { Theme } from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport * as React from \"react\";\r\nimport FocusManager from \"../core/FocusManager\";\r\nimport Paper from \"../coreui/Paper\";\r\nimport Presentation from \"../coreui/Presentation\";\r\n\r\nexport interface StepProps {\r\n dataId: string;\r\n label: string;\r\n paneUse: object;\r\n paneUseKey: string;\r\n}\r\n\r\nconst useStyles = makeStyles((theme: Theme) => ({\r\n root: {\r\n boxSizing: \"border-box\",\r\n minHeight: 80 + 8 * 2, // Loading animation + padding\r\n position: \"relative\",\r\n },\r\n}));\r\n\r\nexport default function WizardStepPane(props: StepProps): JSX.Element {\r\n const styles = useStyles();\r\n const isPresentationNavigation = React.useRef(true);\r\n const paneRef = React.useRef(null);\r\n\r\n const focusFirstElement = (): void => {\r\n if (paneRef.current === null) {\r\n console.warn(\r\n \"No step pane element exists when attempting to focus the first \" +\r\n \"element in the wizard step.\"\r\n );\r\n } else {\r\n FocusManager.grabFocusForChild(\r\n paneRef.current,\r\n [\r\n FocusManager.selectors.headings,\r\n FocusManager.selectors.focusable,\r\n ].join(\", \")\r\n );\r\n }\r\n };\r\n\r\n React.useEffect(() => {\r\n // Focus must only be set when navigating between wizard steps on the same\r\n // presentation, so as not to interfere with focus being set to the main\r\n // heading when navigating to a new presentation.\r\n if (isPresentationNavigation.current) {\r\n isPresentationNavigation.current = false;\r\n } else {\r\n focusFirstElement();\r\n }\r\n }, [props.paneUseKey]);\r\n\r\n // The key attribute tells React to recreate the component from scratch when\r\n // the selected step changes. Without this, child components are reused and\r\n // constructors are not called.\r\n return (\r\n \r\n
{Presentation.create(props.paneUse)}
\r\n \r\n );\r\n}\r\n","import {\r\n action,\r\n autorun,\r\n IReactionDisposer,\r\n makeObservable,\r\n observable,\r\n transaction,\r\n} from \"mobx\";\r\nimport { observer } from \"mobx-react\";\r\nimport * as React from \"react\";\r\nimport Localization from \"../core/Localization\";\r\nimport RequestPromise from \"../core/RequestPromise\";\r\nimport Sys from \"../core/Sys\";\r\nimport PaneRow from \"../models/PaneRow\";\r\nimport NewObjectService from \"../services/NewObjectService\";\r\nimport RoundTripService, {\r\n RoundTripResponse,\r\n} from \"../services/RoundTripService\";\r\nimport ErrorsStore from \"../stores/ErrorsStore\";\r\nimport LayoutStateStore from \"../stores/LayoutStateStore\";\r\nimport PaneDataStore, {\r\n PaneData,\r\n PaneDataByDataId,\r\n} from \"../stores/PaneDataStore\";\r\nimport RequestsStore from \"../stores/RequestsStore\";\r\nimport { AccessLevel } from \"./AccessLevel\";\r\nimport ErrorBoundary from \"./ErrorBoundary\";\r\nimport WizardStepPane, { StepProps } from \"./WizardStepPane\";\r\n\r\ninterface GetDataResponse {\r\n paneDataByDataId: PaneDataByDataId;\r\n validationErrors: string[];\r\n}\r\n\r\ninterface Props {\r\n dataId: string;\r\n name: string;\r\n steps: StepProps[];\r\n}\r\n\r\ninterface State {\r\n selectedPaneUseKey?: string;\r\n}\r\n\r\nexport interface StepWidgetProperties {\r\n accessLevel: AccessLevel;\r\n paneUseKey: string;\r\n rowKey: string;\r\n stepComplete: boolean;\r\n}\r\n\r\nexport interface WidgetProperties {\r\n accessLevel: AccessLevel;\r\n selectedPaneUseKey: string | null;\r\n steps: StepWidgetProperties[];\r\n}\r\n\r\nexport class WizardControl extends React.PureComponent {\r\n private static widgetProperties: WidgetProperties = observable({\r\n accessLevel: AccessLevel.hidden,\r\n selectedPaneUseKey: null,\r\n steps: [],\r\n });\r\n public static instance: WizardControl | null = null;\r\n private dataId: string = \"\";\r\n private dataMonitorDisposer: IReactionDisposer;\r\n private lastRetrievedPaneDate: Date | undefined;\r\n private name: string = \"\";\r\n private retrieveDataPromises: RequestPromise[] = [];\r\n private steps: StepProps[];\r\n\r\n private static finishNavigate(\r\n response: RoundTripResponse,\r\n scrollToPageTop: boolean\r\n ) {\r\n PaneDataStore.clearAllDataChanges();\r\n\r\n if (WizardControl.isOnLastStep()) {\r\n if (response.newObjectId) {\r\n NewObjectService.navigateToNewObject(\r\n response.newObjectId,\r\n response.layoutId!\r\n );\r\n }\r\n\r\n ErrorsStore.clearErrors();\r\n RequestsStore.instance.setSaved(\"fas fa-save\");\r\n }\r\n\r\n if (scrollToPageTop) {\r\n window.scrollTo(0, 0);\r\n }\r\n }\r\n\r\n public static announceNavigation(previousStepIndex: number) {\r\n const instance = WizardControl.instance;\r\n if (!instance) {\r\n return;\r\n }\r\n\r\n const stepCount = instance.steps.length;\r\n const complete =\r\n WizardControl.widgetProperties?.steps[previousStepIndex].stepComplete;\r\n\r\n const announcement: string = Localization.getBuiltInMessage(\r\n complete ? \"Wizard.stepComplete\" : \"Wizard.stepIncomplete\",\r\n {\r\n count: stepCount,\r\n step: previousStepIndex + 1,\r\n }\r\n );\r\n\r\n Sys.announce(announcement);\r\n }\r\n\r\n public static getStepCount(): number {\r\n let result: number = WizardControl.widgetProperties.steps.length;\r\n\r\n for (const step of WizardControl.widgetProperties.steps) {\r\n if (step.accessLevel === AccessLevel.hidden) {\r\n result--;\r\n }\r\n }\r\n\r\n return result;\r\n }\r\n\r\n public static getStepNumber(step: number): number {\r\n let result: number = step + 1;\r\n\r\n for (let index = 0; index <= step; index++) {\r\n if (\r\n WizardControl.widgetProperties.steps[index].accessLevel ===\r\n AccessLevel.hidden\r\n ) {\r\n result--;\r\n }\r\n }\r\n\r\n return result;\r\n }\r\n\r\n public static getSteps(): StepProps[] | null {\r\n const instance = WizardControl.instance;\r\n if (!instance) {\r\n return null;\r\n }\r\n\r\n return instance.steps;\r\n }\r\n\r\n public static getWidgetProperties(): WidgetProperties {\r\n return WizardControl.widgetProperties;\r\n }\r\n\r\n public static async gotoNextStep(): Promise {\r\n const instance = WizardControl.instance;\r\n if (!instance) {\r\n return;\r\n }\r\n\r\n const previousStepIndex = instance.steps.findIndex(\r\n (s) => s.paneUseKey === instance.state.selectedPaneUseKey\r\n );\r\n RequestsStore.instance.processingStarted(null, false, true);\r\n\r\n try {\r\n const response: RoundTripResponse =\r\n await RoundTripService.standardRoundTrip(\r\n \"WizardControl/OnNavigate\",\r\n { dataId: instance.dataId, name: instance.name },\r\n { navigationDirection: \"next\" },\r\n true\r\n );\r\n\r\n if (\r\n response.businessErrors.length === 0 &&\r\n response.validationErrors.length === 0\r\n ) {\r\n WizardControl.announceNavigation(previousStepIndex);\r\n WizardControl.finishNavigate(response, true);\r\n }\r\n } catch (reason) {\r\n if (reason) {\r\n throw reason;\r\n }\r\n } finally {\r\n RequestsStore.instance.processingStopped();\r\n }\r\n }\r\n\r\n public static async gotoPreviousStep(): Promise {\r\n const instance = WizardControl.instance;\r\n if (!instance) {\r\n return;\r\n }\r\n\r\n const previousStepIndex = instance.steps.findIndex(\r\n (s) => s.paneUseKey === instance.state.selectedPaneUseKey\r\n );\r\n RequestsStore.instance.processingStarted(null, false, true);\r\n\r\n try {\r\n const response: RoundTripResponse =\r\n await RoundTripService.standardRoundTrip(\r\n \"WizardControl/OnNavigate\",\r\n { dataId: instance.dataId, name: instance.name },\r\n { navigationDirection: \"previous\" },\r\n true\r\n );\r\n\r\n if (\r\n response.businessErrors.length === 0 &&\r\n response.validationErrors.length === 0\r\n ) {\r\n WizardControl.announceNavigation(previousStepIndex);\r\n WizardControl.finishNavigate(response, true);\r\n }\r\n } catch (reason) {\r\n if (reason) {\r\n throw reason;\r\n }\r\n } finally {\r\n RequestsStore.instance.processingStopped();\r\n }\r\n }\r\n\r\n public static async gotoStep(navigationPaneUseKey: string): Promise {\r\n const instance = WizardControl.instance;\r\n if (!instance) {\r\n return;\r\n }\r\n\r\n const previousStepIndex = instance.steps.findIndex(\r\n (s) => s.paneUseKey === instance.state.selectedPaneUseKey\r\n );\r\n\r\n try {\r\n const response: RoundTripResponse =\r\n await RoundTripService.standardRoundTrip(\r\n \"WizardControl/OnNavigate\",\r\n { dataId: instance.dataId, name: instance.name },\r\n { navigationPaneUseKey }\r\n );\r\n\r\n if (\r\n response.businessErrors.length === 0 &&\r\n response.validationErrors.length === 0\r\n ) {\r\n WizardControl.announceNavigation(previousStepIndex);\r\n WizardControl.finishNavigate(response, false);\r\n }\r\n } catch (reason) {\r\n if (reason) {\r\n throw reason;\r\n }\r\n }\r\n }\r\n\r\n public static isOnLastStep(): boolean {\r\n const instance = WizardControl.instance;\r\n if (!instance) {\r\n return false;\r\n }\r\n\r\n const index = instance.steps.findIndex(\r\n (s) => s.paneUseKey === instance.state.selectedPaneUseKey\r\n );\r\n\r\n return index === instance.steps.length - 1;\r\n }\r\n\r\n public constructor(props: Props) {\r\n super(props);\r\n\r\n makeObservable(\r\n this,\r\n {\r\n dataId: observable,\r\n name: observable,\r\n syncDerivedWithProps: action,\r\n }\r\n );\r\n\r\n this.state = {\r\n selectedPaneUseKey: undefined,\r\n };\r\n\r\n WizardControl.instance = this;\r\n\r\n this.syncDerivedWithProps();\r\n }\r\n\r\n private dataMonitor = () => {\r\n const parentPane: PaneData = PaneDataStore.instance.getPane(this.dataId)!;\r\n\r\n if (!parentPane.lastRetrieved) {\r\n return;\r\n }\r\n\r\n if (\r\n this.lastRetrievedPaneDate &&\r\n this.lastRetrievedPaneDate >= parentPane.lastRetrieved\r\n ) {\r\n return;\r\n }\r\n\r\n for (const retrievePromise of this.retrieveDataPromises) {\r\n retrievePromise.abort();\r\n }\r\n\r\n const row = PaneRow.get(this.dataId)!;\r\n const widget = row.getWidgetT(this.name)!;\r\n transaction(\r\n action(() => {\r\n // Copy the members accross rather than directly assigning to maintain\r\n // the original observable reference.\r\n WizardControl.widgetProperties.accessLevel =\r\n widget.properties.accessLevel;\r\n WizardControl.widgetProperties.selectedPaneUseKey =\r\n widget.properties.selectedPaneUseKey;\r\n WizardControl.widgetProperties.steps = widget.properties.steps;\r\n })\r\n );\r\n\r\n const paneUseKey: string | null =\r\n WizardControl.widgetProperties.selectedPaneUseKey;\r\n\r\n LayoutStateStore.setSelectedStep(paneUseKey);\r\n\r\n if (paneUseKey) {\r\n const activeStep: StepWidgetProperties | undefined =\r\n WizardControl.widgetProperties.steps.find(\r\n (t) => t.paneUseKey === paneUseKey\r\n );\r\n\r\n if (!activeStep) {\r\n throw new Error(`No step with pane use key of ${paneUseKey} found`);\r\n }\r\n\r\n this.setState({\r\n selectedPaneUseKey: activeStep.paneUseKey,\r\n });\r\n } else {\r\n this.setState({\r\n selectedPaneUseKey: undefined,\r\n });\r\n }\r\n\r\n this.lastRetrievedPaneDate = parentPane.lastRetrieved;\r\n };\r\n\r\n private syncDerivedWithProps(): void {\r\n this.dataId = this.props.dataId;\r\n this.name = this.props.name;\r\n this.steps = this.props.steps;\r\n }\r\n\r\n public componentDidMount(): void {\r\n this.dataMonitorDisposer = autorun(this.dataMonitor);\r\n }\r\n\r\n public componentDidUpdate(): void {\r\n this.syncDerivedWithProps();\r\n }\r\n\r\n public componentWillUnmount(): void {\r\n WizardControl.instance = null;\r\n\r\n for (const retrievePromise of this.retrieveDataPromises) {\r\n retrievePromise.abort();\r\n }\r\n\r\n this.dataMonitorDisposer();\r\n\r\n LayoutStateStore.setSelectedStep(null);\r\n }\r\n\r\n public render(): React.ReactNode {\r\n if (!this.state.selectedPaneUseKey || this.props.steps.length <= 0) {\r\n return null;\r\n }\r\n\r\n if (WizardControl.widgetProperties.accessLevel <= AccessLevel.disabled) {\r\n return null;\r\n }\r\n\r\n const selectedStep: StepProps = this.props.steps.find(\r\n (s) => s.paneUseKey === this.state.selectedPaneUseKey\r\n )!;\r\n\r\n return (\r\n \r\n \r\n \r\n );\r\n }\r\n}\r\n\r\nexport default observer(WizardControl);\r\n","import { Theme, useMediaQuery } from \"@mui/material\";\r\nimport { observer } from \"mobx-react\";\r\nimport * as React from \"react\";\r\nimport MenuItem from \"../../coreui/MenuItem\";\r\nimport PaneRow from \"../../models/PaneRow\";\r\nimport { AccessLevel } from \"../AccessLevel\";\r\nimport { ActionButtonProps, ActionButtonRuntimeProps } from \"../ActionButton\";\r\nimport ApiButton from \"../ApiButton\";\r\nimport { MenuItemProps } from \"../MenuItem\";\r\nimport { WizardControl as WizardControlBase } from \"../WizardControl\";\r\nimport { StepProps } from \"../WizardStepPane\";\r\n\r\ninterface Props extends ActionButtonProps {}\r\n\r\nexport const WizardNextButtonMenuItem = (props: MenuItemProps): JSX.Element => {\r\n const { config, runtime, ...otherProps } = props;\r\n const configProps = config as unknown as Props;\r\n const runtimeProps = runtime as ActionButtonRuntimeProps;\r\n\r\n const onClick = () => {\r\n if (props.runtime.accessLevel >= AccessLevel.actionable) {\r\n WizardControlBase.gotoNextStep();\r\n configProps.propagated.onItemClicked!();\r\n }\r\n };\r\n\r\n return (\r\n \r\n {runtimeProps.label}\r\n \r\n );\r\n};\r\n\r\nexport const WizardNextButton = observer((props: Props): JSX.Element | null => {\r\n const isIconOnly = useMediaQuery((theme: Theme) =>\r\n theme.breakpoints.only(\"xs\")\r\n );\r\n\r\n const row = PaneRow.get(props.dataId);\r\n if (!row) {\r\n return null;\r\n }\r\n\r\n const wizardProperties = WizardControlBase.getWidgetProperties();\r\n const last: number = wizardProperties.steps.length - 1;\r\n const selectedStep: number = wizardProperties.steps.findIndex(\r\n (s) => s.paneUseKey === wizardProperties.selectedPaneUseKey\r\n )!;\r\n\r\n if (selectedStep >= last) {\r\n return null;\r\n }\r\n\r\n const widget = row.getWidgetT(props.name);\r\n\r\n if (widget.properties.accessLevel === AccessLevel.hidden) {\r\n return null;\r\n }\r\n\r\n let label: string = widget.properties.label;\r\n let iconName: string = \"fas fa-arrow-right\";\r\n\r\n const count: number = WizardControlBase.getStepCount();\r\n const step: number = WizardControlBase.getStepNumber(selectedStep);\r\n const steps: StepProps[] | null = WizardControlBase.getSteps();\r\n\r\n if (step === count && steps) {\r\n label = steps[last].label;\r\n iconName = \"fas fa-check\";\r\n }\r\n\r\n return (\r\n WizardControlBase.gotoNextStep()}\r\n size={props.size}\r\n />\r\n );\r\n});\r\n","import { Theme, useMediaQuery } from \"@mui/material\";\r\nimport { observer } from \"mobx-react\";\r\nimport * as React from \"react\";\r\nimport MenuItem from \"../../coreui/MenuItem\";\r\nimport PaneRow from \"../../models/PaneRow\";\r\nimport { AccessLevel } from \"../AccessLevel\";\r\nimport { ActionButtonProps, ActionButtonRuntimeProps } from \"../ActionButton\";\r\nimport ApiButton from \"../ApiButton\";\r\nimport { MenuItemProps } from \"../MenuItem\";\r\nimport { WizardControl as WizardControlBase } from \"../WizardControl\";\r\n\r\ninterface Props extends ActionButtonProps {}\r\n\r\nexport const WizardPreviousButtonMenuItem = (\r\n props: MenuItemProps\r\n): JSX.Element => {\r\n const { config, runtime, ...otherProps } = props;\r\n const configProps = config as unknown as Props;\r\n const runtimeProps = runtime as ActionButtonRuntimeProps;\r\n\r\n const onClick = () => {\r\n if (props.runtime.accessLevel >= AccessLevel.actionable) {\r\n WizardControlBase.gotoPreviousStep();\r\n configProps.propagated.onItemClicked!();\r\n }\r\n };\r\n\r\n return (\r\n \r\n {runtimeProps.label}\r\n \r\n );\r\n};\r\n\r\nexport const WizardPreviousButton = observer(\r\n (props: Props): JSX.Element | null => {\r\n const isIconOnly = useMediaQuery((theme: Theme) =>\r\n theme.breakpoints.only(\"xs\")\r\n );\r\n\r\n const row = PaneRow.get(props.dataId);\r\n if (!row) {\r\n return null;\r\n }\r\n\r\n const widget = row.getWidgetT(props.name);\r\n\r\n if (widget.properties.accessLevel === AccessLevel.hidden) {\r\n return null;\r\n }\r\n\r\n const wizardProperties = WizardControlBase.getWidgetProperties();\r\n const selectedStep: number = wizardProperties.steps.findIndex(\r\n (s) => s.paneUseKey === wizardProperties.selectedPaneUseKey\r\n )!;\r\n const step: number = WizardControlBase.getStepNumber(selectedStep);\r\n\r\n return (\r\n WizardControlBase.gotoPreviousStep()}\r\n size={props.size}\r\n />\r\n );\r\n }\r\n);\r\n","import * as React from \"react\";\r\nimport {\r\n ButtonColor,\r\n ButtonSize,\r\n DialogChildProps,\r\n SearchChildProps,\r\n} from \"../config\";\r\nimport { TableChildProps } from \"../coreui/Table\";\r\nimport { AccessLevel } from \"./AccessLevel\";\r\nimport ClearCriteriaButton from \"./ActionButtons/ClearCriteriaButton\";\r\nimport CustomActionButton, {\r\n CustomActionButton as CustomActionButtonBase,\r\n} from \"./ActionButtons/CustomActionButton\";\r\nimport DeletePresentationButton, {\r\n DeletePresentationButton as DeletePresentationButtonBase,\r\n} from \"./ActionButtons/DeletePresentationButton\";\r\nimport DeleteRowButton, {\r\n DeleteRowButton as DeleteRowButtonBase,\r\n} from \"./ActionButtons/DeleteRowButton\";\r\nimport ExecuteSearchButton from \"./ActionButtons/ExecuteSearchButton\";\r\nimport NewRowButton, {\r\n NewRowButton as NewRowButtonBase,\r\n} from \"./ActionButtons/NewRowButton\";\r\nimport SavePresentationButton, {\r\n SavePresentationButton as SavePresentationButtonBase,\r\n} from \"./ActionButtons/SavePresentationButton\";\r\nimport SelectButton from \"./ActionButtons/SelectButton\";\r\nimport SignInButton, {\r\n SignInButton as SignInButtonBase,\r\n} from \"./ActionButtons/SignInButton\";\r\nimport SignOutButton, {\r\n SignOutButton as SignOutButtonBase,\r\n} from \"./ActionButtons/SignOutButton\";\r\nimport {\r\n WizardNextButton,\r\n WizardNextButtonMenuItem,\r\n} from \"./ActionButtons/WizardNextButton\";\r\nimport {\r\n WizardPreviousButton,\r\n WizardPreviousButtonMenuItem,\r\n} from \"./ActionButtons/WizardPreviousButton\";\r\nimport { MenuChild } from \"./MenuButton\";\r\nimport { MenuItemProps } from \"./MenuItem\";\r\nimport { SelectChildProps } from \"./SelectControl\";\r\nimport { ToolbarChildProps } from \"./Toolbar\";\r\n\r\nexport interface ActionButtonProps {\r\n buttonColor: ButtonColor;\r\n dataId: string;\r\n disabledHelpText: string;\r\n iconName: string;\r\n name: string;\r\n propagated: DialogChildProps &\r\n MenuChild &\r\n SearchChildProps &\r\n SelectChildProps &\r\n TableChildProps &\r\n ToolbarChildProps;\r\n renderAsLink: boolean;\r\n size: ButtonSize;\r\n uploadOnNew?: boolean;\r\n}\r\n\r\nexport type ButtonAction =\r\n | \"Clear Criteria\"\r\n | \"Delete Presentation\"\r\n | \"Delete Row\"\r\n | \"Execute Search\"\r\n | \"New Row\"\r\n | \"Save Presentation\"\r\n | \"Select\"\r\n | \"Sign In\"\r\n | \"Sign Out\"\r\n | \"Wizard Next\"\r\n | \"Wizard Previous\";\r\n\r\nexport interface ActionButtonRuntimeProps {\r\n accessLevel: AccessLevel;\r\n alternateText: string;\r\n cancelButtonText: string | null;\r\n confirmMessage: string | null;\r\n confirmTitle: string | null;\r\n continueButtonText: string | null;\r\n label: string;\r\n showDisabledHelp: boolean;\r\n validateCaptcha: boolean;\r\n}\r\n\r\ninterface Props extends ActionButtonProps {\r\n buttonAction?: ButtonAction;\r\n}\r\n\r\nexport class ActionButton extends React.PureComponent {\r\n public static renderMenuItem(props: MenuItemProps): JSX.Element {\r\n const configProps = props.config as unknown as {\r\n buttonAction: ButtonAction;\r\n };\r\n\r\n if (configProps.buttonAction === null) {\r\n return ;\r\n }\r\n\r\n switch (configProps.buttonAction) {\r\n case \"Delete Presentation\":\r\n return ;\r\n case \"Delete Row\":\r\n return ;\r\n case \"New Row\":\r\n return ;\r\n case \"Save Presentation\":\r\n return ;\r\n case \"Select\":\r\n return ;\r\n case \"Sign In\":\r\n return ;\r\n case \"Sign Out\":\r\n return ;\r\n case \"Wizard Next\":\r\n return ;\r\n case \"Wizard Previous\":\r\n return ;\r\n default:\r\n throw new Error(`Unknown button action ${configProps.buttonAction}`);\r\n }\r\n }\r\n\r\n public render(): React.ReactNode {\r\n const { buttonAction, ...buttonProps } = this.props;\r\n\r\n if (this.props.buttonAction === null) {\r\n return ;\r\n }\r\n\r\n switch (this.props.buttonAction) {\r\n case \"Clear Criteria\":\r\n return ;\r\n case \"Delete Presentation\":\r\n return ;\r\n case \"Delete Row\":\r\n return ;\r\n case \"Execute Search\":\r\n return ;\r\n case \"New Row\":\r\n return ;\r\n case \"Save Presentation\":\r\n return ;\r\n case \"Select\":\r\n return ;\r\n case \"Sign In\":\r\n return ;\r\n case \"Sign Out\":\r\n return ;\r\n case \"Wizard Next\":\r\n return ;\r\n case \"Wizard Previous\":\r\n return ;\r\n default:\r\n throw new Error(`Unknown button action ${this.props.buttonAction}`);\r\n }\r\n }\r\n}\r\n\r\nexport default ActionButton;\r\n","import { styled } from \"@mui/material\";\r\nimport * as React from \"react\";\r\nimport { ErrorMessage } from \"./ErrorMessage\";\r\n\r\ninterface Props {\r\n errors: string[];\r\n}\r\n\r\nconst Container = styled(\"div\")({\r\n display: \"grid\",\r\n rowGap: \"4px\",\r\n});\r\n\r\nexport const ErrorList = (props: Props): JSX.Element => {\r\n return (\r\n \r\n {props.errors.map((error) => (\r\n \r\n ))}\r\n \r\n );\r\n};\r\n","import { FormHelperTextProps, styled, Typography } from \"@mui/material\";\r\nimport * as React from \"react\";\r\nimport { ErrorList } from \"./ErrorList\";\r\n\r\ninterface Props {\r\n getErrors?: (value?: string) => string[];\r\n helperText: React.ReactNode;\r\n value?: string;\r\n}\r\n\r\ninterface Result {\r\n formHelperTextProps: Partial;\r\n errors: string[];\r\n hasErrors: boolean;\r\n helperText: React.ReactNode;\r\n}\r\n\r\nconst ErrorContainer = styled(ErrorList)({\r\n overflow: \"visible\",\r\n whiteSpace: \"normal\",\r\n});\r\n\r\nconst HelperText = styled(Typography)({\r\n overflow: \"hidden\",\r\n textOverflow: \"ellipsis\",\r\n});\r\n\r\nexport default function getFieldHelperText(props: Props): Result {\r\n const result: Result = {\r\n errors: [],\r\n formHelperTextProps: {\r\n // Required so the DOM is still valid when error\r\n // messages are displayed in the helper text.\r\n component: \"div\",\r\n style: {\r\n marginLeft: 16,\r\n marginRight: 0,\r\n },\r\n },\r\n hasErrors: false,\r\n helperText: props.helperText,\r\n };\r\n\r\n if (!props.getErrors) {\r\n return result;\r\n }\r\n\r\n const errors: string[] = props.getErrors(props.value);\r\n if (errors.length === 0) {\r\n return result;\r\n }\r\n\r\n result.hasErrors = true;\r\n result.errors = errors;\r\n\r\n result.helperText = props.helperText ? (\r\n
\r\n {props.helperText}\r\n \r\n
\r\n ) : (\r\n \r\n );\r\n\r\n return result;\r\n}\r\n","import {\r\n ButtonBase,\r\n colors,\r\n FormControl,\r\n InputAdornment,\r\n FilledTextFieldProps as MuiFilledTextFieldProps,\r\n TextField as MuiTextField,\r\n Typography as MuiTypography,\r\n Theme,\r\n} from \"@mui/material\";\r\nimport { createStyles, WithStyles, withStyles } from \"@mui/styles\";\r\nimport { observer } from \"mobx-react\";\r\nimport * as React from \"react\";\r\nimport Sys from \"../core/Sys\";\r\nimport DisabledHelpBadge from \"./DisabledHelpBadge\";\r\nimport getFieldHelperText from \"./FieldHelperText\";\r\nimport Icon from \"./Icon\";\r\nimport multiClassName from \"./MultiClassName\";\r\nimport Typography from \"./Typography\";\r\n\r\nexport interface TextFieldProps extends MuiFilledTextFieldProps {\r\n disabledHelpText?: string;\r\n endAdornment?: React.ReactNode;\r\n getErrors?: (value: string) => string[];\r\n icon?: string;\r\n onBlur?: (event: React.FocusEvent) => void;\r\n onValueChange?: (value: string) => void;\r\n readOnly?: boolean;\r\n readOnlyProps?: {\r\n classes?: {\r\n content?: string;\r\n root?: string;\r\n };\r\n contentRef?: React.Ref | React.RefObject;\r\n };\r\n}\r\n\r\nconst styles = (theme: Theme) =>\r\n createStyles({\r\n disabledButton: {\r\n textAlign: \"left\",\r\n width: \"100%\",\r\n },\r\n inputLabelRoot: {\r\n width: \"calc(100% - 33px)\",\r\n },\r\n inputLabelRootEndAdornment: {\r\n width: \"calc(100% - 67px)\",\r\n },\r\n inputLabelRootIcon: {\r\n width: \"calc(100% - 55px)\",\r\n },\r\n inputLabelRootIconEndAdornment: {\r\n width: \"calc(100% - 89px)\",\r\n },\r\n inputLabelShrink: {\r\n width: \"calc((100% - 33px) * 1.333)\",\r\n },\r\n inputLabelShrinkEndAdornment: {\r\n width: \"calc((100% - 67px) * 1.333)\",\r\n },\r\n inputLabelShrinkIcon: {\r\n width: \"calc((100% - 55px) * 1.333)\",\r\n },\r\n inputLabelShrinkIconEndAdornment: {\r\n width: \"calc((100% - 89px) * 1.333)\",\r\n },\r\n readOnlyContent: {\r\n \"&:focus-visible\": {\r\n outline: \"1px solid\",\r\n outlineColor: theme.palette.grey[800],\r\n outlineOffset: \"2px\",\r\n },\r\n },\r\n readOnlyContentMultiline: {\r\n whiteSpace: \"pre-wrap\",\r\n },\r\n readOnlyLabel: {\r\n color: theme.palette.grey[700],\r\n flexShrink: 0,\r\n marginBottom: 8,\r\n },\r\n readOnlyRoot: {\r\n \"&:hover\": { backgroundColor: \"transparent\" },\r\n backgroundColor: \"transparent\",\r\n },\r\n root: {},\r\n rootWithStartIcon: {\r\n \"& label, & input\": {\r\n marginLeft: 22,\r\n },\r\n },\r\n startIcon: {\r\n color: theme.palette.text.primary,\r\n left: 16,\r\n position: \"absolute\",\r\n },\r\n });\r\n\r\ninterface State {\r\n isDisabledHelpOpen: boolean;\r\n isFocusRippleVisible: boolean;\r\n}\r\n\r\nexport class TextField extends React.Component<\r\n TextFieldProps & WithStyles,\r\n State\r\n> {\r\n private readonly componentId: string;\r\n\r\n public constructor(props: TextFieldProps & WithStyles) {\r\n super(props);\r\n\r\n this.componentId = `text-field-${Sys.nextId}`;\r\n\r\n this.state = { isDisabledHelpOpen: false, isFocusRippleVisible: false };\r\n }\r\n\r\n private onChange = (event: React.ChangeEvent) => {\r\n if (!this.props.onValueChange) {\r\n return;\r\n }\r\n\r\n this.props.onValueChange(event.target.value as string);\r\n };\r\n\r\n private announceErrors(errors: string[]): void {\r\n if (errors.length > 0) {\r\n Sys.announce(errors.join(\"; \"));\r\n }\r\n }\r\n\r\n public render(): React.ReactNode {\r\n const {\r\n classes,\r\n className,\r\n disabled,\r\n disabledHelpText,\r\n endAdornment,\r\n error,\r\n getErrors,\r\n helperText,\r\n icon,\r\n id,\r\n inputProps,\r\n InputProps,\r\n onBlur,\r\n onValueChange,\r\n readOnly,\r\n readOnlyProps: readOnlyPropOverrides,\r\n variant,\r\n ...otherProps\r\n } = this.props;\r\n\r\n const componentId = id !== undefined ? id : this.componentId;\r\n const disabledHelpTextId = `${componentId}-disabled-help-text`;\r\n const labelId = `${this.componentId}-label`;\r\n\r\n if (readOnly) {\r\n const { inputRef, label, multiline, value } = otherProps;\r\n\r\n const readOnlyProps = {\r\n classes: {\r\n content: \"\",\r\n root: \"\",\r\n },\r\n contentRef: undefined,\r\n ...readOnlyPropOverrides,\r\n };\r\n\r\n const readOnlyClassNames: string[] = [\r\n readOnlyProps.classes.root || \"\",\r\n classes.readOnlyRoot,\r\n ];\r\n\r\n return (\r\n \r\n \r\n {label}\r\n \r\n \r\n {(value as string) || \"-\"}\r\n \r\n \r\n );\r\n }\r\n\r\n const classNames: string[] = [className ? className : \"\", classes.root];\r\n\r\n const inputLabelClasses = {\r\n root: classes.inputLabelRoot,\r\n shrink: classes.inputLabelShrink,\r\n };\r\n\r\n if (icon !== undefined && endAdornment === undefined) {\r\n inputLabelClasses.root = classes.inputLabelRootIcon;\r\n inputLabelClasses.shrink = classes.inputLabelShrinkIcon;\r\n } else if (icon === undefined && endAdornment !== undefined) {\r\n inputLabelClasses.root = classes.inputLabelRootEndAdornment;\r\n inputLabelClasses.shrink = classes.inputLabelShrinkEndAdornment;\r\n } else if (icon !== undefined && endAdornment !== undefined) {\r\n inputLabelClasses.root = classes.inputLabelRootIconEndAdornment;\r\n inputLabelClasses.shrink = classes.inputLabelShrinkIconEndAdornment;\r\n }\r\n\r\n if (icon !== undefined) {\r\n classNames.push(classes.rootWithStartIcon);\r\n }\r\n\r\n let adornment: React.ReactNode = null;\r\n\r\n if (icon !== undefined || endAdornment !== undefined) {\r\n // End adornment is used instead of start since when start is set\r\n // the field moves the label above the input\r\n adornment = (\r\n \r\n {icon !== undefined ? (\r\n \r\n ) : null}\r\n {endAdornment}\r\n \r\n );\r\n }\r\n\r\n if (adornment && InputProps?.endAdornment) {\r\n adornment = (\r\n \r\n {InputProps.endAdornment}\r\n {adornment}\r\n \r\n );\r\n\r\n // Creating a local clone of the InputProps causes rendering issues\r\n // so we are manipulating the provided properties.\r\n delete InputProps.endAdornment;\r\n }\r\n\r\n if (disabled) {\r\n if (disabledHelpText === undefined) {\r\n return (\r\n \r\n );\r\n }\r\n\r\n return (\r\n \r\n this.setState({ isDisabledHelpOpen: isHelpOpen })\r\n }\r\n >\r\n \r\n this.setState({\r\n isFocusRippleVisible: false,\r\n })\r\n }\r\n onClick={() =>\r\n this.setState({\r\n isDisabledHelpOpen: !this.state.isDisabledHelpOpen,\r\n })\r\n }\r\n onFocusVisible={() =>\r\n this.setState({\r\n isFocusRippleVisible: true,\r\n })\r\n }\r\n role={undefined} // Override default \"button\" role\r\n tabIndex={0}\r\n >\r\n \r\n \r\n {disabledHelpText}\r\n \r\n \r\n \r\n );\r\n }\r\n\r\n const fieldHelperText = getFieldHelperText({\r\n getErrors,\r\n helperText,\r\n value: otherProps.value as string,\r\n });\r\n\r\n return (\r\n ) => {\r\n if (onBlur) {\r\n onBlur(event);\r\n }\r\n this.announceErrors(fieldHelperText.errors);\r\n }}\r\n onChange={this.onChange}\r\n type=\"text\"\r\n variant=\"filled\"\r\n {...otherProps}\r\n />\r\n );\r\n }\r\n}\r\n\r\nexport default withStyles(styles)(observer(TextField));\r\n","import AppServer, { State as AppServerState } from \"../core/AppServer\";\r\nimport Sys from \"../core/Sys\";\r\nimport { EmbeddedAddOn as EmbeddedAddOnBase } from \"../mustangui/EmbeddedAddOn\";\r\nimport ErrorsStore, { BusinessError } from \"../stores/ErrorsStore\";\r\nimport LayoutStateStore from \"../stores/LayoutStateStore\";\r\nimport PaneDataStore, { PaneDataByDataId } from \"../stores/PaneDataStore\";\r\nimport RequestsStore from \"../stores/RequestsStore\";\r\nimport BaseService from \"./BaseService\";\r\n\r\ninterface AddressCandidate {\r\n attributes: object;\r\n}\r\n\r\nexport interface AddressCandidatesResponse {\r\n candidates: AddressCandidate[];\r\n error?: { code: number };\r\n}\r\n\r\ninterface AddressSuggestions {\r\n isCollection: boolean;\r\n magicKey: string;\r\n text: string;\r\n}\r\n\r\nexport interface AddressSuggestionsResponse {\r\n suggestions: AddressSuggestions[];\r\n error?: { code: number };\r\n}\r\n\r\ninterface GetTokenResponse {\r\n accessToken: string;\r\n}\r\n\r\nexport interface OnSelectResponse {\r\n appServerState: AppServerState;\r\n businessErrors: BusinessError[];\r\n paneDataByDataId: PaneDataByDataId;\r\n validationErrors: string[];\r\n}\r\n\r\nexport default class AddressSearchService {\r\n public static async getCandidates(\r\n url: string,\r\n category: string,\r\n location: number[],\r\n magicKey: string,\r\n searchExtent: number[],\r\n singleLine: string,\r\n sourceCountry: string,\r\n token: string | null\r\n ): Promise {\r\n const queryArgs = {\r\n category,\r\n f: \"json\",\r\n forStorage: true,\r\n location: location.join(\",\"),\r\n magicKey,\r\n maxLocations: 1,\r\n outFields: \"*\",\r\n searchExtent: searchExtent.join(\",\"),\r\n SingleLine: singleLine,\r\n sourceCountry,\r\n token,\r\n };\r\n\r\n return BaseService.requestObject(\r\n `${url}?${Sys.objectToQueryString(queryArgs)}`,\r\n null,\r\n null,\r\n null,\r\n \"POST\"\r\n );\r\n }\r\n\r\n public static async getSuggestions(\r\n url: string,\r\n category: string,\r\n countryCode: string,\r\n location: number[],\r\n searchExtent: number[],\r\n text: string,\r\n token: string | null\r\n ): Promise {\r\n const queryArgs = {\r\n category,\r\n countryCode,\r\n f: \"json\",\r\n location: location.join(\",\"),\r\n maxSuggestions: 8,\r\n searchExtent: searchExtent.join(\",\"),\r\n text,\r\n token,\r\n };\r\n\r\n return BaseService.requestObject(\r\n `${url}?${Sys.objectToQueryString(queryArgs)}`,\r\n {},\r\n {},\r\n {},\r\n \"POST\",\r\n false\r\n );\r\n }\r\n\r\n public static async getToken(\r\n rowKey: string,\r\n dataId: string,\r\n widgetName: string\r\n ): Promise {\r\n return BaseService.requestObject(\r\n `AddressSearch/GetToken/${rowKey}/${dataId}/${widgetName}`,\r\n null,\r\n null,\r\n {\r\n appServerState: AppServer.getState(),\r\n layoutState: LayoutStateStore.getCurrentState(),\r\n },\r\n \"POST\"\r\n ).then((response: GetTokenResponse) => {\r\n return response.accessToken;\r\n });\r\n }\r\n\r\n public static onSelect(\r\n rowKey: string,\r\n dataId: string,\r\n widgetName: string,\r\n selectedAddress: AddressCandidate\r\n ): Promise {\r\n RequestsStore.instance.processingStarted();\r\n EmbeddedAddOnBase.roundTripStarting();\r\n ErrorsStore.clearErrors();\r\n\r\n return BaseService.requestObject(\r\n `AddressSearch/OnSelect/${rowKey}/${dataId}/${widgetName}`,\r\n null,\r\n null,\r\n {\r\n appServerState: AppServer.getState(),\r\n dataChanges: PaneDataStore.getChanges(),\r\n layoutState: LayoutStateStore.getCurrentState(),\r\n selectedAddress: JSON.stringify(selectedAddress.attributes),\r\n },\r\n \"POST\"\r\n )\r\n .then((response: OnSelectResponse) => {\r\n if (response.validationErrors.length > 0) {\r\n ErrorsStore.showErrors(response.validationErrors);\r\n EmbeddedAddOnBase.rejectRoundTrip();\r\n\r\n return;\r\n }\r\n\r\n AppServer.setState(response.appServerState);\r\n PaneDataStore.loadResponse(response.paneDataByDataId);\r\n\r\n if (response.businessErrors.length > 0) {\r\n ErrorsStore.setBusinessErrors(response.businessErrors, true);\r\n EmbeddedAddOnBase.rejectRoundTrip();\r\n\r\n return;\r\n }\r\n\r\n EmbeddedAddOnBase.resolveRoundTrip();\r\n })\r\n .finally(() => {\r\n RequestsStore.instance.processingStopped();\r\n });\r\n }\r\n}\r\n","import { Autocomplete } from \"@mui/material\";\r\nimport { observer } from \"mobx-react\";\r\nimport * as React from \"react\";\r\nimport Localization from \"../core/Localization\";\r\nimport Sys from \"../core/Sys\";\r\nimport Icon from \"../coreui/Icon\";\r\nimport TextField from \"../coreui/TextField\";\r\nimport Typography from \"../coreui/Typography\";\r\nimport PaneRow from \"../models/PaneRow\";\r\nimport AddressSearchService from \"../services/AddressSearchService\";\r\nimport { AccessLevel } from \"./AccessLevel\";\r\n\r\ninterface ConfigurationProperties {\r\n dataId: string;\r\n geocodeApiUrlFindAddressCandidates: string;\r\n geocodeApiUrlSuggest: string;\r\n helperText: string;\r\n label: string;\r\n name: string;\r\n noResultsMessage: string;\r\n propagated?: object;\r\n}\r\n\r\ninterface Option {\r\n isCollection?: boolean;\r\n magicKey: string;\r\n text: string;\r\n}\r\n\r\ninterface State {\r\n didInputChange: boolean;\r\n options: Option[];\r\n value: string;\r\n}\r\n\r\ninterface RuntimeProperties {\r\n accessLevel: AccessLevel;\r\n category: string;\r\n countryCode: string;\r\n location: number[];\r\n searchExtent: number[];\r\n showAsMandatory: boolean;\r\n}\r\n\r\nexport class AddressSearch extends React.PureComponent<\r\n ConfigurationProperties,\r\n State\r\n> {\r\n private accessToken: string | null = null;\r\n\r\n public constructor(props: ConfigurationProperties) {\r\n super(props);\r\n\r\n this.state = { didInputChange: false, options: [], value: \"\" };\r\n }\r\n\r\n private async getCandidate(option: Option): Promise {\r\n const row: PaneRow = PaneRow.get(this.props.dataId)!;\r\n const widget = row.getWidgetT(this.props.name);\r\n\r\n const esriResponse = await AddressSearchService.getCandidates(\r\n this.props.geocodeApiUrlFindAddressCandidates,\r\n widget.properties.category,\r\n widget.properties.location,\r\n option.magicKey,\r\n widget.properties.searchExtent,\r\n option.text,\r\n widget.properties.countryCode,\r\n this.accessToken\r\n );\r\n\r\n if (esriResponse.candidates) {\r\n await AddressSearchService.onSelect(\r\n row.rowKey,\r\n this.props.dataId,\r\n this.props.name,\r\n esriResponse.candidates[0]\r\n );\r\n Sys.announce(\r\n Localization.getBuiltInMessage(\"AddressSearch.succeeded\", {\r\n label: this.props.label,\r\n }),\r\n true\r\n );\r\n } else if (esriResponse.error && esriResponse.error.code === 498) {\r\n await this.getToken();\r\n return this.getCandidate(option);\r\n }\r\n }\r\n\r\n private async getSuggestions(value: string): Promise {\r\n const row: PaneRow = PaneRow.get(this.props.dataId)!;\r\n const widget = row.getWidgetT(this.props.name);\r\n\r\n this.setState({ value });\r\n\r\n try {\r\n const esriResponse = await AddressSearchService.getSuggestions(\r\n this.props.geocodeApiUrlSuggest,\r\n widget.properties.category,\r\n widget.properties.countryCode,\r\n widget.properties.location,\r\n widget.properties.searchExtent,\r\n value,\r\n this.accessToken\r\n );\r\n if (esriResponse.suggestions) {\r\n this.setState({\r\n options: esriResponse.suggestions\r\n .filter((s) => !s.isCollection)\r\n .map((s) => ({\r\n magicKey: s.magicKey,\r\n text: s.text,\r\n })),\r\n });\r\n } else {\r\n this.setState({ options: [] });\r\n if (esriResponse.error && esriResponse.error.code === 498) {\r\n await this.getToken();\r\n return this.getSuggestions(value);\r\n }\r\n }\r\n } catch {\r\n this.setState({ options: [] });\r\n }\r\n }\r\n\r\n private async getToken(): Promise {\r\n const row = PaneRow.get(this.props.dataId)!;\r\n\r\n this.accessToken = await AddressSearchService.getToken(\r\n row.rowKey,\r\n this.props.dataId,\r\n this.props.name\r\n );\r\n }\r\n\r\n private onInputChange = (\r\n event: React.SyntheticEvent,\r\n value: string,\r\n reason: string\r\n ) => {\r\n this.setState({ didInputChange: true });\r\n\r\n if (reason === \"input\") {\r\n this.getSuggestions(value);\r\n } else {\r\n // The input is being set based on a selected value or because focus is\r\n // leaving the field. In either case, the input must be cleared because if\r\n // a value is selected the round trip script will set the data value and\r\n // if a value is not selected but focus is leaving the field, the criteria\r\n // entered in the field should not stick around as it is not \"data\" that\r\n // is saved with the rest of the form.\r\n this.setState({ options: [], value: \"\" });\r\n }\r\n };\r\n\r\n private onValueChange = (\r\n event: React.SyntheticEvent,\r\n option: Option | null\r\n ) => {\r\n this.setState({ didInputChange: false });\r\n\r\n if (option) {\r\n this.getCandidate(option);\r\n }\r\n };\r\n\r\n public render() {\r\n const row: PaneRow = PaneRow.get(this.props.dataId)!;\r\n if (!row) {\r\n return null;\r\n }\r\n\r\n const widget = row.getWidgetT(this.props.name);\r\n\r\n if (widget.properties.accessLevel === AccessLevel.hidden) {\r\n return null;\r\n }\r\n\r\n if (!this.accessToken) {\r\n this.getToken();\r\n }\r\n\r\n return (\r\n options}\r\n forcePopupIcon={false}\r\n getOptionLabel={(option: Option) => option.text}\r\n handleHomeEndKeys={false}\r\n inputValue={this.state.value}\r\n isOptionEqualToValue={(option: Option, value: Option) =>\r\n option.text === value.text\r\n }\r\n noOptionsText={this.props.noResultsMessage}\r\n onChange={this.onValueChange}\r\n onInputChange={this.onInputChange}\r\n options={this.state.options}\r\n renderInput={(params) => (\r\n \r\n )}\r\n renderOption={(props, option: Option) => {\r\n return (\r\n \r\n \r\n {option.text}\r\n \r\n );\r\n }}\r\n />\r\n );\r\n }\r\n}\r\n\r\nexport default observer(AddressSearch);\r\n","import { Autocomplete } from \"@mui/material\";\r\nimport { action, makeObservable, observable } from \"mobx\";\r\nimport { observer } from \"mobx-react\";\r\nimport * as React from \"react\";\r\nimport Icon from \"../coreui/Icon\";\r\nimport TextField from \"../coreui/TextField\";\r\nimport Typography from \"../coreui/Typography\";\r\nimport PaneRow, { RuntimeWidget } from \"../models/PaneRow\";\r\nimport AddressSearchService from \"../services/AddressSearchService\";\r\nimport { AccessLevel } from \"./AccessLevel\";\r\n\r\nexport interface AddressSearchCriteriaValue {\r\n addressValue: object | null;\r\n userValue: string | null;\r\n}\r\n\r\nexport interface Props {\r\n dataId: string;\r\n geocodeApiUrlFindAddressCandidates: string;\r\n geocodeApiUrlSuggest: string;\r\n helperText: string;\r\n label: string;\r\n mandatory: boolean;\r\n name: string;\r\n noResultsMessage: string;\r\n propagated?: object;\r\n}\r\n\r\ninterface Option {\r\n isCollection?: boolean;\r\n magicKey: string;\r\n text: string;\r\n}\r\n\r\ninterface State {\r\n didInputChange: boolean;\r\n options: Option[];\r\n}\r\n\r\nexport interface RuntimeProperties {\r\n accessLevel: AccessLevel;\r\n category: string;\r\n countryCode: string;\r\n location: number[];\r\n searchExtent: number[];\r\n}\r\n\r\nexport class AddressSearchCriteria extends React.PureComponent {\r\n public static readonly widgetTypeId: number = 83;\r\n\r\n private accessToken: string | null = null;\r\n private dataId: string = \"\";\r\n private name: string = \"\";\r\n\r\n public static clear(widgetName: string, row: PaneRow): void {\r\n const widget = row.getWidgetT<\r\n AddressSearchCriteriaValue,\r\n RuntimeProperties\r\n >(widgetName);\r\n\r\n widget.setValue({\r\n addressValue: null,\r\n userValue: null,\r\n });\r\n }\r\n\r\n public static isEntered(widgetName: string, row: PaneRow): boolean {\r\n const widget = row.getWidgetT<\r\n AddressSearchCriteriaValue,\r\n RuntimeProperties\r\n >(widgetName);\r\n\r\n return widget.value.addressValue !== null;\r\n }\r\n\r\n public constructor(props: Props) {\r\n super(props);\r\n\r\n makeObservable<\r\n AddressSearchCriteria,\r\n | \"dataId\"\r\n | \"getSuggestions\"\r\n | \"name\"\r\n | \"onValueChange\"\r\n | \"syncDerivedWithProps\"\r\n >(this, {\r\n dataId: observable,\r\n getSuggestions: action,\r\n name: observable,\r\n onValueChange: action,\r\n syncDerivedWithProps: action,\r\n });\r\n\r\n this.state = { didInputChange: false, options: [] };\r\n\r\n this.syncDerivedWithProps();\r\n }\r\n\r\n private async getCandidate(option: Option): Promise {\r\n const row: PaneRow = PaneRow.get(this.dataId)!;\r\n const widget = row.getWidgetT<\r\n AddressSearchCriteriaValue,\r\n RuntimeProperties\r\n >(this.name);\r\n\r\n const esriResponse = await AddressSearchService.getCandidates(\r\n this.props.geocodeApiUrlFindAddressCandidates,\r\n widget.properties.category,\r\n widget.properties.location,\r\n option.magicKey,\r\n widget.properties.searchExtent,\r\n option.text,\r\n widget.properties.countryCode,\r\n this.accessToken\r\n );\r\n\r\n if (esriResponse.candidates) {\r\n widget.setValue({\r\n addressValue: esriResponse.candidates[0].attributes,\r\n userValue: widget.value.userValue,\r\n });\r\n } else if (esriResponse.error && esriResponse.error.code === 498) {\r\n await this.getToken();\r\n return this.getCandidate(option);\r\n }\r\n }\r\n\r\n private async getSuggestions(userValue: string): Promise {\r\n const row: PaneRow = PaneRow.get(this.props.dataId)!;\r\n const widget = row.getWidgetT<\r\n AddressSearchCriteriaValue,\r\n RuntimeProperties\r\n >(this.name);\r\n\r\n widget.setValue({\r\n addressValue: widget.value.addressValue,\r\n userValue,\r\n });\r\n\r\n try {\r\n const esriResponse = await AddressSearchService.getSuggestions(\r\n this.props.geocodeApiUrlSuggest,\r\n widget.properties.category,\r\n widget.properties.countryCode,\r\n widget.properties.location,\r\n widget.properties.searchExtent,\r\n userValue,\r\n this.accessToken\r\n );\r\n\r\n if (esriResponse.suggestions) {\r\n this.setState({\r\n options: esriResponse.suggestions\r\n .filter((s) => !s.isCollection)\r\n .map((s) => ({\r\n magicKey: s.magicKey,\r\n text: s.text,\r\n })),\r\n });\r\n } else {\r\n this.setState({ options: [] });\r\n if (esriResponse.error && esriResponse.error.code === 498) {\r\n await this.getToken();\r\n return this.getSuggestions(userValue);\r\n }\r\n }\r\n } catch {\r\n this.setState({ options: [] });\r\n }\r\n }\r\n\r\n private async getToken(): Promise {\r\n const row: PaneRow = PaneRow.get(this.dataId)!;\r\n\r\n this.accessToken = await AddressSearchService.getToken(\r\n row.rowKey,\r\n this.dataId,\r\n this.name\r\n );\r\n }\r\n\r\n private onInputChange = (event: React.SyntheticEvent, value: string) => {\r\n this.setState({ didInputChange: true });\r\n this.getSuggestions(value);\r\n };\r\n\r\n private onValueChange = (\r\n event: React.SyntheticEvent,\r\n option: Option | null\r\n ) => {\r\n this.setState({ didInputChange: false });\r\n\r\n if (option) {\r\n this.getCandidate(option);\r\n } else {\r\n const row: PaneRow = PaneRow.get(this.dataId)!;\r\n const widget = row.getWidgetT<\r\n AddressSearchCriteriaValue,\r\n RuntimeProperties\r\n >(this.name);\r\n\r\n widget.setValue({\r\n addressValue: null,\r\n userValue: null,\r\n });\r\n }\r\n };\r\n\r\n private syncDerivedWithProps(): void {\r\n this.dataId = this.props.dataId;\r\n this.name = this.props.name;\r\n }\r\n\r\n public componentDidUpdate(): void {\r\n this.syncDerivedWithProps();\r\n }\r\n\r\n public render() {\r\n const row: PaneRow = PaneRow.get(this.dataId)!;\r\n if (!row) {\r\n return null;\r\n }\r\n\r\n const widget = row.getWidgetT<\r\n AddressSearchCriteriaValue,\r\n RuntimeProperties\r\n >(this.name);\r\n\r\n if (widget.properties.accessLevel === AccessLevel.hidden) {\r\n return null;\r\n }\r\n\r\n if (!this.accessToken) {\r\n this.getToken();\r\n }\r\n\r\n return (\r\n options}\r\n forcePopupIcon={false}\r\n getOptionLabel={(option: Option) => option.text}\r\n handleHomeEndKeys={false}\r\n inputValue={widget.value.userValue || \"\"}\r\n isOptionEqualToValue={(option: Option, optionValue: Option) =>\r\n option.text === optionValue.text\r\n }\r\n noOptionsText={this.props.noResultsMessage}\r\n onChange={this.onValueChange}\r\n onInputChange={this.onInputChange}\r\n options={this.state.options}\r\n renderInput={(params) => (\r\n \r\n )}\r\n renderOption={(props, option: Option) => {\r\n return (\r\n \r\n \r\n {option.text}\r\n \r\n );\r\n }}\r\n />\r\n );\r\n }\r\n}\r\n\r\nexport default observer(AddressSearchCriteria);\r\n","import { Badge, BadgeProps, styled } from \"@mui/material\";\r\nimport * as React from \"react\";\r\n\r\nconst StyledBadge = styled(Badge)(({ theme }) => ({\r\n \"& .MuiBadge-badge\": {\r\n backgroundColor: theme.palette.common.white,\r\n borderColor: theme.palette.info.main,\r\n borderStyle: \"solid\",\r\n borderWidth: 1,\r\n color: theme.palette.info.main,\r\n fontSize: 11,\r\n height: 16,\r\n minWidth: 16,\r\n padding: 0,\r\n width: 16,\r\n },\r\n}));\r\n\r\nexport function ContentsExistBadge(props: BadgeProps): JSX.Element {\r\n const { max, overlap, ...otherProps } = props;\r\n\r\n return (\r\n \r\n );\r\n}\r\n","import {\r\n Collapse as MuiCollapse,\r\n CollapseProps as MuiCollapseProps,\r\n Theme,\r\n} from \"@mui/material\";\r\nimport { createStyles, WithStyles, withStyles } from \"@mui/styles\";\r\nimport * as React from \"react\";\r\nimport * as ReactDOM from \"react-dom\";\r\nimport multiClassName from \"./MultiClassName\";\r\n\r\ninterface Props extends MuiCollapseProps {}\r\n\r\nconst styles = (theme: Theme) =>\r\n createStyles({\r\n container: {\r\n transition: theme.transitions.create([\"height\", \"margin-top\"]),\r\n },\r\n });\r\n\r\nexport class Collapse extends React.PureComponent<\r\n Props & WithStyles\r\n> {\r\n private onCollapse = (node: HTMLElement): void => {\r\n node.style.marginTop = \"0px\";\r\n };\r\n\r\n private onCollapseEnd = (node: HTMLElement): void => {\r\n node.style.display = \"none\";\r\n };\r\n\r\n private onExpand = (node: HTMLElement, isAppearing?: boolean): void => {\r\n node.style.marginTop = \"\";\r\n };\r\n\r\n private onExpandStart = (node: HTMLElement, isAppearing?: boolean): void => {\r\n node.style.display = \"\";\r\n };\r\n\r\n public componentDidMount(): void {\r\n if (this.props.in) {\r\n return;\r\n }\r\n\r\n // Ensure the element is in 'collapsed' state if it starts collapsed.\r\n const node = ReactDOM.findDOMNode(this)! as HTMLElement;\r\n node.style[\"display\"] = \"none\";\r\n node.style[\"marginTop\"] = \"0px\";\r\n }\r\n\r\n public render(): React.ReactNode {\r\n const {\r\n className,\r\n classes,\r\n children,\r\n onEnter: onEnterProp,\r\n onExited: onExitedProp,\r\n ...collapseProps\r\n } = this.props;\r\n\r\n const onEnter = (node: HTMLElement, isAppearing: boolean): void => {\r\n if (onEnterProp) {\r\n onEnterProp(node, isAppearing);\r\n }\r\n\r\n this.onExpandStart(node, isAppearing);\r\n };\r\n\r\n const onExited = (node: HTMLElement): void => {\r\n if (onExitedProp) {\r\n onExitedProp(node);\r\n }\r\n\r\n this.onCollapseEnd(node);\r\n };\r\n\r\n return (\r\n \r\n {children}\r\n \r\n );\r\n }\r\n}\r\n\r\nexport default withStyles(styles)(Collapse);\r\n","!function(e,t){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=t(require(\"react\")):\"function\"==typeof define&&define.amd?define([\"react\"],t):\"object\"==typeof exports?exports.DayPicker=t(require(\"react\")):e.DayPicker=t(e.React)}(\"undefined\"!=typeof self?self:this,function(e){return function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,\"a\",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p=\"\",t(t.s=8)}([function(t,n){t.exports=e},function(e,t,n){\"use strict\";function o(e){return new Date(e.getTime())}function r(e){return e instanceof Date&&!isNaN(e.valueOf())}function a(e,t){var n=o(e);return n.setMonth(e.getMonth()+t),n}function s(e,t){return!(!e||!t)&&(e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear())}function i(e,t){return!(!e||!t)&&(e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear())}function u(e,t){return o(e).setHours(0,0,0,0)o(t).setHours(0,0,0,0)}function c(e){var t=new Date;return t.setHours(0,0,0,0),u(e,t)}function p(e){var t=new Date((new Date).getTime()+864e5);return t.setHours(0,0,0,0),e>=t}function f(e,t,n){var r=o(e);return r.setHours(0,0,0,0),l(r,t)&&u(r,n)||l(r,n)&&u(r,t)}function h(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{from:null,to:null},n=t.from,o=t.to;return n?n&&o&&s(n,o)&&s(e,n)?(n=null,o=null):o&&u(e,n)?n=e:o&&s(e,o)?(n=e,o=e):(o=e,u(o,n)&&(o=n,n=e)):n=e,{from:n,to:o}}function d(e,t){var n=t.from,o=t.to;return n&&s(e,n)||o&&s(e,o)||n&&o&&f(e,n,o)}function y(e){var t=o(e);return t.setHours(0,0,0),t.setDate(t.getDate()+4-(t.getDay()||7)),Math.ceil(((t-new Date(t.getFullYear(),0,1))/864e5+1)/7)}Object.defineProperty(t,\"__esModule\",{value:!0}),t.clone=o,t.isDate=r,t.addMonths=a,t.isSameDay=s,t.isSameMonth=i,t.isDayBefore=u,t.isDayAfter=l,t.isPastDay=c,t.isFutureDay=p,t.isDayBetween=f,t.addDayToRange=h,t.isDayInRange=d,t.getWeekNumber=y,t.default={addDayToRange:h,addMonths:a,clone:o,getWeekNumber:y,isDate:r,isDayAfter:l,isDayBefore:u,isDayBetween:f,isDayInRange:d,isFutureDay:p,isPastDay:c,isSameDay:s,isSameMonth:i}},function(e,t,n){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});t.LEFT=37,t.UP=38,t.RIGHT=39,t.DOWN=40,t.ENTER=13,t.SPACE=32,t.ESC=27,t.TAB=9},function(e,t,n){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.default={container:\"DayPicker\",wrapper:\"DayPicker-wrapper\",interactionDisabled:\"DayPicker--interactionDisabled\",months:\"DayPicker-Months\",month:\"DayPicker-Month\",navBar:\"DayPicker-NavBar\",navButtonPrev:\"DayPicker-NavButton DayPicker-NavButton--prev\",navButtonNext:\"DayPicker-NavButton DayPicker-NavButton--next\",navButtonInteractionDisabled:\"DayPicker-NavButton--interactionDisabled\",caption:\"DayPicker-Caption\",weekdays:\"DayPicker-Weekdays\",weekdaysRow:\"DayPicker-WeekdaysRow\",weekday:\"DayPicker-Weekday\",body:\"DayPicker-Body\",week:\"DayPicker-Week\",weekNumber:\"DayPicker-WeekNumber\",day:\"DayPicker-Day\",footer:\"DayPicker-Footer\",todayButton:\"DayPicker-TodayButton\",today:\"today\",selected:\"selected\",disabled:\"disabled\",outside:\"outside\"}},function(e,t,n){\"use strict\";function o(e){e.preventDefault(),e.stopPropagation()}function r(e){return new Date(e.getFullYear(),e.getMonth(),1,12)}function a(e){var t=r(e);return t.setMonth(t.getMonth()+1),t.setDate(t.getDate()-1),t.getDate()}function s(e){var t=y({},e.modifiers);return e.selectedDays&&(t[e.classNames.selected]=e.selectedDays),e.disabledDays&&(t[e.classNames.disabled]=e.disabledDays),t}function i(e){var t=e.firstDayOfWeek,n=e.locale,o=void 0===n?\"en\":n,r=e.localeUtils,a=void 0===r?{}:r;return isNaN(t)?a.getFirstDayOfWeek?a.getFirstDayOfWeek(o):0:t}function u(e){return!!(e&&e.from&&e.to)}function l(e,t){return t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear())}function c(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,m.getFirstDayOfWeek)(),n=arguments[2],o=a(e),r=[],s=[],i=[],u=1;u<=o;u+=1)r.push(new Date(e.getFullYear(),e.getMonth(),u,12));r.forEach(function(e){s.length>0&&e.getDay()===t&&(i.push(s),s=[]),s.push(e),r.indexOf(e)===r.length-1&&i.push(s)});for(var l=i[0],c=7-l.length;c>0;c-=1){var p=(0,v.clone)(l[0]);p.setDate(l[0].getDate()-1),l.unshift(p)}for(var f=i[i.length-1],h=f.length;h<7;h+=1){var d=(0,v.clone)(f[f.length-1]);d.setDate(f[f.length-1].getDate()+1),f.push(d)}if(n&&i.length<6)for(var y=void 0,k=i.length;k<6;k+=1){y=i[i.length-1];for(var D=y[y.length-1],b=[],g=0;g<7;g+=1){var w=(0,v.clone)(D);w.setDate(D.getDate()+g+1),b.push(w)}i.push(b)}return i}function p(e){var t=(0,v.clone)(e);return t.setDate(1),t.setHours(12,0,0,0),t}function f(e,t){var n=void 0;n=t===D.default?t.day+\"--\"+t.outside:\"\"+t.outside;var o=t.day.replace(/ /g,\".\"),r=n.replace(/ /g,\".\"),a=\".\"+o+\":not(.\"+r+\")\";return e.querySelectorAll(a)}function h(e){return Array.prototype.slice.call(e,0)}function d(e,t){return Object.prototype.hasOwnProperty.call(e,t)}Object.defineProperty(t,\"__esModule\",{value:!0});var y=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(t).reduce(function(n,r){var a=t[r];return o(e,a)&&n.push(r),n},[])}Object.defineProperty(t,\"__esModule\",{value:!0}),t.dayMatchesModifier=o,t.getModifiersForDay=r;var a=n(1),s=n(4);t.default={dayMatchesModifier:o,getModifiersForDay:r}},function(e,t,n){\"use strict\";function o(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){var n={};for(var o in e)t.indexOf(o)>=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}function s(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}function i(e,t){if(!e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!t||\"object\"!=typeof t&&\"function\"!=typeof t?e:t}function u(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,\"__esModule\",{value:!0}),t.ModifiersUtils=t.LocaleUtils=t.DateUtils=t.DayPicker=void 0;var l=Object.assign||function(e){for(var t=1;t1&&e.fromMonth){var o=w.startOfMonth(e.fromMonth),r=w.getMonthsDiff(o,n);n=P.addMonths(o,Math.floor(r/e.numberOfMonths)*e.numberOfMonths)}else e.toMonth&&e.numberOfMonths>1&&w.getMonthsDiff(n,e.toMonth)<=0&&(n=P.addMonths(w.startOfMonth(e.toMonth),1-this.props.numberOfMonths));return n}},{key:\"getNextNavigableMonth\",value:function(){return P.addMonths(this.state.currentMonth,this.props.numberOfMonths)}},{key:\"getPreviousNavigableMonth\",value:function(){return P.addMonths(this.state.currentMonth,-1)}},{key:\"allowPreviousMonth\",value:function(){var e=P.addMonths(this.state.currentMonth,-1);return this.allowMonth(e)}},{key:\"allowNextMonth\",value:function(){var e=P.addMonths(this.state.currentMonth,this.props.numberOfMonths);return this.allowMonth(e)}},{key:\"allowMonth\",value:function(e){var t=this.props,n=t.fromMonth,o=t.toMonth;return!(!t.canChangeMonth||n&&w.getMonthsDiff(n,e)<0||o&&w.getMonthsDiff(o,e)>0)}},{key:\"allowYearChange\",value:function(){return this.props.canChangeMonth}},{key:\"showMonth\",value:function(e,t){var n=this;this.allowMonth(e)&&this.setState({currentMonth:w.startOfMonth(e)},function(){t&&t(),n.props.onMonthChange&&n.props.onMonthChange(n.state.currentMonth)})}},{key:\"showNextYear\",value:function(){if(this.allowYearChange()){var e=P.addMonths(this.state.currentMonth,12);this.showMonth(e)}}},{key:\"showPreviousYear\",value:function(){if(this.allowYearChange()){var e=P.addMonths(this.state.currentMonth,-12);this.showMonth(e)}}},{key:\"focus\",value:function(){this.wrapper.focus()}},{key:\"focusFirstDayOfMonth\",value:function(){w.getDayNodes(this.dayPicker,this.props.classNames)[0].focus()}},{key:\"focusLastDayOfMonth\",value:function(){var e=w.getDayNodes(this.dayPicker,this.props.classNames);e[e.length-1].focus()}},{key:\"focusPreviousDay\",value:function(e){var t=this,n=w.getDayNodes(this.dayPicker,this.props.classNames),o=w.nodeListToArray(n).indexOf(e);-1!==o&&(0===o?this.showPreviousMonth(function(){return t.focusLastDayOfMonth()}):n[o-1].focus())}},{key:\"focusNextDay\",value:function(e){var t=this,n=w.getDayNodes(this.dayPicker,this.props.classNames),o=w.nodeListToArray(n).indexOf(e);-1!==o&&(o===n.length-1?this.showNextMonth(function(){return t.focusFirstDayOfMonth()}):n[o+1].focus())}},{key:\"focusNextWeek\",value:function(e){var t=this,n=w.getDayNodes(this.dayPicker,this.props.classNames),o=w.nodeListToArray(n).indexOf(e);o>n.length-8?this.showNextMonth(function(){var e=n.length-o,r=7-e;w.getDayNodes(t.dayPicker,t.props.classNames)[r].focus()}):n[o+7].focus()}},{key:\"focusPreviousWeek\",value:function(e){var t=this,n=w.getDayNodes(this.dayPicker,this.props.classNames),o=w.nodeListToArray(n).indexOf(e);o<=6?this.showPreviousMonth(function(){var e=w.getDayNodes(t.dayPicker,t.props.classNames);e[e.length-7+o].focus()}):n[o-7].focus()}},{key:\"handleOutsideDayClick\",value:function(e){var t=this.state.currentMonth,n=this.props.numberOfMonths,o=w.getMonthsDiff(t,e);o>0&&o>=n?this.showNextMonth():o<0&&this.showPreviousMonth()}},{key:\"renderNavbar\",value:function(){var e=this.props,t=e.labels,n=e.locale,o=e.localeUtils,r=e.canChangeMonth,s=e.navbarElement,i=a(e,[\"labels\",\"locale\",\"localeUtils\",\"canChangeMonth\",\"navbarElement\"]);if(!r)return null;var u={month:this.state.currentMonth,classNames:this.props.classNames,className:this.props.classNames.navBar,nextMonth:this.getNextNavigableMonth(),previousMonth:this.getPreviousNavigableMonth(),showPreviousButton:this.allowPreviousMonth(),showNextButton:this.allowNextMonth(),onNextClick:this.showNextMonth,onPreviousClick:this.showPreviousMonth,dir:i.dir,labels:t,locale:n,localeUtils:o};return f.default.isValidElement(s)?f.default.cloneElement(s,u):f.default.createElement(s,u)}},{key:\"renderMonths\",value:function(){for(var e=[],t=w.getFirstDayOfWeekFromProps(this.props),n=0;n-1,ariaSelected:r.indexOf(o.props.classNames.selected)>-1,onClick:o.props.onDayClick,onFocus:o.props.onDayFocus,onKeyDown:o.props.onDayKeyDown,onMouseEnter:o.props.onDayMouseEnter,onMouseLeave:o.props.onDayMouseLeave,onMouseDown:o.props.onDayMouseDown,onMouseUp:o.props.onDayMouseUp,onTouchEnd:o.props.onDayTouchEnd,onTouchStart:o.props.onDayTouchStart},o.props.renderDay(e,u))},r=n,s(o,r)}return i(t,e),u(t,[{key:\"render\",value:function(){var e=this,t=this.props,n=t.classNames,o=t.month,r=t.months,a=t.fixedWeeks,s=t.captionElement,i=t.weekdayElement,u=t.locale,l=t.localeUtils,p=t.weekdaysLong,h=t.weekdaysShort,d=t.firstDayOfWeek,v=t.onCaptionClick,m=t.showWeekNumbers,k=t.showWeekDays,b=t.onWeekClick,w={date:o,classNames:n,months:r,localeUtils:l,locale:u,onClick:v?function(e){return v(o,e)}:void 0},M=c.default.isValidElement(s)?c.default.cloneElement(s,w):c.default.createElement(s,w),P=D.getWeekArray(o,d,a);return c.default.createElement(\"div\",{className:n.month,role:\"grid\"},M,k&&c.default.createElement(f.default,{classNames:n,weekdaysShort:h,weekdaysLong:p,firstDayOfWeek:d,showWeekNumbers:m,locale:u,localeUtils:l,weekdayElement:i}),c.default.createElement(\"div\",{className:n.body,role:\"rowgroup\"},P.map(function(t){var r=void 0;return m&&(r=g.getWeekNumber(t[6])),c.default.createElement(\"div\",{key:t[0].getTime(),className:n.week,role:\"row\"},m&&c.default.createElement(\"div\",{className:n.weekNumber,tabIndex:b?0:-1,role:\"gridcell\",onClick:b?function(e){return b(r,t,e)}:void 0,onKeyUp:b?function(e){return e.keyCode===y.ENTER&&b(r,t,e)}:void 0},e.props.renderWeek(r,t,o)),t.map(e.renderDay))})))}}]),t}(l.Component);t.default=w},function(e,t,n){\"use strict\";function o(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}function r(e,t){if(!e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return!t||\"object\"!=typeof t&&\"function\"!=typeof t?e:t}function a(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Super expression must either be null or a function, not \"+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,\"__esModule\",{value:!0});var s=function(){function e(e,t){for(var n=0;n=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}function l(e){var t=(e.input,e.selectedDay,e.month,e.children),n=e.classNames,o=u(e,[\"input\",\"selectedDay\",\"month\",\"children\",\"classNames\"]);return y.default.createElement(\"div\",h({className:n.overlayWrapper},o),y.default.createElement(\"div\",{className:n.overlay},t))}function c(e){if((0,k.isDate)(e)){return e.getFullYear()+\"-\"+(\"\"+(e.getMonth()+1))+\"-\"+(\"\"+e.getDate())}return\"\"}function p(e){if(\"string\"==typeof e){var t=e.split(\"-\");if(3===t.length){var n=parseInt(t[0],10),o=parseInt(t[1],10)-1,r=parseInt(t[2],10);if(!(isNaN(n)||String(n).length>4||isNaN(o)||isNaN(r)||r<=0||r>31||o<0||o>=12))return new Date(n,o,r,12,0,0,0)}}}Object.defineProperty(t,\"__esModule\",{value:!0}),t.HIDE_TIMEOUT=void 0;var f=function(){function e(e,t){for(var n=0;n0&&this.setState(t)}},{key:\"componentWillUnmount\",value:function(){clearTimeout(this.clickTimeout),clearTimeout(this.hideTimeout),clearTimeout(this.inputFocusTimeout),clearTimeout(this.inputBlurTimeout),clearTimeout(this.overlayBlurTimeout)}},{key:\"getInitialMonthFromProps\",value:function(e){var t=e.dayPickerProps,n=e.format,o=void 0;return e.value&&(o=(0,k.isDate)(e.value)?e.value:e.parseDate(e.value,n,t.locale)),t.initialMonth||t.month||o||new Date}},{key:\"getInitialStateFromProps\",value:function(e){var t=e.dayPickerProps,n=e.formatDate,o=e.format,r=e.typedValue,a=e.value;return e.value&&(0,k.isDate)(e.value)&&(a=n(e.value,o,t.locale)),{value:a,typedValue:r,month:this.getInitialMonthFromProps(e),selectedDays:t.selectedDays}}},{key:\"getInput\",value:function(){return this.input}},{key:\"getDayPicker\",value:function(){return this.daypicker}},{key:\"updateState\",value:function(e,t,n){var o=this,a=this.props,s=a.dayPickerProps,i=a.onDayChange;this.setState({month:e,value:t,typedValue:\"\"},function(){if(n&&n(),i){var t=h({disabled:s.disabledDays,selected:s.selectedDays},s.modifiers),a=(0,D.getModifiersForDay)(e,t).reduce(function(e,t){return h({},e,r({},t,!0))},{});i(e,a,o)}})}},{key:\"showDayPicker\",value:function(){var e=this,t=this.props,n=t.parseDate,o=t.format,r=t.dayPickerProps,a=this.state,s=a.value;if(!a.showOverlay){var i=s?n(s,o,r.locale):this.getInitialMonthFromProps(this.props);this.setState(function(e){return{showOverlay:!0,month:i||e.month}},function(){e.props.onDayPickerShow&&e.props.onDayPickerShow()})}}},{key:\"hideDayPicker\",value:function(){var e=this;!1!==this.state.showOverlay&&this.setState({showOverlay:!1},function(){e.props.onDayPickerHide&&e.props.onDayPickerHide()})}},{key:\"hideAfterDayClick\",value:function(){var e=this;this.props.hideOnDayClick&&(this.hideTimeout=setTimeout(function(){e.overlayHasFocus=!1,e.hideDayPicker()},g))}},{key:\"handleInputClick\",value:function(e){this.showDayPicker(),this.props.inputProps.onClick&&(e.persist(),this.props.inputProps.onClick(e))}},{key:\"handleInputFocus\",value:function(e){var t=this;this.showDayPicker(),this.inputFocusTimeout=setTimeout(function(){t.overlayHasFocus=!1},2),this.props.inputProps.onFocus&&(e.persist(),this.props.inputProps.onFocus(e))}},{key:\"handleInputBlur\",value:function(e){var t=this;this.inputBlurTimeout=setTimeout(function(){t.overlayHasFocus||t.hideDayPicker()},1),this.props.inputProps.onBlur&&(e.persist(),this.props.inputProps.onBlur(e))}},{key:\"handleOverlayFocus\",value:function(e){e.preventDefault(),this.overlayHasFocus=!0,this.props.keepFocus&&this.input&&\"function\"==typeof this.input.focus&&this.input.focus()}},{key:\"handleOverlayBlur\",value:function(){var e=this;this.overlayBlurTimeout=setTimeout(function(){e.overlayHasFocus=!1},3)}},{key:\"handleInputChange\",value:function(e){var t=this.props,n=t.dayPickerProps,o=t.format,r=t.inputProps,a=t.onDayChange,s=t.parseDate;r.onChange&&(e.persist(),r.onChange(e));var i=e.target.value;if(\"\"===i.trim())return this.setState({value:i,typedValue:\"\"}),void(a&&a(void 0,{},this));var u=s(i,o,n.locale);if(!u)return this.setState({value:i,typedValue:i}),void(a&&a(void 0,{},this));this.updateState(u,i)}},{key:\"handleInputKeyDown\",value:function(e){e.keyCode===b.TAB?this.hideDayPicker():this.showDayPicker(),this.props.inputProps.onKeyDown&&(e.persist(),this.props.inputProps.onKeyDown(e))}},{key:\"handleInputKeyUp\",value:function(e){e.keyCode===b.ESC?this.hideDayPicker():this.showDayPicker(),this.props.inputProps.onKeyUp&&(e.persist(),this.props.inputProps.onKeyUp(e))}},{key:\"handleMonthChange\",value:function(e){var t=this;this.setState({month:e},function(){t.props.dayPickerProps&&t.props.dayPickerProps.onMonthChange&&t.props.dayPickerProps.onMonthChange(e)})}},{key:\"handleDayClick\",value:function(e,t,n){var o=this,r=this.props,a=r.clickUnselectsDay,s=r.dayPickerProps,i=r.onDayChange,u=r.formatDate,l=r.format;if(s.onDayClick&&s.onDayClick(e,t,n),!(t.disabled||s&&s.classNames&&t[s.classNames.disabled])){if(t.selected&&a){var c=this.state.selectedDays;if(Array.isArray(c)){c=c.slice(0);var p=c.indexOf(e);c.splice(p,1)}else c&&(c=null);return this.setState({value:\"\",typedValue:\"\",selectedDays:c},this.hideAfterDayClick),void(i&&i(void 0,t,this))}var f=u(e,l,s.locale);this.setState({value:f,typedValue:\"\",month:e},function(){i&&i(e,t,o),o.hideAfterDayClick()})}}},{key:\"renderOverlay\",value:function(){var e=this,t=this.props,n=t.classNames,o=t.dayPickerProps,r=t.parseDate,a=t.formatDate,s=t.format,i=this.state,u=i.selectedDays,l=i.value,c=void 0;if(!u&&l){var p=r(l,s,o.locale);p&&(c=p)}else u&&(c=u);var f=void 0;o.todayButton&&(f=function(){return e.updateState(new Date,a(new Date,s,o.locale),e.hideAfterDayClick)});var d=this.props.overlayComponent;return y.default.createElement(d,{classNames:n,month:this.state.month,selectedDay:c,input:this.input,tabIndex:0,onFocus:this.handleOverlayFocus,onBlur:this.handleOverlayBlur},y.default.createElement(m.default,h({ref:function(t){return e.daypicker=t},onTodayButtonClick:f},o,{month:this.state.month,selectedDays:c,onDayClick:this.handleDayClick,onMonthChange:this.handleMonthChange})))}},{key:\"render\",value:function(){var e=this,t=this.props.component,n=this.props.inputProps;return y.default.createElement(\"div\",{className:this.props.classNames.container,style:this.props.style},y.default.createElement(t,h({ref:function(t){return e.input=t},placeholder:this.props.placeholder},n,{value:this.state.value||this.state.typedValue,onChange:this.handleInputChange,onFocus:this.handleInputFocus,onBlur:this.handleInputBlur,onKeyDown:this.handleInputKeyDown,onKeyUp:this.handleInputKeyUp,onClick:n.disabled?void 0:this.handleInputClick})),this.state.showOverlay&&this.renderOverlay())}}]),t}(y.default.Component);w.defaultProps={dayPickerProps:{},value:\"\",typedValue:\"\",placeholder:\"YYYY-M-D\",format:\"L\",formatDate:c,parseDate:p,showOverlay:!1,hideOnDayClick:!0,clickUnselectsDay:!1,keepFocus:!0,component:\"input\",inputProps:{},overlayComponent:l,classNames:{container:\"DayPickerInput\",overlayWrapper:\"DayPickerInput-OverlayWrapper\",overlay:\"DayPickerInput-Overlay\"}},t.default=w}]).default});\n//# sourceMappingURL=react-day-picker.min.js.map","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.formatDay = formatDay;\nexports.formatMonthTitle = formatMonthTitle;\nexports.formatWeekdayShort = formatWeekdayShort;\nexports.formatWeekdayLong = formatWeekdayLong;\nexports.getFirstDayOfWeek = getFirstDayOfWeek;\nexports.getMonths = getMonths;\nexports.formatDate = formatDate;\nexports.parseDate = parseDate;\n\nvar _moment = require('moment');\n\nvar _moment2 = _interopRequireDefault(_moment);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction formatDay(day) {\n var locale = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'en';\n\n return (0, _moment2.default)(day).locale(locale).format('ddd ll');\n} /* eslint-disable import/no-extraneous-dependencies, no-underscore-dangle */\n\nfunction formatMonthTitle(date) {\n var locale = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'en';\n\n return (0, _moment2.default)(date).locale(locale).format('MMMM YYYY');\n}\n\nfunction formatWeekdayShort(day) {\n var locale = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'en';\n\n return _moment2.default.localeData(locale).weekdaysMin()[day];\n}\n\nfunction formatWeekdayLong(day) {\n var locale = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'en';\n\n return _moment2.default.localeData(locale).weekdays()[day];\n}\n\nfunction getFirstDayOfWeek() {\n var locale = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'en';\n\n return _moment2.default.localeData(locale).firstDayOfWeek();\n}\n\nfunction getMonths() {\n var locale = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'en';\n\n return _moment2.default.localeData(locale).months();\n}\n\nfunction formatDate(date) {\n var format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'L';\n var locale = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'en';\n\n return (0, _moment2.default)(date).locale(locale).format(Array.isArray(format) ? format[0] : format);\n}\n\nfunction parseDate(str) {\n var format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'L';\n var locale = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'en';\n\n var m = (0, _moment2.default)(str, format, locale, true);\n if (m.isValid()) {\n return m.toDate();\n }\n return undefined;\n}\n\nexports.default = {\n formatDay: formatDay,\n formatMonthTitle: formatMonthTitle,\n formatWeekdayShort: formatWeekdayShort,\n formatWeekdayLong: formatWeekdayLong,\n getFirstDayOfWeek: getFirstDayOfWeek,\n getMonths: getMonths,\n formatDate: formatDate,\n parseDate: parseDate\n};\n//# sourceMappingURL=MomentLocaleUtils.js.map","module.exports = require('../build/addons/MomentLocaleUtils');\n","import { darken, DialogContent, MenuItem, styled, Theme } from \"@mui/material\";\r\nimport { createStyles, WithStyles, withStyles } from \"@mui/styles\";\r\nimport * as React from \"react\";\r\nimport DayPicker from \"react-day-picker\";\r\n// @ts-ignore\r\nimport MomentLocaleUtils from \"react-day-picker/moment\";\r\nimport Localization from \"../core/Localization\";\r\nimport Sys from \"../core/Sys\";\r\nimport Button from \"./Button\";\r\nimport Dialog from \"./Dialog\";\r\nimport Typography from \"./Typography\";\r\n\r\ntype Digit = \"0\" | \"1\" | \"2\" | \"3\" | \"4\" | \"5\" | \"6\" | \"7\" | \"8\" | \"9\";\r\n\r\ninterface Props {\r\n onClose: () => void;\r\n onDateSelected: (date: Date) => void;\r\n onRestoreFocus?: () => void;\r\n open: boolean;\r\n title: string;\r\n value: Date | null;\r\n}\r\n\r\ninterface State {\r\n selectedDate: Date | null;\r\n visibleMonth: Date;\r\n yearPickerOpen: boolean;\r\n yearPickerTypeAheadYear: number | null;\r\n}\r\n\r\nconst styles = (theme: Theme) =>\r\n createStyles({\r\n calendar: {\r\n [theme.breakpoints.down(\"xs\")]: {\r\n padding: 16,\r\n },\r\n\r\n \"& .DayPicker-Body\": {\r\n display: \"table-row-group\",\r\n },\r\n\r\n \"& .DayPicker-Caption\": {\r\n display: \"table-caption\",\r\n marginBottom: \"0.5rem\",\r\n maxHeight: 40,\r\n padding: \"0 42px\",\r\n textAlign: \"center\",\r\n },\r\n\r\n \"& .DayPicker-Day\": {\r\n display: \"table-cell\",\r\n outline: \"none\",\r\n textAlign: \"center\",\r\n },\r\n \"& .DayPicker-Day button\": {\r\n borderRadius: \"50%\",\r\n fontWeight: 400,\r\n letterSpacing: \"normal\",\r\n minWidth: \"40px\",\r\n padding: \"0.5rem\",\r\n },\r\n \"& .DayPicker-Day--outside button\": {\r\n color: theme.palette.grey[\"300\"],\r\n },\r\n \"& .DayPicker-Day--selected button\": {\r\n background: `${theme.palette.grey[\"800\"]} !important`,\r\n color: theme.palette.getContrastText(theme.palette.grey[\"800\"]),\r\n },\r\n \"& .DayPicker-Day--selected button:hover\": {\r\n background: darken(theme.palette.grey[\"800\"], 0.1),\r\n },\r\n \"& .DayPicker-Day--selected:focus button\": {\r\n background: theme.palette.grey[\"800\"],\r\n },\r\n \"& .DayPicker-Day--selected:focus button:hover\": {\r\n background: darken(theme.palette.grey[\"800\"], 0.1),\r\n },\r\n \"& .DayPicker-Day:focus button\": {\r\n background: theme.palette.grey[\"400\"],\r\n },\r\n \"& .DayPicker-Day:focus button:hover\": {\r\n background: darken(theme.palette.grey[\"400\"], 0.1),\r\n },\r\n\r\n \"& .DayPicker-Month\": {\r\n display: \"table\",\r\n width: \"100%\",\r\n },\r\n\r\n \"& .DayPicker-NavButton\": {\r\n position: \"absolute\",\r\n top: \"5px\",\r\n },\r\n \"& .DayPicker-NavButton > button\": {\r\n height: 24,\r\n padding: 0,\r\n width: 24,\r\n },\r\n \"& .DayPicker-NavButton--next\": {\r\n \"& > button\": { paddingLeft: 2 },\r\n right: \"0.5rem\",\r\n },\r\n \"& .DayPicker-NavButton--prev\": {\r\n \"& > button\": { paddingRight: 1 },\r\n left: \"0.5rem\",\r\n },\r\n\r\n \"& .DayPicker-Week\": {\r\n display: \"table-row\",\r\n },\r\n \"& .DayPicker-Weekday\": {\r\n color: theme.palette.grey[\"500\"],\r\n display: \"table-cell\",\r\n fontSize: 12,\r\n lineHeight: \"1.42857\",\r\n padding: \"0.5rem\",\r\n textAlign: \"center\",\r\n },\r\n \"& .DayPicker-Weekdays\": {\r\n display: \"table-header-group\",\r\n },\r\n \"& .DayPicker-WeekdaysRow\": {\r\n display: \"table-row\",\r\n },\r\n\r\n \"& .DayPicker-wrapper\": {\r\n outline: \"none\",\r\n position: \"relative\",\r\n },\r\n\r\n padding: 40,\r\n },\r\n\r\n dialogContainer: {\r\n \"&:first-child\": {\r\n paddingTop: 0,\r\n },\r\n\r\n height: 405, // Ensure space for months that span 6 weeks\r\n margin: \"0 auto\",\r\n maxWidth: \"100%\",\r\n padding: 0,\r\n width: 380,\r\n },\r\n\r\n yearSelected: {\r\n color: theme.palette.getContrastText(theme.palette.grey[\"800\"]),\r\n },\r\n });\r\n\r\nconst SwitchYearButton = styled(Button)({\r\n \"& .MuiTouchRipple-root\": {\r\n background: \"transparent\",\r\n margin: \"0 auto\",\r\n maxHeight: 40,\r\n maxWidth: 150,\r\n },\r\n fontSize: 16,\r\n fontWeight: 700,\r\n letterSpacing: \"0.01071em\",\r\n lineHeight: \"20px\",\r\n maxWidth: 215,\r\n minWidth: 150,\r\n paddingLeft: 0,\r\n paddingRight: 0,\r\n position: \"static\", // Fix for Safari not firing click event\r\n textTransform: \"none\",\r\n whiteSpace: \"normal\",\r\n});\r\n\r\nexport class CalendarDialog extends React.Component<\r\n Props & WithStyles,\r\n State\r\n> {\r\n private contentRef?: HTMLDivElement | null;\r\n private switchYearButtonRef = React.createRef();\r\n private yearPickerTypeAheadDigits: string = \"\";\r\n\r\n public constructor(props: Props & WithStyles) {\r\n super(props);\r\n\r\n this.state = {\r\n selectedDate: props.value,\r\n visibleMonth: props.value || new Date(),\r\n yearPickerOpen: false,\r\n yearPickerTypeAheadYear: null,\r\n };\r\n }\r\n\r\n private addDigitToYearPickerTypeAhead(digit: Digit): void {\r\n this.yearPickerTypeAheadDigits += digit;\r\n if (this.yearPickerTypeAheadDigits.length < 4) {\r\n return;\r\n }\r\n\r\n const candidateYear = this.yearPickerTypeAheadDigits.slice(-4);\r\n this.setState({ yearPickerTypeAheadYear: parseInt(candidateYear, 10) });\r\n }\r\n\r\n private focusSelectedDay = () => {\r\n let selected = this.contentRef!.querySelector(\r\n \".DayPicker-Day--selected\"\r\n ) as HTMLLinkElement;\r\n\r\n if (!selected) {\r\n selected = this.contentRef!.querySelector(\r\n \".DayPicker-Day--today\"\r\n ) as HTMLLinkElement;\r\n }\r\n\r\n if (!selected) {\r\n selected = this.contentRef!.querySelector(\r\n '.DayPicker-Day[tabindex=\"0\"]'\r\n ) as HTMLLinkElement;\r\n }\r\n\r\n if (selected) {\r\n selected.focus();\r\n }\r\n };\r\n\r\n private navigateYears = (event: React.KeyboardEvent) => {\r\n const targetElement = event.target as HTMLElement;\r\n\r\n switch (event.key) {\r\n case \"ArrowDown\":\r\n if (targetElement.nextElementSibling) {\r\n (targetElement.nextElementSibling as HTMLElement).focus();\r\n }\r\n this.yearPickerTypeAheadDigits = \"\";\r\n break;\r\n case \"ArrowUp\":\r\n if (targetElement.previousElementSibling) {\r\n (targetElement.previousElementSibling as HTMLElement).focus();\r\n }\r\n this.yearPickerTypeAheadDigits = \"\";\r\n break;\r\n case \"Escape\":\r\n this.setState({ yearPickerOpen: false }, () => {\r\n this.switchYearButtonRef.current?.focus();\r\n });\r\n break;\r\n case \"0\":\r\n case \"1\":\r\n case \"2\":\r\n case \"3\":\r\n case \"4\":\r\n case \"5\":\r\n case \"6\":\r\n case \"7\":\r\n case \"8\":\r\n case \"9\":\r\n this.addDigitToYearPickerTypeAhead(event.key);\r\n break;\r\n default:\r\n return;\r\n }\r\n\r\n event.preventDefault();\r\n event.stopPropagation();\r\n };\r\n\r\n private onExited = () => {\r\n if (this.props.onRestoreFocus) {\r\n this.props.onRestoreFocus();\r\n }\r\n };\r\n\r\n private renderCalendar(): React.ReactNode {\r\n return (\r\n {\r\n this.props.onDateSelected(date);\r\n this.props.onClose();\r\n }}\r\n captionElement={(props) => {\r\n const selectedMonth = Localization.formatMonthTitle(props.date);\r\n\r\n return (\r\n
\r\n this.switchToYearsView(props.date)}\r\n variant=\"text\"\r\n >\r\n {selectedMonth}\r\n \r\n
\r\n );\r\n }}\r\n navbarElement={(props) => {\r\n const selectedMonth = Localization.formatMonthTitle(props.month);\r\n\r\n return (\r\n
\r\n \r\n props.onPreviousClick()}\r\n />\r\n \r\n \r\n props.onNextClick()}\r\n />\r\n \r\n
\r\n );\r\n }}\r\n renderDay={(day, modifiers) => (\r\n \r\n {day.getDate()}\r\n \r\n )}\r\n weekdayElement={(props) => (\r\n \r\n {Localization.formatWeekdayShort(props.weekday, props.locale)}\r\n \r\n )}\r\n />\r\n );\r\n }\r\n\r\n private renderYearPicker(): React.ReactNode {\r\n const years: number[] = [];\r\n const currentYear = this.state.visibleMonth.getFullYear();\r\n for (let i = currentYear - 50; i <= currentYear + 50; i += 1) {\r\n years.push(i);\r\n }\r\n\r\n return (\r\n \r\n {years.map((year: number) => {\r\n const isSelected: boolean = year === currentYear;\r\n\r\n return (\r\n ) =>\r\n this.selectYear(year, event)\r\n }\r\n onKeyDown={this.navigateYears}\r\n role=\"option\"\r\n selected={isSelected}\r\n tabIndex={isSelected ? 0 : -1}\r\n >\r\n {year}\r\n \r\n );\r\n })}\r\n \r\n );\r\n }\r\n\r\n private selectYear(year: number, event: React.MouseEvent) {\r\n const isUsingKeyboard: boolean = event.clientX === undefined;\r\n\r\n this.setState(\r\n (lastState) => {\r\n const currentMonth = lastState.visibleMonth.getMonth();\r\n\r\n return {\r\n visibleMonth: new Date(year, currentMonth, 1),\r\n yearPickerOpen: false,\r\n };\r\n },\r\n () => {\r\n if (isUsingKeyboard) {\r\n this.switchYearButtonRef.current?.focus();\r\n }\r\n }\r\n );\r\n }\r\n\r\n private switchToYearsView = (currentMonth: Date): void => {\r\n this.yearPickerTypeAheadDigits = \"\";\r\n this.setState({ visibleMonth: currentMonth, yearPickerOpen: true });\r\n };\r\n\r\n public componentDidUpdate(prevProps: Props, prevState: State): void {\r\n if (prevProps.value !== this.props.value) {\r\n this.setState({\r\n selectedDate: this.props.value,\r\n visibleMonth: this.props.value || new Date(),\r\n });\r\n }\r\n\r\n if (prevProps.open && !this.props.open) {\r\n this.setState({\r\n yearPickerOpen: false,\r\n });\r\n }\r\n }\r\n\r\n public render(): React.ReactNode {\r\n return (\r\n \r\n \r\n
(this.contentRef = r)} style={{ margin: \"0 auto\" }}>\r\n {this.state.yearPickerOpen\r\n ? this.renderYearPicker()\r\n : this.renderCalendar()}\r\n {!this.state.yearPickerOpen ? (\r\n \r\n {Localization.getBuiltInMessage(\"cancel\")}\r\n \r\n ) : null}\r\n
\r\n
\r\n \r\n );\r\n }\r\n}\r\n\r\nexport default withStyles(styles)(CalendarDialog);\r\n","import * as React from \"react\";\r\nimport Localization from \"../core/Localization\";\r\nimport Button from \"./Button\";\r\nimport CalendarDialog from \"./CalendarDialog\";\r\nimport TextField from \"./TextField\";\r\n\r\ninterface Props {\r\n dateFormatError: string;\r\n error?: boolean;\r\n helperText?: string;\r\n label: string;\r\n getErrors?: (value: string) => string[];\r\n onChange: (value: Date | null) => void;\r\n onEnterKeyPress?: () => void;\r\n onInputChange?: (event: React.ChangeEvent) => void;\r\n onInvalidEntry?: (entry: string) => void;\r\n required?: boolean;\r\n value: Date | null;\r\n}\r\n\r\ninterface State {\r\n calendarOpen: boolean;\r\n hasInvalidInput: boolean;\r\n pendingValue: string;\r\n}\r\n\r\nexport class DatePicker extends React.PureComponent {\r\n private calendarHasFocus: boolean;\r\n\r\n private static datesAreEquivalent(a: Date | null, b: Date | null): boolean {\r\n if (a === null && b === null) {\r\n return true;\r\n }\r\n\r\n if (a === null || b === null) {\r\n return false;\r\n }\r\n\r\n return a.valueOf() === b.valueOf();\r\n }\r\n\r\n public constructor(props: Props) {\r\n super(props);\r\n\r\n this.calendarHasFocus = false;\r\n\r\n let dateString: string = \"\";\r\n if (this.props.value !== null) {\r\n dateString = Localization.formatDate(this.props.value);\r\n }\r\n\r\n this.state = {\r\n calendarOpen: false,\r\n hasInvalidInput: false,\r\n pendingValue: dateString,\r\n };\r\n }\r\n\r\n private flushInput(): void {\r\n let date: Date | null = null;\r\n const dateString: string = this.state.pendingValue;\r\n if (dateString.length > 0) {\r\n date = Localization.parseDate(dateString);\r\n if (date === null) {\r\n this.setState({ hasInvalidInput: true });\r\n\r\n if (this.props.onInvalidEntry) {\r\n this.props.onInvalidEntry(dateString);\r\n }\r\n\r\n return;\r\n }\r\n }\r\n\r\n if (!DatePicker.datesAreEquivalent(this.props.value, date)) {\r\n this.props.onChange(date);\r\n }\r\n }\r\n\r\n private getErrors(value: string): string[] {\r\n const errors = [];\r\n\r\n if (this.props.getErrors) {\r\n errors.push(...this.props.getErrors(value));\r\n }\r\n\r\n if (this.state.hasInvalidInput) {\r\n errors.push(this.props.dateFormatError);\r\n }\r\n\r\n return errors;\r\n }\r\n\r\n private onCalendarClose = (): void => {\r\n this.setState({ calendarOpen: false });\r\n };\r\n\r\n private onCalendarDateSelected = (date: Date): void => {\r\n this.setState({ hasInvalidInput: false });\r\n\r\n if (!DatePicker.datesAreEquivalent(this.props.value, date)) {\r\n this.props.onChange(date);\r\n }\r\n };\r\n\r\n private onChange = (event: React.ChangeEvent): void => {\r\n this.setState({\r\n hasInvalidInput: false,\r\n pendingValue: event.target.value,\r\n });\r\n\r\n if (this.props.onInputChange) {\r\n this.props.onInputChange(event);\r\n }\r\n };\r\n\r\n private onKeyPress = (event: React.KeyboardEvent): void => {\r\n if (event.key !== \"Enter\" || this.calendarHasFocus) {\r\n return;\r\n }\r\n\r\n event.preventDefault();\r\n event.stopPropagation();\r\n\r\n this.flushInput();\r\n\r\n if (this.props.onEnterKeyPress) {\r\n this.props.onEnterKeyPress();\r\n }\r\n };\r\n\r\n private onOpenCalendar = (): void => {\r\n this.setState({ calendarOpen: true });\r\n };\r\n\r\n public componentDidUpdate(prevProps: Props, prevState: State): void {\r\n if (!DatePicker.datesAreEquivalent(prevProps.value, this.props.value)) {\r\n let dateString: string = \"\";\r\n if (this.props.value !== null) {\r\n dateString = Localization.formatDate(this.props.value);\r\n }\r\n\r\n this.setState({ pendingValue: dateString });\r\n }\r\n }\r\n\r\n public render(): React.ReactNode {\r\n return (\r\n \r\n {\r\n this.calendarHasFocus = false;\r\n }}\r\n onClick={this.onOpenCalendar}\r\n onFocus={() => {\r\n this.calendarHasFocus = true;\r\n }}\r\n size=\"small\"\r\n />\r\n }\r\n error={this.props.error}\r\n getErrors={(v) => this.getErrors(v)}\r\n helperText={this.props.helperText}\r\n InputProps={{\r\n placeholder: Localization.dateFormat,\r\n }}\r\n label={this.props.label}\r\n onBlur={() => {\r\n this.flushInput();\r\n }}\r\n onChange={this.onChange}\r\n onKeyPress={this.onKeyPress}\r\n required={this.props.required}\r\n value={this.state.pendingValue}\r\n variant=\"filled\"\r\n />\r\n \r\n \r\n );\r\n }\r\n}\r\n\r\nexport default DatePicker;\r\n","import {\r\n Breakpoint,\r\n ClickAwayListener,\r\n Grow,\r\n MenuList,\r\n Menu as MuiMenu,\r\n Paper,\r\n Popper,\r\n Theme,\r\n} from \"@mui/material\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport * as React from \"react\";\r\nimport { useWidth } from \"../core/Responsive\";\r\nimport MaskingStore from \"../stores/MaskingStore\";\r\n\r\ninterface Props {\r\n anchorEl?: HTMLElement | null;\r\n \"aria-label\"?: string;\r\n children: React.ReactNode;\r\n labelId?: string;\r\n menuId?: string;\r\n modal?: boolean;\r\n offset?: number;\r\n onClose?: () => void;\r\n variant: \"menu\" | \"selectedMenu\";\r\n}\r\n\r\nconst useStyles = makeStyles((theme: Theme) => ({\r\n list: {\r\n flex: 1,\r\n minHeight: 0,\r\n outline: \"none\",\r\n overflow: \"auto\",\r\n },\r\n paper: {\r\n display: \"flex\",\r\n flex: 1,\r\n minHeight: 0,\r\n },\r\n popper: {\r\n display: \"flex\",\r\n flexDirection: \"column\",\r\n // Force marginTop to 0 to avoid inheriting the top margin that Grid.tsx\r\n // applies to the contents the nested GridItem divs. This happens when\r\n // disablePortal=true and the menu is inline.\r\n marginTop: \"0 !important\",\r\n zIndex: theme.zIndex.modal,\r\n },\r\n}));\r\n\r\nexport default function Menu(props: Props): JSX.Element {\r\n const classes = useStyles();\r\n const width = useWidth();\r\n\r\n const didClickAway = React.useRef(false);\r\n const isMasked = React.useRef(false);\r\n const prevAnchorEl = React.useRef(props.anchorEl || null);\r\n const prevWidth = React.useRef(width);\r\n\r\n const onClickAway = React.useCallback(\r\n (event: MouseEvent | TouchEvent): void => {\r\n if (props.anchorEl?.contains(event.target as HTMLElement)) {\r\n return;\r\n }\r\n\r\n didClickAway.current = true;\r\n if (props.onClose) {\r\n props.onClose();\r\n }\r\n },\r\n [props.anchorEl, props.onClose]\r\n );\r\n\r\n const onClose = React.useCallback(\r\n (event: React.KeyboardEvent | React.MouseEvent): void => {\r\n if (props.onClose) {\r\n props.onClose();\r\n }\r\n },\r\n [props.onClose]\r\n );\r\n\r\n // The MUI menu will disable scrolling, but we need to increment / decrement\r\n // the masking store to indicate when masking is applied, in order to\r\n // add or remove the body class that overrides overflow-y\r\n const onEntering = React.useCallback(\r\n (node: HTMLElement, isAppearing: boolean) => {\r\n if (props.modal && !isMasked.current) {\r\n MaskingStore.maskOpened();\r\n isMasked.current = true;\r\n }\r\n },\r\n [props.modal]\r\n );\r\n\r\n const onExit = React.useCallback((node: HTMLElement) => {\r\n if (isMasked.current) {\r\n MaskingStore.maskClosed();\r\n isMasked.current = false;\r\n }\r\n }, []);\r\n\r\n const onKeyDown = React.useCallback(\r\n (event: React.KeyboardEvent): void => {\r\n event.stopPropagation();\r\n\r\n switch (event.key) {\r\n case \"Escape\":\r\n if (props.onClose) {\r\n props.onClose();\r\n }\r\n break;\r\n\r\n case \"Tab\":\r\n if (props.onClose) {\r\n props.onClose();\r\n }\r\n\r\n event.preventDefault();\r\n break;\r\n default:\r\n }\r\n },\r\n [props.onClose]\r\n );\r\n\r\n React.useEffect(() => {\r\n if (prevAnchorEl.current && !props.anchorEl) {\r\n if (!didClickAway.current) {\r\n prevAnchorEl.current.focus();\r\n }\r\n }\r\n prevAnchorEl.current = props.anchorEl || null;\r\n didClickAway.current = false;\r\n }, [props.anchorEl]);\r\n\r\n React.useEffect(() => {\r\n if (prevWidth.current !== width) {\r\n if (props.onClose) {\r\n props.onClose();\r\n }\r\n }\r\n prevWidth.current = width;\r\n }, [width]);\r\n\r\n React.useEffect(() => {\r\n return () => {\r\n if (isMasked.current) {\r\n MaskingStore.maskClosed();\r\n isMasked.current = false;\r\n }\r\n };\r\n }, []);\r\n\r\n if (props.modal) {\r\n return (\r\n \r\n {props.children}\r\n \r\n );\r\n }\r\n\r\n const rootAncestor: Element | null = props.anchorEl\r\n ? props.anchorEl.closest(\"#root\")\r\n : null;\r\n\r\n // The root element is not an ancestor of the anchorEl if this component is\r\n // rendered in a dialog. In that case, the scroll parent is used to contain\r\n // the menu.\r\n const boundariesElement: Element | string = rootAncestor || \"scrollParent\";\r\n\r\n return (\r\n \r\n {({ TransitionProps, placement }) => (\r\n \r\n \r\n {props.anchorEl ? (\r\n // Setting touchEvent to false prevents the menu from closing when\r\n // using VoiceOver on iOS. This still will click away when using\r\n // mouse or iphone without VoiceOver turned on.\r\n \r\n \r\n {props.children}\r\n \r\n \r\n ) : null}\r\n \r\n \r\n )}\r\n \r\n );\r\n}\r\n","// VERSION_WARNING Material-UI 4.9.14\r\n// This component is based on the internal SelectInput component used by MUI's\r\n// Select component. See comments in Select.tsx for further background.\r\n//\r\n// See original source at https://github.com/mui-org/material-ui/blob/v4.9.14/packages/material-ui/src/Select/SelectInput.js\r\n// This code attempts to follow the existing source where possible with some\r\n// removal of unnecesary features (multi-select, controlled open), built-in\r\n// MenuItem generation (to simplify) and other changes where necessary to\r\n// support ARIA 1.2.\r\n\r\nimport { InputBaseComponentProps, Theme } from \"@mui/material\";\r\nimport { useControlled, useForkRef } from \"@mui/material/utils\";\r\nimport { makeStyles } from \"@mui/styles\";\r\nimport * as React from \"react\";\r\nimport ComboBoxOption from \"./ComboBoxOption\";\r\nimport Menu from \"./Menu\";\r\nimport MenuItem from \"./MenuItem\";\r\nimport multiClassName from \"./MultiClassName\";\r\n\r\n// Styles are taken from the MUI NativeSelect component and are necessary to\r\n// style the select\r\nconst useStyles = makeStyles((theme: Theme) => ({\r\n /* Pseudo-class applied to the select component `disabled` class. */\r\n disabled: {},\r\n /* Styles applied to the select component if `variant=\"filled\"`. */\r\n filled: {\r\n \"&&\": {\r\n paddingRight: 32,\r\n },\r\n },\r\n /* Styles applied to the select component `root` class. */\r\n root: {},\r\n /* Styles applied to the select component `select` class. */\r\n select: {\r\n \"&$disabled\": {\r\n cursor: \"default\",\r\n },\r\n \"&&\": {\r\n paddingRight: 24,\r\n },\r\n // Remove IE 11 arrow\r\n \"&::-ms-expand\": {\r\n display: \"none\",\r\n },\r\n \"&:focus\": {\r\n // Show that it's not an text input\r\n backgroundColor: \"rgba(0, 0, 0, 0.05)\",\r\n borderRadius: 0, // Reset Chrome style\r\n },\r\n \"&:not([multiple]) option, &:not([multiple]) optgroup\": {\r\n backgroundColor: theme.palette.background.paper,\r\n },\r\n \"&[multiple]\": {\r\n height: \"auto\",\r\n },\r\n \"-moz-appearance\": \"none\", // Reset\r\n \"-webkit-appearance\": \"none\", // Reset\r\n borderRadius: 0, // Reset\r\n cursor: \"pointer\",\r\n // When interacting quickly, the text can end up selected.\r\n // Native select can't be selected either.\r\n minWidth: 16, // So it doesn't collapse.\r\n userSelect: \"none\",\r\n },\r\n /* Styles applied to the select component `selectMenu` class. */\r\n selectMenu: {\r\n height: \"auto\", // Resets for multpile select with chips\r\n minHeight: \"1.1876em\", // Required for select\\text-field height consistency\r\n overflow: \"hidden\",\r\n textOverflow: \"ellipsis\",\r\n whiteSpace: \"nowrap\",\r\n },\r\n}));\r\n\r\ninterface Props extends InputBaseComponentProps {\r\n defaultValue?: string;\r\n errors: string[];\r\n IconComponent: React.ElementType;\r\n inputRef: React.Ref;\r\n labelId?: string;\r\n name: string;\r\n openOnMount: boolean;\r\n onValueChange: (value: ComboBoxOption) => void;\r\n options: ComboBoxOption[];\r\n required?: boolean;\r\n SelectDisplayProps?: React.HTMLAttributes;\r\n value?: string;\r\n}\r\n\r\ninterface InputRef {\r\n focus: () => void;\r\n node: HTMLInputElement | null;\r\n value: string;\r\n}\r\n\r\nconst SelectInput = React.forwardRef((props, ref) => {\r\n const {\r\n \"aria-label\": ariaLabel,\r\n autoFocus,\r\n className,\r\n defaultValue,\r\n disabled,\r\n errors,\r\n IconComponent,\r\n inputRef: inputRefProp,\r\n labelId,\r\n name,\r\n onBlur,\r\n onClose,\r\n onChange,\r\n onFocus,\r\n onValueChange,\r\n openOnMount,\r\n options,\r\n readOnly,\r\n required,\r\n SelectDisplayProps,\r\n tabIndex: tabIndexProp,\r\n // Catching `type` from Input which makes no sense for SelectInput\r\n type,\r\n value: valueProp,\r\n ...other\r\n } = props;\r\n\r\n const [value, setValue] = useControlled({\r\n controlled: valueProp,\r\n default: defaultValue,\r\n name: \"Select\",\r\n });\r\n\r\n const classes = useStyles();\r\n const inputRef = React.useRef(null);\r\n const [displayNode, setDisplayNode] = React.useState(\r\n null\r\n );\r\n const [openState, setOpenState] = React.useState(false);\r\n const handleRef = useForkRef(ref, inputRefProp);\r\n\r\n React.useImperativeHandle(\r\n handleRef,\r\n () => ({\r\n focus: () => {\r\n displayNode!.focus();\r\n },\r\n node: inputRef.current,\r\n value,\r\n }),\r\n [displayNode, value]\r\n );\r\n\r\n React.useEffect(() => {\r\n if (displayNode) {\r\n if (!labelId) {\r\n return;\r\n }\r\n const label = displayNode.ownerDocument!.getElementById(labelId);\r\n if (label) {\r\n const handler = () => {\r\n if (getSelection()!.isCollapsed) {\r\n displayNode.focus();\r\n }\r\n };\r\n label.addEventListener(\"click\", handler);\r\n return () => {\r\n label.removeEventListener(\"click\", handler);\r\n };\r\n }\r\n }\r\n\r\n return undefined;\r\n }, [labelId, displayNode]);\r\n\r\n React.useEffect(() => {\r\n if (!openOnMount) {\r\n return;\r\n }\r\n\r\n setTimeout(() => {\r\n if (displayNode) {\r\n displayNode.focus();\r\n setOpenState(true);\r\n }\r\n }, 100);\r\n }, [displayNode]);\r\n\r\n const update = (\r\n openValue: boolean,\r\n event?:\r\n | React.MouseEvent\r\n | React.KeyboardEvent\r\n ) => {\r\n if (!openValue && onClose) {\r\n onClose(event);\r\n }\r\n setOpenState(openValue);\r\n };\r\n\r\n const onMouseDownDisplayNode = (event: React.MouseEvent) => {\r\n // Ignore everything but left-click\r\n if (event.button !== 0) {\r\n return;\r\n }\r\n // Hijack the default focus behavior.\r\n event.preventDefault();\r\n displayNode!.focus();\r\n\r\n // Toggle openState. Because the drop down is non-model, clicking the input\r\n // element again should collapse the drop down\r\n update(!openState, event);\r\n };\r\n\r\n const onKeyDownDisplayNode = (event: React.KeyboardEvent) => {\r\n const validKeys = [\r\n \" \",\r\n \"ArrowUp\",\r\n \"ArrowDown\",\r\n // The native select doesn't respond to enter on MacOS, but it's recommended by\r\n // https://www.w3.org/TR/wai-aria-practices/examples/listbox/listbox-collapsible.html\r\n \"Enter\",\r\n ];\r\n\r\n if (validKeys.indexOf(event.key) !== -1) {\r\n event.preventDefault();\r\n update(true, event);\r\n }\r\n };\r\n\r\n const onCloseMenu = (): void => {\r\n update(false);\r\n if (displayNode) {\r\n displayNode.focus();\r\n }\r\n };\r\n\r\n const onClickMenuItem = (\r\n event: React.MouseEvent,\r\n optionValue: ComboBoxOption\r\n ): void => {\r\n if (onValueChange) {\r\n onValueChange(optionValue);\r\n }\r\n update(false);\r\n if (displayNode) {\r\n displayNode.focus();\r\n }\r\n };\r\n\r\n const open = displayNode !== null && openState;\r\n\r\n const onBlurDisplayNode = (event: React.FocusEvent) => {\r\n // If open event.stopImmediatePropagation\r\n if (onBlur) {\r\n if (!open) {\r\n event.persist();\r\n // Preact support, target is read only property on a native event.\r\n Object.defineProperty(event, \"target\", {\r\n value: { name, value },\r\n writable: true,\r\n });\r\n }\r\n onBlur(event);\r\n }\r\n };\r\n\r\n let display;\r\n const componentId =\r\n SelectDisplayProps!.id || (name ? `select-${name}` : undefined);\r\n const menuId = `${componentId}-list`;\r\n let selectedId: string | undefined = undefined;\r\n\r\n const comboBoxOptions: React.ReactNode[] = options.map((o, i) => {\r\n const selected = o.value === value || (!o.value && !value);\r\n const optionId = `${menuId}-${i}`;\r\n if (selected) {\r\n selectedId = optionId;\r\n // Only display if this is a non-null value\r\n if (value) {\r\n display = o.display;\r\n }\r\n }\r\n\r\n return (\r\n onClickMenuItem(event, o)}\r\n onKeyUp={(event) => {\r\n if (event.key === \" \") {\r\n // Otherwise MenuItem dispatches a click event which is not the\r\n // behaviour of the native